/*
 * ============================================================
 * FEARANN ALBA — nav.css
 * ============================================================
 * All styles for the site header, primary navigation,
 * mobile hamburger menu, and site footer.
 *
 * Relies on CSS variables defined in main.css — make sure
 * main.css loads before this file (handled in enqueue.php).
 * ============================================================
 */


/*
 * ============================================================
 * SITE HEADER
 * ============================================================
 */

.site-header {
    /* Fix the header to the top of the viewport at all times */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;

    /* Black at 90% opacity with blur — glass effect */
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px); /* Safari support */

    /* Subtle gold line at the very bottom of the header */
    border-bottom: 1px solid var(--color-border);

    /* Smooth transition if we add scroll-based effects later */
    transition: background-color 0.3s ease;
}

.header-inner {
    /* Flex row: logo on left, nav on right */
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}


/*
 * ============================================================
 * HEADER LOGO
 * ============================================================
 */

.header-logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0; /* Prevent logo shrinking on small screens */

    /* Remove browser default underline */
    text-decoration: none;

    /* Needed for the animated underline pseudo-element */
    position: relative;
    padding-bottom: 4px;
}

/* Animated gold underline — grows left to right on hover */
.header-logo::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-gold);
    transition: width 0.25s ease;
}

.header-logo:hover::after {
    width: 100%;
}

.header-logo img {
    height: 36px;
    width: auto;
}

/* Text fallback — shown until real logo SVG is uploaded */
.header-logo__text {
    font-family: var(--font-primary);
    font-weight: var(--weight-bold);
    font-size: 1rem;
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    color: var(--color-text);
}


/*
 * ============================================================
 * PRIMARY NAVIGATION — DESKTOP
 * ============================================================
 */

.primary-nav {
    display: flex;
    align-items: center;
}

.primary-nav__list {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.primary-nav__list li a {
    font-family: var(--font-primary);
    font-size: 0.75rem;
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--color-text);
    text-decoration: none; /* No underline at rest */
    transition: color 0.2s ease;
}

.primary-nav__list li a:hover {
    color: var(--color-gold);
}

/* Active/current page link — stays gold permanently */
.primary-nav__list li.current-menu-item > a,
.primary-nav__list li.current_page_item > a {
    color: var(--color-gold);
}


/*
 * ============================================================
 * HAMBURGER TOGGLE BUTTON — MOBILE
 * ============================================================
 */

.nav-toggle {
    /* Hidden on desktop — shown only on mobile */
    display: none;

    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.nav-toggle__bar {
    display: block;
    width: 100%;
    height: 1px;
    background-color: var(--color-text);
    transition:
        transform  0.3s ease,
        opacity    0.3s ease;
}

/*
 * When the nav is open, the three bars animate into an X.
 * The .is-open class is toggled by main.js.
 */
.nav-toggle.is-open .nav-toggle__bar:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}

.nav-toggle.is-open .nav-toggle__bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle.is-open .nav-toggle__bar:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
}


/*
 * ============================================================
 * MOBILE NAVIGATION DROPDOWN
 * ============================================================
 */

@media ( max-width: 768px ) {

    /* Show hamburger button on mobile */
    .nav-toggle {
        display: flex;
    }

    /* Hide the desktop nav */
    .primary-nav {
        position: absolute;
        top: 70px; /* Sits directly below the header */
        left: 0;
        width: 100%;
        background-color: rgba(0, 0, 0, 0.97);
        border-bottom: 1px solid var(--color-border);

        /* Hidden by default — slides down when .is-open is added */
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease;
    }

    /* When open — main.js adds .is-open to #primary-nav */
    .primary-nav.is-open {
        max-height: 400px;
    }

    /* Stack nav items vertically */
    .primary-nav__list {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 1rem 0;
    }

    .primary-nav__list li {
        width: 100%;
    }

    .primary-nav__list li a {
        display: block;
        padding: 0.9rem 2rem;
        font-size: 0.8rem;
        border-bottom: 1px solid var(--color-border);
    }

    .primary-nav__list li:last-child a {
        border-bottom: none;
    }

}


/*
 * ============================================================
 * PAGE OFFSET
 * ============================================================
 * Because the header is fixed, it sits on top of the page
 * content. This adds top padding to the main content area
 * equal to the header height, so nothing is hidden behind it.
 * ============================================================
 */

/* WordPress outputs a <div id="page"> or we target <main> */
body {
    padding-top: 70px;
}

/*
 * Exception: pages that hide the header don't need the offset.
 * Add .no-header to <body> via body_class() in those templates.
 */
body.no-header {
    padding-top: 0;
}


/*
 * ============================================================
 * SITE FOOTER
 * ============================================================
 */

.site-footer {
    background-color: var(--color-surface);
    margin-top: auto;
}

/* Gold top border */
.footer-border {
    height: 1px;
    background-color: var(--color-gold);
    opacity: 0.4;
}

.footer-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding-top: 3rem;
    padding-bottom: 3rem;
    gap: 2rem;
}


/*
 * ============================================================
 * FOOTER BRAND
 * ============================================================
 */

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-logo img {
    height: 32px;
    width: auto;
}

/* Text fallback until real logo is uploaded */
.footer-logo__text {
    font-family: var(--font-primary);
    font-weight: var(--weight-bold);
    font-size: 0.9rem;
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    color: var(--color-text);
}

.footer-tagline {
    font-size: 0.8rem;
    font-weight: var(--weight-light);
    letter-spacing: var(--tracking-wide);
    color: var(--color-text-muted);
    font-style: italic;
    max-width: none; /* Override the p max-width from main.css */
}


/*
 * ============================================================
 * FOOTER NAVIGATION
 * ============================================================
 */

.footer-nav__list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: right;
}

.footer-nav__list li a {
    font-size: 0.75rem;
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--color-text-muted);
    transition: color 0.2s ease;
}

.footer-nav__list li a:hover {
    color: var(--color-gold);
}


/*
 * ============================================================
 * FOOTER BOTTOM BAR
 * ============================================================
 */

.footer-bottom {
    border-top: 1px solid var(--color-border);
    padding: 1.25rem 0;
}

.footer-copyright {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    letter-spacing: var(--tracking-wide);
    text-align: center;
    max-width: none; /* Override the p max-width from main.css */
}


/*
 * ============================================================
 * MOBILE FOOTER
 * ============================================================
 */

@media ( max-width: 768px ) {

    .footer-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }

    .footer-nav__list {
        align-items: center;
        text-align: center;
    }

    .footer-tagline {
        text-align: center;
    }

}