/* Stylesheet: Shared site header and footer.
 * Cascade order is intentional: later component/responsive refinements win.
 * Keep selectors, declaration order and breakpoints in place when editing.
 * Shared palette: --brand and --brand-dark in archive.css; fallbacks retained.
 */

/* Shared header and footer; keep page layouts and admin menus independent. */
/* Shared mobile rule formerly delivered with admin-navigation.css. Its position
 * before the remaining chrome rules preserves the existing cascade. */
@media (max-width: 680px) {
    .site-header .site-nav {
        position: relative;
        flex-wrap: wrap;
    }
}

.mobile-archive-exit { display: none; }
.site-header {
    width: min(980px,calc(100% - 40px));
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 22px 0 30px;
    margin: 0 auto 0;
    position: relative;
    font-family: Montserrat,Arial,sans-serif;
}

.site-header::after {
    content: "";
    position: absolute;
    left: 126px;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--line);
}

.society-logo {
    flex: 0 0 auto;
    display: block;
}

.society-logo img {
    display: block;
    object-fit: contain;
    max-width: 100%;
    filter: drop-shadow(0 4px 9px rgb(23 56 75 / 9%));
    transition: transform 180ms ease;
}

.society-logo:hover img,.society-logo:focus-visible img {
    transform: translateY(-3px);
}

@media(prefers-reduced-motion:reduce) {
    .society-logo img {
        transition: none;
    }

    .society-logo:hover img,.society-logo:focus-visible img {
        transform: none;
    }

}

.archive-brand {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.brand-eyebrow {
    color: #617b87;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.7px;
    text-transform: uppercase;
}

.site-header .site-title {
    color: var(--brand);
    font: 700 clamp(22px,2.2vw,30px)/1.25 'Montagu Slab',Georgia,serif;
    text-decoration: none;
}

.brand-subtitle {
    color: var(--brand);
    font-size: 12px;
}

.site-header .site-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    flex: 0 0 auto;
    font-size: 13px;
}

.site-header .archive-nav-link {
    color: var(--brand-dark);
    text-decoration: none;
    position: relative;
    white-space: nowrap;
    padding: 7px 0;
    background: transparent;
    border-radius: 0;
    transition: color 150ms ease, opacity 150ms ease;
    font-weight: 500;
}

.site-header .archive-nav-link::after {
    content: "";
    position: absolute;
    bottom: 2px;
    left: 0;
    right: 0;
    height: 1px;
    background: #e44346;
    transform: scaleX(0);
    transition: transform 150ms ease;
}

.site-header .archive-nav-link:hover::after,.site-header .archive-nav-link:focus-visible::after {
    transform: scaleX(1);
}

.site-header .society-nav-link {
    font-size: 11px;
    color: #65777c;
    font-weight: 600;
    letter-spacing: .8px;
    text-transform: uppercase;
    border-left: 1px solid var(--line);
    padding-left: 22px;
}

.site-header .society-nav-link::after {
    left: 22px;
}

.society-join-button {
    display: inline-block;
    flex: 0 0 auto;
    padding: 13px 21px;
    border-radius: 6px;
    background: #e44346;
    color: #fff;
    font: 700 13px/1.5 Montserrat,Arial,sans-serif;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 4px 8px rgb(23 56 75 / 7%);
}

.society-join-button:hover {
    background: #cc3438;
    color: #fff;
}

.site-header a:focus-visible,.site-footer a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}

footer.site-footer {
    display: block;
    width: 100%;
    max-width: none;
    margin: 28px 0 0;
    padding: 0;
    border: 0;
    background: #183f4e;
    color: #edf4f5;
    font-family: Montserrat,Arial,sans-serif;
    overflow: hidden;
}

.footer-feature {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: linear-gradient(112deg,#285765,#1f4858 65%,#183c4b);
}

/* Asset: 2172x724; visible ridge occupies rows 368–608 (241px).
Crop only the transparent canvas, keeping the complete panorama at <=800px wide / 89px tall; phones use a shallow 56px band. */
.footer-mountain-accent {
    display: none;
    position: absolute;
    left: 0;
    bottom: -1px;
    width: min(800px,100%);
    aspect-ratio: 2172/241;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
    opacity: .32;
    -webkit-mask-image: linear-gradient(90deg,#000 72%,transparent);
    mask-image: linear-gradient(90deg,#000 72%,transparent);
}

.footer-mountains {
    position: absolute;
    left: 0;
    top: -152.6971%;
    width: 100%;
    max-width: none;
    height: 300.4149%;
    object-fit: fill;
    transform: none;
    filter: saturate(.25);
    pointer-events: none;
}

.footer-jefferson-rock {
    position: absolute;
    right: 0;
    top: 0;
    width: 40%;
    height: 100%;
    object-fit: cover;
    object-position: center 50%;
    transform: scale(1.12);
    opacity: .48;
    mix-blend-mode: luminosity;
    pointer-events: none;
    z-index: 0;
    -webkit-mask-image: linear-gradient(90deg,transparent,#000 40%);
    mask-image: linear-gradient(90deg,transparent,#000 40%);
}

.footer-feature::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: linear-gradient(90deg,transparent 20%,#1e4b5826 45%,#1c4452b8 69%,#16384652);
}

.footer-support {
    position: relative;
    z-index: 2;
    width: min(1150px,calc(100% - 48px));
    margin: auto;
    display: grid;
    grid-template-columns: 116px minmax(0,1fr) 225px;
    align-items: center;
    gap: 32px;
    min-height: 220px;
    padding: 34px 0;
}

.footer-support .society-logo {
    display: block;
    position: relative;
    margin: 0;
    align-self: center;
}

.footer-support .society-logo img {
    display: block;
    width: 116px;
    height: 116px;
    max-width: 100%;
    object-fit: contain;
}

.footer-support-copy {
    min-width: 0;
    padding: 0 0 0 30px;
    border-left: 1px solid rgb(218 236 237 / 28%);
}

.site-footer .footer-support-copy p {
    margin: 0;
    font-size: 14px;
    line-height: 1.8;
    color: #d5e4e8;
    max-width: 53ch;
}

.site-footer .footer-support-copy .footer-eyebrow {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #d9e9e9;
    margin: 0 0 10px;
}

.footer-support-copy h2 {
    font: 700 clamp(24px,2.2vw,29px)/1.25 'Montagu Slab',Georgia,serif;
    white-space: pre-line;
    max-width: 28ch;
    color: #fffdf6;
    margin: 0 0 12px;
}

.site-footer a {
    color: inherit;
}

.footer-support-copy p a {
    font-weight: 600;
    text-underline-offset: 3px;
}

.footer-membership-actions {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
    min-width: 0;
}

.site-footer .society-join-button {
    color: #fff;
    min-width: 185px;
    min-height: 46px;
    padding: 12px 20px;
    font-size: 14px;
    text-align: center;
    white-space: normal;
    background: linear-gradient(110deg,#ed4648,#dc373b);
    box-shadow: 0 4px 12px rgb(12 32 43 / 15%);
}

.site-footer .society-join-button:hover {
    background: #cc3438;
}

.site-footer .society-join-button>span {
    margin-left: 7px;
}

.site-footer .footer-membership-link {
    font-size: 12px;
    line-height: 1.6;
    text-decoration: underline;
    text-underline-offset: 3px;
    color: #eef5f4;
    overflow-wrap: anywhere;
}

.footer-bottom {
    display: block;
    padding: 20px 0;
    border-top: 1px solid rgb(221 239 239 / 15%);
    background: #173d4c;
}

.footer-bottom-inner {
    width: min(1150px,calc(100% - 48px));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    font-size: 12px;
    color: #cddfe5;
}

.footer-bottom p {
    margin: 0;
    line-height: 1.7;
}

.footer-bottom nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px 18px;
}

.footer-bottom a {
    font-size: 12px;
    line-height: 1.7;
    text-decoration: none;
    white-space: nowrap;
}

.footer-bottom a+a {
    border-left: 1px solid rgb(218 236 237 / 24%);
    padding-left: 18px;
}

.footer-bottom a:hover,.footer-membership-link:hover {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media(max-width:1000px) {
    .site-header {
        flex-wrap: wrap;
    }

    .site-header .site-nav {
        margin-left: 126px;
    }

}

@media(max-width:600px) {
    .site-header {
        gap: 14px;
        padding: 18px 0;
    }

    .site-header .society-logo img {
        width: 72px;
        height: 72px;
    }

    .site-header::after {
        left: 0;
    }

    .brand-eyebrow {
        font-size: 8px;
        letter-spacing: 1px;
    }

    .site-header .site-title {
        font-size: 21px;
    }

    .brand-subtitle {
        font-size: 11px;
    }

    .site-header .site-nav {
        width: 100%;
        margin-left: 0;
        gap: 16px;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .site-header .society-nav-link {
        padding-left: 14px;
        font-size: 10px;
    }

    .site-header .society-nav-link::after {
        left: 14px;
    }

    .society-join-button {
        padding: 10px 14px;
    }

}

@media(max-width:1000px) {
    .footer-support {
        grid-template-columns: 96px minmax(0,1fr) 200px;
        gap: 24px;
    }

    .footer-support .society-logo img {
        width: 96px;
        height: 96px;
    }

    .footer-support-copy {
        padding-left: 24px;
    }

    .footer-jefferson-rock {
        width: 48%;
    }

    .footer-support-copy h2 {
        font-size: 26px;
    }

}

@media(max-width:800px) {
    .footer-support {
        grid-template-columns: 96px minmax(0,1fr);
        gap: 20px 24px;
        padding: 30px 0;
    }

    .footer-support .society-logo {
        align-self: start;
        margin-top: 10px;
    }

    .footer-membership-actions {
        grid-column: 2;
    }

    .footer-support-copy {
        border-left: 0;
        padding-left: 0;
    }

    .footer-jefferson-rock {
        width: 60%;
    }

    .footer-bottom-inner {
        align-items: flex-start;
    }

    .footer-bottom nav {
        gap: 8px 12px;
    }

    .footer-bottom a+a {
        padding-left: 12px;
    }

}

@media(max-width:600px) {
    .footer-support {
        width: calc(100% - 36px);
        grid-template-columns: 76px minmax(0,1fr);
        gap: 18px;
        padding: 30px 0;
    }

    .footer-support .society-logo img {
        width: 76px;
        height: 76px;
    }

    .footer-support-copy h2 {
        font-size: 23px;
        max-width: none;
    }

    .site-footer .footer-support-copy p {
        font-size: 13px;
    }

    .site-footer .footer-support-copy .footer-eyebrow {
        font-size: 9px;
        letter-spacing: 1.5px;
    }

    .footer-membership-actions {
        align-items: stretch;
    }

    .site-footer .society-join-button {
        min-width: 0;
        width: 100%;
        padding: 11px 14px;
    }

    .site-footer .footer-membership-link {
        font-size: 12px;
    }

    .footer-jefferson-rock {
        width: 100%;
        opacity: .24;
        object-position: 65% center;
    }

    .footer-bottom-inner {
        width: calc(100% - 36px);
        flex-direction: column;
        align-items: center;
        gap: 14px;
        text-align: center;
    }

    .footer-bottom nav {
        justify-content: center;
    }

    .footer-feature::after {
        background: linear-gradient(90deg,#1c445240,#1c4452a6);
    }

    .footer-bottom {
        padding: 20px 0;
    }

}

@media(prefers-reduced-motion:reduce) {
    .site-footer a {
        transition: none;
    }

}

@media(max-width:600px) {
    .footer-mountain-accent {
        height: 56px;
        aspect-ratio: auto;
        opacity: .45;
    }

}

/* Use one decorative treatment per screen size. */
@media(max-width:760px) {
    .footer-jefferson-rock {
        display: none;
    }

    .footer-mountain-accent {
        display: block;
    }

}

/* Compact phone masthead, with archive navigation on its own row. */
@media (max-width: 600px) {
    body .site-header.site-header {
        display: grid;
        grid-template-columns: 64px minmax(0, 1fr) 36px;
        gap: 12px 10px;
        box-sizing: border-box;
        width: 100%;
        padding: 16px 12px 8px;
        border-radius: 0;
        background: linear-gradient(112deg, #285765, #1f4858 65%, #183c4b);
    }
    body .site-header.site-header::after { display: none; }
    body .site-header.site-header .society-logo img { width: 64px; height: 64px; }
    body .site-header.site-header .brand-eyebrow { color: #dae6e6; font-size: 7px; letter-spacing: 1.2px; }
    body .site-header.site-header .site-title { color: #fff9ed; font: 700 clamp(15px, 4.5vw, 21px)/1.25 'Montagu Slab', Georgia, serif; }
    body .site-header.site-header .brand-subtitle { color: #e1e9e7; font: 10px/1.4 Montserrat, Arial, sans-serif; }
    body .site-header.site-header .mobile-archive-exit {
        display: grid;
        place-items: center;
        grid-column: 3;
        grid-row: 1;
        width: 36px;
        min-height: 44px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #e1e9e7;
        cursor: pointer;
    }
    .mobile-archive-exit:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
    body .site-header.site-header .site-nav {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        margin: 0;
        box-sizing: border-box;
        padding: 5px 10px;
        gap: 14px;
        border-radius: 14px;
        background: #173d4c;
        flex-wrap: wrap;
    }
    body .site-header.site-header .archive-nav-link { display: inline-flex; align-items: center; gap: 7px; color: #f2eee3; font: 12px/1.5 Montserrat, Arial, sans-serif; min-height: 34px; }
    body .site-header .site-nav > .archive-nav-link + .archive-nav-link { border-left: 1px solid #ffffff18; padding-left: 14px; }
    body .site-header .site-nav > .archive-nav-link::before { content: ''; width: 18px; height: 18px; background: currentColor; mask: center / contain no-repeat; }
    body .site-header .site-nav > .archive-nav-link:first-child::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Ccircle cx='10' cy='10' r='7'/%3E%3Cpath d='m15 15 7 7'/%3E%3C/svg%3E"); }
    body .site-header .site-nav > .archive-nav-link:nth-child(2)::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Cpath d='M12 5C8 2 3 3 2 4v16c3-2 7-2 10 0 3-2 7-2 10 0V4c-1-1-6-2-10 1v15'/%3E%3C/svg%3E"); }
    body .site-header .site-nav .society-join-button { margin-left: auto; padding: 9px 12px; border-radius: 4px; background: #ca202e; font: 700 12px/1.5 Montserrat, Arial, sans-serif; }
}
