/* The Musical Arts Association - shared design system. Page stylesheets build on this. */

/* TOKENS: palette, type, spacing. Use the custom properties, never retype a hex. */
:root {
  --ground: #a6a8a4;
  --panel: #dcddd9;
  --ink: #202522;
  --accent: #ffce28;
  --stripe: rgba(32, 37, 34, 0.07);
  --display: 'Stardos Stencil', Rockwell, Georgia, serif;
  --text: 'Fira Sans', 'Segoe UI', system-ui, sans-serif;
  --fs-body: 1rem;
  --fs-small: 0.9375rem;
  --fs-say: 1.875rem;
  --fs-h1: 1.5rem;
  --fs-h2: 1.5rem;
  --fs-h3: 1.25rem;
  --gut: 1rem;
  --gap: 0.5rem;
  --tape: 0.5rem;
  --pad: 1rem;
  --dock-h: calc(3.5rem + env(safe-area-inset-bottom, 0rem));
  --consent-h: 0rem;
}
@media (min-width: 56rem) {
  :root {
    --fs-body: 1.125rem;
    --fs-say: 2.75rem;
    --fs-h1: 1.875rem;
    --fs-h2: 2rem;
    --fs-h3: 1.375rem;
    --gut: clamp(1.5rem, 4vw, 3.5rem);
    --gap: 0.75rem;
    --pad: clamp(1.25rem, 2.2vw, 1.75rem);
  }
}

/* BASE: cross-mark ground, reading type. The ground texture never sits behind type: put text on .panel. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-bottom: calc(var(--dock-h) + 1.5rem); }
body {
  margin: 0;
  padding-bottom: calc(var(--dock-h) + var(--consent-h));
  background-color: var(--ground);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M20 16v8M16 20h8' stroke='%23202522' stroke-opacity='.4' fill='none'/%3E%3C/svg%3E");
  background-size: 2.5rem 2.5rem;
  color: var(--ink);
  font-family: var(--text);
  font-size: var(--fs-body);
  line-height: 1.55;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
p, ul, ol, dl, figure, table { margin: 0 0 1em; }
p:last-child, ul:last-child, ol:last-child { margin-bottom: 0; }
strong, b, th { font-weight: 400; }
::selection { background: var(--accent); color: var(--ink); }
:focus-visible { outline: 0.1875rem solid var(--ink); outline-offset: 0.1875rem; }
.on-ink :focus-visible, .dock :focus-visible { outline-color: var(--accent); }

/* HEADINGS: Stardos Stencil, sentence case, 24-32px. Wrap ONE word per heading in <em> (sets it in Fira italic). */
h1, h2, h3 {
  margin: 0 0 0.5em;
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.15;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h1 em, h2 em, h3 em { font-family: var(--text); font-style: italic; font-size: 0.92em; }

/* LINKS: underlined at rest; a heavier underline draws outward on hover/focus. .linkbtn = a <button> that reads as a link. */
a, .linkbtn, .pick {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 0.0625rem;
  text-underline-offset: 0.2em;
  background: linear-gradient(currentColor, currentColor) 50% 100% / 0 0.1875rem no-repeat;
  background-origin: content-box;
  transition: background-size 0.22s ease-out;
}
a:hover, a:focus-visible, .linkbtn:hover, .linkbtn:focus-visible, .pick:hover, .pick:focus-visible { background-size: 100% 0.1875rem; }
.linkbtn, .pick {
  appearance: none;
  border: 0;
  border-radius: 0;
  margin: 0;
  padding: 0.7rem 0;
  font: inherit;
  line-height: 1.5;
  cursor: pointer;
}
.on-ink a:hover, .on-ink a:focus-visible, .on-ink .linkbtn:hover, .on-ink .linkbtn:focus-visible { color: var(--accent); }

/* ACTION LINK: the one plain, larger link a block ends on. Use .act on an <a>. */
.act { display: inline-block; padding-block: 0.6rem; font-size: 1.125rem; }

/* SKIP LINK: .skip, first element in body. */
.skip { position: fixed; left: 0; top: 0; z-index: 60; padding: 0.75rem 1rem; background: var(--ink); color: var(--panel); transform: translateY(-110%); }
.skip:focus { transform: none; }

/* LAYOUT: .wrap = page width with outer gutters; .grid = twelve columns from 56rem; .c-3 to .c-12 = column spans. */
.wrap { width: min(100% - 2 * var(--gut), 82rem); margin-inline: auto; }
.grid { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 56rem) {
  .grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .c-3 { grid-column: span 3; }
  .c-4 { grid-column: span 4; }
  .c-5 { grid-column: span 5; }
  .c-6 { grid-column: span 6; }
  .c-7 { grid-column: span 7; }
  .c-8 { grid-column: span 8; }
  .c-9 { grid-column: span 9; }
  .c-12 { grid-column: span 12; }
}

/* BLOCK: a major section. Use <section class="block"> and start it with <div class="tape"></div>. */
.block { padding-block: clamp(1.25rem, 4.5vh, 3rem); }
.block > .wrap > .tape, .block > .tape { margin-bottom: var(--gap); }

/* PANELS: .panel = opaque pale grey behind all reading text; .on-ink = soft-black panel with pale text. Square, no outline, no shadow. */
.panel { background: var(--panel); padding: var(--pad); }
.on-ink { background: var(--ink); color: var(--panel); }

/* DEVICE, TAPE BAR: .tape = full-width 8px sunflower bar that strokes in once in view (also the site's rule). */
.tape { height: var(--tape); }
.tape::before, .tape-strip::before, .reveal::before {
  content: "";
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: 0 50%;
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* HOME OPENING BAR: .main--home is set on <main> of the home page only. There the opening picture strip
   bleeds to the right window edge, so the tape bar above it runs to the window edge with it. */
@media (min-width: 56rem) {
  .main--home .tape:has(+ .opening) { margin-right: calc((100% - 100vw) / 2); }
  .main--home > :first-child > .tape:first-child,
  .main--home > :first-child > .wrap > .tape:first-child { margin-right: calc((100% - 100vw) / 2); }
}

/* DEVICE, TAPE STRIP: .tape-strip = short strip heading a task or step; strokes in like .tape. */
.tape-strip { width: 6rem; max-width: 100%; height: var(--tape); margin-bottom: 0.625rem; }

/* REVEAL ON SCROLL: the stroke is the only reveal. .reveal on any empty bar element; site.js adds .is-in. Text and images stay still. */
.reveal { height: var(--tape); }
.reveal-ready .tape:not(.is-in)::before,
.reveal-ready .tape-strip:not(.is-in)::before,
.reveal-ready .reveal:not(.is-in)::before { transform: scaleX(0); }

/* DEVICE, TAPE TAB: .tape-tab = small sunflower label naming a venue, a format or a desk. Ink text only. */
.tape-tab { display: inline-block; padding: 0.125rem 0.625rem; background: var(--accent); color: var(--ink); font-size: var(--fs-small); line-height: 1.5; }

/* DEVICE, SPIKE MARK: .spike = a small ink cross, inline, before a row or label. Decorative: add aria-hidden. */
.spike {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  vertical-align: baseline;
  background:
    linear-gradient(currentColor, currentColor) 50% 50% / 100% 0.125rem no-repeat,
    linear-gradient(currentColor, currentColor) 50% 50% / 0.125rem 100% no-repeat;
}

/* DEVICE, LISTENING DISTANCE: .distance (set style="--at:70%") > .distance__mark, then .distance__ends with two <span> labels. */
.distance { position: relative; height: 2rem; background: linear-gradient(var(--ink), var(--ink)) 0 50% / 100% 0.125rem no-repeat; }
.distance__mark {
  position: absolute;
  left: clamp(1rem, var(--at, 50%), 100% - 1rem);
  top: 50%;
  width: 2rem;
  height: 1rem;
  transform: translate(-50%, -50%);
  background:
    linear-gradient(var(--ink), var(--ink)) 50% 50% / 0.125rem 100% no-repeat,
    linear-gradient(var(--ink), var(--ink)) 50% 50% / 1rem 0.125rem no-repeat,
    var(--accent);
}
.distance__ends { display: flex; justify-content: space-between; gap: 1rem; font-size: var(--fs-small); }

/* PAGE OPENING: .opening (grid) > .opening__text.panel [.opening__say sentence, h1, .act link] + .opening__media figure. */
.opening { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); padding-top: var(--gap); }
.opening__text { display: flex; flex-direction: column; justify-content: center; }
.opening__say, .say { margin: 0 0 0.5em; font-size: var(--fs-say); line-height: 1.12; text-wrap: balance; }
.opening__text h1 { margin-bottom: 0.35em; }
.opening__media { margin: 0; min-width: 0; }
@media (min-width: 56rem) {
  .opening { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  /* The opening ends on the grid, in line with the tape bar above it: neither the opening nor
     its picture strip may be wider than the column it stands in, whatever a page adds. */
  .opening, .opening > *, .opening__media { max-width: 100% !important; }
}

/* FIGURE AND CAPTION: .fig > img + figcaption (factual, on its own grey strip). .fig--wide 16:9, .fig--land 4:3, .fig--tall 4:5. */
.fig { margin: 0; display: flex; flex-direction: column; min-width: 0; }
.fig img, .fig video { width: 100%; height: 100%; object-fit: cover; }
.fig--wide img, .fig--wide video { aspect-ratio: 16 / 9; height: auto; }
.fig--land img { aspect-ratio: 4 / 3; height: auto; }
.fig--tall img { aspect-ratio: 4 / 5; height: auto; }
.fig figcaption { background: var(--panel); padding: 0.5rem 0.75rem; font-size: var(--fs-small); }

/* NUMBERED ROWS: ol.rows > li.row > .row__no (stencil number) + .row__body (set --cols for desktop columns). Phones stack the fields. */
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.row { display: flex; gap: 0.75rem; align-items: baseline; background: var(--panel); padding: 0.875rem var(--pad); }
.row__no { flex: 0 0 2.75rem; font-family: var(--display); font-size: 1.5rem; line-height: 1.2; white-space: nowrap; }
.row__body { flex: 1; min-width: 0; display: grid; gap: 0.25rem 1.25rem; grid-template-columns: minmax(0, 1fr); align-items: baseline; }
.row__body > * { margin: 0; min-width: 0; }
.row__name { font-family: var(--display); font-size: var(--fs-h3); line-height: 1.2; }
@media (min-width: 56rem) {
  .row__no { flex-basis: 4rem; font-size: 1.75rem; }
  .row__body { grid-template-columns: var(--cols, minmax(0, 3fr) minmax(0, 2fr) minmax(0, 4fr) minmax(0, 2fr)); }
}

/* TEXT TOGGLES: .picks (row, scrolls sideways on phones) > button.pick; the chosen one has aria-pressed="true". */
.picks { display: flex; gap: 0 1.5rem; margin: 0; padding: 0 var(--pad); list-style: none; overflow-x: auto; white-space: nowrap; background: var(--panel); }
.pick { flex: none; color: var(--ink); text-decoration: none; }
.pick[aria-pressed="true"], .pick[aria-current="true"] { background-size: 100% 0.1875rem; }

/* FACTS TABLE: table.facts with th (label) and td (answer) per row; striped, no rules. Also fits a <dl class="facts">. */
.facts { width: 100%; border-collapse: collapse; font-size: var(--fs-body); }
.facts th, .facts td { padding: 0.625rem 0.75rem; text-align: left; vertical-align: top; }
.facts th { width: 34%; }
.facts tr:nth-child(odd) { background: var(--stripe); }
dl.facts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 0.25rem 1rem; }
dl.facts dd { margin: 0; }

/* PROSE: .prose inside a .panel for long reading and legal pages; keeps the measure and spaces headings. */
.prose { max-width: 44rem; }
.prose h2 { margin-top: 1.5em; }
.prose h3 { margin-top: 1.25em; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.35em; }

/* HAND-OFF: the last block before the footer. .handoff.on-ink > .handoff__line + .handoff__links (two or three large links). */
.handoff { display: grid; gap: 1rem 2rem; padding: var(--pad); align-items: center; }
.handoff__line { margin: 0; font-size: 1.25rem; line-height: 1.3; }
.handoff__links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 2rem; }
.handoff__links a { display: inline-block; padding-block: 0.6rem; font-family: var(--display); font-size: 1.5rem; line-height: 1.25; }
@media (min-width: 56rem) {
  .handoff { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .handoff__line { font-size: 1.5rem; }
}

/* MASTHEAD: .mast holds the name alone, on solid grey, and scrolls away. .mark is the spike-mark logo. */
.mast { background: var(--ground); padding: 1rem var(--gut) 0.75rem; }
.mast__name {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  font-family: var(--display);
  font-size: 1.75rem;
  line-height: 1.1;
  text-decoration: none;
}
.mast__name span { background: inherit; }
.mark { flex: none; width: 1.15em; height: 1.15em; }
@media (min-width: 56rem) {
  .mast { padding-block: 1.25rem 1rem; }
  .mast__name { font-size: 2.5rem; }
}

/* DOCK: the navigation, a solid ink bar pinned to the bottom. The page links are equal-width centred columns
   with the same padding at both sides, on every screen; nothing else sits in the bar. */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: var(--ink);
  padding-bottom: env(safe-area-inset-bottom, 0rem);
}
.dock ul { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: 0; padding: 0 0.25rem; list-style: none; }
.dock li { min-width: 0; }
.dock a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 3.5rem;
  color: var(--panel);
  font-size: 0.9rem;
  text-align: center;
  white-space: nowrap;
  text-decoration: none;
  background: none;
}
.dock a span {
  padding-bottom: 0.25rem;
  background: linear-gradient(var(--accent), var(--accent)) 50% 100% / 0 0.1875rem no-repeat;
  transition: background-size 0.22s ease-out;
}
.dock a:hover span, .dock a:focus-visible span, .dock a[aria-current] span { background-size: 100% 0.1875rem; }
.dock a:hover, .dock a:focus-visible { color: var(--accent); }
.dock a:focus-visible { outline-offset: -0.375rem; }
@media (min-width: 48rem) {
  .dock ul { padding-inline: var(--gut); }
  .dock a { font-size: var(--fs-small); }
}
@media (min-width: 56rem) {
  .dock a { font-size: 1.0625rem; }
}

/* CONSENT: #consent = a solid grey band directly above the dock; a line of text, then two text choices. No overlay. */
#consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--dock-h);
  z-index: 39;
  background: var(--panel);
  border-top: 0.25rem solid var(--accent);
  padding: 0.375rem max(0.75rem, var(--gut)) 0;
  font-size: var(--fs-small);
  line-height: 1.4;
}
#consent p { margin: 0; }
.consent__choices { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
#consent .linkbtn { padding-block: 0.65rem; color: var(--ink); }

/* OFFER BAR: #promo = a sunflower tape strip that slides down from the top edge; only present when site.promo is set. */
#promo {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.25rem var(--gut);
  background: var(--accent);
  color: var(--ink);
  font-size: var(--fs-small);
  line-height: 1.4;
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.28s ease-out, opacity 0.28s ease-out;
}
#promo.is-in { transform: none; opacity: 1; }
#promo p { margin: 0; }
#promo button {
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 1.5rem;
  cursor: pointer;
}

/* FOOTER: .foot = full-width strike photograph with one square ink panel; in flow under the picture on phones, lower middle on desktop.
   The address, the link stack and the page links are all set in normal-case Fira at the body size. */
.foot { display: grid; grid-template-columns: minmax(0, 1fr); margin-top: clamp(1.25rem, 4.5vh, 3rem); }
.foot__img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.foot__panel { display: grid; gap: 0.75rem 2.5rem; padding: 1.25rem var(--gut) 1.5rem; font-family: var(--text); font-size: var(--fs-body); }
.foot__lead { margin: 0; font-size: 1.25rem; line-height: 1.3; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot a, .foot .linkbtn { display: inline-block; padding-block: 0.65rem; line-height: 1.5; color: var(--panel); }
.foot address, .foot address * {
  font-family: var(--text) !important;
  font-style: normal !important;
  font-weight: 400 !important;
  font-size: var(--fs-body) !important;
  line-height: 1.5;
  letter-spacing: normal !important;
  text-transform: none !important;
  font-variant: normal !important;
}
.foot address { margin-bottom: 0.75rem; }
.foot__place { white-space: nowrap; }
.foot__reach p { margin: 0; }
.foot__pages { display: flex; flex-wrap: wrap; gap: 0 1.25rem; font-size: inherit; }
.foot__fine { margin: 0; font-size: var(--fs-small); }
@media (min-width: 56rem) {
  .foot > * { grid-area: 1 / 1; }
  .foot__img { height: 100%; min-height: 46rem; aspect-ratio: auto; }
  .foot__panel {
    align-self: end;
    justify-self: center;
    width: min(100% - 2 * var(--gut), 50rem);
    margin: 14rem 0 2.5rem;
    padding: 1.75rem 2rem;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .foot__lead, .foot__pages, .foot__fine { grid-column: 1 / -1; }
  .foot__lead { font-size: 1.5rem; }
  .foot a, .foot .linkbtn { padding-block: 0.3rem; }
}

/* REDUCED MOTION: every stroke is fully drawn, nothing slides. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal-ready .tape:not(.is-in)::before,
  .reveal-ready .tape-strip:not(.is-in)::before,
  .reveal-ready .reveal:not(.is-in)::before { transform: none; }
}

/* PRINT: drop the pinned chrome. */
@media print {
  .dock, #consent, #promo, .skip { display: none; }
  body { padding-bottom: 0; background: none; }
}

/* A page never scrolls sideways. */
html, body { overflow-x: clip; }
/* Past a full-HD window the whole page grows with the window - type, gaps and pictures
   together - so a very wide screen (or a page zoomed far out) shows the same composition,
   not a small column of text lost in an enormous picture. */
@media (min-width: 1921px) { html { font-size: calc(100vw / 120); } }
/* What can be pressed in the chrome lies above the page: a huge headline's line box reaching
   into the navigation must not swallow the clicks meant for the links. */
header a, header button, nav a, nav button { position: relative; z-index: 2; }
/* A visitor who asked the system for less motion gets none, whatever a page forgot. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
