/* uaclub.org.uk — components
 * Buttons · links · cards · event card + status badges · forms ·
 * header/nav · branch sub-nav · footer · photo block · pull-quote ·
 * stats · logo grid · hours · timetable
 */

/* =============== Buttons =============== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 48px; padding: var(--space-3) var(--space-5);
  font-family: var(--font-ui); font-size: 17px; font-weight: 600; line-height: 1.2;
  border: 2px solid var(--brand); border-radius: var(--radius-button);
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn--primary { background: var(--brand); color: var(--ink-inverse); }
.btn--primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--ink-inverse); }
.btn--secondary { background: transparent; color: var(--brand); }
.btn--secondary:hover { background: var(--surface-quiet); color: var(--brand-strong); }
.btn--block { width: 100%; }
.btn svg { width: 1.2em; height: 1.2em; flex: none; }

/* Gold is only ever legible on a deep-blue ground. */
.band--deep .btn--primary,
.hero__body .btn--primary { background: var(--accent); border-color: var(--accent); color: var(--brand-strong); }
.band--deep .btn--primary:hover,
.hero__body .btn--primary:hover { background: #F5D547; border-color: #F5D547; color: var(--brand-strong); }
.band--deep .btn--secondary,
.hero__body .btn--secondary { color: var(--ink-inverse); border-color: rgba(250, 246, 238, .6); background: transparent; }
.band--deep .btn--secondary:hover,
.hero__body .btn--secondary:hover { background: rgba(250, 246, 238, .14); color: var(--ink-inverse); }

.link-action {
  font-family: var(--font-ui); font-size: 16.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 48px; white-space: nowrap;
}

/* The eyebrow heading on a door card. The prototype writes these as a long inline style repeated
 * on every card; one class says the same thing and cannot drift between three copies. */
.door__label {
  color: var(--accent); font-family: var(--font-ui); font-size: var(--text-overline);
  font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
  margin-bottom: var(--space-2);
}

/* Door cards sit in a grid of equal-height columns, so their calls to action should line up even
 * when one card's text runs to three lines and another's to two. */
.grid--3 > div:has(> .door__label) { display: flex; flex-direction: column; align-items: flex-start; }
.grid--3 > div:has(> .door__label) > .link-action { margin-top: auto; }

/* A link-action on a band--deep, where the default ink would sink into the background. */
.link-action--inverse { color: var(--ink-inverse); }
.link-action--inverse:hover { color: var(--accent); }

/* Two of these in a row read as one run-on link: they are inline-flex, so the single space between
 * them collapses to almost nothing next to the arrow. */
.link-action + .link-action { margin-left: var(--space-5); }

/* The design's `nowrap` keeps the arrow beside the last word, which is right when the label is
 * "What's on". Ukrainian labels run to a full sentence, and a sentence that cannot wrap is a page
 * that scrolls sideways. On a phone, legibility wins over the tidy arrow. */
@media (max-width: 899px) {
  .link-action { white-space: normal; }
}

/* =============== The two flags ===============
 * Ukraine and Scotland, the same size, neither in front. They sit inline with an overline, so the
 * height follows the type rather than a fixed pixel value.
 */
.flags { display: inline-flex; gap: .45em; vertical-align: -0.12em; margin-right: .6em; }
.flags__flag {
  width: 1.5em; height: auto; display: block;
  border-radius: 2px;
}
/* No outline. A 1px light ring read as a thick white frame at this size, and on the saltire it ran
 * into the arms of the cross where they meet the corners. Both flags carry enough of their own
 * colour to sit on any background here without help. */

/* Larger, on its own line — the footer identity block. */
.flags--block { display: flex; margin: 0 0 var(--space-3); }
.flags--block .flags__flag { width: 30px; }

/* =============== Status badges ===============
 * Never colour alone: every badge carries a word and an icon.
 */
.badge {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-ui); font-size: 13px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-badge);
}
.badge svg { width: 14px; height: 14px; flex: none; }
.badge--open    { color: var(--state-open);    background: var(--state-open-wash); }
.badge--planned { color: var(--state-planned); background: var(--accent-wash); }
.badge--closed  { color: var(--state-closed);  background: var(--state-closed-wash); }
.badge--sm { font-size: 11.5px; padding: var(--space-1) var(--space-2); }
.badge--sm svg { width: 11px; height: 11px; }

/* =============== Cards =============== */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); overflow: hidden;
  display: flex; flex-direction: column;
}
.card__media { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }

/* A card's call to action, pinned to its foot.
 *
 * Cards in a grid already stretch to the tallest of them, so two side by side with a long blurb and
 * a short one put their buttons at different heights — the eye reads that as two unrelated things
 * rather than a pair. `margin-top: auto` in the card's existing flex column takes up whatever slack
 * there is, so the buttons land on the same line whatever the text does.
 *
 * A class rather than `:has(> .btn--block)`: the selector would be neater, and Gecko is the one
 * engine this project cannot currently test (see TESTING.md). Two explicit markup changes beat an
 * elegant rule nobody can verify.
 *
 * The padding is here rather than inline for the same reason `margin-top` has to be — an inline
 * `margin-top` would outrank the `auto` and quietly undo the whole thing. */
.card__foot { margin-top: auto; padding-top: var(--space-4); margin-bottom: 0; }

/* News & stories index — a compact list. A small fixed-size thumbnail sits beside the date, title
 * and standfirst, so the photographs never dominate the page (they used to render full-width at
 * natural height, which was enormous on one column). */
/* News & stories index — each post is a horizontal card: a full-height photo panel on the left and
 * the date, title and standfirst on the right, so nothing floats and the image never dominates. */
.story-list { max-width: 820px; }
.story-list .wp-block-post-template { display: flex; flex-direction: column; gap: var(--space-5); margin: 0; }
.story-list .wp-block-post { min-width: 0; }

.story-row {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  align-items: stretch;
  min-width: 0;
  min-height: 210px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
@media (hover: hover) {
  .story-row:hover { border-color: var(--brand); box-shadow: 0 12px 28px rgba(26, 26, 24, .12); transform: translateY(-2px); }
  .story-row:hover .story-row__title a { color: var(--brand-link); }
  .story-row:hover .story-row__media img { transform: scale(1.04); }
}
/* The photo fills the panel: absolutely positioned so it never dictates the card's height — the
 * card is as tall as the text (with a minimum), and the image covers whatever height that is. */
.story-row__media { position: relative; margin: 0; align-self: stretch; overflow: hidden; background: var(--surface-quiet); }
.story-row__media a { position: absolute; inset: 0; display: block; }
.story-row__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.story-row__body { padding: var(--space-5) var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); align-self: center; min-width: 0; }
.story-row__body > * { margin: 0; }
.story-row__date { font-family: var(--font-ui); font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--thread-red); }
.story-row__title { font-family: var(--font-voice); font-size: 24px; line-height: 1.2; font-weight: 700; }
.story-row__title a { color: var(--brand-strong); text-decoration: none; }
@media (prefers-color-scheme: dark) { .story-row__title a { color: var(--ink); } }
.story-row__title a:hover { text-decoration: underline; }
.story-row .wp-block-post-excerpt, .story-row .wp-block-post-excerpt p { margin: 0; color: var(--ink-soft); font-size: 16px; line-height: 1.55; }
/* Keep every card's excerpt to three lines, so the cards stay even. */
.story-row .wp-block-post-excerpt p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }

/* Stack on a phone: photo on top, text below. */
@media (max-width: 560px) {
  .story-row { grid-template-columns: 1fr; min-height: 0; }
  .story-row__media { height: 190px; align-self: stretch; }
  .story-row__body { align-self: start; padding: var(--space-4) var(--space-5) var(--space-5); }
  .story-row__title { font-size: 20px; }
}
.card__body { padding: var(--space-4) var(--space-5) var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); flex: 1; }
.card__body > * { margin: 0; }
.card__title { font-size: 21px; line-height: 1.25; font-weight: 700; }
.card__title .sub { display: block; font-size: 17px; font-weight: 500; color: var(--ink-soft); }
.card p { color: var(--ink-soft); font-size: 16.5px; line-height: 1.6; }
.card--flat { background: transparent; border: 0; }

/* =============== Donate page =============== */
/* Give online is the primary action: a wider, lifted card, with the other ways to give stacked
 * beside it so no card is left half-empty. Single column on a phone. */
.donate-layout { display: grid; gap: var(--space-6); margin-top: var(--space-6); }
@media (min-width: 860px) { .donate-layout { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.donate-more { display: grid; gap: var(--space-6); }
.card--primary { border-color: var(--brand); box-shadow: 0 10px 28px rgba(26, 26, 24, .10); }

/* Compact list row used for "coming up" strips and sub-page indexes */
.row-card {
  display: flex; gap: var(--space-4); align-items: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: var(--space-3) var(--space-4);
  text-decoration: none; color: inherit;
}
.row-card:hover { border-color: var(--brand); color: inherit; }
.row-card img { width: 84px; height: 84px; object-fit: cover; border-radius: var(--radius-input); flex: none; }
/* Branch index — a branch's rooms and classes as a two-column card grid, each with a round icon. */
.branch-index { display: grid; gap: var(--space-4); }
@media (min-width: 700px) { .branch-index { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.row-card__ico {
  width: 42px; height: 42px; flex: none; border-radius: 999px;
  display: grid; place-items: center; background: var(--accent-wash); color: var(--brand);
}
.row-card__ico svg { width: 21px; height: 21px; }
.row-card__body { min-width: 0; flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); }
.row-card__title { font-family: var(--font-voice); font-size: 18px; font-weight: 700; line-height: 1.25; color: var(--brand-strong); }
@media (prefers-color-scheme: dark) { .row-card__title { color: var(--ink); } }
.row-card__arrow { font-size: 22px; color: var(--brand-link); flex: none; }

/* =============== Event card =============== */
.event-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; display: flex; flex-direction: column; }
.event-card img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
/* The stand-in for an event with no photograph yet: same 3:2 block, so the cards in a row keep
 * their dates, titles and buttons on the same lines as each other. */
.card-thumb--empty {
  aspect-ratio: 3 / 2; width: 100%;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(-45deg,
    var(--line) 0 1px,
    transparent 1px 10px);
}
.event-card--past img { filter: saturate(.55) brightness(.96); }
.event-card__body { padding: var(--space-4) var(--space-5) var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); flex: 1; }
.event-card__body > * { margin: 0; }
.event-card__when { font-family: var(--font-ui); font-size: 15px; font-weight: 600; color: var(--ink-soft); }
.event-card__title { font-size: 21px; line-height: 1.25; font-weight: 700; }
.event-card__title .sub { display: block; font-size: 17px; font-weight: 500; color: var(--ink-soft); }
.event-card p { flex: 1; font-size: 16.5px; line-height: 1.6; color: var(--ink-soft); }

/* The photograph on a card, now a link. `display: block` so the anchor is exactly the size of the
 * image and not a text-baseline box a few pixels taller, which would show as a hairline under the
 * picture inside a card with `overflow: hidden`. */
.card-thumb { display: block; }

/* =============== Photo block =============== */
figure { margin: 0; }
.photo img { width: 100%; border-radius: var(--radius-card); }
.photo--hero img { border-radius: 0; }

/* A lead photograph is landscape, whatever shape the file is.
 *
 * Without this the featured image renders at its own proportions, so a portrait photograph opened
 * a page with a 944px-tall picture and pushed the words that explain it off the screen — a phone
 * camera's 3:4 is simply not a page-opening shape. Lead images are cropped to the site's own 3:2,
 * which is what `.ratio-32` already does everywhere a ratio was set by hand.
 *
 * Scoped to the lead slot, not to `.photo` generally. A blanket `.photo > img` rule was tried first
 * and flattened the partners feature, whose photograph is 3:4 on purpose — a portrait frame beside
 * a column of text, which is a design decision and not an accident of the file. Anything already
 * carrying a `ratio-*` class asked for its shape too, so it is left alone. */
/* Stacked on a phone the photograph goes first and the card follows it. In the markup the card
 * comes first, which is right for reading order and right for the two-column layout — but on a
 * phone it put 500px of facts between the title and any picture of the thing. */
.event-layout--aside-right > aside { order: 2; }

.photo.wp-block-post-featured-image > img:not([class*="ratio-"]),
.photo--lead > img:not([class*="ratio-"]) {
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

/* A lead image that spans the full content column is a banner, not a photograph in a column.
 *
 * 3:2 across 1116px is 744 pixels tall — the event page opened with a bowl of borscht the height of
 * a laptop screen and pushed its own title, date and booking button below the fold. At 21:9 the same
 * width is 478px, which is a lead image rather than a poster.
 *
 * Only the full-width wrap. `.wrap--narrow` is 780px, where 3:2 is 520px and already right, and the
 * class page's lead sits inside a grid column and has its own ratio. Below the two-column
 * breakpoint everything stacks and 21:9 would be a 160px letterbox, so it stays 3:2 there.
 */
@media (min-width: 900px) {
  .wrap:not(.wrap--narrow) > .photo.wp-block-post-featured-image > img:not([class*="ratio-"]) {
    aspect-ratio: 21 / 9;
  }
}

/* Beside a card, shorter still — but only while there is a card beside it. 3:2 is right for a
 * photograph that leads a page on its own; next to a 700px column of facts it was taller than it
 * needed to be, so in the two-column layout it is 2:1, about three quarters of the height. Below
 * that breakpoint the columns stack, nothing is beside it, and a 2:1 crop of a phone photograph is
 * a 170px band — so it goes back to 3:2. */
@media (min-width: 900px) {
  .event-layout .photo.wp-block-post-featured-image > img:not([class*="ratio-"]) {
    aspect-ratio: 2 / 1;
  }
}
.photo figcaption { margin-top: var(--space-3); font-family: var(--font-ui); font-size: var(--text-caption); line-height: 1.5; color: var(--ink-soft); }
.photo figcaption .credit { display: block; font-weight: 600; letter-spacing: .02em; }
.ratio-45 { aspect-ratio: 4 / 5; object-fit: cover; }
.ratio-32 { aspect-ratio: 3 / 2; object-fit: cover; }
.ratio-219 { aspect-ratio: 21 / 9; object-fit: cover; }

/* Text over a photograph: a scrim, never an opacity wash.
 * The gradient is >=.78 across the whole band where text sits. */
.scrim-figure { position: relative; display: flex; align-items: flex-end; overflow: hidden; }
.scrim-figure > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Rotating hero background: several images stacked, one shown at a time (site.js picks one at
 * random and crossfades it in). The layer is oversized (inset:-8%) so pointer/scroll parallax can
 * move it without exposing an edge — the figure's overflow:hidden clips the overscan. */
.hero-bg { position: absolute; inset: -8%; overflow: hidden; }
.hero-bg__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 30%;
  opacity: 0; transition: opacity .8s ease;
}
.hero-bg__img.is-active { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .hero-bg__img { transition: none; } }

/* A slow horizontal pan across the panorama — left to right and back, on a loop. `alternate`
 * reverses the direction smoothly at each end; the scale gives the translate room to move without
 * exposing an edge. The pointer/scroll parallax (site.js) rides on the parent .hero-bg, so the two
 * motions compose rather than fight. Held still under reduced-motion. */
@keyframes hero-pan {
  from { transform: scale(1.2) translateX(-8%); }
  to   { transform: scale(1.2) translateX(8%); }
}
@media (prefers-reduced-motion: no-preference) {
  .hero-bg--pan .hero-bg__img.is-active {
    animation: hero-pan 60s ease-in-out infinite alternate;
    will-change: transform;
  }
}

/* The last word of the hero heading types itself over between Greenock / Inverclyde / Scotland.
 * It stays the same colour as the rest of the heading; the caret is the only cue that it is live.
 * A screen reader gets the stable "…heart of Greenock" from the sr-only twin instead. The caret
 * only appears once JS is driving it (.is-live), so with no JS or under reduced-motion the word
 * simply sits still. */
/* A hidden sizer (the longest word) holds the space, and the animated word is overlaid on top, so
 * the heading never re-wraps and nothing below it jumps as the word types and erases. */
.hero-rewrite { position: relative; display: inline-block; white-space: nowrap; margin-left: 0.15em; }
.hero-rewrite__sizer { visibility: hidden; }
.hero-rewrite__anim { position: absolute; left: 0; top: 0; color: inherit; }
.hero-rewrite.is-live .hero-rewrite__anim::after {
  content: ""; display: inline-block;
  width: 2px; height: 0.9em; margin-left: 3px; vertical-align: -0.08em;
  background: currentColor;
  animation: hero-caret 1s steps(1) infinite;
}
@keyframes hero-caret { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
.scrim-figure::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top,
    rgba(7, 34, 47, .94) 0%, rgba(7, 34, 47, .88) 40%,
    rgba(7, 34, 47, .78) 56%, rgba(7, 34, 47, .2) 82%, rgba(7, 34, 47, 0) 100%);
}
.scrim-figure > .scrim-figure__body { position: relative; z-index: 1; color: var(--ink-inverse); padding: var(--space-5) var(--gutter) var(--space-6); width: 100%; }
@media (min-width: 900px) {
  .scrim-figure--wide::after {
    background: linear-gradient(to right,
      rgba(7, 34, 47, .95) 0%, rgba(7, 34, 47, .91) 48%,
      rgba(7, 34, 47, .82) 78%, rgba(7, 34, 47, .30) 93%, rgba(7, 34, 47, .06) 100%);
  }
  .scrim-figure--wide > .scrim-figure__body { max-width: 680px; padding: var(--space-7) var(--space-7); }
}
.scrim-figure__body h1, .scrim-figure__body h2 { color: var(--ink-inverse); }
.scrim-figure__body .lede { color: #E6EBEE; }
.scrim-figure__body .credit { font-family: var(--font-ui); font-size: 14.5px; color: var(--ink-quiet-inv); }

/* =============== Hero =============== */
.hero { aspect-ratio: 4 / 5; max-width: 100%; }
/* The 21/9 desktop crop keeps under half the photograph's height, and centred it cut the gable off
 * at the top — the curve the building is named after, and the two flags with it. Favour the upper
 * part of the frame. The phone crop is nearly the whole image, so it needs no help. */
@media (min-width: 900px) {
  .hero > img { object-position: 50% 22%; }
  .hero .hero-bg__img { object-position: 50% 26%; }
}
/* 21:9 as a floor, not a ceiling.
 *
 * `aspect-ratio` fixes the height, and the hero's contents outgrew it: the gallery, the headline,
 * the lede, the buttons and the credit came to more than 816px, so the credit spilled 25px past
 * the bottom edge — clipped by the figure's `overflow: hidden` — and the buttons were left 15px
 * from the edge instead of the 48px their padding asks for. A min-height in the same proportion
 * keeps the shape when the content is short and lets the box grow when it is not. */
@media (min-width: 900px) {
  .hero { aspect-ratio: auto; min-height: max(440px, min(42.86vw, 900px)); }
}
.hero__body .display, .hero__body h1 { color: var(--ink-inverse); }
.hero__body .lede { color: #E6EBEE; max-width: 44ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-5); }
/* Keep the action row clear of the hero's bottom edge — it was sitting almost on it. */
.hero > .hero__body { padding-bottom: var(--space-8); }

/* =============== Pull-quote (the only home for the watercolour) === */
.pullquote { position: relative; overflow: hidden; border-radius: var(--radius-card); background: var(--paper); border: 1px solid var(--line); padding: var(--space-6) var(--space-5); }
.pullquote::before {
  content: ""; position: absolute; inset: 0; opacity: .16;
  background:
    radial-gradient(60% 70% at 10% 20%, #0569B7 0%, rgba(5,105,183,0) 60%),
    radial-gradient(55% 60% at 90% 25%, #E9C605 0%, rgba(233,198,5,0) 62%),
    radial-gradient(70% 80% at 72% 95%, #0A3449 0%, rgba(10,52,73,0) 58%);
}
.pullquote blockquote { position: relative; margin: 0; font-size: 22px; line-height: 1.5; }
.pullquote .attrib { position: relative; margin: var(--space-3) 0 0; font-family: var(--font-ui); font-size: 14px; color: var(--ink-soft); }

/* The same card on a dark band. It closes the numbers with a sentence in the founder's voice,
 * which is more use there than the quote was as a pale strip of its own between two pale bands. */
.pullquote--inverse {
  background: rgba(250, 246, 238, .07);
  border-color: rgba(250, 246, 238, .22);
}
/* On paper the wash is a faint watercolour; at the same strength over navy it just looks like the
 * image failed to load. Keep a hint of it and let the gold rule carry the accent instead. */
.pullquote--inverse::before { opacity: .12; }
.pullquote--inverse { border-left: 3px solid var(--accent); }
.pullquote--inverse blockquote { font-size: 24px; }
.pullquote--inverse blockquote { color: var(--ink-inverse); }
.pullquote--inverse .attrib { color: var(--ink-quiet-inv); }

/* =============== Header & nav =============== */
.site-header { background: var(--surface-deep); color: var(--ink-inverse); }
/* Full-bleed dark bar. The brand lines up with the page content's left edge — the same column as the
 * breadcrumb "Home" and every page heading — while Log in reaches the right gutter. The left padding
 * resolves to the centred content margin on wide screens and to the plain gutter once the viewport is
 * narrower than the content column. */
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  flex-wrap: wrap;
  min-height: 68px; padding-block: var(--space-3); max-width: none;
  padding-left: max(var(--gutter), calc(50% - var(--page-max) / 2 + var(--gutter)));
  padding-right: var(--gutter);
}
/* On a full-bleed-hero page (the front page) the hero content runs to the page inset, not the
 * article column — so the header brand and Log in line up with that inset instead. */
@media (min-width: 1150px) {
  body.has-fullbleed-hero .site-header .wrap { padding-left: var(--space-7); padding-right: var(--space-7); }
}
.brand { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; color: var(--ink-inverse); }
.brand:hover { color: var(--ink-inverse); }
.brand svg { flex: none; }

/* The mark is cropped from the Club's own logo — the sunflower — rather than drawn to look like
 * it. The drawn version that was here before was an eight-petal rosette that resembled neither the
 * sunflower nor the thistle beside it in the real artwork.
 *
 * The logo exists only as a 440x277 raster, which makes the flower itself 66px. It is displayed at
 * 34, so it holds at 1x and softens on a retina screen; the round crop and the dark surround hide
 * most of that. A vector original would fix it properly. */
.brand__mark {
  flex: none; width: 34px; height: 34px;
  border-radius: 50%;
  display: block;
  box-shadow: 0 0 0 1.5px var(--accent);
}
.brand__name { font-family: var(--font-ui); font-size: 15px; font-weight: 700; line-height: 1.15; }
.brand__name b { color: var(--accent); font-weight: 700; }

.nav-tools { display: flex; align-items: center; gap: var(--space-3); margin-left: auto; }

.lang-switch { display: flex; gap: var(--space-1); }
.lang-switch button {
  font-family: var(--font-ui); font-size: 12px; font-weight: 700; letter-spacing: .05em;
  min-height: 34px; padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-badge); border: 1px solid rgba(250,246,238,.45);
  background: transparent; color: var(--ink-inverse); cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--brand-strong); }
.lang-switch button:hover[aria-pressed="false"] { background: rgba(250,246,238,.14); }

/* Account controls — log in / sign up, at the top-right on desktop. Hidden below the desktop
 * breakpoint, where the header has no room for them and the same links appear in the menu instead. */
.nav-account { display: none; align-items: center; gap: var(--space-2); }
.nav-account__btn {
  font-family: var(--font-ui); font-size: 12.5px; font-weight: 700; letter-spacing: .03em;
  min-height: 34px; padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-badge); border: 1px solid rgba(250,246,238,.45);
  background: transparent; color: var(--ink-inverse); text-decoration: none;
  display: inline-flex; align-items: center; white-space: nowrap;
}
.nav-account__btn--ghost:hover { background: rgba(250,246,238,.14); color: var(--ink-inverse); }
.nav-account__btn--solid { background: var(--accent); border-color: var(--accent); color: var(--brand-strong); }
.nav-account__btn--solid:hover { background: #F5D547; border-color: #F5D547; color: var(--brand-strong); }
/* Who you are signed in as — a chip, matching the height of the buttons beside it so the three
 * controls read as one group. It used to be a bare word floating next to a bordered button, which
 * gave no sign it was a link at all. */
.nav-account__user {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 34px; padding: 3px 12px 3px 4px;
  border-radius: 999px; border: 1px solid rgba(250, 246, 238, .28);
  background: rgba(250, 246, 238, .08);
  text-decoration: none; color: var(--ink-inverse);
  transition: background-color .15s ease, border-color .15s ease;
}
.nav-account__user:hover {
  background: rgba(250, 246, 238, .16); border-color: rgba(250, 246, 238, .55);
  color: var(--ink-inverse);
}
.nav-account__user:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.nav-account__mono {
  flex: none; width: 26px; height: 26px; border-radius: 999px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--brand-strong);
  font-family: var(--font-ui); font-weight: 800; font-size: 12px; line-height: 1;
}
.nav-account__label {
  font-family: var(--font-ui); font-size: 13.5px; font-weight: 600;
  max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; background: transparent; border: 1px solid rgba(250,246,238,.45);
  border-radius: var(--radius-button); color: var(--ink-inverse); cursor: pointer;
}
.menu-toggle svg { width: 24px; height: 24px; }

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a {
  font-family: var(--font-ui); font-size: 15.5px; font-weight: 600;
  color: var(--ink-inverse); text-decoration: none; display: block;
  min-height: 48px; display: flex; align-items: center;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--accent); }

/* Mobile: collapsed panel. Desktop: inline row. */
.site-nav { display: none; }
/* Mobile: the toggle (with the brand and language pills) stays on the first row; opening the menu
 * drops it onto its own full-width row below the bar, instead of squeezing in beside the brand. */
.nav-tools { order: 1; }
.site-nav[data-open="true"] { display: block; order: 2; flex-basis: 100%; width: 100%; margin-top: var(--space-2); }
.site-nav[data-open="true"] ul { display: flex; flex-direction: column; border-top: 1px solid rgba(250,246,238,.22); padding-bottom: var(--space-4); }
.site-nav[data-open="true"] li + li { border-top: 1px solid rgba(250,246,238,.14); }

/* 1150px, not 1000: the full inline nav needs the extra room for the long Ukrainian labels plus the
 * language switcher and Log in on one line. Below it, the tidy hamburger menu takes over. */
@media (min-width: 1150px) {
  .menu-toggle { display: none; }
  /* The tools sit together in the right corner: the language switcher, then Log in beside it. The
   * language switcher (in .nav-tools) carries the auto margin that pushes the whole cluster right,
   * and Log in follows directly after it. */
  .nav-tools { margin-left: auto; order: 0; }
  .nav-account { display: flex; margin-left: 0; }
  .site-nav__account { display: none; }
  /* Back to a single inline row: reset the mobile wrap/order so the menu is not full-width. */
  .site-nav { display: block; order: 0; flex-basis: auto; width: auto; }
  .site-nav[data-open="true"] { flex-basis: auto; width: auto; margin-top: 0; }
  .site-nav ul { display: flex; gap: var(--space-5); align-items: center; }
  .site-nav[data-open="true"] ul { flex-direction: row; border-top: 0; padding-bottom: 0; }
  .site-nav[data-open="true"] li + li { border-top: 0; }
}

.breadcrumb { font-family: var(--font-ui); font-size: 14px; color: var(--ink-soft); padding-top: var(--space-4); }
/* 24px tall, which is WCAG 2.5.8's minimum for anything you have to hit. These were 17px — the
 * bare line box of 14px text — and they are on nearly every page, so it was the most-encountered
 * small target on the site. `inline-block` with a matching line-height grows the hit area without
 * moving the text off its baseline. */
.breadcrumb a { color: var(--brand-link); text-decoration: none; display: inline-block; min-height: 24px; line-height: 24px; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--line-strong); padding-inline: var(--space-1); }

/* =============== Branch sub-nav =============== */
.subnav { font-family: var(--font-ui); }
.subnav__title { font-size: var(--text-overline); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 var(--space-3); }
.subnav ul { list-style: none; margin: 0; padding: 0; }
.subnav li + li { border-top: 1px solid var(--line); }
.subnav a { display: flex; align-items: center; min-height: 48px; font-size: 16.5px; font-weight: 600; color: var(--ink); text-decoration: none; }
.subnav a:hover { color: var(--brand-link); }
.subnav a[aria-current="page"] { color: var(--thread-red); }
.subnav details > summary { list-style: none; cursor: pointer; font-weight: 700; min-height: 48px; display: flex; align-items: center; gap: var(--space-2); }
.subnav details > summary::-webkit-details-marker { display: none; }
@media (min-width: 900px) {
  .subnav details { display: contents; }
  .subnav details > summary { display: none; }

  /* `display: contents` is not enough on its own any more. Chrome now hides a closed <details>
   * through `::details-content { content-visibility: hidden }`, which `display: contents` on the
   * parent does not lift — so on desktop the section navigation was in the DOM, occupying its
   * column, and rendering nothing. The details stays closed because that is what a phone needs;
   * this reveals it where the design promotes it. */
  .subnav details::details-content { content-visibility: visible; block-size: auto; }
}

/* =============== Stats =============== */
.stats { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: var(--space-5) var(--space-4); }

/* The design places the numbers on a light band. On the deep one its white card reads as a hard
 * rectangle and the figure gets lost in it, so on navy the card steps back and the number — in the
 * brand's gold, which exists for exactly this background — does the work. */
/* Cards sized to their content rather than stretched across the container: a 52px numeral in a
 * 280px box left most of each card empty. */
.band--deep .stats { gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
/* At 360px the 160px floor plus the gap tips auto-fit to one column, and four stacked cards is a
 * lot of scrolling for four numbers. Two up. */
@media (max-width: 420px) {
  .band--deep .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* The numbers and the quote below them share a measure, so their right edges line up instead of
 * ending raggedly at two different widths. */
.band--deep .stats,
.band--deep .pullquote--inverse { max-width: 880px; }
.band--deep .stat {
  background: rgba(250, 246, 238, .06);
  border-color: rgba(250, 246, 238, .18);
  padding: var(--space-5) var(--space-5) var(--space-4);
}
.band--deep .stat__n { color: var(--accent); font-size: 52px; letter-spacing: -.01em; }
.band--deep .stat__label { color: var(--ink-quiet-inv); font-size: 15.5px; margin-top: var(--space-3); }
.stat__n { font-family: var(--font-voice); font-size: 38px; font-weight: 700; line-height: 1; color: var(--brand-strong); }
@media (prefers-color-scheme: dark) { .stat__n { color: var(--ink); } }
.stat__label { font-family: var(--font-ui); font-size: 15px; color: var(--ink-soft); margin-top: var(--space-2); }

/* =============== Logo grid (partners & funders) =============== */
.logo-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
/* At 360px the 150px floor plus the gap lands a pixel over the available width, so auto-fill drops
 * to a single column and six tiles become 600px of scrolling for a thank-you strip. Two up. */
@media (max-width: 420px) {
  .logo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.logo-tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
  min-height: 104px; display: grid; place-items: center; gap: var(--space-3); padding: var(--space-4);
  font-family: var(--font-ui); font-size: 14px; font-weight: 600; color: var(--ink-soft); text-align: center;
}
.logo-tile__mono {
  width: 42px; height: 42px; border-radius: 999px; display: grid; place-items: center;
  background: var(--accent-wash); color: var(--brand);
  font-family: var(--font-ui); font-weight: 700; font-size: 18px; line-height: 1;
}
.logo-tile__name { display: block; }
.logo-tile--logo { padding: var(--space-4) var(--space-5); }
.logo-tile--logo img { max-width: 100%; max-height: 60px; width: auto; height: auto; object-fit: contain; }

/* Partners feature — a photograph beside the thank-you wall */
.partner-feature { display: grid; gap: var(--space-6); align-items: center; }
@media (min-width: 860px) {
  .partner-feature { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-7); }
  /* Text left, photograph right — the mirror of the latest-story band directly above it. Both ran
     image-left, so two full-width bands in a row had the identical shape and the page stopped
     having a rhythm. Reordered in CSS, not in the markup, so the photograph still follows its
     heading for anyone reading the page in source order. */
  .partner-feature__media { order: 2; }
  .partner-feature__body { order: 1; }
}
.partner-feature__media { margin: 0; }
.partner-feature__frame {
  border-radius: var(--radius-card); overflow: hidden;
  box-shadow: 0 10px 28px rgba(26, 26, 24, .12);
}
.partner-feature__img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block;
}
@media (min-width: 860px) { .partner-feature__img { aspect-ratio: 3 / 4; } }
.partner-feature__credit { margin: var(--space-2) 0 0; font-family: var(--font-ui); font-size: var(--text-caption); color: var(--ink-soft); }
.partner-feature__lead { margin: var(--space-3) 0 var(--space-5); font-size: var(--text-lede); line-height: 1.5; color: var(--ink-soft); max-width: 46ch; }
.partner-feature__more { margin: var(--space-4) 0 0; }

/* =============== Hours =============== */
.hours { background: var(--surface-deep); color: var(--ink-inverse); border-radius: var(--radius-card); padding: var(--space-5); }
.hours h2, .hours h3 { color: var(--ink-inverse); }
.hours__row { padding: var(--space-3) 0; border-top: 1px solid rgba(250,246,238,.22); }
.hours__row:last-child { border-bottom: 1px solid rgba(250,246,238,.22); }
.hours__head { display: flex; justify-content: space-between; gap: var(--space-3); align-items: baseline; margin-bottom: var(--space-1); }
.hours__when { font-family: var(--font-ui); font-size: 17px; font-weight: 700; color: var(--accent); }
.hours__row--closed .hours__when, .hours__row--closed .hours__time { color: var(--ink-quiet-inv); }
.hours__time { font-family: var(--font-ui); font-size: 18px; font-weight: 700; }
.hours p { font-size: 16.5px; line-height: 1.55; color: #E6EBEE; }

/* =============== Timetable =============== */
.timetable { width: 100%; border-collapse: collapse; font-family: var(--font-ui); }
.timetable caption { text-align: left; font-size: var(--text-caption); color: var(--ink-soft); padding-bottom: var(--space-3); }
.timetable th, .timetable td { border: 1px solid var(--line); padding: var(--space-3); vertical-align: top; text-align: left; font-size: 15px; }
.timetable thead th { background: var(--surface-quiet); font-weight: 700; color: var(--ink); }
.timetable tbody th { background: var(--surface-quiet); font-weight: 700; white-space: nowrap; }
.timetable td { background: var(--surface); }
.slot { display: block; font-weight: 700; color: var(--brand-strong); }
.slot + .slot { margin-top: var(--space-2); }
.slot small { display: block; font-weight: 500; color: var(--ink-soft); }
/* inline-block overrides the global `svg { display:block }`, so the icon sits on the same line as
 * the activity name instead of dropping to its own line above it. */
.slot__ico { display: inline-block; width: 15px; height: 15px; vertical-align: -2px; margin-right: 6px; color: var(--brand-link); }
@media (prefers-color-scheme: dark) { .slot { color: var(--ink); } }
/* Phone: the grid becomes a day-by-day list. */
.timetable--stack { display: block; }
.timetable--stack thead { display: none; }
.timetable--stack tbody, .timetable--stack tr, .timetable--stack th, .timetable--stack td { display: block; width: 100%; }
.timetable--stack tr { border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; margin-bottom: var(--space-4); }
.timetable--stack th, .timetable--stack td { border: 0; border-bottom: 1px solid var(--line); }
.timetable--stack td::before { content: attr(data-day-en); display: block; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: var(--space-1); }
html[data-lang="uk"] .timetable--stack td::before { content: attr(data-day-uk); }
@media (min-width: 860px) {
  .timetable--stack { display: table; }
  .timetable--stack thead { display: table-header-group; }
  .timetable--stack tbody { display: table-row-group; }
  .timetable--stack tr { display: table-row; border: 0; border-radius: 0; margin: 0; }
  .timetable--stack th, .timetable--stack td { display: table-cell; border: 1px solid var(--line); }
  .timetable--stack td::before { display: none; }
}

/* =============== Forms =============== */
.field { margin-bottom: var(--space-5); }
.field label { display: block; font-family: var(--font-ui); font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: var(--space-1); }
.field label .opt { color: var(--ink-soft); font-weight: 400; }
.field .hint { font-family: var(--font-ui); font-size: 15px; color: var(--ink-soft); margin: 0 0 var(--space-2); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: var(--space-3) var(--space-3);
  font-family: var(--font-voice); font-size: var(--text-body); color: var(--ink);
  background: var(--surface); border: 2px solid var(--line-strong); border-radius: var(--radius-input);
}
.field textarea { min-height: 140px; line-height: 1.55; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--state-closed); }
.field .error {
  display: flex; gap: var(--space-2); align-items: flex-start; margin: var(--space-2) 0 0;
  font-family: var(--font-ui); font-size: 16px; font-weight: 600; color: var(--state-closed);
}
.field .error svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.check { display: flex; gap: var(--space-3); align-items: flex-start; margin-bottom: var(--space-4); }
.check input { width: 24px; height: 24px; min-height: 0; flex: none; margin-top: 4px; accent-color: var(--brand); }
.check label { font-family: var(--font-ui); font-size: 16.5px; font-weight: 500; line-height: 1.5; margin: 0; }
.check label .opt { color: var(--ink-soft); font-weight: 400; }

/* Membership application — groups of fields under a heading. */
.membership-form__group { border: 0; padding: 0; margin: 0 0 var(--space-7); }
.membership-form__group > legend {
  font-family: var(--font-voice); font-size: var(--text-h3); font-weight: 600; color: var(--brand-strong);
  padding: 0; margin: 0 0 var(--space-4); width: 100%;
  border-bottom: 1px solid var(--line); padding-bottom: var(--space-2);
}
.membership-form__group[hidden] { display: none; }

/* =============== Membership office (staff) =============== */
.office-tabs { display: flex; gap: var(--space-2); border-bottom: 1px solid var(--line); margin-bottom: var(--space-5); }
.office-tab { padding: var(--space-3) var(--space-4); text-decoration: none; font-family: var(--font-ui); font-weight: 600; color: var(--ink-soft); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.office-tab:hover { color: var(--brand-strong); }
.office-tab.is-on { color: var(--brand-strong); border-bottom-color: var(--accent); }
.office__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; margin: var(--space-4) 0 var(--space-4); }
.office__title { font-family: var(--font-voice); font-size: var(--text-h3); font-weight: 600; margin: 0; }
.office__filters { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-5); }
.office__filter {
  display: inline-flex; align-items: center; gap: var(--space-2); text-decoration: none;
  font-family: var(--font-ui); font-size: 14px; font-weight: 600; color: var(--ink);
  padding: var(--space-2) var(--space-3); border: 1px solid var(--line-strong); border-radius: var(--radius-badge);
}
.office__filter:hover { border-color: var(--brand); color: var(--brand-strong); }
.office__filter.is-on { background: var(--brand); border-color: var(--brand); color: var(--ink-inverse); }
.office__count { font-size: 12px; font-variant-numeric: tabular-nums; opacity: .8; }

.office-table { width: 100%; border-collapse: collapse; font-family: var(--font-ui); }
.office-table th, .office-table td { text-align: left; padding: var(--space-3) var(--space-3); border-bottom: 1px solid var(--line); vertical-align: top; }
.office-table th { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.office-table__link { font-weight: 700; color: var(--brand-link); text-decoration: none; }
.office-table__link:hover { color: var(--brand); text-decoration: underline; }
.office-table__sub { display: block; font-size: 13.5px; color: var(--ink-soft); margin-top: 2px; }

.office-tag { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; padding: 1px var(--space-2); border-radius: var(--radius-badge); margin-left: var(--space-2); vertical-align: 1px; }
.office-tag--minor { background: var(--accent-wash); color: var(--brand-strong); }
.office-tag--dupe { background: var(--state-closed-wash); color: var(--state-closed); }

.office-badge { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 2px var(--space-2); border-radius: var(--radius-badge); background: var(--surface-quiet); color: var(--ink); }
.office-badge--submitted, .office-badge--under_review, .office-badge--info_requested { background: var(--accent-wash); color: var(--brand-strong); }
.office-badge--approved { background: var(--state-open-wash); color: var(--state-open); }
.office-badge--declined, .office-badge--withdrawn { background: var(--state-closed-wash); color: var(--state-closed); }

@media print {
  .site-header, .site-footer, .breadcrumb, .office__filters, .office__print, .lang-switch { display: none !important; }
  .band { padding: 0 !important; }
  .office-table th, .office-table td { padding: 4px 8px; }
}

/* Application detail */
.office-grid { display: grid; gap: var(--space-6); }
@media (min-width: 900px) { .office-grid { grid-template-columns: 1.2fr 1fr; align-items: start; } }
.office-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: var(--space-5); }
.office-panel h3 { font-family: var(--font-ui); font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); margin: var(--space-5) 0 var(--space-2); }
.office-panel > h3:first-child { margin-top: 0; }
.office-dl { margin: 0; }
.office-dl__row { display: grid; grid-template-columns: 12rem 1fr; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--line); }
.office-dl__row dt { margin: 0; font-family: var(--font-ui); font-size: 14px; color: var(--ink-soft); }
.office-dl__row dd { margin: 0; }
.office-prose { line-height: 1.6; }
.office-consents { list-style: none; margin: 0; padding: 0; font-family: var(--font-ui); font-size: 15px; }
.office-consents li { padding: 2px 0; }
.office-reviews { list-style: none; margin: 0 0 var(--space-4); padding: 0; }
.office-reviews li { padding: var(--space-2) 0; border-bottom: 1px solid var(--line); font-family: var(--font-ui); font-size: 15px; }
.office-reviews__pos { font-weight: 700; margin-right: var(--space-2); }
.office-reviews__pos--support { color: var(--state-open); }
.office-reviews__pos--object { color: var(--state-closed); }
.office-reviews__who { color: var(--ink-soft); }
.office-reviews__note { display: block; color: var(--ink-soft); margin-top: 2px; }
.office-actionform { margin: var(--space-3) 0 0; }
.office-outcomes { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-4); }

/* =============== Notice =============== */
.notice { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: var(--space-5); display: flex; gap: var(--space-4); align-items: flex-start; }
.notice--error { border-color: var(--state-closed); background: var(--state-closed-wash); }
.notice--error ul { color: var(--ink); }
.notice__mark { flex: none; width: 42px; height: 42px; border-radius: var(--radius-badge); background: var(--accent-wash); display: grid; place-items: center; }
.notice__mark svg { width: 22px; height: 22px; }

/* A notice with a photograph in it. The text keeps the room it needs and the picture takes a fixed
 * column beside it, so a long Ukrainian paragraph pushes the card taller rather than squeezing the
 * photograph to a sliver. */
.notice--photo { align-items: center; gap: var(--space-5); }
.notice__body { flex: 1 1 auto; min-width: 0; }
.notice__photo {
  flex: none; width: 280px; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: var(--radius-card); background: var(--surface-quiet);
}
/* Below the two-column point the photograph leads the card instead of shrinking. `order` puts it
 * above the icon and the words without moving it in the markup, where it belongs after them. */
@media (max-width: 859px) {
  .notice--photo { flex-wrap: wrap; }
  .notice__photo { width: 100%; aspect-ratio: 16 / 9; order: -1; }
}

/* =============== Filter chips =============== */
.filters { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.filters button {
  font-family: var(--font-ui); font-size: 15px; font-weight: 600; min-height: 44px;
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-badge);
  border: 1px solid var(--line-strong); background: transparent; color: var(--ink); cursor: pointer;
}
.filters button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--ink-inverse); }

/* =============== Gallery =============== */
/* 140px below the tablet breakpoint so two tiles fit on a 345px screen — at a 160px floor a small
 * phone dropped to a single column and twelve photographs became a very long scroll. */
.gallery { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
@media (min-width: 600px) {
  .gallery { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
.gallery img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; border-radius: var(--radius-card); }

/* Masonry variant for the main gallery page: photographs shown whole (no crop) and packed into
 * columns of varying height, so mixed portrait/landscape event shots read as an editorial wall
 * rather than a grid of identical tiles. CSS columns keep it working with no JavaScript; the DOM
 * order (and so the lightbox order and reading order) is unchanged — only the visual flow runs
 * down each column. */
.gallery--masonry {
  display: block;
  column-count: 2; column-gap: var(--space-4);
}
@media (min-width: 640px)  { .gallery--masonry { column-count: 3; } }
@media (min-width: 1180px) { .gallery--masonry { column-count: 4; } }
.gallery--masonry .gallery__item {
  display: block; break-inside: avoid; margin: 0 0 var(--space-4);
}
.gallery--masonry .gallery__item img {
  aspect-ratio: auto; height: auto; width: 100%;
}

/* nanogallery2 gallery (Gallery page). These rules style the plain <a><img> fallback shown before
 * the library initialises or when JavaScript is off; nanogallery2 empties the container and builds
 * its own DOM on init, so they stop applying once it is running. */
.ngallery > a { display: inline-block; }
.ngallery > a > img {
  height: 150px; width: auto; margin: 3px;
  border-radius: var(--radius-card); vertical-align: top;
}
/* Round the library's own thumbnails to match the rest of the site. */
.nGY2 .nGY2GThumbnailImage, .nGY2 .nGY2GThumbnailImage img { border-radius: var(--radius-card); }

/* A space gallery's lead photograph: full width, shown whole (no crop), above the grid. */
.space-gallery__lead { display: block; margin-bottom: var(--space-4); border-radius: var(--radius-card); overflow: hidden; }
.space-gallery__lead img { width: 100%; height: auto; display: block; border-radius: var(--radius-card); }

/* Gallery filter bar — collapsed behind a single toggle so the photographs, not the facets, lead
 * the page. It opens on its own when a filter is active, so a shared/filtered link shows its state.
 * One labelled row of chips per axis (year, event, people, tag, branch); the chips reuse the
 * .filters look, but as links (they carry URL state, so they can be shared). */
.gallery-filters-wrap { margin-bottom: var(--space-5); }
.gallery-filters-summary {
  display: inline-flex; align-items: center; gap: var(--space-2); width: fit-content;
  list-style: none; cursor: pointer;
  font-family: var(--font-ui); font-size: 15px; font-weight: 600; color: var(--brand-strong);
  padding: var(--space-2) var(--space-4); border: 1px solid var(--line-strong);
  border-radius: 999px; background: var(--surface);
}
.gallery-filters-summary::-webkit-details-marker { display: none; }
.gallery-filters-summary:hover { border-color: var(--brand); color: var(--brand); }
.gallery-filters-summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.gallery-filters-summary__ico { width: 16px; height: 16px; flex: none; }
.gallery-filters-summary__chev { width: 16px; height: 16px; flex: none; transition: transform .2s ease; }
.gallery-filters-wrap[open] .gallery-filters-summary__chev { transform: rotate(180deg); }
.gallery-filters-summary__on {
  font-family: var(--font-ui); font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--thread-red); background: var(--state-closed-wash);
  padding: 2px 8px; border-radius: 999px;
}
.gallery-filters-wrap[open] .gallery-filters { margin-top: var(--space-5); }
.gallery-filters { display: flex; flex-direction: column; gap: var(--space-4); margin-bottom: 0; }
.gallery-facet { display: grid; gap: var(--space-2); }
@media (min-width: 720px) {
  .gallery-facet { grid-template-columns: 130px minmax(0, 1fr); align-items: start; gap: var(--space-4); }
}
.gallery-facet__label {
  font-family: var(--font-ui); font-size: var(--text-overline); font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); padding-top: 12px;
}
.gallery-facet__options a {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-ui); font-size: 15px; font-weight: 600; min-height: 44px;
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-badge);
  border: 1px solid var(--line-strong); background: transparent; color: var(--ink);
  text-decoration: none;
}
.gallery-facet__options a:hover { border-color: var(--brand); color: var(--brand-strong); }
.gallery-facet__options a[aria-current="true"] { background: var(--brand); border-color: var(--brand); color: var(--ink-inverse); }
.gallery-facet__count { font-size: 12.5px; font-weight: 500; opacity: .7; font-variant-numeric: tabular-nums; }
.gallery-filters__reset { margin: 0; }
.gallery-count { font-family: var(--font-ui); font-size: 15px; color: var(--ink-soft); margin: 0 0 var(--space-4); }

/* Pagination — numbered pages plus prev/next, shared by the gallery and any paged archive. */
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-6); font-family: var(--font-ui); }
.pagination__pages { display: inline-flex; flex-wrap: wrap; gap: var(--space-2); }
.pagination__page, .pagination__step {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-width: 44px; min-height: 44px; padding: 0 var(--space-3);
  font-size: 15px; font-weight: 600; border-radius: var(--radius-badge);
  border: 1px solid var(--line-strong); background: transparent; color: var(--ink); text-decoration: none;
}
.pagination__page:hover, .pagination__step:hover { border-color: var(--brand); color: var(--brand-strong); }
.pagination__page--current { background: var(--brand); border-color: var(--brand); color: var(--ink-inverse); }
.pagination__step { font-weight: 700; }

/* Gallery tile — the image is now a link that opens the photo. */
.gallery__item { display: block; border-radius: var(--radius-card); overflow: hidden; position: relative; }
.gallery__item img { display: block; }
.gallery__item:focus-visible { outline: 3px solid var(--brand-link); outline-offset: 2px; }
@media (hover: hover) {
  .gallery__item { transition: transform .3s cubic-bezier(.22, .61, .36, 1); }
  .gallery__item:hover { transform: translateY(-2px); }
  .gallery__item::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit;
    box-shadow: inset 0 0 0 100vmax rgba(7, 34, 47, 0); transition: box-shadow .3s ease;
  }
  .gallery__item:hover::after { box-shadow: inset 0 0 0 100vmax rgba(7, 34, 47, .12); }
}

/* Lightbox — the full photo, its caption and a link to its occasion. Built and driven by site.js;
 * hidden until opened, and never shown at all without JavaScript (the tile is a real link). */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: var(--gutter);
  background: rgba(7, 34, 47, .88);
}
.lightbox[hidden] { display: none; }
.lightbox__figure {
  margin: 0; max-width: min(1100px, 100%); max-height: 100%;
  display: flex; flex-direction: column; gap: var(--space-3);
}
.lightbox__img {
  display: block; max-width: 100%; max-height: 78vh; margin: 0 auto;
  object-fit: contain; border-radius: var(--radius-card); background: rgba(0, 0, 0, .2);
}
.lightbox__caption {
  font-family: var(--font-ui); color: var(--ink-inverse); text-align: center;
  display: flex; flex-direction: column; gap: var(--space-2); align-items: center;
}
.lightbox__alt { font-size: 16px; line-height: 1.5; color: #E6EBEE; max-width: 60ch; }
.lightbox__occasion.link-action { color: var(--accent); min-height: 0; }
.lightbox__occasion.link-action:hover { color: #F5D547; }
.lightbox__occasion[hidden] { display: none; }
.lightbox__close, .lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(250, 246, 238, .4); background: rgba(7, 34, 47, .6);
  color: var(--ink-inverse); font-size: 26px; line-height: 1;
}
.lightbox__close { top: var(--space-4); right: var(--space-4); transform: none; }
.lightbox__nav--prev { left: var(--space-3); }
.lightbox__nav--next { right: var(--space-3); }
.lightbox__close:hover, .lightbox__nav:hover { background: var(--brand); border-color: var(--brand); }
.lightbox__nav[hidden] { display: none; }
@media (max-width: 640px) {
  .lightbox__nav { top: auto; bottom: var(--space-4); transform: none; }
  .lightbox__nav--prev { left: var(--space-4); }
  .lightbox__nav--next { right: var(--space-4); }
}

/* =============== Document list =============== */
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-list li { border-top: 1px solid var(--line); }
.doc-list li:last-child { border-bottom: 1px solid var(--line); }
.doc-list a { display: flex; gap: var(--space-4); align-items: center; justify-content: space-between; min-height: 64px; padding: var(--space-4) 0; text-decoration: none; color: inherit; }
.doc-list a:hover .doc-list__title { color: var(--brand-link); }
.doc-list a > span:not(.badge) { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.doc-list__title { display: block; font-family: var(--font-voice); font-size: 18px; font-weight: 700; line-height: 1.3; color: var(--brand-strong); }
@media (prefers-color-scheme: dark) { .doc-list__title { color: var(--ink); } }
.doc-list__meta { display: block; font-family: var(--font-ui); font-size: 14.5px; line-height: 1.45; color: var(--ink-soft); }

/* =============== Footer =============== */
.site-footer { background: var(--surface-deepest); color: var(--ink-quiet-inv); font-family: var(--font-ui); font-size: 15px; line-height: 1.7; }
.site-footer .wrap { padding-block: var(--space-8) var(--space-6); }
.site-footer a { color: var(--ink-inverse); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer h2 { font-family: var(--font-ui); font-size: var(--text-overline); font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--accent); margin: 0 0 var(--space-3); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding-block: 2px; }
.site-footer strong { color: var(--ink-inverse); }
.footer-grid { display: grid; gap: var(--space-6); grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
/* Five columns at desktop, and not five equal ones: the identity block carries an address and the
 * sign-up carries a form, so both need more room than a list of links. Below this the auto-fit
 * above takes over and the columns wrap on their own. */
@media (min-width: 1040px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr 1.35fr; gap: var(--space-7); }
}

/* The address is a link to the visit page, but it should read as an address, not a link. */
.footer-address a { color: var(--ink-quiet-inv); text-decoration: none; }
.footer-address a:hover { color: var(--accent); }

/* Links that leave the site, and the register link that was reading as a stray sentence. */
/* The registration number goes to the same OSCR page as the labelled link three lines below. It is
 * underlined but carries no ↗: one external-link glyph in a four-line block is a convention, two
 * pointing at the same page is noise. The screen-reader text is what tells a listener where it
 * goes — on its own, "SC054758" is not a destination.
 *
 * `a.charity-no`, not `.charity-no`, because `.site-footer a` sets `text-decoration: none` at one
 * class plus one element and would otherwise win — the link came out looking like plain text. */
a.charity-no { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a.charity-no:hover { color: var(--accent); }

.footer-link--out { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.footer-link--out::after { content: " ↗"; font-size: .9em; }

/* Donate — a prominent gold call to action on the navy footer. */
.footer-donate {
  display: inline-flex; align-items: center; gap: var(--space-2);
  margin-top: var(--space-3); padding: var(--space-3) var(--space-5);
  background: var(--accent); border-radius: var(--radius-button);
  font-family: var(--font-ui); font-size: 16px; font-weight: 700; letter-spacing: .01em;
  color: var(--brand-strong) !important; text-decoration: none;
}
.footer-donate:hover { background: #F5D547; color: var(--brand-strong) !important; }
.footer-donate svg { width: 18px; height: 18px; flex: none; }

/* Donate amount form (Stripe) */
.donate-form__row { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.donate-chip {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-4); border: 1px solid var(--line-strong); border-radius: var(--radius-badge);
  font-family: var(--font-ui); font-weight: 600; cursor: pointer; background: #fff;
}
.donate-chip:has(input:checked) { background: var(--brand); border-color: var(--brand); color: var(--ink-inverse); }
.donate-chip input { accent-color: var(--accent); }

.footer-contact { margin-top: var(--space-4); }
.footer-contact li { padding-block: 3px; }
.footer-contact a { color: var(--ink-inverse); }
.footer-legal { margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid rgba(250,246,238,.16); display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: space-between; font-size: 14.5px; }
.footer-signup { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.footer-signup input { flex: 1 1 160px; min-height: 48px; padding: 0 var(--space-3); font-family: var(--font-voice); font-size: 16px; border: 1px solid rgba(250,246,238,.45); border-radius: var(--radius-input); background: rgba(250,246,238,.06); color: var(--ink-inverse); }
.footer-signup input::placeholder { color: var(--ink-quiet-inv); }
.footer-signup button { min-height: 48px; padding: 0 var(--space-4); font-family: var(--font-ui); font-size: 16px; font-weight: 600; border: 2px solid var(--accent); border-radius: var(--radius-button); background: var(--accent); color: var(--brand-strong); cursor: pointer; }

/* Single event: detail card beside the prose on desktop */
@media (min-width: 900px) {
  .event-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
}

/* =============== People =============== */
.person-grid { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.person { display: flex; gap: var(--space-4); align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: var(--space-4); }
.avatar {
  flex: none; width: 60px; height: 60px; border-radius: var(--radius-badge);
  display: grid; place-items: center; background: var(--accent-wash);
  font-family: var(--font-ui); font-size: 19px; font-weight: 700; color: var(--brand);
}
.person__name { font-size: 19px; font-weight: 700; line-height: 1.25; margin: 0; }
.person__role { font-family: var(--font-ui); font-size: 14.5px; font-weight: 600; color: var(--thread-red); margin: 2px 0 var(--space-2); }
.person p:last-child { margin: 0; }

/* =============== Partners =============== */
/* A wall of organisations, not a list of wide cards.
 *
 * Each of these carries one fact — the name — because that is all the Club has recorded so far.
 * Two 385px cards abreast turned seventeen names into a page you scroll for a minute; a tighter
 * grid puts four across at desktop and reads as what it is, a thank-you wall. `auto-fill` with a
 * floor rather than a fixed count, so it steps down to three, two and one on its own.
 *
 * The logo sits above the name rather than beside it: a logo is roughly square or wide, and a
 * 120px column beside the text wasted a third of every card on white space. */
.partner-grid {
  display: grid; gap: var(--space-4);
  /* 140px on a phone so two fit abreast even at 345px, where 150 missed by three pixels. At a
     190px floor a 343px screen took one card per row
     and the page ran to 6,287px, which is a worse version of the problem this replaced. */
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
@media (min-width: 600px) {
  .partner-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}
.partner {
  display: flex; flex-direction: column; gap: var(--space-3);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: var(--space-4);
}
.partner .logo-tile {
  border: 0; background: var(--surface-quiet);
  /* One height for every tile, so a tall logo and a wide one still line up across a row. */
  min-height: 0; height: 84px; padding: var(--space-3);
}
.partner .logo-tile--logo img { max-height: 56px; }
.partner__body { display: flex; flex-direction: column; gap: var(--space-1); }
.partner__name { margin: 0; font-size: 16px; line-height: 1.3; }
/* The link inside the heading, not the heading. WCAG 2.5.8 wants 24px and these were 23 — and
 * raising the h4's line-height does nothing for them, because an inline <a> is sized by its own
 * line box, not its parent's. `inline-block` with a 24px line-height is what actually grows the
 * target, and at one pixel it is invisible. */
.partner__name a { display: inline-block; min-height: 24px; line-height: 24px; }
.partner__meta { margin: 0; }
.partner__what { margin: 0; color: var(--ink-soft); }

/* ---- Event / class detail layout ------------------------------
 * Article beside its detail card on desktop, stacked on a phone.
 * Matches the two-column arrangement in 07-event.html.
 * -------------------------------------------------------------- */
@media (min-width: 900px) {
  .event-layout { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
  .event-layout > aside { position: sticky; top: var(--space-5); }

  /* Class pages keep the facts card first in the markup (reading order) but show it in the
     right-hand column: the photograph and prose lead on the left, the sticky card sits to their
     right. `> aside { order: 2 }` (set at every width) does the move; the base columns above give
     the widths. On a phone the columns stack and the card follows the photograph. */
}

/* ---- Long-language safety -------------------------------------
 * Ukrainian runs 10–15% longer than English, and "Зареєструватися на
 * Eventbrite" overflows a card-width button that assumed "Book your place".
 * Let button labels wrap rather than spill.
 * -------------------------------------------------------------- */
.btn {
  white-space: normal;
  text-wrap: balance;
  line-height: 1.3;
  hyphens: auto;
}

.event-card .btn { width: 100%; }

/* ---- Hero scrim, tuned for this photograph ---------------------
 * The design specifies >=.78 opacity across the band where text sits, for contrast. That stays.
 * What changes is the part of the gradient with no text behind it: the original stops hid the
 * building almost entirely, and the building is the point of the picture.
 * Text band unchanged; the open side lightens sooner.
 * -------------------------------------------------------------- */
.hero.scrim-figure::after {
  background: linear-gradient(to top,
    rgba(7, 34, 47, .92) 0%, rgba(7, 34, 47, .86) 34%,
    rgba(7, 34, 47, .78) 50%, rgba(7, 34, 47, .34) 68%,
    rgba(7, 34, 47, .10) 84%, rgba(7, 34, 47, 0) 100%);
}

/* ---- Hero scrim on a phone, anchored to the text ----------------
 * A percentage gradient assumes it knows how tall the text is. On a 360px phone it does not: the
 * hero is 431px and the English text block is 421px of it, so the overline lands at 92% of the
 * height, where the design's gradient has faded to about .04. Measured, not guessed — the words
 * were sitting on bare photograph.
 *
 * Widening the gradient to cover 92% would black out the whole picture on small phones, which is
 * the complaint this scrim was already re-tuned once to answer. So below 900px the wash stops
 * being a property of the picture and becomes a property of the text: the body carries its own
 * backing, never below .82, with a short fade above it. Every word clears the .78 floor (§11.6),
 * and the rest of the photograph is left alone — more of the building is visible on a phone now
 * than before this change, not less.
 * -------------------------------------------------------------- */
@media (max-width: 899px) {
  /* Let the hero be as tall as its text needs, and reserve a band for the picture above it.
   * The fixed 4/5 box is what caused the squeeze: the text is 380-420px whatever the screen,
   * so on a 360px phone it filled 431px of a 431px box and left the photograph nowhere to go. */
  .hero.scrim-figure { aspect-ratio: auto; }
  .hero > .hero__body { margin-top: 240px; }

  .hero.scrim-figure::after { background: none; }

  .hero > .hero__body {
    background: linear-gradient(to top,
      rgba(7, 34, 47, .95) 0%, rgba(7, 34, 47, .93) 55%,
      rgba(7, 34, 47, .88) 85%, rgba(7, 34, 47, .82) 100%);
  }

  /* The fade above, so the panel does not cut the photograph with a hard line. */
  .hero > .hero__body::before {
    content: ""; position: absolute; left: 0; right: 0; bottom: 100%;
    height: 88px; pointer-events: none;
    background: linear-gradient(to top, rgba(7, 34, 47, .82), rgba(7, 34, 47, 0));
  }
}

@media (min-width: 900px) {
  .hero.scrim-figure--wide::after {
    background: linear-gradient(to right,
      rgba(7, 34, 47, .93) 0%, rgba(7, 34, 47, .88) 34%,
      rgba(7, 34, 47, .78) 52%, rgba(7, 34, 47, .42) 70%,
      rgba(7, 34, 47, .14) 86%, rgba(7, 34, 47, .02) 100%);
  }
}

/* ---- Timetable column widths ----------------------------------
 * Auto layout gave the day column the slack and squeezed the three period
 * columns into a few characters each. The day names are short and fixed;
 * the periods hold the content, so give them the room.
 * -------------------------------------------------------------- */
@media (min-width: 860px) {
  .timetable--stack { table-layout: fixed; }
  .timetable--stack thead th:first-child,
  .timetable--stack tbody th { width: 8.5rem; }
  .timetable--stack thead th:not(:first-child) { width: auto; }
}

/* Slot links: readable, not decorated into noise. */
.slot small a { text-decoration: none; }
.slot small a:hover { text-decoration: underline; }

/* ---- Timetable caption in stacked mode -------------------------
 * `display: block` on the table leaves the caption as `display: table-caption`
 * inside a block box, which collapses it to roughly one word per line on a phone.
 * -------------------------------------------------------------- */
.timetable--stack caption { display: block; width: 100%; text-align: left; }
@media (min-width: 860px) {
  .timetable--stack caption { display: table-caption; }
}

/* ---- Tap targets on a phone (WCAG 2.5.8) ----------------------
 * Footer and inline list links rendered ~19px tall — under the 24px minimum, and well under the
 * 44px that actually works with a thumb. Padding rather than font size, so the design's type scale
 * is untouched.
 * -------------------------------------------------------------- */
@media (max-width: 899px) {
  .site-footer li a,
  .footer-legal a,
  .doc-list a,
  .subnav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  /* The address and the register link run to several lines. inline-flex turned each of them into a
     single centred row and pushed the ↗ to the far side of the column, adrift from its own text. */
  .footer-address a,
  .footer-col--identity .footer-link--out {
    display: inline;
    padding-block: var(--space-2);
  }

  .site-footer ul li + li { margin-top: var(--space-1); }

  /* One column put 2000px of footer — two and a half screens — after the end of the page. The link
     lists go two up; the identity block and the sign-up form keep the full width they need. */
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6) var(--space-4); }
  .footer-col--identity,
  .footer-col--contact { grid-column: 1 / -1; }

  /* The legal row is a single line of separated links — give each room without
     breaking the row. */
  .footer-legal a { min-height: 40px; padding-inline: 2px; }
}

/* =============== Photo strip (hero → archive) ===============
 * A wall of narrow upright slats, one photograph each, edge to edge with no gaps and no rounding.
 * Ten of them in the width of a few thumbnails is the whole point: the count of slats is what says
 * the Club has a lot of photographs, before anyone reads the number underneath.
 *
 * Earlier versions of this made the container the interesting thing — a pill, then a grid, then a
 * fanned deck of tilted cards — and the photographs became texture inside a widget. Here the
 * photographs are the component and the frame is almost nothing.
 *
 * It is one link, not ten: ten slats all going to the same page would give a screen reader ten
 * identical links in a row and a keyboard ten stops to get past.
 */
.photo-strip {
  /* Above the scrim, the same way `.scrim-figure__body` is. Without this the figure's ::after
   * paints over the slats — they are a sibling that comes earlier — and ten photographs arrive
   * under a .9 wash of navy. */
  position: relative; z-index: 1;
  display: block;
  width: min(46%, 620px);
  text-decoration: none; color: var(--ink-inverse);
}

.photo-strip__shots {
  /* A stack seen in perspective. The first child is the front of it — closest, tallest, sharpest —
   * and each one behind steps back: a little shorter, a little narrower, a little further into the
   * wash, down to the edges that are a few pixels of themselves. Flowing left→right it reads the way
   * the label under it does: the photograph you meet first is the biggest. `align-items: flex-end`
   * stands the whole stack on one baseline so the recession climbs away from the reader. */
  display: flex; flex-direction: row-reverse; align-items: flex-end;
  height: 320px;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: rgba(7, 34, 47, .4);
  box-shadow: 0 14px 34px -18px rgba(7, 34, 47, .8);
  position: relative;
  isolation: isolate;
}

/* The far end fades into the wash, so the stack reads as continuing rather than stopping at a
 * hard line. Pointer-events off: it sits over the slats. */
.photo-strip__shots::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 48px;
  background: linear-gradient(to right, rgba(7, 34, 47, .6), rgba(7, 34, 47, 0));
  pointer-events: none; z-index: 6;
}

/* Three photographs, then edges. The three are wide enough to read as pictures; the rest are a
 * few pixels of themselves, the way a stack of prints looks from the side. Each tucks a touch under
 * the one in front of it (negative margin + descending z-index) and casts a soft shadow onto it, so
 * the depth is real overlap rather than three tiles in a row. */
.photo-strip__slat {
  flex: 1 1 0; min-width: 0;
  height: 100%;
  overflow: hidden;
  border-radius: 10px;
  position: relative;
  transition: flex .45s cubic-bezier(.22, .61, .36, 1), transform .2s ease-out;
}
.photo-strip__slat img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* Depth, front to back — and the front is on the right, because that is the end the eye arrives at
 * and the end the label's call to action sits under.
 *
 * Heights fall geometrically, not arithmetically: each slat is 0.982 of the one in front of it
 * rather than a fixed number of pixels shorter. A constant subtraction draws a ramp; a constant
 * ratio draws something going away from you. Nine steps of that ratio land the back of the stack
 * at exactly 85% of the front — the floor, because below that the short ones stop reading as
 * photographs and start reading as a broken edge.
 *
 * The fade rides on top and is eased rather than linear, so the three that are wide enough to see
 * stay near full strength and the dimming concentrates where the slats are too narrow to show
 * anything anyway.
 *
 * Widths, z-index, the tuck under the neighbour and the shadow all run the same way, mirrored for
 * row-reverse: each slat tucks under the one to its right and casts onto it. */
.photo-strip__slat:nth-child(1) {
  flex-grow: 2.4; height: 100%; z-index: 5; opacity: 1;
  box-shadow: -12px 0 26px -12px rgba(7, 34, 47, .7);
}
.photo-strip__slat:nth-child(2) {
  flex-grow: 1.5; height: 98.2%; z-index: 4; opacity: .97;
  margin-right: -18px; box-shadow: -10px 0 22px -12px rgba(7, 34, 47, .6);
}
.photo-strip__slat:nth-child(2) img { filter: saturate(.94) brightness(.94); }
.photo-strip__slat:nth-child(3) {
  flex-grow: 1; height: 96.5%; z-index: 3; opacity: .93;
  margin-right: -16px; box-shadow: -8px 0 18px -12px rgba(7, 34, 47, .55);
}
.photo-strip__slat:nth-child(3) img { filter: saturate(.88) brightness(.88); }

.photo-strip__slat--edge {
  flex: 0 0 11px; z-index: 2;
  margin-right: -8px; border-radius: 6px;
}
.photo-strip__slat:nth-child(4)  { height: 94.7%; opacity: .88; }
.photo-strip__slat:nth-child(5)  { height: 93.0%; opacity: .83; }
.photo-strip__slat:nth-child(6)  { height: 91.4%; opacity: .78; }
.photo-strip__slat:nth-child(7)  { height: 89.7%; opacity: .72; }
.photo-strip__slat:nth-child(8)  { height: 88.1%; opacity: .66; }
.photo-strip__slat:nth-child(9)  { height: 86.6%; opacity: .60; }
.photo-strip__slat:nth-child(n+10) { height: 85%;  opacity: .54; }

.photo-strip__slat--edge img { filter: saturate(.7) brightness(.72); }

/* One slat opens under the pointer and the rest give up the room — a contact sheet you can push a
 * finger into. Pointer only: on a phone a tap would leave a slat stuck open. */
/* Hover behaviour for the stack lives in motion.css, with the rest of the motion. */

.photo-strip__label {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3);
  margin-top: var(--space-3);
  font-family: var(--font-ui); font-size: 15px; font-weight: 600; letter-spacing: .01em;
  text-shadow: 0 1px 10px rgba(7, 34, 47, .9);
}
.photo-strip__count { color: var(--ink-quiet-inv); font-weight: 500; }
.photo-strip__cta { display: inline-flex; align-items: center; gap: var(--space-2); white-space: nowrap; }
.photo-strip__arrow { font-size: 1.1em; }
.photo-strip:hover .photo-strip__cta { color: var(--accent); }

/* Above 900px the hero is a column with space-between: the slats take the top, the headline takes
 * the bottom. Absolute positioning meant picking numbers that happened to clear the text, and they
 * stopped clearing it every time the thumbnails changed shape. */
@media (min-width: 900px) {
  .hero.scrim-figure { flex-direction: column; justify-content: space-between; align-items: stretch; }
}

/* The phone's picture band above the text panel is about 240px tall, so the wall is shorter and
 * drops to six slats — ten at phone width would be 35px each, which is texture, not photographs. */
@media (max-width: 899px) {
  .photo-strip {
    position: absolute; z-index: 1;
    top: var(--space-4); left: var(--gutter); right: var(--gutter);
    width: auto;
  }
  .photo-strip__shots { height: 128px; }
  /* Widths and overlap step down more gently on a phone — a 128px band is too short to fan far —
   * but the heights are left alone. These rules used to set their own (92%, 84%, 74%), which broke
   * the recession twice over: it fell below the 85% floor, and because only the first three were
   * overridden an edge behind them ended up taller than the photograph in front of it. The
   * geometric heights above apply at every width; only the horizontal treatment changes here. */
  .photo-strip__slat:nth-child(1) { flex-grow: 1.7; }
  .photo-strip__slat:nth-child(2) { flex-grow: 1.2; margin-right: -8px; }
  .photo-strip__slat:nth-child(3) { flex-grow: 1; margin-right: -7px; }
  /* Narrower edges on a phone, and fewer of them — eight slivers on a 320px wall would take a
   * third of the width away from the photographs. */
  .photo-strip__slat--edge { flex-basis: 6px; margin-right: -5px; }
  .photo-strip__slat:nth-child(n+8) { display: none; }
  .photo-strip__label {
    font-size: 14px; margin-top: var(--space-2);
    /* Over the bright top of the photograph the label has no scrim behind it, so it carries its
     * own. Measured against a white frame as the worst case. */
    background: rgba(7, 34, 47, .78);
    padding: 6px var(--space-3); border-radius: 999px;
  }
  .photo-strip__count { color: #DDE4E8; }
}

/* =============== Hero top row ===============
 * The stack of photographs on one side, what is on next on the other. Both sit above the headline
 * in the hero's own column layout, so neither can collide with it.
 */
/* The gutters live here now. They used to sit on `.hero > .photo-strip`, which stopped matching
 * the moment the strip gained this wrapper — both panels went flush to the viewport edges. */
.hero__top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-6);
  padding: var(--space-6) var(--space-7) 0;
}

/* The rail is the frosted panel; the blocks inside it are the content. Two of them now — what is
 * coming up, and what runs every week — because they answer different questions and a single
 * undifferentiated list of six made the reader work out which was which. */
.hero-rail {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  flex: 0 1 340px; align-self: stretch;
  width: 340px;
  /* Tighter top and bottom padding than the sides. Eight rows in one panel is a lot to ask of a
   * hero, and the vertical inches are the ones under pressure; the side gutters are not. */
  padding: var(--space-5) var(--space-5);
  border-radius: var(--radius-card);
  /* A more transparent, frosted panel. A low background alpha lets the photograph show through; the
   * backdrop-filter's brightness() darkens whatever sits behind the panel, so the white text keeps
   * its contrast without a heavy solid fill. brightness()/blur backdrop-filters are supported by
   * every current browser (incl. Safari with the -webkit prefix below); where a browser ignores
   * them entirely, the .58 fill still tips the panel well toward the dark side of the scrim. */
  background: rgba(7, 34, 47, .58);
  border: 1px solid rgba(250, 246, 238, .22);
  backdrop-filter: blur(10px) saturate(1.05) brightness(.6);
  -webkit-backdrop-filter: blur(10px) saturate(1.05) brightness(.6);
  color: var(--ink-inverse);
}

.hero-rail__block { flex: 1 1 auto; display: flex; flex-direction: column; }

/* A stronger line than the ones between rows, because it divides two different things rather than
 * two items of the same thing. */
.hero-rail__block + .hero-rail__block {
  margin-top: var(--space-3); padding-top: var(--space-3);
  border-top: 1px solid rgba(250, 246, 238, .3);
}

.hero-events__list {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  margin: var(--space-2) 0 0; padding: 0; list-style: none;
}

/* `flex-basis: auto`, emphatically not `0`.
 *
 * With a basis of 0 the rows divide the *whole* panel between them, so four rows of 96px content
 * came out 275px tall each and the panel read as a mostly-empty box with some small print floating
 * in it. With `auto` they divide only what is left over after their own content. */
.hero-events__item {
  flex: 1 1 auto;
  display: flex; align-items: center;
}

/* A hairline between rows, not around them. */
.hero-events__item + .hero-events__item { border-top: 1px solid rgba(250, 246, 238, .16); }

.hero-events__item > a {
  flex: 1;
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) 0;
  text-decoration: none; color: var(--ink-inverse);
}
.hero-events__item > a:hover .hero-events__title { color: var(--accent); }
.hero-events__item > a:hover .hero-events__thumb { filter: brightness(1.12); }

/* Doubled-up selector on purpose. The hero is a `.photo` figure, so `.photo img { width: 100% }`
 * matches these thumbnails and, at one class plus one element, outranks a lone class — the squares
 * came out 250px wide and the titles wrapped to five lines each.
 *
 * The explicit height (rather than `aspect-ratio`) is because a lazy image that has not arrived
 * yet has no intrinsic size, and the rows would jump as each one loaded. */
.hero-rail .hero-events__thumb {
  flex: none; width: 44px; height: 44px;
  object-fit: cover; border-radius: 10px;
  background: rgba(250, 246, 238, .08);
  transition: filter .2s ease;
}

/* The stand-in for an event with no photograph yet. Quiet enough to read as an empty slot rather
 * than a broken image, and it keeps the row's left column so the titles stay in line. */
.hero-rail .hero-events__thumb--empty {
  border: 1px solid rgba(250, 246, 238, .14);
  background:
    repeating-linear-gradient(-45deg,
      rgba(250, 246, 238, .05) 0 6px,
      rgba(250, 246, 238, 0) 6px 12px);
}

/* The timetable half: no squares, so the rows can be tighter. That is not only a saving — a class
 * has no single photograph that means anything at 52px, and six identical squares down the rail
 * would have said the two halves were the same kind of thing. */
/* The timetable half runs tighter and quieter than the events above it. Five events and three
 * classes do not fit one hero at the same weight, and they should not: the events are the news and
 * the classes are the standing arrangement underneath. Smaller type and a shorter row say so
 * before anyone reads a word. */
.hero-classes__list .hero-events__item > a { padding: 6px 0; gap: var(--space-3); }
.hero-classes__list .hero-events__when { font-size: 10px; }
.hero-classes__list .hero-events__title { font-size: 14px; line-height: 1.2; margin-top: 2px; }

/* The class marker, redesigned: a gold line-icon set in a soft navy "glass" tile the same size as
 * the event thumbnails. Both lists now share one clean left column, so the titles line up down the
 * whole rail — and a tinted icon tile still reads as a category, not a photograph. Blue tile, gold
 * icon: the Ukrainian palette, which is the right accent for the Club. */
.hero-rail .hero-classes__ico {
  flex: none; box-sizing: border-box;
  width: 38px; height: 38px; padding: 8px;
  border-radius: 10px;
  color: #FAF6EE;
  background: linear-gradient(150deg, rgba(0, 91, 187, .48), rgba(0, 91, 187, .14));
  border: 1px solid rgba(250, 246, 238, .14);
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
/* Placeholder tile for a class with no icon yet — keeps the column, reads as an empty slot. */
.hero-rail .hero-classes__ico--empty {
  background: rgba(250, 246, 238, .05);
  border-style: dashed; color: transparent;
}
/* Hover lifts the icon to the Club's gold — the flag's second colour, and a clear affordance. */
.hero-events__item > a:hover .hero-classes__ico { color: var(--accent); border-color: rgba(255, 213, 0, .55); }

.hero-events__text { min-width: 0; }

.hero-events__when {
  display: block;
  font-family: var(--font-ui); font-size: 10.5px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-quiet-inv);
}

/* The next one up, in the same gold as the headings. One rule, and the rail gets a head instead of
 * being six things of identical weight. Scoped to the first block so the first class does not get
 * it too — there is no "next" class, they all run every week. */
.hero-rail__block:first-child .hero-events__item:first-child .hero-events__when { color: var(--accent); }

/* Two lines, hard.
 *
 * A row whose height depends on how long a title happens to be cannot be budgeted, and the
 * Ukrainian titles run half again as long as the English. Clamped, every row has a known maximum,
 * so two lists fit one panel at the shortest hero the layout can produce. Nothing is actually
 * being cut at present — it is the guarantee that matters, not the truncation. */
.hero-events__title {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden;
  margin-top: 2px;
  font-family: var(--font-voice); font-size: 15px; line-height: 1.22; font-weight: 700;
}

/* Anchored to the foot of its own block. */
/* No underline on the two rail links. They sit on a frosted panel over a photograph, where a rule
 * under the text competes with the hairlines ruling the rows just above — the eye read it as one
 * more row divider. Colour is not carrying the link on its own: the leading glyph and the trailing
 * arrow are both non-colour cues, and `:focus-visible` still draws the site's focus ring. */
.hero-events__all { margin-top: var(--space-2); font-size: 13.5px; min-height: 0; display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
/* A leading glyph on the two rail links — calendar for events, clock for the timetable — echoing
 * the hero action buttons. The trailing text arrow stays as the site's link-action affordance. */
.hero-events__all-ico { flex: none; width: 15px; height: 15px; }

/* On a phone the hero is already a photograph, a stack, a headline, a lede and two buttons. The
 * "Coming up" band sits immediately below with the same events and room to describe them, so the
 * hero copy of the list is redundant rather than useful. */
@media (max-width: 899px) {
  /* `display: contents`, not `block`. Below 900px the hero is still a flex *row*, so a wrapper in
   * the flow became a second column beside the headline and squeezed it to 279px of 390. Contents
   * removes the box: the strip inside is positioned against the hero itself, and the body is once
   * again the only item in the row. */
  .hero__top { display: contents; }
  .hero-rail { display: none; }
}

/* The hero's composition, above the phone breakpoint.
 *
 * The panel is a full-height rail down the right-hand side: the photo strip fills the top-left, the
 * headline the bottom-left, and this runs floor to ceiling opposite them. Absolute with both `top`
 * and `bottom` set, because "full height" means the hero's height — the row the panel is written in
 * is only as tall as the strip, so stretching inside that row would not reach the bottom.
 */
@media (min-width: 900px) {
  .hero-rail {
    position: absolute;
    top: var(--space-6);
    right: var(--space-7);
    /* Was space-8. Five events and three classes need the inches, and the rail still clears the
     * hero's bottom edge by more than its own padding. */
    bottom: var(--space-7);
  }

  /* Keep the headline out from under the panel. The lede already wraps at 44ch, but the h1 is
     free to run wide and would otherwise slide beneath it on a narrow desktop. */
  .hero > .hero__body { max-width: calc(100% - 400px); }
}

/* =============== A room's photographs =============== */
/* Column flow, not a grid. The archive's `.gallery` crops everything to 3:2, which suits a wall of
 * craftwork and ruins this set: half of these are books open at their title pages, and a 3:2 crop
 * takes the words off the top and bottom. `columns` lets every photograph keep its own shape, and
 * the portrait and landscape ones settle into each other instead of being forced to match.
 *
 * `break-inside: avoid` is what stops a photograph being sliced across two columns — without it
 * Chrome will happily put the top half of the fireplace at the foot of one column and the bottom
 * half at the head of the next. */
.space-gallery { margin-top: var(--space-7); }
.space-gallery h2 { font-size: var(--text-h3); margin-bottom: var(--space-1); }

.photo-columns {
  /* Two columns even on the narrowest phone. One column made ten photographs a 4,500px scroll for
     a section nobody came to read; at 345px two columns are 166px each, which is plenty for a
     gallery and halves the distance. */
  columns: 2;
  column-gap: var(--space-3);
  margin-top: var(--space-4);
}
@media (min-width: 1000px) { .photo-columns { columns: 3; } }

.photo-columns__item {
  break-inside: avoid;
  margin: 0 0 var(--space-3);
  /* `inline-block` belongs with column layout: a block-level figure can still be broken across a
     column boundary in some engines even with break-inside, and this cannot. */
  display: inline-block;
  width: 100%;
}
.photo-columns__item img {
  display: block; width: 100%; height: auto;
  border-radius: var(--radius-card);
  background: var(--surface-quiet);
}

/* =============== Space video (self-hosted, portrait) =============== */
/* The film leads the page, centred in the reading column. It is shot upright, so it is capped by
 * height rather than width — a 9:16 clip given the full column width would be over a thousand
 * pixels tall and push everything else off the screen. */
.space-video { margin: 0 auto var(--space-7); max-width: min(100%, 420px); }
.space-video__el {
  display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: cover;
  border-radius: var(--radius-card); background: var(--surface-quiet);
}
.space-video__cap {
  margin-top: var(--space-2); font-family: var(--font-ui);
  font-size: var(--text-caption); color: var(--ink-soft);
}

/* =============== Space stage: the film behind the hours ===============
 * The library's own film opens the page, full-bleed, with the badge, the title and the opening
 * hours on it — the same job the hero does on the home page. The clip is shot upright on a phone,
 * so across a wide band it is cropped to a strip through the middle of the frame;
 * `object-position` picks which strip rather than leaving it to chance.
 *
 * Full-bleed with no width trickery: the stage is a top-level block in <main>, outside .wrap, so
 * it is already the width of the page. A `100vw` plus negative-margin escape would have had to be
 * measured from the right-hand grid column it used to sit in, which is not centred on the
 * viewport — the arithmetic only works for a centred ancestor.
 *
 * Height is the lever that shows more film. An upright clip in a landscape box is cropped by its
 * width, so making the card wider shows *less* of it; making it taller shows more. The floor is
 * set by what the panel holds, the ceiling stops a huge monitor turning the page into a poster.
 */
.space-stage {
  position: relative; isolation: isolate;
  overflow: hidden;
  min-height: max(560px, min(48vw, 800px));
  display: flex; align-items: stretch;
  background: var(--surface-deep);
}

/* The words line up with the page gutter; the film takes the rest of the row and runs off the
 * right-hand edge of the screen. */
.space-stage__inner {
  position: relative; z-index: 2;
  display: flex; align-items: stretch;
}

/* ---- The film's own column ------------------------------------
 * The film used to lie under the whole stage with a gradient wash dragged across it, which meant
 * the half of the frame behind the schedule was downloaded, decoded and then hidden. Now it has a
 * column of its own that starts where the schedule ends and bleeds off the right edge.
 *
 * `margin-right: calc(50% - 50vw)` is the one-sided version of the full-bleed trick, and it is
 * exact rather than approximate: a margin percentage resolves against this box's containing block,
 * so at any width — capped at --page-max or gutter-limited on a narrow screen — the right edge
 * lands on the viewport edge. The stage clips it.
 *
 * It also shows far more of the film than the full-width version did. An upright clip in a
 * landscape box is cropped by its width, so a narrower column crops less: at 1400px this column
 * shows about half the frame's height where the full-bleed version showed a quarter, and scales
 * the picture 1.2× instead of 2.2×, which is the difference between soft and mush.
 */
.space-stage__film {
  position: relative;
  flex: 1 1 auto; min-width: 0;
  margin-right: calc(50% - 50vw);
}

.space-stage__panel h1 { color: var(--ink-inverse); margin-bottom: var(--space-5); }

/* Breadcrumb sits inside the stage, on the dark ground, so there is no pale strip above the stage. */
.space-stage__crumb { margin-bottom: var(--space-5); }
.space-stage__crumb .breadcrumb { color: var(--ink-quiet-inv); padding-top: 0; }
.space-stage__crumb .breadcrumb a { color: var(--ink-inverse); }
.space-stage__crumb .breadcrumb strong { color: var(--ink-inverse); }
.space-stage__crumb .breadcrumb .sep { color: rgba(250, 246, 238, .4); }

/* The film fills its column. `object-position` picks which horizontal strip of the upright frame
 * survives the crop — the middle-upper part, where the shelves, the fireplace and the book are.
 *
 * The mask replaces the old scrim. Instead of a wash laid over the picture, the picture itself
 * dissolves into the deep surface at its left edge, so the film reads as flowing out of the
 * schedule rather than being covered by it. Nothing is printed over the film any more, so no
 * contrast depends on this — it is purely a join. */
.space-stage__video {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 40%;
  background: var(--surface-deep);
  -webkit-mask-image: linear-gradient(to right, transparent 0, rgba(0, 0, 0, .35) 14%, #000 42%);
          mask-image: linear-gradient(to right, transparent 0, rgba(0, 0, 0, .35) 14%, #000 42%);
}

.space-stage__panel {
  flex: 0 1 520px;
  padding-block: var(--space-7);
  padding-inline-end: var(--space-7);
}

/* Inside the stage the hours card drops its own background — the scrim is doing that job. */
.space-stage .hours {
  background: transparent; padding: 0; margin: 0; width: 100%;
}

/* ---- The controls ---------------------------------------------
 * Two of them, sitting together at the bottom-right of the film: stop the picture, and start the
 * sound. Anchored to the film's own column, so they are always on the film and never over the
 * schedule.
 *
 * Pause is not a courtesy. WCAG 2.2.2: anything that moves by itself for more than five seconds
 * needs a way to stop it, and this loops at 41. Sound is the opposite — it never starts on its
 * own, because every browser blocks audible autoplay and the film is served muted.
 */
.space-stage__controls {
  position: absolute; z-index: 3;
  right: var(--gutter); bottom: var(--space-5);
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2);
}

.space-stage__ctl {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 44px; padding: 0 var(--space-4);
  font-family: var(--font-ui); font-size: 14px; font-weight: 600;
  color: var(--ink-inverse);
  background: rgba(7, 34, 47, .82);
  border: 1px solid rgba(250, 246, 238, .38);
  border-radius: 999px;
  cursor: pointer;
}
.space-stage__ctl:hover { border-color: rgba(250, 246, 238, .7); }

/* One label of each pair, never both — and never the one that does not match the state. The
 * inner lang spans are still the switcher's business; this only chooses the pair. */
.space-stage__ctl-label { display: none; }
.space-stage__pause[data-playing="true"]  .space-stage__ctl-label[data-when="playing"],
.space-stage__pause[data-playing="false"] .space-stage__ctl-label[data-when="paused"],
.space-stage__sound[data-sound="off"]     .space-stage__ctl-label[data-when="off"],
.space-stage__sound[data-sound="on"]      .space-stage__ctl-label[data-when="on"] { display: inline; }

.space-stage__ctl-svg { width: 17px; height: 17px; flex: none; display: none; }
.space-stage__sound[data-sound="off"] .space-stage__ctl-svg[data-when="off"],
.space-stage__sound[data-sound="on"]  .space-stage__ctl-svg[data-when="on"] { display: block; }

/* Two bars while playing, a triangle once paused. */
.space-stage__pause-icon {
  width: 11px; height: 12px; flex: none;
  background:
    linear-gradient(var(--ink-inverse), var(--ink-inverse)) 0 0 / 3.5px 12px no-repeat,
    linear-gradient(var(--ink-inverse), var(--ink-inverse)) 7.5px 0 / 3.5px 12px no-repeat;
}
.space-stage__pause[data-playing="false"] .space-stage__pause-icon {
  background: var(--ink-inverse);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

/* On a phone the film goes back to being a picture above the hours: an upright clip cropped to a
 * wide band on a 360px screen shows almost nothing, and text over it would have to fight for
 * every pixel of contrast. */
@media (max-width: 899px) {
  .space-stage { display: block; min-height: 0; }
  /* `column-reverse` rather than reordering the markup: the film is the second child so that a
     screen reader meets the schedule first, and the picture still sits above it on the screen. */
  .space-stage__inner {
    max-width: none; padding-inline: 0;
    flex-direction: column-reverse;
  }
  /* An upright film on an upright screen: give it the phone hero's own 4/5 and it shows about
     70% of the frame instead of the 45% a 300px band showed.
     The cap is what keeps the page legible rather than the ratio. On a 390×844 phone the ratio
     wins and the film is 469px; on a 360×640 one the cap wins at 352px, which is what puts the
     badge and the title back above the fold. `dvh` so the cap follows the visible viewport when
     the browser chrome is showing, with `vh` behind it for anything that does not know `dvh`. */
  .space-stage__film {
    flex: none; margin-right: 0;
    aspect-ratio: 4 / 5; height: auto;
    max-height: 55vh;
    max-height: 55dvh;
  }
  /* No mask on a phone: there is nothing to its left to dissolve into, and a fade would just eat
     the left third of an already small picture. */
  .space-stage__video { -webkit-mask-image: none; mask-image: none; object-position: 50% 42%; }
  .space-stage__panel { padding: var(--space-6) var(--gutter); background: var(--surface-deep); }
  .space-stage__controls { right: var(--gutter); bottom: var(--space-3); }
}

/* On the narrowest phones the two pills and their Ukrainian labels come within a few pixels of
 * each other. Tightening the padding rather than dropping the words: an icon-only control would
 * need its name in an attribute, and an attribute can hold one language, not two. */
@media (max-width: 420px) {
  .space-stage__ctl { padding: 0 var(--space-3); font-size: 13px; gap: 6px; }
  .space-stage__ctl-svg { width: 15px; height: 15px; }
}

/* Reduced motion: the poster frame, held — but the controls stay.
 *
 * The plan said no controls here, and that was wrong. Asking a system for less movement means
 * "do not start without me", not "never let me watch this". Nothing moves until the visitor
 * presses play, which is the whole point; hiding the button would leave them with a still
 * photograph and no way to see the room or hear it. */
