/* =========================================================================
   Shared Header (navbar) + Footer styles — used on EVERY page.
   Include this file once, right after assets/css/style.css:

       <link rel="stylesheet" href="assets/css/style.css">
       <link rel="stylesheet" href="assets/css/nav-style.css">

   (adjust the "assets/..." prefix to "../assets/..." from a subfolder)
   ========================================================================= */

/*
 * Colour theme, as CSS custom properties.
 * These defaults are the "Online Book Library" parchment theme (used by
 * index.php, book-details.php). A section with its OWN brand colours
 * (e.g. the admin/staff dashboards, or the login/register/student pages)
 * overrides just these variables in a small stylesheet loaded AFTER this
 * file — see assets/css/nav-theme-dashboard.css and
 * assets/css/nav-theme-modern.css — instead of redefining the whole
 * navbar/footer again. That keeps one shared layout with per-section colours.
 */
:root {
    --nf-ink: #1B2A4A;
    --nf-ink-light: #2C4270;
    --nf-parchment: #F3ECDD;
    --nf-card: #FFFFFF;
    --nf-brand-icon: #7A2E3B;
    --nf-burgundy: #7A2E3B;
    --nf-burgundy-dark: #5E212C;
    --nf-gold: #C8963E;
    --nf-sage: #3F7053;
    --nf-sage-dark: #2E5940;
    --nf-text-muted: #5B6B8C;
}

/* ---------------------------- Navigation ------------------------------ */
.navbar {
    background: var(--nf-card);
    box-shadow: 0 2px 10px rgba(27, 42, 74, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1450px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    gap: 16px;
}

.nav-brand a {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--nf-ink);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.nav-brand a i {
    color: var(--nf-brand-icon);
}

/* Used by pages that render the brand icon inside a filled badge
   (see header.php's $brand_logo_badge option) instead of a bare icon. */
.nav-brand a .logo-badge {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--nf-brand-icon);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.nav-links a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-size: 0.95rem;
    position: relative;
}

.nav-links a:hover {
    background: var(--nf-parchment);
    color: var(--nf-ink);
}

.nav-links a.active {
    background: var(--nf-ink);
    color: #fff;
}

.nav-badge {
    display: inline-block;
    background: var(--nf-burgundy);
    color: #fff;
    border-radius: 50%;
    padding: 1px 7px;
    font-size: 0.72rem;
    margin-left: 4px;
    vertical-align: 2px;
}

.btn-logout {
    background: var(--nf-burgundy) !important;
    color: #fff !important;
}

.btn-logout:hover {
    background: var(--nf-burgundy-dark) !important;
}

.btn-login-nav {
    background: var(--nf-ink) !important;
    color: #fff !important;
}

.btn-login-nav:hover {
    background: var(--nf-ink-light) !important;
}

.btn-register-nav {
    background: var(--nf-sage) !important;
    color: #fff !important;
}

.btn-register-nav:hover {
    background: var(--nf-sage-dark) !important;
}

.nav-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--nf-ink);
    padding: 4px 8px;
    border-radius: 6px;
}

.nav-toggle:hover {
    background: var(--nf-parchment);
}

/* ------------------------------- Footer -------------------------------- */
.footer {
    background: var(--nf-ink);
    color: #fff;
    padding: 1px 0 1px;
    margin-top: 2px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin-bottom: 20px;
}

.footer-section h4 {
    margin-bottom: 15px;
    color: var(--nf-gold);
    font-family: 'Fraunces', Georgia, serif;
}

.footer-section p,
.footer-section a {
    color: #C9D0E0;
    line-height: 1.8;
}

.footer-section a {
    display: block;
    text-decoration: none;
    width: fit-content;
}

.footer-section a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 20px;
    text-align: center;
    color: #C9D0E0;
    font-size: 0.9rem;
}

/* ----------------------------- Responsive ------------------------------
   Tablet & mobile: collapse the links into a full-width dropdown behind
   a hamburger button, so the header stays usable on small screens.
   ------------------------------------------------------------------------ */
@media (max-width: 900px) {
    .nav-links {
        gap: 2px;
    }

    .nav-links a {
        padding: 8px 10px;
        font-size: 0.88rem;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 12px 16px;
        flex-wrap: nowrap;
    }

    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        padding: 12px 0 16px;
        background: var(--nf-card);
        position: absolute;
        top: 100%;
        left: 0;
        box-shadow: 0 10px 20px rgba(27, 42, 74, 0.15);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        width: 100%;
        text-align: center;
        padding: 13px 12px;
        border-radius: 0;
        font-size: 1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-section a {
        margin: 0 auto;
    }
}

@media (max-width: 420px) {
    .nav-brand a {
        font-size: 1.15rem;
    }
}
