/* ============================================================
   navbar.css — v3.3
   Layout: world-clock strip (clock-and-weather.hbs) →
           logo row (socials | logo | auth) →
           nav row (centred links) →
           announcement bar (announcement-bar.hbs)
   ============================================================ */

/* ── Header shell ─────────────────────────────────────────── */
.header {
    display: block;
    background-color: var(--background-color);
    padding-top: 0;
    padding-bottom: 0;
    z-index: 100;
    font-family: var(--font2);
    font-size: 20px;
    line-height: 100%;
    overflow-x: clip;
}

/* ── Logo row ─────────────────────────────────────────────── */
.navbar-logo-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding-top: 22px;
    padding-bottom: 22px;
    gap: 16px;
}

/* Left: Socials */
.navbar-socials-group {
    display: flex;
    align-items: center;
    gap: 18px;
    justify-content: flex-start;
}

.navbar-socials-label {
    font-family: var(--font2);
    font-size: 20px;
    line-height: 100%;
    white-space: nowrap;
    opacity: 0.9;
}

.navbar-socials-icons {
    display: flex;
    align-items: center;
    gap: 18px;
}

.social {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.social:hover .social-inner {
    transform: translateY(-2px);
}

.social-inner {
    width: 22px;
    min-width: 22px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease;
    will-change: transform;
}

.social-inner-smaller {
    width: 21px;
    min-width: 21px;
}

/* Centre: Logo */
.navbar-logo-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.site-logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .28s ease, transform .28s ease, max-height .28s ease;
    will-change: opacity, transform;
    overflow: hidden;
}

.logo-wrapper.logo-hidden {
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.logo-wrapper:not(.logo-hidden) {
    opacity: 1;
    transform: translateY(0);
    max-height: 120px;
}

.logo-image {
    height: calc(60px * var(--logo-scale, 1));
    width: auto;
    display: block;
}

.navbar-logo-text {
    font-family: var(--font4);
    line-height: 80%;
    letter-spacing: -0.02em;
    font-size: 46px;
}

/* Right: Auth controls */
.navbar-account-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
}

/* Search button */
.navbar-search-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    font-family: var(--font2);
    font-size: 20px;
    line-height: 100%;
    padding: 0;
    white-space: nowrap;
    transition: opacity .2s ease;
}

.navbar-search-btn:hover { opacity: .7; }

.navbar-search-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.navbar-search-label {
    /* shown on desktop, hidden on mobile */
}

/* Theme toggle */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    color: var(--text-color);
    font-family: var(--font2);
    font-size: 16px;
    line-height: 1;
    white-space: nowrap;
    transition: opacity .2s ease;
    outline: none;
}

.theme-toggle-btn:hover { opacity: .7; }

.theme-toggle-btn:focus-visible {
    outline: 2px solid var(--text-color);
    outline-offset: 3px;
}

.theme-toggle-track {
    position: relative;
    width: 38px;
    min-width: 38px;
    height: 20px;
    border-radius: 10px;
    background-color: var(--text-color);
    transition: background-color .3s ease;
    flex-shrink: 0;
}

.theme-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--background-color);
    transition: transform .3s ease;
    pointer-events: none;
}

html .theme-toggle-thumb,
html[data-theme="dark"] .theme-toggle-thumb { transform: translateX(0); }
html[data-theme="light"] .theme-toggle-thumb { transform: translateX(18px); }

.theme-toggle-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.theme-toggle-icon svg {
    width: 16px;
    height: 16px;
    fill: var(--text-color);
    transition: opacity .2s ease;
}

.icon-sun  { display: none; }
.icon-moon { display: flex; }
html[data-theme="light"] .icon-sun  { display: flex; }
html[data-theme="light"] .icon-moon { display: none; }

/* Account / sign-in button */
.account-button-wrapper {
    display: flex;
    align-items: center;
    gap: 14px;
    white-space: nowrap;
}

.account-icon-wrapper {
    width: 19px;
    min-width: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.header-signin-button,
.header-account-button {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font2);
    font-size: 20px;
    line-height: 100%;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--text-color);
    text-decoration: none;
    transition: opacity .2s ease;
}

.header-signin-button:hover,
.header-account-button:hover { opacity: .7; }

/* Subscribe button — gradient pill */
.subscribe-button-gradient {
    padding: 9px 22px;
    font-family: var(--font2);
    font-size: 18px;
    line-height: 100%;
    color: #fff !important;
    background: var(--brand-gradient);
    border: none;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity .2s ease, filter .2s ease;
    letter-spacing: 0.04em;
}

.subscribe-button-gradient:hover {
    opacity: .9;
    filter: brightness(1.08);
}

/* ── Nav row ──────────────────────────────────────────────── */
.navbar-links-outer {
    padding-top: 13px;
    padding-bottom: 13px;
    border-top: 1px solid var(--text-color);
    border-bottom: 1px solid var(--text-color);
    min-height: 50px;
    position: relative;
}

.navbar-links-inner {
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    column-gap: 30px;
    row-gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav li {
    list-style-type: none;
    display: flex;
    position: relative;
}

.nav-link,
.links-label {
    line-height: 100%;
    position: relative;
    white-space: nowrap;
    font-family: var(--font2);
    font-size: 20px;
    color: var(--text-color);
    text-decoration: none;
}

.links-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* Keep top-level navigation items styled as navigation, not generic inverted buttons */
.navbar-links .nav > li > .links-label,
.navbar-links .nav > li > .nav-link {
    background: transparent;
    color: var(--text-color);
    -webkit-text-fill-color: currentColor;
    border: 0;
    box-shadow: none;
    padding: 0;
    appearance: none;
}

.navbar-links .nav > li > .links-label:hover,
.navbar-links .nav > li > .links-label:focus-visible,
.navbar-links .nav > li > .nav-link:hover,
.navbar-links .nav > li > .nav-link:focus-visible {
    background: transparent;
    color: var(--text-color);
    -webkit-text-fill-color: currentColor;
    opacity: .72;
}

.navbar-links .nav > li > .links-label:focus-visible,
.navbar-links .nav > li > .nav-link:focus-visible {
    outline: 2px solid var(--text-color);
    outline-offset: 3px;
}

.navbar-links .nav > li > .links-label--pride-accent {
    position: relative;
    padding-bottom: 8px;
}

.navbar-links .nav > li > .links-label--pride-accent::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        #e40303 0%,
        #ff8c00 20%,
        #ffed00 40%,
        #008026 60%,
        #004dff 80%,
        #750787 100%
    );
    opacity: .95;
    transform-origin: center;
    transition: transform .2s ease, opacity .2s ease;
}

.navbar-links .nav > li > .links-label--pride-accent:hover::after,
.navbar-links .nav > li > .links-label--pride-accent:focus-visible::after,
.navbar-links .nav > li:hover > .links-label--pride-accent::after {
    opacity: 1;
    transform: scaleX(1.03);
}

.dropdown-arrow-svg {
    width: 8px;
    min-width: 8px;
    height: 5px;
    min-height: 5px;
    margin-left: 7px;
    margin-top: 1px;
}

/* Dropdown */
.secondary-links {
    position: absolute;
    bottom: 0;
    left: 17px;
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
    min-width: 168px;
    z-index: 200;
}

.nav li:hover .secondary-links,
.nav .secondary-links:focus-within {
    opacity: 1;
    pointer-events: all;
}

.secondary-links-inner {
    margin-top: 13px;
    display: flex;
    flex-direction: column;
    background-color: var(--background-color);
    border: 1px solid var(--text-color);
}

.secondary-links .nav-link {
    width: 100%;
    padding: 14px 16px;
    border-bottom: 1px solid var(--text-color);
    transition: color .2s ease, background-color .2s ease;
}

.secondary-links-inner:last-child { border-bottom: none; }

.secondary-links-inner .nav-link:hover {
    color: var(--background-color);
    background-color: var(--text-color);
}

/* Mobile hamburger (hidden on desktop) */
.menu-button-wrapper { display: none; }
.subscribe-button-mobile-wrapper { display: none; }
.desktop-navbar { display: block !important; opacity: 1 !important; height: auto !important; }

/* ── Search overlay ───────────────────────────────────────── */
.navbar-search-overlay {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--background-color);
    border-bottom: 1px solid var(--text-color);
    z-index: 300;
    padding: 14px 0;
}

.navbar-search-overlay.is-open {
    display: block;
}

.navbar-search-overlay-inner {
    display: flex;
    align-items: center;
}

.navbar-search-form {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 12px;
    border: 1px solid var(--text-color);
    padding: 8px 14px;
}

.navbar-search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-family: var(--font2);
    font-size: 20px;
    color: var(--text-color);
    line-height: 100%;
}

.navbar-search-input::placeholder { opacity: 0.5; }

.navbar-search-submit,
.navbar-search-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    display: flex;
    align-items: center;
    padding: 0;
    transition: opacity .2s ease;
}

.navbar-search-submit:hover,
.navbar-search-close:hover { opacity: .6; }

.navbar-search-submit svg,
.navbar-search-close svg {
    width: 20px;
    height: 20px;
    fill: none;
}

/* ── Large desktop (≥1439px) ──────────────────────────────── */
@media (min-width: 1439px) {
    .header { font-size: calc(1.39vw * var(--scale, 1)); }

    .navbar-logo-row {
        padding-top: calc(1.53vw * var(--scale, 1));
        padding-bottom: calc(1.53vw * var(--scale, 1));
    }

    .navbar-socials-label { font-size: calc(1.39vw * var(--scale, 1)); }
    .navbar-socials-icons { gap: calc(1.25vw * var(--scale, 1)); }
    .social-inner { width: calc(1.53vw * var(--scale, 1)); min-width: calc(1.53vw * var(--scale, 1)); }
    .social-inner-smaller { width: calc(1.46vw * var(--scale, 1)); min-width: calc(1.46vw * var(--scale, 1)); }

    .logo-image { height: calc(2.57vw * var(--scale, 1) * var(--logo-scale, 1)); }
    .navbar-logo-text { font-size: calc(3.19vw * var(--scale, 1)); }

    .navbar-account-links { gap: calc(1.39vw * var(--scale, 1)); }
    .navbar-search-btn { font-size: calc(1.39vw * var(--scale, 1)); }
    .navbar-search-icon { width: calc(1.39vw * var(--scale, 1)); height: calc(1.39vw * var(--scale, 1)); }
    .header-signin-button, .header-account-button { font-size: calc(1.39vw * var(--scale, 1)); }
    .subscribe-button-gradient { font-size: calc(1.25vw * var(--scale, 1)); padding: calc(0.63vw * var(--scale, 1)) calc(1.53vw * var(--scale, 1)); }

    .navbar-links-outer {
        padding-top: calc(0.9vw * var(--scale, 1));
        padding-bottom: calc(0.9vw * var(--scale, 1));
        min-height: calc(3.47vw * var(--scale, 1));
    }

    .nav { column-gap: calc(2.08vw * var(--scale, 1)); row-gap: calc(0.83vw * var(--scale, 1)); }
    .nav-link, .links-label { font-size: calc(1.39vw * var(--scale, 1)); }
    .dropdown-arrow-svg { width: calc(0.56vw * var(--scale, 1)); height: calc(0.35vw * var(--scale, 1)); margin-left: calc(0.49vw * var(--scale, 1)); }
    .secondary-links { left: calc(-1.18vw * var(--scale, 1)); min-width: calc(11.8vw * var(--scale, 1)); }
    .secondary-links-inner { margin-top: calc(1.08vw * var(--scale, 1)); }
    .secondary-links .nav-link { padding: calc(0.97vw * var(--scale, 1)) calc(1.11vw * var(--scale, 1)); }
}

/* ── Tablet (≤991px) ──────────────────────────────────────── */
@media (max-width: 991px) {
    .navbar-logo-row {
        grid-template-columns: 1fr auto 1fr;
        padding-top: 16px;
        padding-bottom: 12px;
    }

    .navbar-socials-group { display: none; }

    .navbar-account-links { gap: 14px; }
    .navbar-search-label { display: none; }
    .account-button-text { display: none; }
    .subscribe-button-gradient { display: none; }

    .account-icon-wrapper { width: 26px; min-width: 26px; }

    .logo-image { height: calc(30px * var(--logo-scale, 1)); }
    .navbar-logo-text { font-size: 38px; }

    /* Hamburger */
    .menu-button-wrapper {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        flex: 1;
    }

    .menu-button {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        row-gap: 7px;
        width: 30px;
        height: 30px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
    }

    .menu-line {
        width: 30px;
        height: 2px;
        background-color: var(--text-color);
        pointer-events: none;
        transition: transform .3s ease;
        display: block;
    }

    /* Full-screen mobile nav */
    .navbar-links-outer {
        text-align: center;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--background-color);
        height: 100dvh;
        width: 100vw;
        display: none;
        opacity: 0;
        flex-direction: column;
        justify-content: flex-start;
        border-top: none;
        border-bottom: none;
        padding-top: 0;
        padding-bottom: 0;
        z-index: 1000;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .navbar-links-inner {
        padding: 24px 24px 60px;
        flex-direction: column;
        align-items: center;
        row-gap: 32px;
        justify-content: flex-start;
        min-height: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    .mobile-nav-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        margin-bottom: 20px;
        padding-bottom: 20px;
        border-bottom: 1px solid color-mix(in srgb, var(--text-color) 15%, transparent);
    }

    .mobile-nav-logo {
        max-width: 150px;
    }

    .mobile-nav-logo img {
        height: 28px;
        width: auto;
        display: block;
    }

    .mobile-nav-logo .navbar-logo-text {
        font-size: 24px;
    }

    .nav {
        flex-direction: column;
        row-gap: 28px;
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }

    .nav-link, .links-label {
        font-size: 26px;
        line-height: 1.2;
        width: 100%;
        text-align: center;
        display: block;
        padding: 4px 0;
    }

    .dropdown-arrow-svg {
        width: 12px;
        min-width: 12px;
        height: 8px;
        display: inline-block;
        vertical-align: middle;
        margin-left: 10px;
        position: relative;
        right: auto;
        transform: none;
    }

    .secondary-links {
        width: 100%;
        position: static;
        transform: none;
        opacity: 1;
        pointer-events: all;
        transition: height 0.3s ease-in-out;
        height: 0;
        overflow: hidden;
    }

    .secondary-links-inner {
        align-items: center;
        padding: 20px 0;
        margin-top: 15px;
        border: none;
        row-gap: 18px;
        border-top: 1px solid color-mix(in srgb, var(--text-color) 20%, transparent);
        border-bottom: 1px solid color-mix(in srgb, var(--text-color) 20%, transparent) !important;
        background: transparent;
    }

    .nav li {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .secondary-links .nav-link {
        font-size: 20px;
        font-weight: 400;
        line-height: 150%;
        color: var(--text-color);
        padding: 0;
        border-bottom: none;
        width: fit-content;
    }

    .secondary-links-inner .nav-link:hover {
        color: unset;
        background-color: unset;
    }

    .subscribe-button-mobile-wrapper {
        display: flex;
        min-width: 280px;
        padding-top: 30px;
        border-top: 1px solid var(--text-color);
    }

    .subscribe-button-mobile {
        display: block;
        font-size: 22px;
        padding: 8px 30px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ── Mobile (≤479px) ──────────────────────────────────────── */
@media (max-width: 479px) {
    .navbar-logo-row {
        padding-top: 14px;
        padding-bottom: 10px;
    }

    .logo-image { height: calc(26px * var(--logo-scale, 1)); }
    .navbar-logo-text { font-size: 32px; }

    .navbar-account-links { gap: 12px; }
    .account-icon-wrapper { width: 24px; min-width: 24px; }

    .menu-button { width: 28px; height: 28px; }
    .menu-line { width: 28px; }

    .nav { row-gap: 18px; min-width: 58vw; }
    .nav-link, .links-label { font-size: 22px; }

    .secondary-links-inner {
        padding-top: 18px;
        margin-top: 22px;
        padding-bottom: 18px;
        row-gap: 8px;
    }

    .subscribe-button-mobile-wrapper { min-width: 58vw; padding-top: 32px; }
    .subscribe-button-mobile { font-size: 21px; }

    .theme-toggle-btn { font-size: 0; gap: 5px; }
    .theme-toggle-track { width: 34px; height: 18px; }
    .theme-toggle-thumb { width: 12px; height: 12px; }
    html[data-theme="light"] .theme-toggle-thumb { transform: translateX(16px); }
}
