/* ===========================
   Global Styles
   =========================== */
   
@font-face {
    font-family: 'OPTIBenjieModern';
    src: url('/resources/fonts/OPTIBenjieModern.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
}

.main-content {
    margin: 2rem;
    font-family: 'OPTIBenjieModern', serif;
    font-weight: 200;
    word-spacing: 0.1rem;
    letter-spacing: 0.05rem;
}

h1, h3 {
    font-family: 'OPTIBenjieModern', serif;
    font-weight: 300;
}

/* ===========================
   Header
   =========================== */

header {
  position: sticky;
  top: 0;
  background: white;
  z-index: 1000;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    border-bottom: 1px solid #ccc;
    background-color: #fff;
}

.logo_nav-container {
    margin-left: 4%;
    display: flex;
    align-items: center;
}

.logo-container {
    flex-shrink: 0;
}

.site-logo {
    height: 250px;
    width: auto;
    transition: height 0.3s ease;
}

.site-logo.shrink {
    height: 100px;
}

.nav {
    margin-left: 3rem;
    margin-right: 3rem;
}

.nav ul {
    list-style: none;
    display: flex;
    gap: 3rem;
    margin: 0;
    padding: 0;
}

.nav li {
    display: inline-block;
}

.nav a {
    font-family: 'OPTIBenjieModern', serif;
    font-size: 1.2rem;
    color: #000;
    text-decoration: none;
    text-underline-offset: 4px;
}

.nav a:hover {
    text-decoration: underline;
}

.nav a.active {
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.nav a.active:hover {
    text-decoration-thickness: 3px;
}

/* User Search navigation*/ 
.nav-icon {
    width: 35px;
    height: 35px;
    transition: transform 0.2s ease;
}

.user-nav {
    margin-right: 6rem;
    display: flex;
    gap: 1.5rem;
}

.user-nav a:hover .nav-icon {
    transform: scale(1.15);
}

.hamburger {
    display: none;
}

.nav-close {
    display: none;
}

/* ===========================
   Footer
   =========================== */

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.5rem;
}

.social-links a {
    color: #000;
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    transform: scale(1.2);
}

.social-links a {
    transition: transform 0.3s ease;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 4rem;
    flex-wrap: wrap;
    text-align: center;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-label {
    font-family: 'OPTIBenjieModern', serif;
    font-size: 1.2rem;
}

.footer-right {
    font-size: 0.9rem;
}

/* ===========================
   Tablet Screen Size
   =========================== */

@media (max-width: 1150px) {
    /* Switch to a 3-column grid so each area (hamburger, logo, user-nav) is independent */
    .header-container {
        display: grid;
        grid-template-columns: 1fr auto 1fr; /* left = hamburger, center = logo, right = user tools */
        align-items: center;
        padding: 0.5rem 1rem;
        position: relative; /* anchor for the dropdown nav */
        border-bottom: 1px solid #ccc;
    }

    /* Show hamburger on the left */
    .hamburger {
        display: block;
        width: 30px;
        height: 30px;
        cursor: pointer;
        background: none;
        border: none;
        padding: 0;
        grid-column: 1;
        justify-self: start;
        margin-left: 2rem;
        position: relative;
    }

    .hamburger span {
        display: block;
        height: 2px;      /* thickness of each line */
        width: 100%;
        background: #000000;  /* color */
        margin: 0.75rem 0;     /* space between lines */
        border-radius: 2px; /* rounded edges for each line */
        transition: transform 0.25s ease, opacity 0.2s ease, background-color 0.2s ease;
        transform-origin: center;
    }

    /* Hover effect for hamburger lines */
    .hamburger:hover span {
        transform: scale(1.05) translateY(-2px);
        transition: transform 0.2s ease;
    }

    .hamburger:focus-visible { outline: 2px solid #000; outline-offset: 4px; }

    /* Center the logo perfectly in the middle column */
    .logo_nav-container {
        grid-column: 2;
        justify-self: center;
        display: flex;
        align-items: center;
    }

    /* Keep user tools on the right */
    .user-nav {
        grid-column: 3;
        justify-self: end;
        margin-right: 1rem;
        display: flex;
        gap: 1rem;
    }

    /* Off-canvas panel (hidden by default) */
    .nav {
        position: fixed;
        left: 0;
        top: 0;
        right: auto;
        height: 100vh;
        width: 80vw;
        max-width: 300px;
        background: #fff;
        box-shadow: -4px 0 16px rgba(0,0,0,0.12);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1100; /* above header */
        padding: 1.25rem 2rem;
        border-right: 1px solid #e6e6e6;
        margin: 0;
        visibility: hidden; /* keep in DOM for animation */
        display: block; /* enable transition */
        padding-top: var(--logo-offset, 0px); /* push links down by logo height */
    }

    /* When menu is open */
    .nav.show {
        transform: translateX(0);
        visibility: visible;

    }

    .nav ul {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .nav li { display: block; }

    .nav a { font-size: 1.1rem; }

    /* Close button inside off-canvas nav */
    .nav-close {
        display: block; 
        position: absolute;
        top: calc((var(--logo-offset, 0px) / 2 - 1rem));
        left: 2rem;
        background: none;
        border: none;
        font-size: 4rem;
        line-height: 1;
        color: #000;
        cursor: pointer;
        transition: transform 0.2s ease, color 0.2s ease;
    }

    .nav-close:hover {
        transform: scale(1.05) translateY(-2px);
        /*color: rgb(220, 237, 241); /* matches your accent color */
    }

    .nav-close:focus-visible {
        outline: 2px solid #000;
        outline-offset: 4px;
    }

    /* Dark overlay when menu is open */
    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000; /* just below the nav panel's z-index */
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .overlay.show {
        opacity: 1;
        pointer-events: auto;
    }
}