/*
 * Location: /postcards/include/css/header.css
 * Shared header & footer styles — included by all public-facing pages.
 */

/* ── Site header ──────────────────────────────────────────── */
.site-header {
    background: #3a7d44;
    border-bottom: 3px solid #2d6235;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
    /* Reset inherited properties so no page-level CSS can affect header size */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1;
    box-sizing: border-box;
}
.site-header *, .site-header *::before, .site-header *::after {
    box-sizing: border-box;
    line-height: 1;
}
.site-header__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: stretch;
    height: 56px;
    min-height: 56px;
    max-height: 56px;
}

/* Logo */
.site-header__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    padding-right: 28px;
    border-right: 1px solid rgba(255,255,255,0.15);
    white-space: nowrap;
    flex-shrink: 0;
}
.site-header__logo img {
    height: 34px;
    width: auto;
    max-width: none;
    margin-right: 10px;
    display: inline-block;
}
.site-header__logo:hover { color: #d4edda; }

/* Nav */
.site-nav {
    display: flex;
    align-items: stretch;
    flex: 1;
    margin-left: 4px;
}
.site-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: stretch;
}
.site-nav__item {
    position: relative;
    display: flex;
    align-items: stretch;
}
.site-nav__link {
    display: flex;
    align-items: center;
    padding: 0 15px;
    color: rgba(255,255,255,0.92);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    border-bottom: 3px solid transparent;
}
.site-nav__link:hover,
.site-nav__item:focus-within > .site-nav__link {
    background: rgba(0,0,0,0.12);
    color: white;
    border-bottom-color: #a8d5b0;
}
.site-nav__link--has-sub::after {
    content: ' ▾';
    font-size: 10px;
    opacity: 0.7;
    margin-left: 3px;
}

/* Dropdowns */
.site-nav__sub {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #2d6235;
    border: 1px solid rgba(255,255,255,0.1);
    border-top: 2px solid #a8d5b0;
    min-width: 200px;
    list-style: none;
    margin: 0;
    padding: 4px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.site-nav__sub--wide {
    min-width: 300px;
    columns: 2;
    column-gap: 0;
}
.site-nav__item:hover > .site-nav__sub,
.site-nav__item:focus-within > .site-nav__sub {
    display: block;
}
.site-nav__sub li { break-inside: avoid; }
.site-nav__sub a {
    display: block;
    padding: 7px 16px;
    color: rgba(255,255,255,0.88);
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
    transition: background 0.1s;
}
.site-nav__sub a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

/* Auth buttons */
.site-header__right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    padding-left: 16px;
}
.site-header__user {
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    white-space: nowrap;
}
.header-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 13px;
    border-radius: 3px;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.15s;
    white-space: nowrap;
}
.header-btn--login {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.25);
}
.header-btn--login:hover { background: rgba(255,255,255,0.25); color: white; }
.header-btn--admin {
    background: #1a5c28;
    color: white;
    border: 1px solid rgba(255,255,255,0.15);
}
.header-btn--admin:hover { background: #174f22; color: white; }
.header-btn--logout {
    background: transparent;
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.2);
    font-weight: 400;
}
.header-btn--logout:hover { background: rgba(0,0,0,0.15); color: white; }

/* Mobile toggle */
.site-header__toggle {
    display: none;
    background: none;
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 6px 10px;
    border-radius: 3px;
    font-size: 18px;
    cursor: pointer;
    margin-left: auto;
    line-height: 1;
}

/* ── Site footer ──────────────────────────────────────────── */
.site-footer {
    background: #2d6235;
    border-top: 3px solid #3a7d44;
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    margin-top: 40px;
    padding: 16px 20px;
}
.site-footer__inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.site-footer__links { display: flex; gap: 16px; }
.site-footer a { color: rgba(255,255,255,0.7); text-decoration: none; }
.site-footer a:hover { color: white; }

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 900px) {
    .site-header__toggle { display: block; }
    .site-nav {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: #2d6235;
        padding: 8px 0 12px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        z-index: 999;
        flex-direction: column;
        align-items: stretch;
    }
    .site-nav.is-open { display: flex; }
    .site-nav__list { flex-direction: column; align-items: stretch; }
    .site-nav__item { flex-direction: column; }
    .site-nav__link {
        padding: 11px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.07);
    }
    .site-nav__link--has-sub::after { float: right; }
    .site-nav__sub,
    .site-nav__sub--wide {
        display: none;
        position: static;
        background: rgba(0,0,0,0.15);
        border: none;
        box-shadow: none;
        columns: 1;
        padding: 0;
    }
    .site-nav__item.is-open > .site-nav__sub { display: block; }
    .site-nav__sub a { padding: 9px 32px; }
    .site-header__right { margin-left: 0; padding: 8px 20px 4px; }
    .site-header__inner { flex-wrap: wrap; height: auto; min-height: unset; max-height: unset; padding: 10px 16px; }
    .site-header__logo { border-right: none; padding-right: 0; }
}