/* =========================================================
   FINARCH — site header 
   ========================================================= */

:root {
    --fa-ink: #111111;
    --fa-paper: #ffffff;
    --fa-accent: #54243D;
    --fa-shell: 1560px;
    --fa-gutter: clamp(20px, 4.5vw, 72px);
    --fa-nav-h: clamp(66px, 6.6vw, 86px);
}

html {
    scroll-padding-top: var(--fa-nav-h);
}

/* ---------- shell ---------- */

.fa-header,
.fa-menu { line-height: normal; }

.fa-header, .fa-header *,
.fa-menu, .fa-menu * { box-sizing: border-box; }

:where(.fa-header, .fa-menu) :is(p, h1, h2, h3, h4, h5, h6) { color: inherit; }
.fa-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 120;
    background: transparent;
    -webkit-backdrop-filter: blur(0px) saturate(100%);
    backdrop-filter: blur(0px) saturate(100%);
    border-bottom: 1px solid transparent;
    transition: background .5s cubic-bezier(.16, 1, .3, 1), border-color .5s ease, backdrop-filter .5s ease;
}
header.fa-header::before { content: none; }

.fa-header__inner {
    max-width: calc(var(--fa-shell) + 2 * var(--fa-gutter));
    margin: 0 auto;
    padding: 0 var(--fa-gutter);
    height: var(--fa-nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

/* ---------- logo ---------- */

.fa-header__logo {
    display: flex;
    align-items: center;
    flex: none;
    text-decoration: none;
}

.fa-header__logo img {
    display: block;
    height: clamp(28px, 2.8vw, 40px);
    width: auto;
}

/* Two logos ship in the markup; the theme decides which one shows. */
.fa-header__logo .fa-logo--light { display: none; }
.fa-header__logo .fa-logo--dark { display: block; }

:is(.fa-header--dark, .fa-header--solid, .fa-header--light.is-scrolled) .fa-header__logo .fa-logo--light { display: block; }
:is(.fa-header--dark, .fa-header--solid, .fa-header--light.is-scrolled) .fa-header__logo .fa-logo--dark { display: none; }

/* ---------- links ---------- */

.fa-header__nav {
    display: flex;
    align-items: center;
    gap: clamp(14px, 1.8vw, 30px);
    list-style: none;
    margin: 0;
    padding: 0;
}

.fa-header__item {
    position: relative;
    display: flex;
    align-items: center;
}

.fa-header__link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 450;
    letter-spacing: .1em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    padding: 9px 0;
    border-bottom: 1px solid transparent;
    background: none;
    border-top: 0;
    border-left: 0;
    border-right: 0;
    cursor: pointer;
    transition: color .3s, border-color .3s;
}

/* The pulsing dot that marks Finmarket in the nav. */
.fa-header__dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--fa-accent);
    flex: none;
    animation: fa-pulse 3s ease-in-out infinite;
}

.fa-header__caret {
    width: 14px;
    height: 14px;
    fill: currentColor;
    transition: transform .3s ease;
}

.fa-header__item:hover > .fa-header__link .fa-header__caret { transform: rotate(180deg); }

.fa-header__divider {
    width: 1px;
    height: 15px;
    flex: none;
}

/* Finmarket has more top-level pages than Finarch, so its bar uses the
   tighter sizes from the Finmarket design to fit them before the burger. */
.fa-header--finmarket .fa-header__inner { gap: clamp(16px, 2vw, 32px); }
.fa-header--finmarket .fa-header__logo img { height: clamp(20px, 1.9vw, 27px); }
.fa-header--finmarket .fa-header__nav { gap: clamp(10px, calc(2.1vw - 12px), 20px); }
.fa-header--finmarket .fa-header__link { font-size: 11.5px; letter-spacing: .08em; }

/* ---------- dropdowns ---------- */

.fa-header__submenu {
    position: absolute;
    top: 100%;
    margin-top:15px!important;
    left: 0;
    min-width: 220px;
    margin: 0;
    padding: 10px 0;
    list-style: none;
    border-radius: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .28s ease, transform .28s ease, visibility .28s;
    box-shadow: 0 24px 48px rgba(0, 0, 0, .22);
}

.fa-header__item:hover > .fa-header__submenu,
.fa-header__item:focus-within > .fa-header__submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fa-header__sublink {
    display: block;
    padding: 10px 20px;
    font-size: 13.5px;
    font-weight: 400;
    letter-spacing: .01em;
    text-decoration: none;
    white-space: nowrap;
    transition: background .25s, color .25s;
}

/* ---------- language switch ---------- */

.fa-header__lang {
    display: flex;
    align-items: center;
    gap: 2px;
}

.fa-header__lang a {
    padding: 5px 7px;
    font-size: 11px;
    font-weight: 450;
    letter-spacing: .12em;
    text-decoration: none;
    transition: color .3s;
}

/* The active language is a notch heavier than the one you can switch to. */
.fa-header__lang a.active { font-weight: 500; }

.fa-header__lang-sep {
    font-size: 11px;
}

/* ---------- burger ---------- */

.fa-header__burger {
    display: none;
    background: none;
    border: 0;
    padding: 10px;
    margin-right: -10px;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

.fa-header__burger span {
    display: block;
    width: 24px;
    height: 1.5px;
    transition: background .3s;
}

.fa-header__burger span:last-child { width: 16px; }

/* =========================================================
   Themes
   --dark  : over a dark hero              (white logo)
   --light : over a light hero             (dark logo, until it scrolls)
   --solid : pages without a hero photo    (white logo)

   The bar is transparent at the top for every theme and turns into the same
   dark glass once scrolled (Finarch and Finmarket alike), so --dark, --solid
   and every scrolled state share one light-on-dark treatment. --light keeps
   the dark text only while it is still transparent. A page whose top is light
   and has no hero paints the bar itself (see FinNewsArticle.css).
   ========================================================= */

:is(.fa-header--dark, .fa-header--solid, .fa-header--light.is-scrolled) .fa-header__link { color: rgba(255, 255, 255, .7); }
:is(.fa-header--dark, .fa-header--solid, .fa-header--light.is-scrolled) .fa-header__link:hover,
:is(.fa-header--dark, .fa-header--solid, .fa-header--light.is-scrolled) .fa-header__link:focus-visible { color: #ffffff; border-bottom-color: rgba(255, 255, 255, .4); }
:is(.fa-header--dark, .fa-header--solid, .fa-header--light.is-scrolled) .fa-header__divider { background: rgba(255, 255, 255, .18); }
:is(.fa-header--dark, .fa-header--solid, .fa-header--light.is-scrolled) .fa-header__lang a { color: rgba(255, 255, 255, .5); }
:is(.fa-header--dark, .fa-header--solid, .fa-header--light.is-scrolled) .fa-header__lang a.active,
:is(.fa-header--dark, .fa-header--solid, .fa-header--light.is-scrolled) .fa-header__lang a:hover { color: #ffffff; }
:is(.fa-header--dark, .fa-header--solid, .fa-header--light.is-scrolled) .fa-header__lang-sep { color: rgba(255, 255, 255, .5); }
:is(.fa-header--dark, .fa-header--solid, .fa-header--light.is-scrolled) .fa-header__burger span { background: #ffffff; }
:is(.fa-header--dark, .fa-header--solid, .fa-header--light.is-scrolled) .fa-header__submenu { background: #1c1c1c; border: 1px solid rgba(255, 255, 255, .1); }
:is(.fa-header--dark, .fa-header--solid, .fa-header--light.is-scrolled) .fa-header__sublink { color: rgba(255, 255, 255, .72); }
:is(.fa-header--dark, .fa-header--solid, .fa-header--light.is-scrolled) .fa-header__sublink:hover { background: rgba(255, 255, 255, .06); color: #ffffff; }

.fa-header--light .fa-header__link { color: rgba(17, 17, 17, .72); }
.fa-header--light .fa-header__link:hover,
.fa-header--light .fa-header__link:focus-visible { color: var(--fa-ink); border-bottom-color: rgba(17, 17, 17, .4); }
.fa-header--light .fa-header__divider { background: rgba(17, 17, 17, .18); }
.fa-header--light .fa-header__lang a { color: rgba(17, 17, 17, .5); }
.fa-header--light .fa-header__lang a.active,
.fa-header--light .fa-header__lang a:hover { color: var(--fa-ink); }
.fa-header--light .fa-header__lang-sep { color: rgba(17, 17, 17, .45); }
.fa-header--light .fa-header__burger span { background: var(--fa-ink); }
.fa-header--light .fa-header__submenu { background: #ffffff; border: 1px solid rgba(17, 17, 17, .08); }
.fa-header--light .fa-header__sublink { color: rgba(17, 17, 17, .75); }
.fa-header--light .fa-header__sublink:hover { background: rgba(17, 17, 17, .04); color: var(--fa-ink); }

/* Finmarket underlines in the accent rather than the theme's hairline. Ties the
   theme rules above on specificity, so it has to stay below them. */
.fa-header .fa-header__link--accent:hover,
.fa-header .fa-header__link--accent:focus-visible { border-bottom-color: var(--fa-accent); }

.fa-header--light .fa-header__link.is-active {
    color: var(--fa-ink);
    border-bottom-color: currentColor;
}

:is(.fa-header--dark, .fa-header--solid, .fa-header--light.is-scrolled) .fa-header__link.is-active {
    color: #ffffff;
    border-bottom-color: currentColor;
}

/* current page inside a dropdown */
.fa-header__sublink.is-active { font-weight: 600; }
.fa-header--light .fa-header__sublink.is-active { color: var(--fa-ink); }
:is(.fa-header--dark, .fa-header--solid, .fa-header--light.is-scrolled) .fa-header__sublink.is-active { color: #ffffff; }

/* ---------- scrolled state (set by header.js) ---------- */

.fa-header.is-scrolled {
    background: rgba(17, 17, 17, .34);
    border-bottom-color: rgba(255, 255, 255, .14);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    backdrop-filter: blur(22px) saturate(150%);
}

/* =========================================================
   Mobile overlay menu
   ========================================================= */

.fa-menu {
    position: fixed;
    inset: 0;
    z-index: 130;
    background: var(--fa-ink);
    color: #ffffff;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity .4s cubic-bezier(.16, 1, .3, 1), visibility 0s .4s;
    display: flex;
    flex-direction: column;
    padding: clamp(20px, 5vw, 48px);
    overflow-y: auto;
}

.fa-menu.is-open {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transition: opacity .4s cubic-bezier(.16, 1, .3, 1), visibility 0s;
}

.fa-menu__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: none;
}

.fa-menu__top img {
    display: block;
    height: 24px;
    width: auto;
}

.fa-menu__close {
    background: none;
    border: 0;
    padding: 12px;
    cursor: pointer;
    font-size: 28px;
    font-weight: 400;
    line-height: 1;
    color: #ffffff;
}

.fa-menu__list {
    margin: auto 0;
    padding: 24px 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fa-menu__link {
    display: block;
    font-size: clamp(26px, 6vw, 40px);
    font-weight: 500;
    letter-spacing: -.03em;
    padding: 10px 0;
    min-height: 44px;
    color: #ffffff;
    text-decoration: none;
}

.fa-menu__sublist {
    list-style: none;
    margin: 4px 0 10px;
    padding: 0 0 0 18px;
    border-left: 1px solid rgba(255, 255, 255, .16);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fa-menu__sublink {
    display: block;
    font-size: 16px;
    font-weight: 400;
    padding: 9px 0;
    min-height: 44px;
    color: rgba(255, 255, 255, .66);
    text-decoration: none;
}

    .fa-menu__sublink.is-active {
        color: #ffffff;
        font-weight: 600;
    }

.fa-menu__foot {
    flex: none;
    display: flex;
    align-items: center;
    gap: 14px;
    border-top: 1px solid rgba(255, 255, 255, .14);
    padding-top: 22px;
}

.fa-menu__foot .fa-header__lang a {
    padding: 12px 14px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    letter-spacing: .14em;
    color: rgba(255, 255, 255, .55);
}

.fa-menu__foot .fa-header__lang a.active { color: #ffffff; }

body.fa-menu-open { overflow: hidden; }

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1179.98px) {
    .fa-header__nav,
    .fa-header__desktop-only { display: none; }
    .fa-header__burger { display: flex; }
}

@media (min-width: 1180px) {
    .fa-menu { display: none; }
}

@keyframes fa-pulse {
    0% { opacity: .35; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.5); }
    100% { opacity: .35; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .fa-header,
    .fa-header__submenu,
    .fa-menu { transition: none; }
    .fa-header__dot { animation: none; }
}
