/* ==========================================================================
   Site header and footer (the site-wide template chrome), Blue Dial.
   Markup: partials/header.html, partials/footer.html, stamped into every page by
   scripts/apply-site-chrome.py. Behaviour: assets/js/site-chrome.js.
   Tokens (--rd-*) and fonts come from assets/css/redesign.css, which every page loads before this file.
   No colour value lives here. Everything below is scoped to .rd-header / .rd-footer so page styles can't leak in.
   ========================================================================== */

/* ---------- Shared base inside header and footer ---------- */
.rd-header, .rd-footer {
    font: 400 16px/24px var(--rd-font-body);
    -webkit-font-smoothing: antialiased;
    text-align: left;
}
.rd-header, .rd-header *, .rd-header *::before, .rd-header *::after,
.rd-footer, .rd-footer *, .rd-footer *::before, .rd-footer *::after { box-sizing: border-box; }
/* main.css colours every p/span/div/li directly; let ours inherit instead. */
.rd-header :where(p, span, div, li, strong, address),
.rd-footer :where(p, span, div, li, strong, address) { color: inherit; }
.rd-header img, .rd-footer img { max-width: 100%; display: block; }
.rd-header a, .rd-footer a { color: inherit; }
.rd-header p, .rd-footer p { margin: 0; }
.rd-header ul, .rd-footer ul { list-style: none; margin: 0; padding: 0; }
.rd-header li::before, .rd-footer li::before { content: none; }
.rd-header :focus-visible, .rd-footer :focus-visible { outline: 2px solid var(--rd-ink); outline-offset: 2px; }
.rd-header .rd-container, .rd-footer .rd-container { width: min(var(--rd-width), 100% - 2 * var(--rd-gutter)); margin-inline: auto; }

.rd-header .rd-eyebrow {
    display: block; margin: 0 0 16px;
    font: 400 12px/16px var(--rd-font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--rd-slate);
}
.rd-header .rd-link { font-weight: 600; color: var(--rd-navy); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.rd-header .rd-link:hover { text-decoration-thickness: 2px; }

/* Header call to action: the secondary (outline) button, so the header never uses the cyan. */
.rd-header .rd-header__actions .rd-header__cta {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 8px 16px; font: 600 14px/24px var(--rd-font-body);
    text-decoration: none; white-space: nowrap; cursor: pointer;
    border: 1px solid var(--rd-navy); background: transparent; color: var(--rd-navy);
}
.rd-header .rd-header__actions .rd-header__cta:hover { background: var(--rd-navy); color: var(--rd-white); }

.rd-skip {
    position: absolute; left: 16px; top: -64px; z-index: 1100;
    background: var(--rd-navy); color: var(--rd-white); padding: 8px 16px;
}
.rd-skip:focus { top: 8px; }

/* ---------- Header ----------
   Fixed, like the previous site header, so existing page offsets keep working.
   Solid off-white with one silver hairline beneath it. */
.rd-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: var(--rd-offwhite); color: var(--rd-navy);
    border-bottom: 1px solid var(--rd-silver);
    --rd-ink: var(--rd-navy);
}
.rd-header__inner { display: flex; align-items: center; gap: 24px; height: var(--rd-header-h); }
/* Logo: never below 120px wide. Clear space on every side is at least the height of the cyan plane, 54% of the
   logo height: 21px at 200px wide (the 88px header gives 24px), 15px at 144px wide (the 16px gutter and 64px header give 16px or more). */
.rd-header__logo { display: inline-flex; flex-shrink: 0; }
.rd-header .rd-logo { width: 200px; height: auto; }

.rd-nav { margin-left: auto; align-self: stretch; }
.rd-nav__list { display: flex; align-items: stretch; gap: 8px; height: 100%; }
.rd-nav__item { position: relative; display: flex; align-items: center; }
.rd-header .rd-nav__link, .rd-header .rd-nav__trigger {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px; border: 0; background: none; cursor: pointer;
    font: 500 15px/24px var(--rd-font-body); color: var(--rd-navy);
    text-decoration: underline transparent; text-decoration-thickness: 1px; text-underline-offset: 8px; white-space: nowrap;
}
/* Navigation items show their underline on hover and on the current page. */
.rd-header .rd-nav__link:hover, .rd-header .rd-nav__trigger:hover,
.rd-header .rd-nav__trigger[aria-expanded="true"] { text-decoration-color: currentColor; text-decoration-thickness: 2px; }
.rd-header .rd-nav__link[aria-current="page"],
.rd-header .rd-nav__item.is-current > .rd-nav__trigger { text-decoration-color: currentColor; }
.rd-chev { width: 8px; height: 8px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); }

/* Dropdown: a white list under its menu item, framed and divided by hairlines. One link per row. */
.rd-mega {
    position: absolute; left: 0; top: 100%; min-width: 224px;
    background: var(--rd-white); border: 1px solid var(--rd-silver);
    opacity: 0; visibility: hidden;
    transition: opacity var(--rd-fade) linear, visibility 0s linear var(--rd-fade);
}
.rd-nav__item--mega.is-open .rd-mega { opacity: 1; visibility: visible; transition: opacity var(--rd-fade) linear; }
.rd-mega__grid { display: grid; }
.rd-header .rd-mega__card { display: block; padding: 16px 24px; text-decoration: none; color: var(--rd-navy); white-space: nowrap; }
.rd-header .rd-mega__card + .rd-mega__card { border-top: 1px solid var(--rd-silver); }
.rd-header .rd-mega__card strong { font: 600 15px/24px var(--rd-font-body); color: var(--rd-navy); }
.rd-header .rd-mega__card:hover strong, .rd-header .rd-mega__card[aria-current="page"] strong { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

.rd-header__actions { display: flex; align-items: center; gap: 16px; }

.rd-burger { display: none; width: 48px; height: 48px; padding: 0; border: 1px solid var(--rd-navy); background: transparent; cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 8px; }
.rd-burger span { width: 24px; height: 1px; background: var(--rd-navy); }
.rd-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.rd-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.rd-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ---------- Footer ----------
   Deep ground, white text, silver hairlines. No cyan. */
.rd-footer { padding-top: 96px; font-size: 14px; line-height: 22px; }
/* Row 1: logo, Services, Platforms, the remaining menu. Row 2 (under the three menu columns): the two offices and contact. */
.rd-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.3fr; gap: 48px; padding-bottom: 56px; }
.rd-footer__brand { grid-row: span 2; }
.rd-footer .rd-footer__brand .rd-logo { width: 200px; height: auto; margin-bottom: 24px; }
.rd-footer__brand p { max-width: 344px; margin-bottom: 24px; color: var(--rd-silver); }
.rd-footer .rd-footer__heading {
    margin: 0 0 24px; color: var(--rd-silver);
    font: 400 12px/16px var(--rd-font-display); letter-spacing: .12em; text-transform: uppercase;
}
.rd-footer ul { display: grid; gap: 8px; }
.rd-footer a { color: var(--rd-white); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.rd-footer a:hover { text-decoration-thickness: 2px; }
.rd-footer address { font-style: normal; margin-bottom: 16px; color: var(--rd-silver); }
.rd-footer address strong { display: block; color: var(--rd-white); font-weight: 600; margin-bottom: 8px; }
/* Each contact line is a target at least 24px tall. */
.rd-footer__contact a { display: block; line-height: 24px; }
/* Footer menu: the top-level pages that have no column of their own. */
.rd-footer .rd-footer__menu { margin-bottom: 32px; }
.rd-social { display: flex; gap: 8px; }
.rd-footer .rd-social a { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--rd-hairline-dark); color: var(--rd-white); }
.rd-footer .rd-social a:hover { border-color: var(--rd-white); }
.rd-footer__bottom { display: flex; justify-content: space-between; gap: 16px; padding: 24px 0; border-top: 1px solid var(--rd-hairline-dark); color: var(--rd-silver); }

@media (prefers-reduced-motion: reduce) {
    .rd-header *, .rd-footer * { transition: none !important; }
}

/* ---------- Responsive ---------- */
/* Eight menu items need about 1,165px: below 1200px the menu becomes the drawer. Same value in site-chrome.js. */
@media (max-width: 1200px) {
    .rd-burger { display: inline-flex; }
    .rd-header .rd-header__actions .rd-header__cta { display: none; }
    .rd-nav {
        position: fixed; inset: var(--rd-header-h) 0 0; margin: 0; overflow-y: auto;
        background: var(--rd-offwhite); padding: 16px 16px 40px;
        opacity: 0; visibility: hidden;
        transition: opacity var(--rd-fade) linear, visibility 0s linear var(--rd-fade);
    }
    .rd-nav.is-open { opacity: 1; visibility: visible; transition: opacity var(--rd-fade) linear; }
    .rd-nav__list { flex-direction: column; align-items: stretch; gap: 0; }
    .rd-nav__item { display: block; border-bottom: 1px solid var(--rd-silver); }
    .rd-header .rd-nav__link, .rd-header .rd-nav__trigger { width: 100%; justify-content: space-between; padding: 16px 0; font-size: 17px; }
    .rd-mega { position: static; border: 0; display: none; opacity: 1; visibility: visible; background: transparent; }
    .rd-nav__item--mega.is-open .rd-mega { display: block; }
    .rd-mega__grid { padding: 0 0 16px; }
    .rd-header .rd-mega__card { padding: 16px; }
    .rd-header .rd-mega__card + .rd-mega__card { border-top: 0; }
    .rd-header__actions { margin-left: auto; }
    body.rd-menu-open { overflow: hidden; }
}
@media (max-width: 1080px) {
    .rd-footer__grid { grid-template-columns: 1fr 1fr; }
    .rd-footer__brand { grid-row: auto; grid-column: 1 / -1; }
}

/* The gutter is 16px from here down, so the logo is drawn 144px wide to keep its clear space. */
@media (max-width: 860px) {
    .rd-header .rd-logo, .rd-footer .rd-footer__brand .rd-logo { width: 144px; }
}

@media (max-width: 560px) {
    .rd-header__inner { gap: 16px; }
    .rd-footer { padding-top: 56px; }
    .rd-footer__grid { grid-template-columns: 1fr; }
    .rd-footer__bottom { flex-direction: column; }
}

/* ---------- Site-wide announcement ----------
   Shown only when partials/header.html holds the bar (kept in partials/announcement.html
   between events). SITE_ANNOUNCEMENT_ENABLED in assets/js/site-chrome.js hides a bar that is there. */
:root { --rd-announcement-h: 44px; }
body.rd:has(.rd-header:not(.rd-header--without-announcement) .rd-announcement) { padding-top: calc(var(--rd-header-h) + var(--rd-announcement-h)); }
.rd-header { top: 0; }
.rd-announcement {
    display: flex; align-items: center; height: var(--rd-announcement-h); overflow: hidden;
    color: var(--rd-white); background: linear-gradient(90deg, var(--rd-deep), var(--rd-navy), var(--rd-cyan));
}
.rd-announcement__viewport { flex: 1; overflow: hidden; white-space: nowrap; }
.rd-announcement__track { display: flex; width: max-content; align-items: center; animation: rd-announcement-scroll 32s linear infinite; }
.rd-announcement__message { margin: 0; padding-right: 96px; font: 600 14px/44px var(--rd-font-body); letter-spacing: .01em; }
@keyframes rd-announcement-scroll { to { transform: translateX(-50%); } }

.rd-header--without-announcement .rd-announcement { display: none; }
body.rd:has(.rd-header--without-announcement) { padding-top: var(--rd-header-h); }
.rd-header--without-announcement .rd-nav { inset-block-start: var(--rd-header-h); }

@media (max-width: 1200px) {
    .rd-header:not(.rd-header--without-announcement):has(.rd-announcement) .rd-nav { inset-block-start: calc(var(--rd-header-h) + var(--rd-announcement-h)); }
}
@media (max-width: 560px) {
    :root { --rd-announcement-h: 40px; }
    .rd-announcement__message { font-size: 13px; line-height: 40px; padding-right: 72px; }
}
@media (prefers-reduced-motion: reduce) {
    .rd-announcement__track { animation: none; }
}
