/* Use the same frame wherever the shared navigation appears. */
.topbar:has(+ header .setx-public-menu),
.setx-topbar:has(+ header .setx-public-menu),
.setx-site-shell:has(> .setx-public-menu) > .setx-site-top,
.setx-menu-header:has(> .setx-public-menu) > :is(.logo, .basketball-brand, .setx-logo) {
    display: none;
}

/* The standalone scoreboard shares an embed wrapper with the forum. */
body:has(#setx-embed-root > header > .setx-public-menu) { padding: 0; }
#setx-embed-root:has(> header > .setx-public-menu) > .scoreboard {
    width: calc(100% - 16px);
    margin-top: 12px;
}

html body header:has(> .setx-public-menu, > .setx-menu-header > .setx-public-menu) {
    position: relative;
    top: auto;
    z-index: 30;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    /* Match the forum's charcoal turf and diagonal mowing pattern. */
    background: #1c1d1b;
    background-image:
        linear-gradient(#ffffff06, #0005),
        repeating-linear-gradient(45deg, #f0f2e30e 0 35px, transparent 35px 70px),
        repeating-linear-gradient(-45deg, #0003 0 35px, transparent 35px 70px),
        url("charcoal-turf.webp");
    background-size: auto, auto, auto, 192px 192px;
    border: 0;
    border-bottom: 3px solid #9c9954;
    border-radius: 0;
    box-shadow: inset 0 1px #ffffff2c, inset 0 -1px #0009, 0 4px 14px #16171232;
    overflow: visible;
}

header .setx-menu-header:has(> .setx-public-menu) {
    display: block;
    width: 100%;
    max-width: none;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: visible;
}

.setx-public-menu, .setx-public-menu * { box-sizing: border-box; }

header .setx-public-menu {
    --menu-gold: #d8d38b;
    --menu-dark: #161712;
    --menu-muted: #f0efe5;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 9px clamp(12px, 2.5vw, 32px);
    color: var(--menu-muted);
    font: 750 .9rem/1.2 system-ui, sans-serif;
}

.setx-public-menu .setx-menu-brand-row,
.setx-public-menu .setx-menu-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.setx-public-menu .setx-menu-brand-row { gap: 14px; }
.setx-public-menu .setx-menu-links > details { position: relative; margin: 0; }

.setx-public-menu a, .setx-public-menu summary {
    display: block;
    padding: 12px 10px;
    border-radius: 6px;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.setx-public-menu .setx-menu-brand {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 5px;
    padding: 0 4px;
}

.setx-public-menu .setx-menu-brand img {
    display: block;
    width: 112px;
    height: 50px;
    object-fit: contain;
    filter: drop-shadow(0 2px 2px #000b);
}

.setx-public-menu .setx-menu-home-label {
    padding: 5px 7px;
    border: 1px solid #a39e67;
    border-radius: 4px;
    background: #212219;
    color: #f2e9ad;
    font-size: .72rem;
    line-height: 1;
}

.setx-public-menu .setx-menu-brand:hover .setx-menu-home-label {
    background: var(--menu-gold);
    color: var(--menu-dark);
}

.setx-public-menu .setx-menu-brand-row > a:last-child {
    padding: 10px 12px;
    border: 1px solid #8c813d;
    background: linear-gradient(#f2edb0, #d7cb7b 55%, #b7a957);
    color: var(--menu-dark);
    box-shadow: inset 0 1px #fff9, inset 0 -2px #7f6f3466, 0 3px 5px #0008;
    text-shadow: 0 1px #fff5;
}

.setx-public-menu .setx-menu-brand-row > a:last-child::before {
    content: "";
    display: inline-block;
    width: .48em;
    height: .48em;
    margin-right: .48em;
    border-radius: 50%;
    background: currentColor;
    vertical-align: .13em;
}

.setx-public-menu summary { cursor: pointer; list-style: none; }
.setx-public-menu summary::-webkit-details-marker { display: none; }
.setx-public-menu summary::after { content: ' ▾'; color: var(--menu-gold); font-size: .8em; }

.setx-public-menu .setx-menu-links > a,
.setx-public-menu .setx-menu-links summary {
    border: 1px solid #10110d;
    background: linear-gradient(#3d3e35 0%, #30312a 47%, #262720 49%, #22231d 100%);
    box-shadow: inset 0 1px #ffffff3b, inset 0 -2px #0005, 0 2px 4px #0009;
    text-shadow: 0 1px 2px #000;
}

.setx-public-menu .setx-menu-links > a:hover,
.setx-public-menu .setx-menu-links summary:hover {
    border-color: #777143;
    background: linear-gradient(#4d4c3e, #292a22);
    color: #fff;
}

.setx-public-menu .setx-menu-links > a[aria-current],
.setx-public-menu .setx-menu-current > summary {
    border-color: #9e9250;
    background: linear-gradient(#ede6a5, #c0b368);
    color: var(--menu-dark);
    text-shadow: 0 1px #fff5;
}

.setx-public-menu .setx-menu-links [open] > summary,
.setx-public-menu .setx-menu-links > a:active,
.setx-public-menu .setx-menu-brand-row > a:last-child:active {
    box-shadow: inset 0 2px 4px #0008, 0 1px #ffffff2b;
}

.setx-public-menu .setx-menu-current > summary::after { color: currentColor; }

.setx-public-menu :focus-visible { outline: 2px solid var(--menu-gold); outline-offset: 2px; }
.setx-public-menu .setx-public-menu-panel :focus-visible { outline-color: #625c25; outline-offset: -2px; }

.setx-public-menu-panel {
    position: absolute;
    z-index: 2;
    inset-block-start: calc(100% + 7px);
    inset-inline-start: 0;
    width: max-content;
    min-width: 190px;
    max-height: min(65vh, 480px);
    overflow: auto;
    padding: 7px;
    background: linear-gradient(#fcfcf8, #f4f3e9);
    color: var(--menu-dark);
    border: 1px solid #dedccb;
    border-top: 3px solid #9c9954;
    border-radius: 8px;
    box-shadow: inset 0 1px #fff, 0 8px 24px #14150e55;
}

.setx-public-menu .setx-public-menu-panel a { white-space: normal; }
.setx-public-menu .setx-public-menu-panel a:is(:hover, [aria-current]) { background: #eae6c7; }
.setx-public-menu .setx-menu-more > .setx-public-menu-panel { inset-inline: auto 0; }

@media (max-width: 860px) {
    header .setx-public-menu { flex-direction: column; align-items: stretch; gap: 6px; padding-block: 7px 6px; }
    .setx-public-menu .setx-menu-brand-row { justify-content: space-between; padding-bottom: 6px; border-bottom: 1px solid #ffffff26; }
    .setx-public-menu .setx-menu-links { justify-content: center; flex-wrap: wrap; }
    .setx-public-menu .setx-menu-links > details { position: static; }
    .setx-public-menu .setx-public-menu-panel,
    .setx-public-menu .setx-menu-more > .setx-public-menu-panel { inset: calc(100% + 3px) 8px auto; width: auto; }
}

@media (max-width: 510px) {
    header .setx-public-menu { gap: 4px; padding-inline: 8px; font-size: .8125rem; }
    .setx-public-menu .setx-menu-brand img { width: 96px; }
    .setx-public-menu .setx-menu-links { gap: 4px; }
    .setx-public-menu .setx-menu-links > * { flex: 1 0 24%; text-align: center; }
    .setx-public-menu .setx-menu-links > a,
    .setx-public-menu .setx-menu-links summary { padding: 13px 2px; }
    .setx-public-menu .setx-public-menu-panel { text-align: left; }
}
