/* ============================
     HEADER STYLING
============================ */

.site-header {
    position: fixed;
    top: var(--admin-bar-height);
    left: 0;
    width: 100%;
    height: var(--hdr-height);
    background: transparent !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
    box-sizing: border-box;
    z-index: 1000;
    pointer-events: auto;
    transition: top 0.3s ease, background 0.3s ease;
    backdrop-filter: none !important;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-branding {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--body-text-color);
}

.site-logo {
    display: block;
    max-height: var(--hdr-height);
    width: auto;
    object-fit: contain;
}

/* Site title in main header */
.site-title {
    font-family: var(--heading-font);
    font-size: 2.2rem;
    font-weight: normal;
    transform: rotate(-5deg);
    color: var(--body-text-color);
    margin: 0;
}

.menu-toggle {
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    font-family: var(--heading-font);
    font-size: 1.8rem;
    color: var(--body-text-color);
    z-index: 1001;
    pointer-events: auto;
}

/* ============================
     OFF-CANVAS NAV (FULL SCREEN OVERLAY)
============================ */

/* ADDED: This rule prevents the page from scrolling when the menu is open. */
body.offcanvas-open {
    overflow: hidden;
}

.offcanvas-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    transform: translateX(100%); /* Starts off-screen to the right */
    transition: transform 0.4s ease-out, visibility 0.4s; /* Added visibility to transition */
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 1rem;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* UPDATED: This hides the menu completely when it's closed. */
    visibility: hidden;
}

.offcanvas-menu.open {
    transform: translateX(0); /* Slides into view */
    /* UPDATED: This makes the menu visible when it's open. */
    visibility: visible;
}

.offcanvas-logo {
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    border-bottom: none;
    margin-top: 0;
    margin-bottom: 2rem;
    text-align: center;
    width: 100%;
}

.offcanvas-logo img {
    max-width: 150px;
    height: auto;
    object-fit: contain;
    margin: 0;
    padding: 0;
    display: block;
}

.offcanvas-menu .offcanvas-logo .site-title {
    font-family: var(--heading-font);
    font-size: 2rem;
    font-weight: normal;
    transform: rotate(0deg);
    color: #fff;
    margin: 0;
    text-transform: none !important;
}


.offcanvas-menu .primary-menu,
.offcanvas-menu .nav-menu {
    list-style: none;
    margin: auto 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    text-align: center;
    width: 100%;
}

.offcanvas-menu .primary-menu li,
.offcanvas-menu .nav-menu li {
    width: 100%;
}

.offcanvas-menu a {
    font-family: var(--body-font);
    font-size: 1.4rem;
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease, transform 0.2s ease;
    display: block;
    padding: 0.15rem 0;
    text-transform: uppercase;
}

.offcanvas-menu a:hover {
    color: rgba(255, 255, 255, 0.7);
    transform: scale(1.02);
}

.offcanvas-footer {
    margin-top: 2rem;
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    width: 100%;
}

.footer-nav {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.footer-nav a {
    font-family: var(--body-font);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    text-transform: capitalize;
    white-space: nowrap;
}

.footer-nav a:hover {
    color: rgba(255, 255, 255, 0.9);
}

.footer-text {
    font-family: var(--body-font);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0;
    text-align: center;
}

/* === ADDED: RESPONSIVE STYLES FOR HEADER === */
@media (max-width: 768px) {
    .site-header {
        padding: 0.5rem 1rem; /* Adjust padding for smaller screens */
    }

    .header-left {
        /* This is the key change: stack the logo and title vertically */
        flex-direction: column;
        align-items: flex-start; /* Align to the left edge */
        gap: 0.25rem; /* Reduce space between logo and title */
    }

    .site-logo {
        /* Reduce logo size slightly on mobile */
        max-height: 40px; 
    }

    .site-title {
        font-size: 1.5rem; /* Reduce title size */
        transform: rotate(-3deg); /* Less of a tilt on mobile */
    }

    .menu-toggle {
        font-size: 1.5rem;
    }
}
