/**
 * Drive - Site Footer Component Styles
 *
 * Dark fullwidth footer matching design:
 * - Top 5-column grid: brand, practice, popular states, company, legal
 * - Middle disclaimer card
 * - Bottom copyright and privacy links bar
 *
 * @package Drive
 */

/* ==========================================================================
   1. Footer Wrapper
   ========================================================================== */
/* ==========================================================================
   1. Footer Wrapper
   ========================================================================== */
.site-footer.dark-site-footer {
    background-color: #2B2D42;
    /* Deep Charcoal */
    color: #ffffff;
    padding: 3.5rem 0 1.5rem;
    position: relative;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-footer .footer-container,
.footer-container {
    max-width: 1240px;
    margin: 0 auto;
    padding-left: clamp(1.25rem, 4vw, 2.5rem);
    padding-right: clamp(1.25rem, 4vw, 2.5rem);
    display: flex;
    flex-direction: column;
    gap: 0 !important;
    /* Override main.css flex gap: 2rem */
}

/* ==========================================================================
   2. 5-Column Main Grid
   ========================================================================== */
.footer-main-grid {
    display: grid;
    grid-template-columns: 1.75fr 1fr 1fr 1fr 1fr;
    gap: 1.75rem;
    margin-bottom: 1.35rem;
    align-items: start;
}

/* ==========================================================================
   3. Brand Column
   ========================================================================== */
.footer-brand-col {
    display: flex;
    flex-direction: column;
}

.footer-logo-wrap {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0.65rem;
}

.footer-logo-wrap .custom-logo-link {
    display: inline-flex;
    align-items: center;
}

.footer-logo-wrap .custom-logo {
    max-height: 32px;
    width: auto;
    display: block;
}

.footer-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    color: #ffffff;
}

.footer-brand-link .brand-logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.footer-brand-link .brand-custom-logo-badge .custom-logo-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: block;
}

.footer-brand-link .brand-title-wrap {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.footer-brand-link .brand-name-main {
    color: #ffffff;
}

.footer-brand-link .brand-name-accent {
    color: #FF6B00;
}

.footer-brand-blurb {
    font-size: 0.8125rem;
    color: #FFFFFF;
    line-height: 1.4;
    margin: 0 0 0.85rem;
    max-width: 290px;
    font-weight: 400;
}

/* Social Icon Buttons */
.footer-social-row {
    display: flex;
    gap: 0.55rem;
}

.footer-social-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #36384E;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #C9CAD3;
    text-decoration: none;
    transition: all 180ms ease;
}

.footer-social-btn svg {
    width: 15px;
    height: 15px;
}

.footer-social-btn:hover,
.footer-social-btn:focus-visible {
    background: #41435C;
    color: #00D4C3;
    border-color: rgba(0, 212, 195, 0.35);
    transform: translateY(-1px);
    outline: none;
}

/* ==========================================================================
   4. Navigation Columns
   ========================================================================== */
.footer-nav-col {
    display: flex;
    flex-direction: column;
}

.footer-col-heading {
    font-size: 0.75rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 0 0 0.65rem;
}

.footer-links-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.footer-links-list li {
    margin: 0;
    padding: 0;
}

.footer-links-list li a {
    color: #E2E8F0;
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 160ms ease, transform 160ms ease;
    display: inline-block;
    line-height: 1.35;
}

.footer-links-list li a:hover,
.footer-links-list li a:focus-visible {
    color: #ffffff;
    transform: translateX(2px);
    outline: none;
}

.link-view-all-states {
    color: #E2E8F0 !important;
    font-weight: 600;
}

.link-view-all-states:hover {
    color: #00D4C3 !important;
}

/* ==========================================================================
   5. Middle Disclaimer Card
   ========================================================================== */
.footer-disclaimer-wrap {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 0.75rem;
    margin-bottom: 0.4rem;
}

.footer-disclaimer-card {
    background: #36384E;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 0.65rem 1.15rem;
}

.footer-disclaimer-card p {
    margin: 0;
    padding: 0;
    font-size: 0.75rem;
    color: #9496A8;
    line-height: 1.4;
    font-weight: 400;
}

/* ==========================================================================
   6. Bottom Copyright Bar
   ========================================================================== */
.footer-bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0;
    margin-top: 0;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.footer-copyright {
    margin: 0;
    padding: 0;
    font-size: 0.75rem;
    color: #8C8E9F;
}

.footer-bottom-links {
    display: flex;
    gap: 1.25rem;
}

.footer-bottom-links a {
    font-size: 0.75rem;
    color: #8C8E9F;
    text-decoration: none;
    transition: color 160ms ease;
}

.footer-bottom-links a:hover,
.footer-bottom-links a:focus-visible {
    color: #ffffff;
    outline: none;
}

/* ==========================================================================
   7. Responsive Breakpoints
   ========================================================================== */
/* Large Tablet / Small Laptop (1024px - 1100px) */
@media (max-width: 1100px) {
    .footer-main-grid {
        grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr;
        gap: 1.25rem;
    }

    .footer-brand-blurb {
        font-size: 0.8rem;
        max-width: 260px;
    }

    .footer-links-list li a {
        font-size: 0.8rem;
    }
}

/* Tablet in Landscape and Portrait (769px - 992px) */
@media (max-width: 992px) {
    .site-footer.dark-site-footer {
        padding: 3rem 0 1.5rem;
    }

    .footer-container {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .footer-main-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem 1.5rem;
        margin-bottom: 1.75rem;
    }

    .footer-brand-col {
        grid-column: span 4;
        max-width: 580px;
        margin-bottom: 0.5rem;
    }

    .footer-brand-blurb {
        max-width: 520px;
        font-size: 0.875rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }

    .footer-social-row {
        gap: 0.65rem;
    }

    .footer-links-list {
        gap: 0.5rem;
    }

    .footer-links-list li a {
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .site-footer.dark-site-footer {
        padding: 3rem 0 2rem;
    }

    .footer-container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .footer-main-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.25rem 1.5rem;
        margin-bottom: 2rem;
    }

    .footer-brand-col {
        grid-column: span 2;
        margin-bottom: 0.5rem;
    }

    .footer-brand-blurb {
        max-width: 100%;
        font-size: 0.875rem;
        line-height: 1.5;
        margin-bottom: 1.25rem;
    }

    .footer-social-row {
        gap: 0.75rem;
        margin-bottom: 0.5rem;
    }

    .footer-social-btn {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .footer-social-btn svg {
        width: 18px;
        height: 18px;
    }

    .footer-col-heading {
        font-size: 0.8125rem;
        margin-bottom: 0.85rem;
        letter-spacing: 0.08em;
    }

    .footer-links-list {
        gap: 0.65rem;
    }

    .footer-links-list li a {
        font-size: 0.875rem;
        color: #FFFFFF;
        line-height: 1.4;
    }

    .link-view-all-states {
        color: #FFFFFF !important;
    }

    .footer-disclaimer-wrap {
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .footer-disclaimer-card {
        background: #36384E;
        border: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 12px;
        padding: 1.15rem 1.25rem;
    }

    .footer-disclaimer-card p {
        font-size: 0.8125rem;
        color: #CBD5E1;
        line-height: 1.5;
    }

    .footer-bottom-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .footer-copyright {
        font-size: 0.8125rem;
        color: #CBD5E1;
    }

    .footer-bottom-links {
        display: flex;
        gap: 1.25rem;
        width: 100%;
    }

    .footer-bottom-links a {
        font-size: 0.8125rem;
        color: #CBD5E1;
    }
}

@media (max-width: 480px) {
    .site-footer.dark-site-footer {
        padding: 2.75rem 0 1.75rem;
    }

    .footer-container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .footer-main-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem 1.25rem;
        margin-bottom: 1.75rem;
    }

    .footer-brand-col {
        grid-column: span 2;
    }

    .footer-disclaimer-card {
        padding: 1rem 1.15rem;
    }
}

/* ==========================================================================
   6. Scroll To Top Component (.scroll-to-top-btn)
   ========================================================================== */
.scroll-to-top-btn {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background-color: #2B2D42; /* Charcoal */
    color: #FFFFFF;
    border: 1.5px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 8px 24px rgba(15, 17, 26, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(0.92);
    transition: opacity 240ms cubic-bezier(0.16, 1, 0.3, 1),
                transform 240ms cubic-bezier(0.16, 1, 0.3, 1),
                background-color 180ms ease,
                border-color 180ms ease,
                box-shadow 180ms ease;
    padding: 0;
    outline: none;
}

.scroll-to-top-btn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

@media (hover: hover) and (pointer: fine) {
    .scroll-to-top-btn:hover {
        background-color: #00B4A6; /* Primary brand teal */
        color: #FFFFFF;
        border-color: #00B4A6;
        box-shadow: 0 10px 28px rgba(0, 180, 166, 0.35);
        transform: translateY(-3px) scale(1.04);
    }

    .scroll-to-top-btn:hover .scroll-to-top-icon {
        transform: translateY(-2px);
    }
}

.scroll-to-top-btn:focus-visible {
    outline: 2px solid #00B4A6;
    outline-offset: 3px;
}

.scroll-to-top-btn:active {
    background-color: #00B4A6;
    color: #FFFFFF;
    border-color: #00B4A6;
    transform: translateY(-1px) scale(0.98);
}

/* Mobile & Safe Area Positioning */
@media (max-width: 768px) {
    .scroll-to-top-btn {
        right: 1rem;
        bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
        width: 42px;
        height: 42px;
    }

    /* Elevate above mobile sticky buy bar if present on cheat sheet pages */
    body.page-cheat-sheet .scroll-to-top-btn,
    body:has(.cs-sticky-buy-bar) .scroll-to-top-btn {
        bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    }
}