/* ==========================================================================
   Site header  (views/partials/header.hbs)

   1. .topbar     contact details + social links
   2. .masthead   logo + main navigation (becomes fixed on scroll, see
                  headerStyle() in js/script.js)
   3. .ticker     scrolling notifications

   Self-contained: it only styles the classes used by the header partial and
   is loaded after style.css / responsive.css. The older .header-top,
   .header-lower, .main-menu ... rules in those files no longer match anything.
   ========================================================================== */

.main-header {
    --navy: #111d42;
    --navy-deep: #0b1332;
    --gold: #d1a24f;
    --gold-text: #8a6217;      /* gold dark enough to read as text on white */
    --gold-tint: #faf4e6;
    --muted: #5b6482;
    --line: #e8eaf1;
    --masthead-h: 84px;
    --nav-pad: 16px;

    position: relative;
    z-index: 999;
    width: 100%;
    font-family: 'Raleway', 'PT Sans', Arial, sans-serif;
}

.main-header ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.main-header a,
.main-header a:hover,
.main-header a:focus {
    text-decoration: none;
}

.main-header button {
    font-family: inherit;
}

.main-header a:focus-visible,
.main-header button:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}


/* --------------------------------------------------------------------------
   1. Top bar
   -------------------------------------------------------------------------- */

.topbar {
    background: var(--navy-deep);
    color: rgba(255, 255, 255, .82);
    font-size: 13px;
    line-height: 1.2;
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 40px;
}

.topbar a {
    color: inherit;
    transition: color .2s ease;
}

.topbar a:hover,
.topbar a:focus {
    color: var(--gold);
}

.topbar__contact {
    display: flex;
    align-items: center;
    gap: 26px;
    min-width: 0;
}

.topbar__contact li {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.topbar .ico {
    display: inline-flex;
    justify-content: center;
    width: 14px;
    color: var(--gold);
    font-size: 13px;
}

/* thin divider between the two phone numbers */
.topbar__phone a + a {
    padding-left: 8px;
    border-left: 1px solid rgba(255, 255, 255, .28);
}

.topbar__social {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
}

.topbar__social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .09);
    color: #fff;
    font-size: 14px;
    transition: background-color .2s ease, color .2s ease;
}

.topbar__social a:hover,
.topbar__social a:focus {
    background: var(--gold);
    color: var(--navy);
}


/* --------------------------------------------------------------------------
   2. Masthead: brand + navigation
   -------------------------------------------------------------------------- */

/* Keeps its height when .masthead turns fixed, so the page does not jump. */
.masthead-wrap {
    height: var(--masthead-h);
}

.masthead {
    position: relative;
    height: var(--masthead-h);
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.fixed-header .masthead {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(17, 29, 66, .14);
    animation: masthead-drop .3s ease both;
}

@keyframes masthead-drop {
    from { transform: translateY(-100%); }
    to   { transform: none; }
}

.masthead__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* Brand */

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: var(--navy);
}

.brand:hover,
.brand:focus {
    color: var(--navy);
}

.brand__logo {
    display: block;
    flex: none;
    width: auto;
    height: 60px;
}

.brand__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
}

.brand__text strong {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: .01em;
    color: var(--navy);
}

.brand__text small {
    margin-top: 3px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--gold-text);
}

/* Navigation (desktop) */

.nav-toggle {
    display: none;
}

.site-nav {
    height: 100%;
}

.site-nav__list {
    display: flex;
    height: 100%;
}

.site-nav__list > li {
    position: relative;
    display: flex;
    align-items: center;
}

.site-nav__list > li > a {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 var(--nav-pad);
    color: var(--navy);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    transition: color .2s ease;
}

/* gold bar under the current / hovered item */
.site-nav__list > li > a::after {
    content: "";
    position: absolute;
    left: var(--nav-pad);
    right: var(--nav-pad);
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--gold);
    transform: scaleX(0);
    transition: transform .25s ease;
}

.site-nav__list > li:hover > a::after,
.site-nav__list > li.active > a::after,
.site-nav__list > li > a:focus::after {
    transform: scaleX(1);
}

/* Submenu chevron button */

.sub-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 100%;
    margin: 0 6px 0 -10px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--navy);
    font-size: 18px;
    cursor: pointer;
}

.sub-toggle > * {
    transition: transform .2s ease;
}

/* Submenu panel */

.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 20;
    width: 340px;
    padding: 8px 0;
    background: #fff;
    border-top: 3px solid var(--gold);
    border-radius: 0 0 6px 6px;
    box-shadow: 0 18px 40px rgba(17, 29, 66, .18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
}

.sub-menu a {
    display: block;
    padding: 10px 22px 10px 19px;
    border-left: 3px solid transparent;
    color: var(--navy);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    transition: background-color .15s ease, border-color .15s ease;
}

.sub-menu a:hover,
.sub-menu a:focus {
    background: var(--gold-tint);
    border-left-color: var(--gold);
    color: var(--navy);
}

.has-sub.is-open > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.has-sub.is-open > .sub-toggle > * {
    transform: rotate(180deg);
}

/* Hover opens the panel only where a real pointer exists (not on touch). */
@media (min-width: 992px) and (hover: hover) {
    .has-sub:hover > .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .has-sub:hover > .sub-toggle > * {
        transform: rotate(180deg);
    }
}

/* Keyboard users: open while focus is inside the item. */
@media (min-width: 992px) {
    .has-sub:has(:focus-visible) > .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: none;
    }
}


/* --------------------------------------------------------------------------
   3. Notifications ticker
   -------------------------------------------------------------------------- */

.ticker {
    background: var(--navy);
    color: #fff;
}

.ticker__inner {
    display: flex;
    align-items: stretch;
    height: 42px;
}

.ticker__label {
    position: relative;
    z-index: 1;
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 28px 0 16px;
    background: var(--gold);
    color: var(--navy);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    -webkit-clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
    clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
}

.ticker__viewport {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
}

/* Two identical groups side by side; sliding by 50% loops seamlessly.
   --ticker-duration is set from the content width in js/script.js. */
.ticker__track {
    display: flex;
    flex: none;
    width: max-content;
    animation: ticker-scroll var(--ticker-duration, 60s) linear infinite;
}

.ticker__viewport:hover .ticker__track,
.ticker__track:focus-within {
    animation-play-state: paused;
}

@keyframes ticker-scroll {
    to { transform: translateX(-50%); }
}

.ticker__group {
    display: flex;
    flex: none;
    align-items: center;
    min-width: 100vw;
}

.ticker__item {
    display: flex;
    align-items: center;
    flex: none;
    padding-right: 48px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.ticker__item::before {
    content: "";
    flex: none;
    width: 7px;
    height: 7px;
    margin-right: 12px;
    background: var(--gold);
    transform: rotate(45deg);
}

.ticker__file {
    margin-left: 10px;
    color: var(--gold);
    transition: color .2s ease;
}

.ticker__file:hover,
.ticker__file:focus {
    color: #fff;
}


/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

/* Tighter navigation on small desktops; address no longer fits the top bar. */
@media (max-width: 1199px) {
    .main-header {
        --nav-pad: 13px;
    }

    .topbar__contact .topbar__addr {
        display: none;
    }
}

/* Tablet and phone: logo + menu button, navigation becomes a dropdown panel. */
@media (max-width: 991px) {
    .main-header {
        --masthead-h: 68px;
    }

    .brand__logo {
        height: 46px;
    }

    .brand__text strong {
        font-size: 17px;
    }

    .brand__text small {
        font-size: 9.5px;
        letter-spacing: .14em;
    }

    .nav-toggle {
        display: flex;
        flex: none;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #fff;
        cursor: pointer;
    }

    .nav-toggle__bar {
        width: 20px;
        height: 2px;
        border-radius: 2px;
        background: var(--navy);
        transition: transform .25s ease, opacity .2s ease;
    }

    .nav-open .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-open .nav-toggle__bar:nth-child(2) { opacity: 0; }
    .nav-open .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 30;            /* above the ticker below the masthead */
        height: auto;
        max-height: calc(100vh - var(--masthead-h));
        overflow-y: auto;
        background: #fff;
        border-bottom: 3px solid var(--gold);
        box-shadow: 0 18px 30px rgba(17, 29, 66, .18);
    }

    .nav-open .site-nav {
        display: block;
    }

    .site-nav__list {
        display: block;
        height: auto;
        padding: 4px 0;
    }

    .site-nav__list > li {
        flex-wrap: wrap;
        align-items: stretch;
        border-bottom: 1px solid var(--line);
    }

    .site-nav__list > li:last-child {
        border-bottom: 0;
    }

    .site-nav__list > li.active {
        background: var(--gold-tint);
        box-shadow: inset 4px 0 0 var(--gold);
    }

    .site-nav__list > li > a {
        flex: 1;
        height: auto;
        padding: 15px 20px;
    }

    .site-nav__list > li > a::after {
        display: none;
    }

    .sub-toggle {
        width: 56px;
        height: auto;
        margin: 0;
        border-left: 1px solid var(--line);
        font-size: 18px;
    }

    .sub-menu {
        position: static;
        display: none;
        flex-basis: 100%;
        width: 100%;
        padding: 0;
        border-top: 0;
        border-radius: 0;
        background: #f7f8fb;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .has-sub.is-open > .sub-menu {
        display: block;
    }

    .sub-menu a {
        padding: 12px 20px 12px 36px;
        border-left: 0;
        border-top: 1px solid var(--line);
    }
}

@media (max-width: 767px) {
    .topbar {
        font-size: 12.5px;
    }

    .topbar__inner {
        min-height: 36px;
    }

    .topbar__contact .topbar__mail {
        display: none;
    }
}

@media (max-width: 575px) {
    .ticker__inner {
        height: 38px;
    }

    .ticker__label {
        padding: 0 24px 0 12px;
        font-size: 11px;
        letter-spacing: .08em;
    }

    .ticker__item {
        font-size: 13px;
    }
}

/* Reduced motion: no looping ticker (the list scrolls by hand), no slide-in. */
@media (prefers-reduced-motion: reduce) {
    .ticker__track {
        animation: none;
    }

    .ticker__viewport {
        overflow-x: auto;
    }

    .ticker__group {
        min-width: 0;
    }

    .ticker__group[aria-hidden="true"] {
        display: none;
    }

    .fixed-header .masthead {
        animation: none;
    }
}
