/*
 * Thursday Night Mens Golf League
 * Standardized site header and hover/focus menu
 */

:root {
    --site-header-dark: #08271d;
    --site-header-green: #0f5136;
    --site-header-accent: #f3d47a;
    --site-header-line: rgba(255, 255, 255, 0.16);
    --site-menu-text: #123126;
    --site-menu-muted: #65726d;
}

.site-header {
    position: sticky;
    z-index: 1000;
    top: 0;
    width: 100%;
    border-bottom: 1px solid var(--site-header-line);
    background:
        linear-gradient(
            135deg,
            var(--site-header-dark),
            #0d3528
        );
    box-shadow: 0 8px 24px rgba(8, 39, 29, 0.2);
    color: #fff;
}

.site-header-inner {
    width: min(1180px, calc(100% - 32px));
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0 auto;
    padding: 8px 0;
}

.site-header-brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
}

.site-header-brand:hover,
.site-header-brand:focus-visible {
    color: #fff;
}

.site-header-logo {
    width: 74px;
    height: 55px;
    flex: 0 0 auto;
    object-fit: contain;
    padding: 4px;
    border-radius: 10px;
    background: #fff;
    box-shadow:
        0 5px 13px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.12);
}

.site-header-title {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.site-header-title small {
    overflow: hidden;
    color: #bdd5c9;
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.075em;
    line-height: 1.05;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.site-header-title strong {
    overflow: hidden;
    color: #fff;
    font-size: clamp(1.15rem, 2.4vw, 1.65rem);
    font-weight: 900;
    letter-spacing: -0.015em;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-nav-menu {
    position: relative;
    flex: 0 0 auto;
}

.site-nav-menu > summary {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 13px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.035em;
    list-style: none;
    text-transform: uppercase;
    transition:
        border-color 150ms ease,
        background 150ms ease,
        box-shadow 150ms ease;
}

.site-nav-menu > summary::-webkit-details-marker {
    display: none;
}

.site-nav-menu > summary::marker {
    content: "";
}

.site-nav-menu > summary:hover,
.site-nav-menu > summary:focus-visible,
.site-nav-menu[open] > summary {
    border-color: var(--site-header-accent);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(243, 212, 122, 0.16);
    outline: none;
}

.site-menu-icon {
    width: 18px;
    display: grid;
    gap: 3px;
}

.site-menu-icon i {
    width: 100%;
    height: 2px;
    display: block;
    border-radius: 999px;
    background: currentColor;
    transition:
        opacity 150ms ease,
        transform 150ms ease;
}

.site-nav-menu[open] .site-menu-icon i:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}

.site-nav-menu[open] .site-menu-icon i:nth-child(2) {
    opacity: 0;
}

.site-nav-menu[open] .site-menu-icon i:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
}

.site-nav-panel {
    position: absolute;
    z-index: 1010;
    top: calc(100% - 1px);
    right: 0;
    width: 280px;
    display: none;
    padding: 10px;
    border: 1px solid #d3dfd8;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(8, 39, 29, 0.25);
    color: var(--site-menu-text);
}

.site-nav-panel::before {
    content: "";
    position: absolute;
    right: 0;
    bottom: 100%;
    width: 100%;
    height: 10px;
}

.site-nav-menu[open] > .site-nav-panel,
.site-nav-menu:focus-within > .site-nav-panel {
    display: block;
}

@media (hover: hover) and (pointer: fine) {
    .site-nav-menu:hover > .site-nav-panel {
        display: block;
    }

    .site-nav-menu:hover > summary {
        border-color: var(--site-header-accent);
        background: rgba(255, 255, 255, 0.15);
    }
}

.site-nav-label {
    margin: 2px 7px 6px;
    color: var(--site-menu-muted);
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.085em;
    line-height: 1;
    text-transform: uppercase;
}

.site-nav-links {
    display: grid;
    gap: 3px;
}

.site-nav-links a,
.site-nav-disabled,
.site-nav-signout button {
    width: 100%;
    min-height: 40px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
    padding: 9px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--site-menu-text);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.15;
    text-align: left;
    text-decoration: none;
}

.site-nav-links a:hover,
.site-nav-links a:focus-visible,
.site-nav-signout button:hover,
.site-nav-signout button:focus-visible {
    background: #eaf3ee;
    color: #0f5136;
    outline: none;
}

.site-nav-links a.is-active {
    background:
        linear-gradient(
            135deg,
            #e5f2eb,
            #f7fbf9
        );
    color: #0f5136;
    box-shadow: inset 3px 0 0 #1f7a55;
}

.site-nav-links a.is-active::after {
    content: "Current";
    color: #537368;
    font-size: 0.52rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.site-nav-disabled {
    color: #8a9691;
    cursor: not-allowed;
}

.site-nav-disabled small {
    padding: 3px 5px;
    border-radius: 999px;
    background: #eef2f0;
    color: #718079;
    font-size: 0.49rem;
    font-weight: 900;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.site-nav-divider {
    height: 1px;
    margin: 9px 3px;
    background: #dce5e0;
}

.site-nav-signout {
    margin: 0;
}

.site-nav-signout button {
    cursor: pointer;
    color: #8a2525;
}

.site-nav-signout button:hover,
.site-nav-signout button:focus-visible {
    background: #f9ecec;
    color: #761d1d;
}

/* Auth pages previously centered the entire body. */
body.auth-page {
    display: block !important;
    min-height: 100vh;
    padding: 0 !important;
}

body.auth-page > .auth-shell {
    min-height: calc(100vh - 78px);
    box-sizing: border-box;
    display: grid;
    place-items: center;
    padding: 24px;
}

/* Keep the standardized header clear of older page-header rules. */
.site-header *,
.site-header *::before,
.site-header *::after {
    box-sizing: border-box;
}

@media screen and (max-width: 760px) {
    .site-header-inner {
        width: calc(100% - 16px);
        min-height: 62px;
        gap: 8px;
        padding: 6px 0;
    }

    .site-header-brand {
        gap: 8px;
    }

    .site-header-logo {
        width: 57px;
        height: 43px;
        padding: 3px;
        border-radius: 8px;
    }

    .site-header-title {
        gap: 2px;
    }

    .site-header-title small {
        font-size: 0.51rem;
        letter-spacing: 0.055em;
    }

    .site-header-title strong {
        font-size: 1rem;
    }

    .site-nav-menu > summary {
        min-height: 36px;
        gap: 6px;
        padding: 6px 9px;
        border-radius: 8px;
        font-size: 0.65rem;
    }

    .site-menu-icon {
        width: 15px;
    }

    .site-nav-panel {
        width: min(286px, calc(100vw - 16px));
        padding: 8px;
        border-radius: 10px;
    }

    .site-nav-links a,
    .site-nav-disabled,
    .site-nav-signout button {
        min-height: 38px;
        padding: 8px 9px;
        font-size: 0.74rem;
    }

    body.auth-page > .auth-shell {
        min-height: calc(100vh - 62px);
        padding: 16px 8px;
    }
}

@media screen and (max-width: 390px) {
    .site-header-inner {
        width: calc(100% - 12px);
        min-height: 57px;
    }

    .site-header-logo {
        width: 50px;
        height: 38px;
    }

    .site-header-title small {
        display: none;
    }

    .site-header-title strong {
        max-width: 190px;
        font-size: 0.92rem;
    }

    .site-nav-menu > summary {
        min-height: 33px;
        padding: 5px 8px;
        font-size: 0.61rem;
    }

    .site-nav-panel {
        width: min(278px, calc(100vw - 12px));
    }
}
