/* =========================================================================
   artemia — a clean, lightweight, non-Bootstrap theme for Tuskfish
   Palette: "a bloom of brine shrimp reddening a white salt lake under a
   brilliant blue sky". The brine-shrimp red leads; the three habitat layers
   map onto the page:
     • brine coral — the brand: header / footer band, links, focus, meta
     • salt white  — the page and card surfaces
     • sky blue    — the cool counter-accent: buttons, title rules, pagination
   The brine colour is a soft, dusty salmon-coral: adult Artemia carry
   canthaxanthin (a red-orange keto-carotenoid) but read as pink-salmon in life,
   only "slightly red" even in the saltiest water. Hand-written, no framework,
   mobile-first.
   ========================================================================= */

/* ---- Design tokens ---------------------------------------------------- */
:root {
  /* Salt-lake palette */
  --bg:          #f5f9fc;   /* salt-flat white, a cool cast */
  --bg-tint:     #e7f0f6;
  --card:        #ffffff;
  --text:        #16242e;   /* deep slate, faintly blue */
  --muted:       #5f7382;
  --text-soft:   #31424f;
  --rule:        #d8e5ed;
  --rule-strong: #bcd1de;
  --accent:      #bd564a;   /* brine-shrimp coral — soft salmon-red of adult Artemia (band, links, focus) */
  --accent-700:  #9c4034;
  --accent-050:  #fbe7e1;
  --link:        #bd564a;
  --link-hover:  #9c4034;
  --sand:        #e3b04b;   /* salt-rim gold, a warm tertiary */
  --coral:       #1683c7;   /* brilliant sky blue (CTA / counter-accent) */
  --coral-700:   #115f93;
  --coral-050:   #e4f2fb;

  /* Type scale (fluid) */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
          sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-heading: "Merriweather Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --h1: clamp(1.8rem, 1.3rem + 2.2vw, 2.6rem);
  --h2: clamp(1.45rem, 1.2rem + 1.3vw, 1.95rem);
  --h3: clamp(1.2rem, 1.05rem + 0.7vw, 1.45rem);

  /* Spacing & shape */
  --gap: 1.5rem;
  --container: 1140px;
  --measure: 70ch;     /* readable line length for prose */
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(17, 45, 70, .07), 0 6px 18px rgba(17, 45, 70, .08);
  --shadow-sm: 0 1px 2px rgba(17, 45, 70, .09);
  --img-border: 1px solid rgba(17, 45, 70, .16);   /* hairline on figure imagery */
}

/* ---- Reset ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  /* Sticky footer: fill the viewport so the footer sits at the bottom even
     when the page content is short. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; margin: 0 0 .6em; color: var(--text); font-family: var(--font-heading); }
.page-title, .featured-title, .stream-item .title, .article .title, .brand-text, .footer-title { font-family: var(--font-heading); }
h1 { font-size: var(--h1); letter-spacing: -.01em; }
h2 { font-size: var(--h2); letter-spacing: -.005em; }
h3 { font-size: var(--h3); }
p { margin: 0 0 1rem; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* ---- Skip link -------------------------------------------------------- */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 1000;
  background: var(--accent); color: #fff; padding: .6rem 1rem; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ---- Layout container ------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 0.5rem + 2vw, 2rem);
}
.page { padding-block: clamp(1.75rem, 1rem + 3vw, 3.25rem); }

/* =========================================================================
   Responsive images — srcset / sizes MAP   (read before changing any width)
   -------------------------------------------------------------------------
   The srcset "rungs" and the `sizes` hint live in the TEMPLATES, not here —
   see $content->cachedImageSrcset([...]) and the sizes="..." attribute in each
   .html file. `sizes` must mirror the display width the CSS below produces:
   change a max-width / padding / breakpoint here and you MUST recompute `sizes`
   (and revisit the rungs) in the listed template(s), or the browser fetches a
   too-small (blurry) or too-large (wasteful) image.

   Layout inputs the maths is derived from (all defined elsewhere in this file):
     --container ........ 1140px          max content width
     .container ......... padding-inline  clamp(1rem, .5rem + 2vw, 2rem)
     .article ........... padding         clamp(1.25rem, .8rem + 2vw, 2.5rem)
     phone breakpoint ... max-width: 560px  (figures drop to full width)

   Each governing rule below is tagged  «srcset: NAME»  — search that tag to
   jump between this map and the rule.

   NAME            CSS rule (this file)        template(s)        src / rungs / sizes
   -------------------------------------------------------------------------
   stream-thumb    .figure-left (200px cap)    listView.html      src 200
                                               search.html        rungs [200,400,600,800]
                                                                  sizes (max-width:560px) calc(96vw - 61px), 200px

   child-thumb     .article .figure-left       children.html      src 200
                   (nested, 200px cap)         parent.html        rungs [200,400,600,800]
                                                                  sizes (max-width:560px) calc(92vw - 42px), 200px

   figure-side     .figure-right (40%) and     collection.html        src 640
                   .article > .figure-left     collection-compact.html rungs [320,400,640,800]
                   (40%, the left mirror)      tag.html, download.html (40% of ~996 ≈ 398 → 400 @1x)
                                               article-right.html      sizes (max-width:560px) calc(92vw - 42px), 400px
                                               article-left.html
                                               audio.html

   figure-centre   .figure-centre img (100%)   article.html       src 996
                                               image.html         rungs [400,680,996,1400,1992]
                                               track.html         sizes (min-width:1140px) 996px, calc(92vw - 42px)

   gallery-tile    .gallery-grid               gallery.html       src 400
                   (minmax(220px,1fr), 4/3)                       rungs [260,400,520,800]
                                                                  sizes (min-width:1200px) 251px,
                                                                        (min-width:1008px) calc((96vw - 88px)/4),
                                                                        (min-width:754px)  calc((96vw - 64px)/3),
                                                                        (min-width:500px)  calc((96vw - 40px)/2),
                                                                        calc(96vw - 16px)
   ========================================================================= */

/* =========================================================================
   Header / navigation — boost-style hero over the flamingos photo
   ========================================================================= */
.site-header {
  /* Photo background borrowed from the boost theme, displayed at boost's height
     (45vh) so the image renders at the size it was selected and sized for. */
  /*background: url(../boost/assets/img/flamingos-2.jpg);*/
  background-image: var(--hero-image, url(img/flamingos-2.jpg));
  background-size: cover;
  background-position: center center;
  min-height: 45vh;
  display: flex;
  color: #fff;
  box-shadow: var(--shadow-sm);
}
/* Home page: full-screen hero over boost layoutHome's pink-lake photo, shown at
   100vh with the branding at the top and the rest of the viewport left to the
   image. Only background-image is overridden; size/position come from .site-header. */
.site-header--home {
  min-height: 100vh;
  background-image: url(../boost/assets/img/pink-lake.jpg);
}
/* The hero fills the photo band; nav sits at the top, the branding block
   is vertically centred in the space that remains. */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: .25rem;
  padding-bottom: 2.5rem;
}

/* Top nav row */
.hero-nav {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--gap);
  padding: 0;
}
.hero-home {
  color: #fff; font-family: "Merriweather Sans", sans-serif; font-weight: 400;
  font-size: 1.1rem; text-decoration: none; letter-spacing: .02em;
  padding: .5rem 1rem; border-radius: var(--radius-sm); margin-top: .75rem;
  transition: background-color .15s ease;
}
.hero-home:hover { color: #fff; background: rgba(255,255,255,.14); text-decoration: none; }

.hero-links { display: flex; align-items: center; gap: .25rem; margin-left: auto; margin-top: .75rem; }
.hero-links a {
  color: #fff; font-family: "Merriweather Sans", sans-serif; font-weight: 400;
  font-size: 1.1rem; text-decoration: none;
  padding: .5rem 1rem; border-radius: var(--radius-sm);
  transition: background-color .15s ease;
}
.hero-links a:hover { background: rgba(255,255,255,.14); color: #fff; text-decoration: none; }

/* Branding block: logo beside the title + tagline. Sits just below the nav
   (top-aligned, like boost) rather than centred in the photo band. */
.hero-content {
  display: flex; align-items: center; gap: 1.75rem;
  padding-top: 2rem;
}
.hero-logo { flex-shrink: 0; display: inline-block; }
.hero-logo img { height: 150px; width: auto; display: block; }
/* Nudge the title/tagline block down ~3/4 of an h1 line relative to the logo. */
.hero-branding { margin-top: 3rem; }
.hero-title {
  margin: 0 0 1rem;
  font-family: Merriweather, serif;
  /* Boost's title = .display-4 (themes/boost/assets/css/style.css): base
     calc(1.45rem + 2.4vw), fixed 3.25rem at >=1200px, line-height 1.3.
     But boost also sets html{font-size:1.125rem} at >=992px, so its rems render
     at an 18px root. Artemia's root stays 16px, so below we scale boost's rems by
     1.125 (1.45->1.63125, 3.25->3.65625) at the same breakpoints to match exactly. */
  font-size: calc(1.45rem + 2.4vw);
  font-weight: 300; line-height: 1.3; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.hero-lead {
  margin: 0;
  font-family: "Merriweather Sans", sans-serif;
  /* Boost .lead = 1.25rem at an 18px root (>=992px) = 22.5px; matched below. */
  font-size: 1.25rem; font-weight: 300; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
/* Match boost's 18px root (html{font-size:1.125rem} @ >=992px) by scaling its
   header rems by 1.125, since artemia keeps a 16px root. */
@media (min-width: 992px) {
  /* Nudged down from boost's exact 1.63125rem/3.65625rem to stop the title wrapping. */
  .hero-title { font-size: calc(1.5rem + 2.4vw); }
  .hero-lead  { font-size: 1.40625rem; }
}
@media (min-width: 1200px) {
  .hero-title { font-size: 3.4rem; }
}

/* CSS-only mobile toggle (reused from artemia's no-JS pattern) */
.nav-toggle { display: none; }
.nav-toggle-label {
  display: none; cursor: pointer; margin-left: auto;
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  align-items: center; justify-content: center;
}
.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  content: ""; display: block; width: 22px; height: 2px; background: #fff; position: relative;
  transition: transform .2s ease;
}
.nav-toggle-label span::before { position: absolute; top: -7px; }
.nav-toggle-label span::after  { position: absolute; top: 7px; }

@media (max-width: 800px) {
  .nav-toggle-label { display: inline-flex; }
  .hero-links {
    order: 3; flex-basis: 100%; margin-left: 0;
    flex-direction: column; align-items: stretch; gap: .15rem;
    display: none; padding-bottom: .5rem;
  }
  .nav-toggle:checked ~ .hero-links { display: flex; }
  .hero-links a { padding: .7rem .6rem; }
  /* Keep the logo to the left of the title at all widths, like boost
     (no column stacking on mobile). Pin it to the top and keep it full size
     so a wrapped title doesn't shrink it or push it down. */
  .hero-content { gap: 1rem; align-items: flex-start; }
  /* Drop the desktop title nudge so the logo and title line up at the top
     rather than the logo sitting higher than the text. */
  .hero-branding { margin-top: 0; }
}

/* =========================================================================
   Buttons & forms
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font: inherit; font-weight: 600; line-height: 1.2; cursor: pointer;
  padding: .55rem 1.1rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: var(--coral); color: #fff;
  text-decoration: none; transition: background-color .15s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--coral-700); color: #fff; text-decoration: none; }
.btn-secondary { background: #fff; color: var(--accent-700); border-color: rgba(255,255,255,.6); }
.btn-secondary:hover { background: var(--accent-050); color: var(--accent-700); }
.btn-block { width: 100%; }

label { font-weight: 600; display: inline-block; margin-bottom: .35rem; }
input[type="text"], input[type="search"], input[type="email"],
input[type="password"], input[type="number"], select, textarea {
  width: 100%; font: inherit; color: var(--text);
  padding: .6rem .75rem; border: 1px solid var(--rule); border-radius: var(--radius-sm);
  background: var(--card);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-050); }
.field { margin-bottom: 1rem; }
.input-group { display: flex; }
.input-group input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .input-group-text {
  display: grid; place-items: center; padding: 0 .8rem;
  border: 1px solid var(--rule); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg-tint); color: var(--muted);
}

/* =========================================================================
   Page title & meta
   ========================================================================= */
.page-title {
  text-align: center; margin-bottom: 1.75rem;
  /* Lighter than the base h1 (700): a 600 weight and smaller size read less
     heavy above their own content. */
  font-weight: 600; font-size: clamp(1.6rem, 1.25rem + 1.4vw, 2.15rem);
}
/* "Horizon" rule — a short plum underline beneath the title */
.page-title::after {
  content: ""; display: block; width: 3.5rem; height: 3px; margin: .6rem auto 0;
  background: var(--coral); border-radius: 3px;
}
.article .title::after {
  content: ""; display: block; width: 3.5rem; height: 3px; margin: .55rem 0 0;
  background: var(--coral); border-radius: 3px;
}
.content-info { color: var(--muted); font-size: .92rem; margin-bottom: 1.25rem; }
/* Tags sit on their own line below the meta. Lift the links with weight +
   underline (not size); a small iron-oxide tag icon adds colour without pill bulk.
   Exclude icon links from the underline. */
.content-tags { margin: -.9rem 0 1.25rem; color: var(--muted); }
.content-tags .icon-tag { color: var(--accent); margin-right: .15rem; }
.content-info a:not(.icon-link), .content-tags a {
  color: var(--accent); font-weight: 600;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px;
}
.content-info a:not(.icon-link):hover, .content-tags a:hover { color: var(--accent-700); }
.small { font-size: .92rem; }

/* Type icon next to titles — the link colour signals "clickable", so colour it
   only when it's a link (<a>). A non-linked title renders the icon in a <span>,
   which stays text colour. */
.icon-link { color: var(--text); }
a.icon-link { color: var(--link); }
a.icon-link:hover { color: var(--link-hover); }
.title .icon-link, .title-link { vertical-align: baseline; }
/* The icon font drops every glyph 0.115em onto the body-text baseline; in the
   larger headings that sinks it below the text. Cancel the nudge inside titles. */
.title [class^="icon-"], .title [class*=" icon-"] { top: .06em; }
/* The same 0.115em nudge drops RSS/tag glyphs below the small meta text. They're
   inline-block (vendor `a > [icon]`), so vertical-align:middle sinks them — pin
   to the baseline and lift slightly to sit on the line. */
.content-info [class^="icon-"], .content-info [class*=" icon-"],
.content-tags [class^="icon-"], .content-tags [class*=" icon-"] {
  top: .02em; vertical-align: baseline;
}

/* =========================================================================
   Stream (teaser list — listView / search results)
   ========================================================================= */
.stream { display: flex; flex-direction: column; }
.stream-item {
  position: relative; display: flow-root;   /* contains the floated thumbnail */
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 1.25rem 1.4rem; margin-bottom: 1.1rem; box-shadow: var(--shadow-sm);
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}

/* Gutter label — content type + date pulled into the left gutter on wide
   screens. Hidden when there's no gutter; the same type/date then appears
   inline in .content-info. */
.gutter-label { display: none; }
/* Absolutely positioned into the free space LEFT of the centred content
   (right:100%). That space only exists once (vw - content)/2 exceeds the gutter
   width — ~1480px; showing it earlier overflows and triggers horizontal scroll. */
@media (min-width: 1480px) {
  .gutter-label {
    display: block; position: absolute; right: 100%; top: 1.4rem;
    width: 8.5rem; margin-right: 1.75rem; text-align: right;
  }
  .gutter-label .kind {
    display: block; font-size: .72rem; font-weight: 800; letter-spacing: .14em;
    text-transform: uppercase; color: var(--accent);
  }
  .gutter-label .when { display: block; font-size: .82rem; color: var(--muted); margin-top: .25rem; }
  .gutter-label::after {
    content: ""; display: block; width: 1.75rem; height: 2px; margin: .55rem 0 0 auto;
    background: var(--rule);
  }
  /* Gutter shows the date on wide screens, so drop the redundant inline date
     below the heading. If there's no other info, the line collapses entirely. */
  .stream-item .content-info .meta-date { display: none; }
  .stream-item .content-info .meta-info::before { content: ""; }
  .stream-item .content-info:has(.meta-date):not(:has(.meta-info)) { display: none; }
}
/* Inline meta separator (narrow screens, where the gutter is hidden). */
.content-info .meta-info::before { content: " | "; }
.stream-item:hover { box-shadow: var(--shadow); border-color: var(--rule-strong); }
/* Secondary tier: lighter than the base heading 700 so it harmonises with the
   600-weight h1 page title (and the matching .block titles). */
.stream-item .title { margin-bottom: .35rem; font-size: var(--h3); font-weight: 600; }
.stream-item .teaser { color: var(--text-soft); }
.stream-item .teaser p:last-child { margin-bottom: 0; }
/* .stream is a flex column, so the last item's margin-bottom doesn't collapse —
   it would otherwise add to the gap above the bottom pagination, making it
   larger than the gap below the top pagination. Drop it for parity. */
.stream-item:last-child { margin-bottom: 0; }

/* Floated thumbnails. The max-widths below drive the responsive-image `sizes`
   in the templates — see the srcset MAP at the top; each rule is tagged
   «srcset: NAME». */
figure { margin: 0; }
figure img { border-radius: var(--radius-sm); border: var(--img-border); }
figcaption { color: var(--muted); font-size: .88rem; margin-top: .4rem; }
/* «srcset: stream-thumb» (streams) / «child-thumb» (.article child & parent lists) */
.figure-left  { float: left;  margin: .25rem 1.25rem 1rem 0; max-width: 200px; }
/* «srcset: figure-side» */
.figure-right { float: right; margin: .25rem 0 1rem 1.25rem; max-width: 40%; }
/* A left-floated article body image mirrors .figure-right at 40%, not the 200px
   thumbnail cap. .figure-left is otherwise the stream/child-list thumbnail
   (nested deeper, not a direct .article child), so widen only the direct child.
   «srcset: figure-side» (shares the right mirror's rungs/sizes). */
.article > .figure-left { max-width: 40%; }
/* «srcset: figure-centre» */
.figure-centre { margin: 1.25rem auto; }
.figure-centre img { width: 100%; }

@media (max-width: 560px) {
  /* Nudge body text up a touch more on phones. */
  body { font-size: 1.1875rem; }
  /* Phone full-width branch of every figure `sizes` (the "(max-width:560px) …"
     clause). Move this breakpoint and you must update that clause in every
     figure template — see the srcset map. */
  .figure-left, .figure-right { float: none; margin: 0 0 1rem; max-width: 100%; }
  /* Match the .article > .figure-left specificity above so the body image also
     goes full width on phones. */
  .article > .figure-left { max-width: 100%; }
  .figure-left img, .figure-right img { width: 100%; }
}

/* =========================================================================
   Single article / collection prose
   ========================================================================= */
.article { position: relative; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: clamp(1.25rem, 0.8rem + 2vw, 2.5rem); box-shadow: var(--shadow); }
.article .title { font-size: var(--h2); font-weight: 600; text-align: left; }
/* Inline prose links: the plain lagoon colour is hard to spot in body text, so
   add a standing underline and a stronger weight. */
.description a, .teaser a {
  color: var(--link); font-weight: 600;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px;
}
.description a:hover, .teaser a:hover { color: var(--link-hover); }
.description img { border-radius: var(--radius-sm); border: var(--img-border); margin: 1rem 0; }
.description h2, .description h3 { margin-top: 1.6rem; }
/* Clearfix (not flow-root): the body text must wrap around a preceding sibling
   thumbnail (.figure-right/-left in article-right/-left.html). flow-root would
   make .description a BFC, which refuses to overlap that float and drops into a
   column beside it. The pseudo-element only contains .description's own internal
   floats (body images), leaving the external wrap intact. */
.description::after { content: ""; display: table; clear: both; }
.rights { font-style: italic; color: var(--muted); }
.media a { font-weight: 600; }

/* tag pills */
.tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag-pill {
  display: inline-block; padding: .22rem .7rem; background: var(--accent-050); color: var(--accent-700);
  border-radius: 999px; font-size: .85rem; font-weight: 600; text-decoration: none;
}
.tag-pill:hover { background: var(--coral); color: #fff; text-decoration: none; }

/* Prose lists in teasers/descriptions. A teaser wraps beside a floated
   thumbnail, so a plain list would start behind the float and strand its outside
   markers. `display: flow-root` gives each list its own BFC, so it sits in the
   text column beside the float and the markers hang correctly. Harmless where
   there's no float (descriptions). */
.teaser ul, .teaser ol,
.description ul, .description ol {
  display: flow-root;
  margin: 0 0 1rem; padding-left: 1.5rem;
  list-style-position: outside;
}
.teaser li, .description li { margin-bottom: .25rem; }

/* Related / parent / children */
.related, .collection-children {
  margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--rule);
  /* flow-root contains a floated thumbnail so a tall image / short teaser
     doesn't spill past the block's bottom edge. */
  display: flow-root;
}
/* Parent / child titles share the stream teaser heading (var(--h3), weight 600);
   placed after `.article .title` so it wins on source order at equal specificity. */
.related .title, .collection-children .title { font-size: var(--h3); font-weight: 600; margin-bottom: .35rem; }
.child-item { padding: 1rem 0; border-bottom: 1px solid var(--rule); display: flow-root; }
.child-item:last-child { border-bottom: 0; }

/* =========================================================================
   Gallery (CSS grid)
   ========================================================================= */
/* «srcset: gallery-tile» — the minmax() track width, the --gap, the container
   padding and the 4/3 aspect-ratio all feed gallery.html's `sizes` breakpoints;
   change any of them and recompute that sizes string. See the srcset map. */
.gallery-grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.gallery-grid a { display: block; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-sm);
  background: var(--card); aspect-ratio: 4 / 3; }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.gallery-grid a:hover img { transform: scale(1.04); }

/* =========================================================================
   Featured content block (CSS grid of card tiles)
   ========================================================================= */
.featured-content { padding-top: clamp(1.75rem, 1rem + 3vw, 3.25rem); padding-bottom: 0; }
.featured-content .featured-title { text-align: center; margin: 0 0 1rem; font-size: var(--h2) !important; font-weight: 600; }
/* Lead paragraph under the section title (boost .lead, centred). */
/* Boost .lead = 1.25rem at its 18px root (>=992px) = 22.5px; matched here with
   1.40625rem, and darkened from --muted to --text-soft for legibility. */
.featured-content .featured-intro { text-align: center; max-width: 46rem; margin: 0 auto 2.5rem; color: var(--text-soft); font-size: 1.40625rem; font-weight: 300; }
.featured-grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.featured-card { display: flex; flex-direction: column; }
/* Printed-photo framing: white mat, thin stroke, soft shadow that lifts on
   hover (slow, eased). */
.featured-thumb {
  display: block; overflow: hidden;
  background: #fff; padding: 8px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(17, 45, 70, .14);
  transition: box-shadow .25s ease, transform .25s ease;
}
.featured-thumb img { width: 100%; height: auto; display: block; }
/* Crop an odd-sized (e.g. landscape) source image to the 3:2 shape the other
   card photos share, keeping the top and trimming the bottom, so it doesn't
   throw out the grid. */
.featured-thumb--crop img { aspect-ratio: 3 / 2; height: auto; object-fit: cover; object-position: top; }
.featured-card:hover .featured-thumb {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(17, 45, 70, .20);
}
/* The global reduced-motion rule kills all transitions with !important;
   re-enable this one gentle decorative lift. */
@media (prefers-reduced-motion: reduce) {
  .featured-thumb { transition: box-shadow .25s ease, transform .25s ease !important; }
}
.featured-card h3 { font-size: 1.15rem; margin: .9rem 0 .4rem; }
.featured-card h3 a { color: var(--link); text-decoration: none; }
.featured-card h3 a:hover { color: var(--link-hover); }
.featured-card p { margin: 0; color: var(--text-soft); }
/* Both blocks carry their own full-width layout, so strip the standard .block
   card chrome (background, border, accent bar, shadow, padding) when wrapping
   one — the featured-video player then sits seamlessly on the page. */
.block:has(.featured-content), .block:has(.featured-video) {
  background: none; border: none; border-radius: 0; box-shadow: none; padding: 0;
}

/* =========================================================================
   Centre blocks (layout regions)
   ========================================================================= */
.block-region { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-bottom: 2rem; }
/* When a block region is the last thing on the page (no pagination to space it
   off), add a top margin so it doesn't rub against the main content. */
.page > .container:last-child > .block-region { margin-top: 1.25rem; }
.block {
  background: var(--card); border: 1px solid var(--rule); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 1.1rem 1.3rem; box-shadow: var(--shadow-sm);
}
/* Block titles arrive from shared templates at mixed levels (Spotlight/
   Featured-video <h2>; Recent-content/HTML <h3>). Normalise both to the
   content-stream tier — var(--h3)/600 — so the home page reads as one h1 over a
   uniform secondary tier; card chrome (border + accent bar), not title size,
   sets a block apart. Applies wherever the block sits. Linked titles (Spotlight)
   take the link colour like stream titles; unlinked ones stay text colour. */
.block :is(h2, h3) {
  font-size: var(--h3); font-weight: 600; line-height: 1.25;
  margin: 0 0 .6rem; letter-spacing: -.005em; color: var(--text);
}
.block :is(h2, h3) a { color: var(--link); text-decoration: none; }
.block :is(h2, h3) a:hover { color: var(--link-hover); text-decoration: underline; }
.block ul { margin: 0; padding-left: 1.1rem; }
.block li { margin-bottom: .35rem; }

/* =========================================================================
   Filters & select bar
   ========================================================================= */
.select-filters { max-width: 22rem; margin: 0 auto 1.75rem; }

/* Expert directory: centred intro, A–Z index + filter grid (expertListView.html). */
.expert-directory { text-align: center; }
.expert-directory .description { max-width: 46rem; margin-left: auto; margin-right: auto; }

/* A–Z index: ~1/3 of the viewport, centred, so the letters wrap onto more lines
   as the viewport narrows. A min-width keeps it usable on small screens. */
.alpha-index {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: .3rem .55rem; width: 33vw; min-width: 15rem; max-width: 100%;
  margin: 0 auto 1.75rem; font-weight: 600;
}
}
.alpha-index a { text-decoration: none; }
.alpha-index a:hover { text-decoration: underline; }
.alpha-index .is-empty { color: var(--muted); }

/* Filter panel: centred, two rows on wide screens (region/country/sector/business,
   then innovation/search/button); a single stacked column below 768px. */
.expert-filters {
  display: grid; gap: 1rem; align-items: end;
  grid-template-columns: repeat(12, 1fr);
  max-width: 60rem; margin: 0 auto 1.75rem;
}
.expert-filters .field { margin-bottom: 0; grid-column: span 12; }
/* Match the Search button's height to the select boxes: stretch its cell to the
   row height and let the flex-child button fill it. */
.expert-filters .filter-submit { align-self: stretch; display: flex; }
.expert-filters .filter-submit .btn { width: 100%; }
@media (min-width: 768px) {
  .expert-filters .field { grid-column: span 3; }
  .expert-filters .filter-innovation,
  .expert-filters .filter-search,
  .expert-filters .filter-submit { grid-column: span 4; }
}

/* =========================================================================
   Pagination  (markup from themes/artemia/pagination.html)
   ========================================================================= */
.pagination { display: flex; flex-wrap: wrap; gap: .3rem; padding: 0; margin: 1.25rem 0; justify-content: flex-end; }
.page-link {
  display: block; padding: .45rem .8rem; border: 1px solid var(--rule); border-radius: var(--radius-sm);
  color: var(--accent-700); background: var(--card); text-decoration: none; font-weight: 600; line-height: 1;
}
.page-link:hover { background: var(--accent-050); text-decoration: none; }
.page-link.is-current { background: var(--coral); border-color: var(--coral); color: #fff; }

/* =========================================================================
   Alerts (webauthn login etc.)
   ========================================================================= */
.alert { padding: 1rem 1.2rem; border-radius: var(--radius-sm); border: 1px solid var(--rule); margin-bottom: 1rem; }
.alert-info { background: var(--accent-050); border-color: #f1d0c7; color: var(--accent-700); }
.alert-success { background: #e4f3ec; border-color: #b7ddc7; color: #1c6b42; }

/* =========================================================================
   Media: audio / video
   ========================================================================= */
.video-player { margin: 1.5rem 0; }
.ratio { position: relative; width: 100%; background: #000; border-radius: var(--radius); overflow: hidden; }
.ratio-16x9 { aspect-ratio: 16 / 9; }
.ratio-4x3  { aspect-ratio: 4 / 3; }
.ratio-1x1  { aspect-ratio: 1 / 1; }
.ratio-21x9 { aspect-ratio: 21 / 9; }
.ratio iframe, .ratio video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-player video { width: 100%; height: auto; border-radius: var(--radius); background: #000; }
.audio-player { margin: 1.5rem 0; }
audio { width: 100%; margin: 1.5rem 0; }
video { max-width: 100%; height: auto; }

/* Track map */
.map-responsive { margin: 1.5rem 0; }
.map-responsive #map { width: 100%; height: 420px; border-radius: var(--radius); }

/* =========================================================================
   Cards, tables & narrow forms (login / register / search)
   ========================================================================= */
.card {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: clamp(1.1rem, 0.8rem + 1vw, 1.6rem); box-shadow: var(--shadow-sm); margin-bottom: 1.5rem;
}
.card h3 { margin-top: 0; color: var(--accent-700); }
.form-narrow, .search-form { max-width: 22rem; margin: 0 auto; }
.search-form { margin-bottom: 2rem; }
.form-text { display: block; color: var(--muted); font-size: .88rem; margin-top: .35rem; }
.mt-3 { margin-top: 1rem; }

.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--rule); }
.table thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.table tbody tr:hover { background: var(--bg-tint); }

.btn-sm { padding: .35rem .7rem; font-size: .88rem; }
/* Danger reads as the brine red, not the blue counter-accent. */
.btn-danger { background: var(--accent); color: #fff; }
.btn-danger:hover { background: var(--accent-700); color: #fff; }

/* =========================================================================
   Footer
   ========================================================================= */
/* The footer is a flat iron-oxide band. */
.site-footer {
  position: relative;
  margin-top: 1rem;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-700) 100%);
  color: #d6edef;
}
.site-footer .container { padding-top: 3.75rem; padding-bottom: 2rem; }
.site-footer a { color: #fff; text-decoration: underline; }
.site-footer a:hover { color: #fff; }

/* Four-column footer: logo + social, then three link columns; the first gets a
   little more room for the logo. */
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.25rem;
}
.footer-brand { display: flex; flex-direction: row; align-items: flex-start; gap: 1rem; }
.footer-logo { display: inline-block; flex-shrink: 0; }
/* Site name beside the logo; wraps within the column rather than overflowing it. */
.footer-brand-name {
  min-width: 0; font-family: var(--font-heading); font-weight: 600;
  font-size: 1.15rem; line-height: 1.25; color: #fff;
}
.footer-logo img { height: 150px; width: auto; }
.footer-social { display: flex; align-items: center; gap: 1rem; }
.footer-social a { color: #d6edef; text-decoration: none; line-height: 0; }
.footer-social a:hover { color: #fff; }
.footer-social [class^="icon-"] { font-size: 1.4rem; }
/* Facebook is an inline SVG (the bundle lacks a square tile). The font tiles ink
   only ~0.875em of their 1.4rem box, so size the full-bleed SVG to that height
   to match. */
.footer-social .social-svg {
  width: 1.22rem; height: 1.22rem; fill: currentColor; display: block;
  /* Font glyphs ink slightly below box centre, so align-items:center leaves the
     SVG riding high — drop it to match. */
  position: relative; top: 0.18em;
}
/* The icon font hard-codes the YouTube glyph red; override to match the set. */
.footer-social .icon-youtube:before { color: inherit; }

.footer-title {
  margin: 0 0 .9rem; color: #fff;
  font-size: 1rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
}
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: .5rem; }
.footer-links a { color: #d6edef; text-decoration: none; font-size: .95rem; }
.footer-links a:hover { color: #fff; text-decoration: underline; }

/* Drop the org name once the columns narrow enough that it would overlap the
   Connect column — this starts while the footer is still 4-column, so hide it
   here rather than waiting for the 2-column breakpoint. The logo alone fits. */
@media (max-width: 992px) {
  .footer-brand-name { display: none; }
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.75rem 2rem; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  /* Single full-width column again — the name has room, so bring it back. */
  .footer-brand-name { display: inline; }
}

.copyright { margin: 0; font-size: .92rem; }

/* =========================================================================
   Utilities
   ========================================================================= */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

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

/* =========================================================================
   Dark mode — "night over the salt lake"
   Driven by [data-theme="dark"] on <html>, set by tide-init.js before first
   paint from the saved choice, falling back to OS preference (no JS = light).
   Header and footer keep their brine-red brand colour in both schemes, so
   --accent / --accent-700 keep their values; we only re-tint the page surfaces
   and the accent-as-text-on-card (links and meta lift to a lighter coral
   to stay legible on dark cards). The sky-blue --coral is vivid enough on a
   dark surface to keep its value (buttons, rules, pagination).
   ========================================================================= */
:root[data-theme="dark"] {
  --bg:          #0d1922;
  --bg-tint:     #122533;
  --card:        #15232f;
  --text:        #e7eff4;
  --text-soft:   #c3d3de;
  --muted:       #8ca3b2;
  --rule:        #243845;
  --rule-strong: #365162;
  --accent-050:  #2c1611;
  --link:        #ef957f;
  --link-hover:  #f3ac99;
  --shadow:    0 1px 2px rgba(0,0,0,.45), 0 6px 18px rgba(0,0,0,.45);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.45);
}

/* Brine red used as text on a dark card — lift to a lighter coral so it stays
   legible (the --accent token itself can't move: it also paints the header/
   footer band). */
:root[data-theme="dark"] :is(.card h3, .page-link, .tag-pill,
  .alert-info, .gutter-label .kind, .content-info a:not(.icon-link), .content-tags a) {
  color: #ef957f;
}
:root[data-theme="dark"] :is(.content-info a:not(.icon-link):hover, .content-tags a:hover) { color: #f3ac99; }

/* The white header search button keeps dark brine-red text on its white face;
   only its hover (which fills with the dark brine-red wash) flips to light text. */
:root[data-theme="dark"] .btn-secondary { color: var(--accent-700); }
:root[data-theme="dark"] .btn-secondary:hover { color: #f7dcd3; }

/* Re-tint the light, hard-coded alert greens for the dark surface. */
:root[data-theme="dark"] .alert-success { background: #14302a; border-color: #2c5a44; color: #8fe0b3; }

/* Soften image hairlines, which were tuned for light cards. */
:root[data-theme="dark"] :is(figure img, .description img) { border-color: rgba(255,255,255,.14); }

/* =========================================================================
   Theme toggle (header) — moon in light mode (= switch to dark), sun in dark.
   Hidden until tide-init.js adds .js to <html>, so it never shows as a dead
   control when scripting is unavailable.
   ========================================================================= */
.theme-toggle { display: none; }
:root.js .theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; cursor: pointer; color: #dff0f1;
  padding: .45rem .7rem; border-radius: var(--radius-sm);
  transition: background-color .15s ease, color .15s ease;
}
.theme-toggle:hover { background: rgba(255,255,255,.14); color: #fff; }
/* Bootstrap Icons, solid fill (toggle + gallery + RSS) share one box so the
   header set reads as a single family. */
.nav-links svg {
  width: 1.15rem; height: 1.15rem; display: block;
  fill: currentColor; stroke: none;
}
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
