/* trailheadfp.com — the whole of the site's CSS.
 *
 * Replaces publicstyle.css and responsive.css (the CMS's own, kept for their
 * palette and nothing else), mbcsmbmcp.css (the "Easy Button & Menu Maker"
 * widget, which shipped HamburgerEnabled:false and therefore no mobile menu
 * at all), layerslider.css + its fullwidth skin, feature.presenter,
 * instalink, html5lightbox, Window.Metro.css and Telerik's WebResource.axd
 * stylesheets.
 *
 * The CMS had NO <meta name="viewport"> on any page: phones were 302'd to a
 * separate site under /mobile/. That site is gone; this stylesheet is what
 * replaces it.
 *
 * Layout is grid/flex on real elements. The six-row <table class="bigTable">
 * shell, the .contentTable inside every row and the <center> wrappers are
 * gone.
 */

/* ----------------------------------------------------------------- tokens */
:root {
  /* read off the live pages, not chosen: the masthead and every heading are
     #2A6786, the bands #EDEDED, the footer #6F6F6F */
  --brand: #2a6786;
  --brand-deep: #1d4a61;
  --brand-tint: #e7eff3;
  --ink: #1a1a1a;
  --muted: #55565a;
  /* The CMS's grey. It is the footer's BACKGROUND, where it is fixed, and
     it was also its heading colour - where it is not safe: #6F6F6F on the
     #EDEDED band is 4.25:1, which passes for a 40px heading and fails for
     the 18.4px one the home page's feature cards come down to on a phone.
     Two tokens, because one of them can move and the other cannot. #666 is
     4.86:1 on the band and 5.74:1 on white, and is four shades from what the
     CMS chose. Solved, not nudged. */
  --grey: #6f6f6f;         /* the footer band - do not darken, it is a surface */
  --grey-text: #666666;    /* every grey heading */
  --band: #ededed;
  --bg: #ffffff;
  --line: #d8d8d8;
  --shell: 1220px;
  --radius: 10px;
  /* named, because the welcome portrait has to cancel exactly this much to
     sit flush on the band below it */
  --section-pad: clamp(2.4rem, 1.6rem + 2.6vw, 4.2rem);
  /* the masthead's measured height; the script keeps it true. This is the
     value the drawer uses before the script has run. */
  --head: 137px;
  /* The width at which the bar becomes a drawer. A media query cannot read a
     custom property, so the number below is repeated in the @media rule near
     the foot of this file and the two MUST be changed together;
     harness/drawer.js asserts that they agree, because a harness carrying its
     own stale copy of a breakpoint reports its own drift as a site bug.
     Derived from a measurement, not chosen: the CMS's logo renders 315px and
     its six-item bar 793px, and at the sizes set here the bar needs 1004px
     beside a 260px logo. */
  --nav-break: 1079.98px;
  --sans: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --display: "Barlow", "Open Sans", "Segoe UI", Arial, sans-serif;
  /* The live site loads TWO Barlow faces, 300 and 400, via
     `css?family=Barlow` and `css?family=Barlow:300`. Measured on it:
     "LET'S GO TOGETHER" at 85px comes out 756px wide at 400, 500, 600 AND
     700 - every weight above 400 resolves to the same face - and 829px at
     300. So every heading and the hero slogan on the current site are Barlow
     REGULAR, and a build that loads a real 700 renders them visibly heavier.
     Declared explicitly rather than left to fall back, because whether a
     browser synthesises bold from a 400 face is not something to leave to
     the browser.

     Set to 600 at the client's request: a real Barlow SemiBold, which is
     heavier than the current site renders and lighter than the 700 this
     build started with. The face is loaded, so nothing here is synthesised -
     change this number and the Google Fonts URL in build.py together, or the
     browser silently falls back to whichever weight IS loaded. */
  --display-weight: 600;
}

/* ------------------------------------------------------------------ reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
/* clipped on BOTH, or the root still scrolls sideways */
html, body { overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 18px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img, svg, video, iframe { max-width: 100%; }
img { height: auto; border: 0; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-deep); }
h1, h2, h3, h4 {
  font-family: var(--display); font-weight: var(--display-weight);
  line-height: 1.12; margin: 0 0 .5em; color: var(--brand);
}
h1 { font-size: clamp(2.1rem, 1.35rem + 2.6vw, 3.35rem); }
h2 { font-size: clamp(1.55rem, 1.15rem + 1.7vw, 2.2rem); color: var(--grey-text); }
h3 { font-size: clamp(1.2rem, 1.05rem + .6vw, 1.45rem); color: var(--grey-text); }
p { margin: 0 0 1.1em; }
address { font-style: normal; }
p:last-child, ul:last-child, ol:last-child { margin-bottom: 0; }
ul, ol { margin: 0 0 1.1em; padding-left: 1.3em; }
li { margin-bottom: .45em; }
:focus-visible { outline: 3px solid #b23f00; outline-offset: 2px; }
::selection { background: var(--brand); color: #fff; }

.shell {
  width: 100%; max-width: var(--shell); margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 34px);
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: 10px; top: -70px; z-index: 300;
  background: #fff; color: var(--brand); padding: 12px 18px;
  border-radius: 6px; box-shadow: 0 4px 18px rgba(0, 0, 0, .3);
  text-decoration: none; font-weight: 700; transition: top .15s;
}
.skip:focus { top: 10px; }

/* The CMS's animated blue rule. It was a `width:1px` div growing to 300px
   over three seconds on every page load, which meant the heading it belongs
   to sat over a moving line for three seconds. Same mark, drawn once. */
.rule { width: 190px; height: 5px; background: var(--brand); margin: 0 0 1.1rem; border: 0; }
.rule-centre { margin-inline: auto; }

/* -------------------------------------------------------- Font Awesome */
/* The client's Pro kit is a JS kit with `asyncLoading` on: it rewrites each
   <i> into an <svg> AFTER first paint, and fetches one SVG per distinct
   icon. Until then an <i> with no font is 0x0, so the box belongs to this
   wrapper - which is neither the <i> nor the <svg> the kit replaces it with,
   and therefore survives the swap. Without it the home page's three cards and
   the seven service cards jump when the kit lands. */
.ico {
  display: inline-flex; align-items: center; justify-content: center;
  flex: none; width: var(--ico, 20px); height: var(--ico, 20px);
  font-size: var(--ico, 20px); line-height: 1; color: inherit;
}
.ico > i, .ico > svg { display: block; }
/* the kit sets `height: 1em` on its own svg; width follows the icon's ratio */
.ico > svg.svg-inline--fa { height: 1em; width: auto; max-width: 100%; }

/* --------------------------------------------------------------- masthead */
/* The CMS's two rows: a thin #ededed utility strip and the #2A6786 bar. The
   bar is what sticks - the strip is 40px of social links that nobody needs
   kept on screen, and giving it up buys the page back a tenth of a phone
   viewport.
   z-index 70 is above the backdrop's 65, and that is not a preference: the
   drawer is a DESCENDANT of this element, so a positioned masthead with a
   z-index is a stacking context and the drawer's own z-index can never lift
   it past a SIBLING of the masthead. Below the scrim the menu paints dimmed
   AND hit-tests to the backdrop, so a tap on a link closes the drawer. */
.masthead { position: relative; z-index: 70; }

.utility { background: var(--band); font-size: .95rem; }
.utility .shell {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 1.1rem; min-height: 40px; padding-block: .3rem;
}
/* WCAG 2.2 wants 24x24 of target on anything that is not an inline link in a
   sentence. The CMS drew these three as bare 20px glyphs. */
.utility a {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .45rem; color: var(--brand); text-decoration: none;
  min-height: 28px; min-width: 28px; padding: 2px 4px;
}
.utility a:hover { color: var(--brand-deep); text-decoration: underline; }
.utility .ico { flex: none; }

.mastbar { background: var(--brand); position: sticky; top: 0; z-index: 60; }
.mastbar .shell {
  display: flex; align-items: center; gap: clamp(1rem, 2vw, 2.2rem);
  min-height: 97px; padding-block: .7rem;
}
.brand { display: inline-flex; flex: none; margin-right: auto; }
.brand img { width: clamp(210px, 22vw, 315px); height: auto; }

/* -------------------------------------------------------------------- nav */
.nav-toggle {
  display: none; align-items: center; gap: .55rem; flex: none;
  background: transparent; border: 1.5px solid rgba(255, 255, 255, .55);
  color: #fff; font: var(--display-weight) .88rem/1 var(--display); letter-spacing: .12em;
  text-transform: uppercase; padding: .7rem .95rem; border-radius: 6px;
  cursor: pointer; min-height: 46px;      /* a thumb-sized target */
}
.nav-toggle:hover { background: rgba(255, 255, 255, .12); border-color: #fff; }
.nav-toggle .bars { width: 19px; height: 13px; position: relative; display: block; }
.nav-toggle .bars::before, .nav-toggle .bars::after, .nav-toggle .bars i {
  content: ""; position: absolute; left: 0; right: 0; height: 2px;
  background: currentColor; transition: transform .22s ease, opacity .18s ease;
}
.nav-toggle .bars::before { top: 0; }
.nav-toggle .bars i { top: 5.5px; }
.nav-toggle .bars::after { bottom: 0; }
body.nav-open .nav-toggle .bars::before { transform: translateY(5.5px) rotate(45deg); }
body.nav-open .nav-toggle .bars i { opacity: 0; }
body.nav-open .nav-toggle .bars::after { transform: translateY(-5.5px) rotate(-45deg); }

.nav ul { list-style: none; margin: 0; padding: 0; }
.nav > ul { display: flex; align-items: stretch; justify-content: flex-end; }
.nav li { position: relative; margin: 0; }
.nav a, .nav .nav-top {
  display: flex; align-items: center; gap: .35rem;
  font-family: var(--display); font-weight: var(--display-weight);
  font-size: clamp(.92rem, .78rem + .35vw, 1.06rem);
  letter-spacing: .04em; text-transform: uppercase; text-decoration: none;
  color: #fff; background: transparent; border: 0; cursor: pointer;
  padding: .65rem clamp(.55rem, 1.05vw, 1rem); min-height: 46px;
  line-height: 1.2; white-space: nowrap; border-radius: 6px;
}
.nav > ul > li > a:hover, .nav > ul > li > .nav-top:hover,
.nav > ul > li > .nav-top[aria-expanded="true"] { background: rgba(255, 255, 255, .14); }
/* A STRAIGHT rule. An inset box-shadow follows the element's 6px
   border-radius and curls up at both ends into a cup; a positioned bar does
   not. */
.nav > ul > li > a, .nav > ul > li > .nav-top { position: relative; }
.nav > ul > li > [aria-current="page"]::after,
.nav > ul > li > [data-current="true"]::after {
  content: ""; position: absolute; left: clamp(.55rem, 1.05vw, 1rem);
  right: clamp(.55rem, 1.05vw, 1rem); bottom: 6px; height: 3px;
  background: #fff; border-radius: 0;
}
.nav .caret { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; }
.nav .nav-top[aria-expanded="true"] .caret { transform: rotate(180deg); }

.nav-sub {
  /* top: 100%, NOT 100% + a gap. The panel is absolutely positioned, so it
     does not extend the <nav>'s own box; a 7px gap between the button and the
     panel is 7px of NOT-the-nav that the pointer has to cross on its way
     down, which fires mouseleave on the nav and closes the menu before it can
     be reached. The visual offset comes from a transparent top border, which
     is part of the panel and therefore part of the nav. */
  position: absolute; top: 100%; left: 0; min-width: 224px;
  border-top: .45rem solid transparent; background-clip: padding-box;
  background: var(--brand-deep); border-radius: 8px; overflow: hidden;
  box-shadow: 0 16px 34px rgba(0, 0, 0, .34);
  opacity: 0; visibility: hidden; transform: translateY(5px);
  /* visibility is stepped, never transitioned, on the property that reveals
     a panel: a transitioned `visibility` leaves the panel hit-testable for
     the whole duration on the way out */
  transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
}
.nav-sub[data-open="true"] {
  opacity: 1; visibility: visible; transform: none; transition-delay: 0s;
}
.nav-sub a {
  text-transform: none; letter-spacing: .01em; font-size: 1rem;
  padding: .75rem 1.1rem; white-space: normal; border-radius: 0;
  border-top: 1px solid rgba(255, 255, 255, .14);
}
.nav-sub li:first-child a { border-top: 0; }
.nav-sub a:hover, .nav-sub a[aria-current="page"] { background: rgba(255, 255, 255, .16); }

/* HOME is a drawer-only item: on a desktop the logo is the home link and
   there is no room beside it for a seventh entry. The /mobile/ menu the CMS
   shipped had one, so the drawer keeps it. */
.nav-home { display: none; }

.backdrop { display: none; }
/* the drawer is focused programmatically (tabindex="-1", nothing tabs to it);
   a ring round the whole panel reads as a stray rule across the menu */
#site-nav:focus, #site-nav:focus-visible { outline: none; }
.nav-extra { display: none; }

/* ------------------------------------------------------------------- hero */
.hero {
  position: relative; overflow: hidden;
  min-height: clamp(320px, 52vw, 530px);
  display: grid; place-items: center;
  background: #2b3f4d; color: #fff;
}
.hero-media {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 42%;
}
/* The h1-sized slogan is 24px+, so 3:1 is the bar: alpha >= .44 over white.
   The band it sits in never drops below .48. */
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(12, 22, 30, .30) 0, rgba(12, 22, 30, .48) 55%, rgba(12, 22, 30, .58) 100%);
}
.hero .shell { position: relative; z-index: 1; padding-block: clamp(2.5rem, 6vw, 5rem); text-align: center; }
.hero-slogan {
  font-family: var(--display); font-weight: var(--display-weight); color: #fff;
  font-size: clamp(2.4rem, 1rem + 7.2vw, 5.3rem); line-height: 1.02;
  margin: 0; text-shadow: 0 3px 26px rgba(0, 0, 0, .45);
}

/* An interior page's 275px LayerSlider strip, as a real image behind the
   page title. The engine that drove it - greensock, transitions,
   kreaturamedia, easing, transit, ~145 KB - ran `responsive: false` on ONE
   static slide, which is also why the strip could never be responsive. */
.banner {
  position: relative; overflow: hidden;
  min-height: clamp(160px, 21vw, 275px);
  display: grid; align-items: center;
  background: #2b3f4d;
}
.banner .banner-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}
.banner::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(10, 20, 28, .52) 0, rgba(10, 20, 28, .18) 62%, rgba(10, 20, 28, .10) 100%);
}
.banner .shell { position: relative; z-index: 1; }
.banner h1 { color: #fff; margin: 0; text-shadow: 0 2px 18px rgba(0, 0, 0, .55); }

/* A page the CMS gave no banner - Trail Sightings and Terms & Conditions are
   the two - keeps that: the title in brand blue on white, with the same rule
   the CMS drew above it, and no invented artwork. */
.pagehead { padding-block: clamp(2rem, 1.4rem + 2vw, 3.2rem) 0; }
.pagehead h1 { margin: 0; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--display); font-weight: var(--display-weight); font-size: 1.15rem;
  text-decoration: none; cursor: pointer; text-align: center;
  padding: .8rem 1.6rem; border-radius: 50px; min-height: 48px;
  background: var(--brand); color: #fff; border: 3px solid var(--brand);
  transition: background .18s, color .18s, border-color .18s;
}
.btn:hover { background: var(--bg); color: var(--brand); border-color: var(--brand); }
.btn-light { background: transparent; color: var(--brand); }
.btn-light:hover { background: var(--brand); color: #fff; }

/* ------------------------------------------------------------------- main */
main { display: block; }
.section { padding-block: var(--section-pad); }
.section-band { background: var(--band); }
.prose { max-width: 74ch; }
.prose-wide { max-width: none; }
.lede { font-size: 1.1rem; }

/* --------------------------------------------------------- welcome band */
.welcome { display: grid; gap: clamp(1.5rem, 1rem + 2.5vw, 3.2rem); align-items: end; }
/* a grid item's default min-width is min-content, and one wide child then
   pushes its whole column past the viewport */
.welcome > * { min-width: 0; }
/* Flush with the band below - no white strip under him. The CMS did this
   with `margin-top: -691px`, dragging the image up out of the next row; here
   the section's own bottom padding is cancelled for this one column, so the
   bottom of the photograph IS the bottom of the #ededed band. */
.welcome-portrait {
  margin: 0 0 calc(-1 * var(--section-pad)); justify-self: center;
  align-self: end;
}
.welcome-portrait img { display: block; width: 100%; max-width: 409px; height: auto; }
/* The heading and the copy come FIRST in the source, so a phone reads the
   message before it scrolls past a 500px portrait; on a wide screen the
   portrait is placed back into the left column, where the CMS had it. */
@media (min-width: 860px) {
  .welcome { grid-template-columns: minmax(0, 34fr) minmax(0, 64fr); }
  .welcome > div { grid-column: 2; grid-row: 1; }
  .welcome-portrait { grid-column: 1; grid-row: 1; }
}

/* There are exactly THREE of these, and `repeat(auto-fit, minmax(220px,1fr))`
   got it wrong by 0.2px inside the 719px copy column - three 220px tracks
   plus two 29.6px gaps is 719.2 - so it laid out 2 + 1. When the count is
   known, state it. */
.features {
  display: grid; gap: clamp(1.1rem, .8rem + 1.2vw, 2rem);
  grid-template-columns: minmax(0, 1fr);
  margin-top: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem);
}
@media (min-width: 560px) { .features { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.feature .ico { color: var(--brand); margin-bottom: .9rem; }
/* Barlow, like every other heading on the site. These began as <strong>
   inside a <p> in the CMS, which is why they were first set in the body
   face; they are headings and they read as headings. */
.feature h2 {
  font-family: var(--display); font-weight: var(--display-weight);
  font-size: clamp(1.15rem, 1.02rem + .5vw, 1.4rem);
  color: var(--grey-text); margin-bottom: .45rem; line-height: 1.15;
}
.feature p { margin: 0; }

/* A 200px band of a city photograph carrying no words. It is decoration, and
   it is 15 KB of WebP, so it keeps its place and loses its height on a phone
   where it would otherwise be a fifth of the screen. */
.photoband {
  height: clamp(110px, 14vw, 200px);
  background: #23303a center/cover no-repeat;
}

/* ----------------------------------------------------------------- cards */
/* The CMS gave every services card `height: 490px`, so a two-line card and a
   nine-line card both reserved nine lines and the grid was mostly empty. A
   grid row stretches its items to the tallest in the ROW, which is the
   effect that height was reaching for, without the dead space. */
.cards {
  display: grid; gap: clamp(1rem, .7rem + 1.2vw, 1.6rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
}
.card {
  background: var(--bg); border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
  padding: clamp(1.6rem, 1.2rem + 1.4vw, 2.6rem) clamp(1.1rem, .9rem + 1vw, 1.9rem);
  text-align: center; display: flex; flex-direction: column; align-items: center;
}
.card .ico { color: var(--brand); margin-bottom: .2rem; }
.card h2 {
  font-size: clamp(1.3rem, 1.15rem + .55vw, 1.65rem);
  font-weight: var(--display-weight);
  color: var(--grey-text); margin: 1.1rem 0 .9rem;
}
.card p { margin: 0; }

/* --------------------------------------------------------------- figures */
figure { margin: 0; }
.figure-wide { margin: 2rem 0 0; }
.figure-wide img {
  display: block; width: 100%; max-width: 900px; height: auto;
  margin-inline: auto; border-radius: 20px;
}
.transcript { margin-top: 1.2rem; max-width: 74ch; }
.transcript > summary {
  cursor: pointer; font-family: var(--display);
  font-weight: var(--display-weight);
  color: var(--brand); padding: .5rem 0; font-size: 1.05rem;
}
.transcript[open] > summary { margin-bottom: .6rem; }
.transcript ul { margin-bottom: .8rem; }

/* ----------------------------------------------------------------- split */
.split { display: grid; gap: clamp(1.6rem, 1.1rem + 2.2vw, 3rem); align-items: start; }
.split > * { min-width: 0; }
@media (min-width: 860px) { .split { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.split-media img, .split-media iframe { display: block; width: 100%; border-radius: 20px; }
.split-media iframe { border: 0; aspect-ratio: 4 / 3; height: auto; }
.split-media > * + * { margin-top: 1.5rem; }

/* --------------------------------------------------------------- widgets */
/* Elfsight refuses to mount a div that carries any class but its own, so the
   widget div is bare and everything it needs is on this wrapper. */
.widget { margin-top: 1.2rem; }
.widget-map { min-height: 420px; }
.widget-team { margin-top: 2rem; }
.widget noscript p {
  background: var(--brand-tint); border-left: 5px solid var(--brand);
  padding: 1rem 1.2rem; border-radius: 0 var(--radius) var(--radius) 0;
}

/* ---------------------------------------------------------------- videos */
.videos {
  display: grid; gap: clamp(1rem, .7rem + 1.2vw, 1.8rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}
.videos figure { display: flex; flex-direction: column; gap: .7rem; }

/* The trigger. It is an <a> to the MP4 so that it still works with the script
   off; the script upgrades it into the lightbox. */
.videolink {
  position: relative; display: block; border-radius: var(--radius);
  overflow: hidden; background: #16222c; text-decoration: none;
  aspect-ratio: 16 / 9;
}
.videoposter, .videoposter picture, .videoposter img {
  display: block; width: 100%; height: 100%;
}
.videoposter img { object-fit: cover; }
.videolink::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(8, 16, 22, .28); transition: background .18s;
}
.videolink:hover::after, .videolink:focus-visible::after { background: rgba(8, 16, 22, .08); }
.playmark {
  position: absolute; inset: 0; margin: auto; z-index: 1;
  width: clamp(56px, 16%, 84px); height: clamp(56px, 16%, 84px);
  display: grid; place-items: center; pointer-events: none;
  filter: drop-shadow(0 3px 14px rgba(0, 0, 0, .45));
  transition: transform .18s;
}
.playmark svg { width: 100%; height: 100%; }
.playmark circle { fill: rgba(42, 103, 134, .82); stroke: #fff; stroke-width: 2; }
.videolink:hover .playmark, .videolink:focus-visible .playmark { transform: scale(1.07); }

/* ------------------------------------------------------------- lightbox */
/* Replaces the CMS's html5lightbox.js. <dialog> supplies Escape, the top
   layer and the backdrop; th.js supplies focus return, the backdrop click and
   stopping playback on close. */
.lightbox {
  border: 0; padding: 0; background: transparent;
  width: min(1100px, 94vw); max-width: 94vw; max-height: 92vh;
  color: #fff; overflow: visible;
}
.lightbox::backdrop { background: rgba(6, 12, 18, .86); }
.lightbox-video {
  display: block; width: 100%; height: auto; max-height: 78vh;
  background: #000; border-radius: var(--radius);
}
.lightbox-title {
  font-family: var(--display); font-weight: var(--display-weight);
  font-size: 1.05rem; margin: .8rem 0 0; text-align: center; color: #fff;
}
.lightbox-close {
  position: absolute; top: -14px; right: -14px; z-index: 2;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  background: #fff; color: var(--brand); border: 0;
  display: grid; place-items: center;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .5);
}
.lightbox-close:hover { background: var(--brand); color: #fff; }
.lightbox-close svg { width: 20px; height: 20px; }
@media (max-width: 560px) {
  .lightbox-close { top: -50px; right: 0; }
}
.videos figcaption { font-family: var(--display); font-size: 1.05rem; color: var(--grey-text); }
/* Barlow has no bold face loaded, so the series label is distinguished by
   colour rather than by a weight the font cannot supply. */
.videos figcaption b { color: var(--brand); font-weight: var(--display-weight); }

.doclinks { display: flex; flex-wrap: wrap; gap: .9rem; margin-bottom: .5rem; }

/* ---------------------------------------------------------------- footer */
.site-footer { background: var(--grey); color: #fff; padding-block: 2.4rem 2rem; }
.site-footer a { color: #fff; }
.foot-top {
  display: grid; gap: 1.4rem clamp(1.5rem, 1rem + 2vw, 3rem); align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}
.foot-top > * { min-width: 0; }
.foot-logo img { width: 100%; max-width: 260px; height: auto; }
.foot-item { display: flex; align-items: flex-start; gap: .65rem; }
.foot-item .ico { flex: none; margin-top: .28rem; }
.foot-item address { font-style: normal; }
/* the phone number under the contact map is a link on its own line, not a
   link in a sentence, so WCAG 2.2's inline exemption does not cover it */
.foot-item address a { display: inline-block; padding: 3px 0; min-height: 24px; }
/* 14px white on #6F6F6F is 5.03:1 - above the 4.5:1 bar, and the size the
   CMS set the disclosure at. It is the regulated Cambridge / FINRA / SIPC
   text and is reproduced exactly. */
.disclosure {
  font-size: .82rem; line-height: 1.55; margin: 1.8rem 0 0;
  padding-top: 1.4rem; border-top: 1px solid rgba(255, 255, 255, .28);
}
.foot-legal {
  display: flex; flex-wrap: wrap; gap: .4rem 1.2rem;
  font-size: .82rem; margin-top: 1rem;
}
.foot-legal a { text-decoration: none; }
.foot-legal a:hover { text-decoration: underline; }

/* -------------------------------------------------------------- 404 page */
.notfound ul { list-style: none; padding: 0; }
.notfound li { margin-bottom: .6rem; }

/* ================================================== the drawer breakpoint */
/* MEASURED, not chosen: the logo is 315px and the six-item bar 793px on the
   live site; at the sizes set above the bar needs 1004px beside a 260px
   logo, and 1080px is the first common width where both fit inside the
   shell's gutters with room to spare. Below it the bar becomes a drawer. */
@media (max-width: 1079.98px) {
  /* the whole header sticks on a phone - it is short enough there, and the
     scroll lock then has one element to fix */
  .masthead { position: sticky; top: 0; }
  /* The drawer IS this bar's <nav>, so the bar cannot be display:none - that
     would hide the drawer with it. */
  .mastbar { position: static; }
  .nav-toggle { display: inline-flex; }
  .utility .shell { justify-content: center; gap: 1.4rem; }

  /* Everything the drawer owns needs a base-level display:none as well, or
     it leaks under the desktop footer while the stylesheet is parsing. */
  .nav {
    position: fixed; top: var(--head); left: 0; bottom: 0;
    width: min(86vw, 350px); background: var(--brand); color: #fff;
    z-index: 70; transform: translateX(-102%); transition: transform .26s ease;
    overflow-y: auto; overscroll-behavior: contain;
    padding: 0 0 2rem; box-shadow: 8px 0 30px rgba(0, 0, 0, .32);
  }
  .nav > ul { flex-direction: column; align-items: stretch; }
  .nav-home { display: block; }
  .nav a, .nav .nav-top {
    width: 100%; padding: .95rem 1.3rem; font-size: 1.05rem; min-height: 54px;
    border-radius: 0; border-bottom: 1px solid rgba(255, 255, 255, .18);
  }
  .nav .nav-top { justify-content: space-between; }
  /* ONE marker in the drawer, not two. The straight underline is the
     desktop bar's; in a stacked list it reads as a row divider, and next to
     the left bar it was simply both at once. A vertical list gets the
     vertical mark. */
  .nav > ul > li > [aria-current="page"],
  .nav > ul > li > [data-current="true"] { box-shadow: inset 4px 0 0 #fff; }
  .nav > ul > li > [aria-current="page"]::after,
  .nav > ul > li > [data-current="true"]::after { content: none; }
  .nav-sub {
    position: static; min-width: 0; opacity: 1; visibility: visible;
    transform: none; box-shadow: none; border-radius: 0; transition: none;
    background: rgba(0, 0, 0, .16); display: none;
    /* the transparent border that bridges the desktop gap is a gap of its
       own in a stacked drawer */
    border-top: 0;
  }
  .nav-sub[data-open="true"] { display: block; }
  .nav-sub a { padding-left: 2.4rem; font-size: 1rem; border-top: 0; }

  /* the phone number and the social links live in the #ededed strip, which
     is not sticky - inside the drawer they are reachable from anywhere */
  .nav-extra { display: grid; gap: .7rem; padding: 1.3rem; }
  .nav-extra a {
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    background: #fff; color: var(--brand); border-radius: 50px;
    font-family: var(--display); font-weight: var(--display-weight);
    text-decoration: none;
    padding: .8rem 1rem; min-height: 48px; border-bottom: 0; text-transform: none;
    letter-spacing: 0; font-size: 1.02rem; white-space: nowrap;
  }
  .nav-extra a:hover { background: var(--ink); color: #fff; }

  .backdrop {
    display: block; position: fixed; inset: var(--head) 0 0; z-index: 65;
    background: rgba(0, 0, 0, .5); opacity: 0; visibility: hidden;
    transition: opacity .26s ease, visibility 0s linear .26s;
  }
  body.nav-open .nav { transform: none; }
  body.nav-open .backdrop { opacity: 1; visibility: visible; transition-delay: 0s; }
  /* The scroll lock fixes the body, which takes the scroll offset away from
     a position:sticky masthead - it would snap back to its static position
     and the drawer would open under nothing. */
  body.nav-open .masthead { position: fixed; top: 0; left: 0; right: 0; }
}

@media (max-width: 860px) {
  .welcome-portrait { max-width: 320px; }
}

/* At 320px the shell has 284px of content box, and a 210px logo beside a
   103px "Menu" button needs 329. The button loses its word - the three bars
   are the universal affordance and the accessible name stays on the button -
   and the logo comes down to 175px: 243px, with room either side. Measured,
   not guessed: the probe reported the button 50px outside the shell. */
@media (max-width: 420px) {
  .brand img { width: 175px; }
  .nav-toggle { padding: .7rem; gap: 0; }
  .nav-toggle-label {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
}

@media (max-width: 560px) {
  body { font-size: 17px; }
  .utility { font-size: .88rem; }
  .utility .shell { gap: .6rem; }
  .brand img { width: 200px; }
  .mastbar .shell { min-height: 80px; gap: .75rem; }
  .card { padding: 1.6rem 1.2rem; }
  .figure-wide img { border-radius: 12px; }
  .split-media img, .split-media iframe { border-radius: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; transition-duration: .01ms !important;
  }
}

@media print {
  .masthead, .nav, .backdrop, .photoband, .banner::after, .skip { display: none !important; }
  body { font-size: 12pt; color: #000; }
  .site-footer { background: none; color: #000; }
  .site-footer a { color: #000; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; }
}
