/*
 * Modern header layouts ("Menu around logos" = .tsom-header--split,
 * "Logos above menu" = .tsom-header--stacked). The classic layout is styled by
 * header.css alone; everything here is scoped to markup only the modern
 * layouts render (.tsom-header-top, .tsom-compact-bar).
 *
 * Breakpoints (chosen so menu text never wraps; the menu moves to its own
 * line well before it gets tight):
 *   >= 1200px  split: [left links] [logos] [right links + Switch FM]
 *   861-1199px logos, then the whole menu + Switch FM on one line (always, for stacked)
 *   <= 860px   ☰ … Switch FM above the logos
 *   compact bar: full menu >= 980px, ☰ below
 */

.tsom-header-top {
    background: #1a1a1a;
    color: #e8e8e8;
}

/* Shared link look (top header + compact bar) */
.tsom-header-top .tsom-nav-list,
.tsom-compact-bar .tsom-nav-list {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.95rem;
}
.tsom-header-top .tsom-nav-list a,
.tsom-compact-bar .tsom-nav-list a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 0;
    color: #e8e8e8;
    text-decoration: none;
    white-space: nowrap;
}
.tsom-header-top .tsom-nav-list a:hover,
.tsom-compact-bar .tsom-nav-list a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.tsom-header-top .tsom-nav-list a:focus-visible,
.tsom-compact-bar .tsom-nav-list a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.tsom-header-top .tsom-nav-list .current-menu-item > a,
.tsom-compact-bar .tsom-nav-list .current-menu-item > a { color: #fff; box-shadow: inset 0 -2px 0 #c8362e; }

/* Switch FM as a square block that sits in line with the links */
.tsom-header-top .tsom-fm,
.tsom-compact-bar .tsom-fm {
    height: 42px;
    border-radius: 0;
    overflow: hidden;
    background: #c8362e;
    flex: 0 0 auto;
}
.tsom-header-top .tsom-fm-button,
.tsom-compact-bar .tsom-fm-button { white-space: nowrap; font-size: 1rem; }

.tsom-header-top .tsom-hamburger,
.tsom-compact-bar .tsom-hamburger { color: #fff; }
.tsom-header-top .tsom-hamburger:focus-visible,
.tsom-compact-bar .tsom-hamburger:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Logos (big, in the top header) */
.tsom-header-top .tsom-logo-banner {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 1.25rem;
    padding: 0;
}
.tsom-header-top .tsom-logo { max-width: none; }

/* ── Wide: split row ───────────────────────────────────────────────────────── */
.tsom-header-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem 2rem;
}
.tsom-header-row .tsom-nav--left .tsom-nav-list { justify-content: flex-end; }
.tsom-header-row .tsom-nav--right {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
}
.tsom-header-top .tsom-nav--line { display: none; }

/* "Logos above menu" behaves like the narrower layout at every desktop width. */
.tsom-header--stacked .tsom-header-row { display: flex; justify-content: center; padding: 1.5rem 1.5rem 1rem; }
.tsom-header--stacked .tsom-header-row .tsom-nav--left,
.tsom-header--stacked .tsom-header-row .tsom-nav--right { display: none; }
.tsom-header--stacked .tsom-nav--line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0 1.5rem 1.25rem;
}

/* ── 861–1199px: logos, then the whole menu on its own line ────────────────── */
@media (max-width: 1199px) {
    .tsom-header-row { display: flex; justify-content: center; padding: 1.5rem 1.5rem 1rem; }
    .tsom-header-row .tsom-nav--left,
    .tsom-header-row .tsom-nav--right { display: none; }
    .tsom-header-top .tsom-nav--line {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
        padding: 0 1.5rem 1.25rem;
    }
}

/* ── Phones: ☰ … Switch FM above the logos ─────────────────────────────────── */
@media (max-width: 860px) {
    .tsom-header-top { display: flex; flex-direction: column; }
    .tsom-header-top .tsom-nav--line,
    .tsom-header--stacked .tsom-nav--line {
        order: -1;
        justify-content: space-between;
        padding: 0.75rem 1rem 0;
    }
    .tsom-header-top .tsom-nav--line .tsom-nav-list { display: none; }
    .tsom-header-row,
    .tsom-header--stacked .tsom-header-row { padding: 0.75rem 1rem 1rem; }
    .tsom-header-top .tsom-fm,
    .tsom-compact-bar .tsom-fm { background: #c8362e; height: 40px; }
    .tsom-header-top .tsom-fm-button,
    .tsom-compact-bar .tsom-fm-button { padding: 0 0.9rem; }
}

/* ── Compact bar (after scrolling) ─────────────────────────────────────────── */
.tsom-compact-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: calc(0.6rem + env(safe-area-inset-top, 0px)) 1.5rem 0.6rem;
    background: #1a1a1a;
    color: #e8e8e8;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    transform: translateY(-110%);
    visibility: hidden;
    transition: transform 220ms ease, visibility 0s linear 220ms;
}
.tsom-compact-bar.is-visible {
    transform: none;
    visibility: visible;
    transition: transform 220ms ease;
}
@media (prefers-reduced-motion: reduce) {
    .tsom-compact-bar,
    .tsom-compact-bar.is-visible { transition: none; }
}
.tsom-compact-logos { display: flex; align-items: center; gap: 1rem; flex: 0 0 auto; }
.tsom-compact-logo { display: block; width: auto; }
.tsom-compact-logo--primary { height: 44px; }
.tsom-compact-logo--secondary { height: 26px; opacity: 0.9; }
.tsom-compact-nav { margin-left: auto; }
.tsom-compact-bar .tsom-hamburger--compact { display: none; }
.admin-bar .tsom-compact-bar { top: 32px; }

@media (max-width: 979px) {
    .tsom-compact-nav { display: none; }
    .tsom-compact-bar .tsom-hamburger--compact { display: inline-flex; align-items: center; }
    .tsom-compact-bar .tsom-fm { margin-left: auto; }
}
@media (max-width: 860px) {
    .tsom-compact-bar { gap: 0.6rem; padding-inline: 0.75rem; }
    .tsom-compact-logo--primary { height: 34px; }
    .tsom-compact-logo--secondary { height: 20px; }
    .tsom-compact-bar .tsom-fm--playing .tsom-fm-volume,
    .tsom-compact-bar .tsom-fm--playing .tsom-fm-mute { display: none; }
}
@media (max-width: 782px) {
    .admin-bar .tsom-compact-bar { top: 46px; }
}

/* ── "Logos left, menu right" (.tsom-header--inline, default) ─────────────────
 *   >= 1000px  [logos] ............ [menu + Switch FM]
 *   <  1000px  [☰] [logos] ........ [Switch FM]   (same as the compact bar)
 * The menu never shares a line with too little room, so its text never wraps. */
.tsom-header--inline .tsom-header-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1.5rem;
    padding: 1.25rem 2rem;
}
.tsom-header--inline .tsom-header-row .tsom-logo-banner { justify-content: flex-start; }
.tsom-header--inline .tsom-header-top .tsom-logo--primary   { height: 72px; }
.tsom-header--inline .tsom-header-top .tsom-logo--secondary { height: 40px; }
.tsom-header--inline .tsom-header-row .tsom-nav--right {
    display: flex;
    margin-left: auto;
    justify-content: flex-end;
}
.tsom-header--inline .tsom-nav--line { display: none !important; }
.tsom-header--inline .tsom-hamburger--row { display: none; }

@media (max-width: 999px) {
    .tsom-header--inline .tsom-header-row { gap: 1rem; padding: 1rem 1.5rem; }
    .tsom-header--inline .tsom-header-row .tsom-nav--right nav { display: none; }
    .tsom-header--inline .tsom-hamburger--row { display: inline-flex; align-items: center; }
}
@media (max-width: 860px) {
    .tsom-header--inline .tsom-header-top { display: block; }
    .tsom-header--inline .tsom-header-row { gap: 0.6rem; padding: 0.75rem 1rem; }
    .tsom-header--inline .tsom-header-top .tsom-logo-banner { gap: 0.75rem; }
    .tsom-header--inline .tsom-header-top .tsom-logo--primary   { height: 44px; }
    .tsom-header--inline .tsom-header-top .tsom-logo--secondary { height: 24px; }
}
@media (max-width: 520px) {
    .tsom-header--inline .tsom-header-row { gap: 0.5rem; padding: 0.6rem 0.75rem; }
    .tsom-header--inline .tsom-header-row .tsom-hamburger--row { padding: 0 0.4rem; }
    .tsom-header--inline .tsom-header-top .tsom-logo--primary   { height: 38px; }
    .tsom-header--inline .tsom-header-top .tsom-logo--secondary { height: 20px; }
    .tsom-header--inline .tsom-header-top .tsom-fm { height: 38px; }
    .tsom-header--inline .tsom-header-top .tsom-fm-button { padding: 0 0.7rem; font-size: 0.9rem; }
    .tsom-compact-bar .tsom-fm-button { padding: 0 0.7rem; font-size: 0.9rem; }
}
/* The narrowest phones: the main logo only, so the header never runs off-screen. */
@media (max-width: 400px) {
    .tsom-header--inline .tsom-header-top .tsom-logo--secondary,
    .tsom-compact-logo--secondary { display: none; }
}
