/* House Synergy flyer archive (/flyers/), built by tools/flyers.py.
   Tokens, header, buttons and footer copy the home page, whose CSS is inline in index.html: keep the two in step.
   The page works without JavaScript (flyers open as plain images); js/flyers.js adds the full-size viewer.
   No animation. The header is not sticky, so it never covers the focused link. */
:root {
  --bg: #15120e;
  --panel: #1f1b16;
  --fg: #f2ebdf;
  --mute: #a9a091;
  --line: #3a332a;
  --signal: #ffb02e;
  --signal-ink: #1a1408;
  --font-display: "Archivo Narrow", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-padding-block: 2rem; }   /* room for the focus ring when Tab scrolls a link into view */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }
main:focus { outline: none; }
.wrap { max-width: 78rem; margin: 0 auto; padding-inline: clamp(1rem, 4vw, 2.5rem); }
.mono { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; }
.k { color: var(--signal); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; line-height: .95; margin: 0; letter-spacing: -.005em; text-wrap: balance; }
p { margin: 0; max-width: 62ch; }
.btn { display: inline-flex; align-items: center; gap: .55rem; background: var(--signal); color: var(--signal-ink); font-weight: 800; text-decoration: none; padding: .8rem 1.15rem; font-size: .95rem; border: 0; font-family: var(--font-body); }
.btn.ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--mute); }

/* skip link: off screen until focused */
.skip { position: absolute; left: 1rem; top: -10rem; z-index: 20; background: var(--signal); color: var(--signal-ink); font-weight: 800; padding: .7rem 1rem; text-decoration: none; }
.skip:focus { top: 1rem; }

/* header (as the home page; links padded to at least 24px tall) */
header.site { border-bottom: 1px solid var(--line); background: var(--bg); }
header.site .wrap { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding-block: .9rem; }
.brand { display: flex; align-items: center; gap: .9rem; text-decoration: none; padding-block: .2rem; }
.brand .hs { font-family: var(--font-display); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; font-size: 1.05rem; }
.brand .hs span { color: var(--signal); }
nav.main { display: flex; gap: .2rem 1.4rem; flex-wrap: wrap; }
nav.main a { display: inline-block; padding-block: .3rem; text-decoration: none; color: var(--mute); }
nav.main a:hover { color: var(--fg); }
nav.main a[aria-current="page"] { color: var(--fg); text-decoration: underline; text-underline-offset: .4em; }
nav.main a.book { color: var(--signal); }

/* page */
.flyers { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.flyers-head { display: grid; gap: .9rem; margin-bottom: clamp(2rem, 5vw, 3rem); }
.flyers-head h1 { font-size: clamp(2.6rem, 7vw, 5rem); }
.lede { color: var(--mute); font-size: 1.15rem; }
.lede a { color: var(--fg); text-underline-offset: 3px; }
.era { margin-bottom: clamp(2.5rem, 6vw, 4rem); }
.era h2 { text-transform: none; font-size: clamp(1.8rem, 4.5vw, 2.8rem); padding-bottom: .7rem; margin-bottom: 1.2rem; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.era .count { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .1em; color: var(--mute); font-weight: 400; }
.note { color: var(--mute); font-size: .9rem; max-width: 62ch; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.note a { color: var(--fg); text-underline-offset: 3px; }

/* grid: rows of flyers at about the same height, whatever their shape. --ar is width / height. */
.flyer-grid { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1.4rem 1rem; }
.flyer-grid::after { content: ""; flex-grow: 1000; }      /* a short last row keeps its size instead of stretching */
.flyer-grid li { flex: calc(var(--ar) * 100) 1 calc(var(--ar) * 17rem); min-width: 0; scroll-margin-top: 1rem; }
.flyer-grid figure { margin: 0; display: grid; gap: .6rem; }
.flyer { display: block; background: var(--panel); outline-offset: 3px; }
.flyer img { width: 100%; height: auto; transition: none; }
.flyer:hover img { opacity: .92; }
.flyer-grid figcaption { display: grid; gap: .15rem; font-size: .82rem; line-height: 1.35; overflow-wrap: anywhere; }
.flyer-grid figcaption strong { font-weight: 700; }
.flyer-grid figcaption span { color: var(--mute); }
@media (max-width: 480px) { .flyer-grid li { flex-basis: calc(var(--ar) * 15rem); } }

/* viewer (built by js/flyers.js) */
body:has(dialog.viewer[open]) { overflow: hidden; }
dialog.viewer { border: 0; padding: 0; margin: 0; width: 100%; max-width: none; height: 100%; max-height: none; background: rgba(10, 8, 6, .96); color: var(--fg); }
dialog.viewer::backdrop { background: rgba(10, 8, 6, .96); }
.viewer-inner { height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: .8rem; padding: 3.8rem clamp(.75rem, 3vw, 2rem) max(1rem, env(safe-area-inset-bottom)); }
.viewer-stage { min-height: 0; position: relative; }
/* the picture is sized against the stage, not its own width and height attributes, so it always fits the screen */
.viewer-stage img { position: absolute; inset: 0; margin: auto; width: auto; height: auto; max-width: 100%; max-height: 100%; }
.viewer-bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1rem; }
.viewer-cap { text-align: center; font-size: .9rem; line-height: 1.35; display: grid; gap: .15rem; overflow-wrap: anywhere; }
.viewer-cap span { color: var(--mute); }
.viewer-cap .pos { color: var(--signal); font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.viewer button { min-width: 48px; min-height: 48px; padding: 0 1rem; background: transparent; color: var(--fg); border: 0; box-shadow: inset 0 0 0 1px var(--line); font: inherit; font-weight: 700; cursor: pointer; }
.viewer button:hover { box-shadow: inset 0 0 0 1px var(--mute); }
.viewer button:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }
.viewer .close { position: absolute; top: .75rem; right: clamp(.75rem, 3vw, 2rem); }
@media (max-width: 560px) { .viewer-bar { grid-template-columns: 1fr 1fr; } .viewer-cap { grid-column: 1 / -1; grid-row: 1; } }

/* footer (as the home page) */
footer { border-top: 1px solid var(--line); padding-block: 2.5rem 3rem; color: var(--mute); }
footer .wrap { display: grid; gap: 2rem; }
.foot-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; }
.signup { display: grid; gap: .7rem; }
.socials { display: flex; flex-wrap: wrap; gap: .2rem 1.4rem; align-content: start; }
.socials a { display: inline-block; padding-block: .3rem; text-decoration: none; color: var(--fg); }
.socials a:hover { color: var(--signal); }
.small { font-size: .8rem; }
@media (max-width: 720px) { .foot-top { grid-template-columns: 1fr; } }
