/* The Chestertonian Players. Plain CSS, no build step.
   Palette comes from the playbills: royal blue ring, cream paper; red velvet and gold for the stage.
   Display face: Fredoka (SIL Open Font License 1.1, see /fonts/OFL-Fredoka.txt), self-hosted. */

@font-face {
  font-family: "Fredoka";
  src: url("/fonts/fredoka-latin-var.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --cream: #fbf4e2;
  --paper: #fffaf0;
  --sand: #f2e6c6;
  --ink: #2b2118;
  --muted: #5b4c3c;
  --blue: #2a6fb8;
  --blue-deep: #17497f;
  --velvet: #9c1f31;
  --velvet-mid: #7c1626;
  --velvet-deep: #5b0e1b;
  --gold: #e3b24a;
  --gold-light: #f6dc8c;
  --gold-deep: #a97a1f;
  --wood: #7a4a26;
  --display: "Fredoka", ui-rounded, "Arial Rounded MT Bold", "Avenir Next", system-ui, sans-serif;
  --body: ui-rounded, "Avenir Next", "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
  --playbill: Helvetica, Arial, sans-serif;
  --gutter: 16px;
  --max: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
img { height: auto; }
h1, h2, h3 { font-family: var(--display); color: var(--blue-deep); line-height: 1.15; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: clamp(2rem, 7vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4.6vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
a { color: var(--blue-deep); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { color: var(--velvet); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
.theatre :focus-visible, .stage :focus-visible, .spot :focus-visible { outline-color: var(--gold-light); }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--blue-deep); color: #fff; padding: 12px 18px; border-radius: 0 0 10px 10px; font-weight: 700; }
.skip-link:focus { top: 0; }

/* ---------- header ---------- */
.site-header { background: var(--paper); border-bottom: 4px solid var(--gold); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 18px; padding-block: 8px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--blue-deep); min-height: 52px; }
.brand-ring { width: 48px; height: 48px; flex: none; }
.brand-word { font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: .01em; line-height: 1.05; }
.brand-the { font-weight: 500; font-size: .8em; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 2px; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  border-radius: 22px; text-decoration: none; color: var(--blue-deep);
  font-family: var(--display); font-weight: 500; font-size: 1rem;
}
.site-nav a:hover { background: var(--sand); }
.site-nav a[aria-current="page"] { background: var(--blue-deep); color: #fff; }
.nav-long { display: none; }
@media (min-width: 760px) { .nav-long { display: inline; } .nav-short { display: none; } .brand-word { font-size: 1.3rem; } .brand-ring { width: 56px; height: 56px; } }
@media (max-width: 420px) { .site-nav a { padding: 0 10px; font-size: .95rem; } }
.ring-text { font-family: var(--display); font-weight: 700; fill: #fff; letter-spacing: 1px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px;
  background: var(--blue-deep); color: #fff; border: 0; border-radius: 26px; text-decoration: none; cursor: pointer;
  font-family: var(--display); font-weight: 600; font-size: 1.05rem; box-shadow: 0 3px 0 rgba(0,0,0,.25);
}
.btn:hover { background: var(--velvet); color: #fff; }
.btn--ghost { background: transparent; color: var(--blue-deep); border: 3px solid var(--blue-deep); box-shadow: none; }
.btn--ghost:hover { background: var(--blue-deep); color: #fff; }

/* ---------- the theatre (home) ---------- */
.theatre { position: relative; overflow: hidden; background: #1d070c; isolation: isolate; }
.valance {
  position: relative; z-index: 6; height: 40px;
  background: linear-gradient(#b52a3e, var(--velvet-mid) 70%, var(--velvet-deep));
  border-bottom: 5px solid var(--gold);
}
.valance::before { /* gold fringe hanging behind the scallops */
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 24px; margin-top: -2px;
  background: repeating-linear-gradient(90deg, var(--gold) 0 2px, transparent 2px 5px);
}
.valance::after { /* velvet scallops */
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 14px; margin-top: -2px;
  background: radial-gradient(circle at 50% 0, var(--velvet-deep) 13.5px, transparent 14px) 0 0 / 28px 14px repeat-x;
  filter: drop-shadow(0 2px 0 var(--gold));
}
.valance-fringe { display: none; }
.curtain {
  position: absolute; top: 0; bottom: 0; width: 50%; z-index: 4; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.40) 0, rgba(0,0,0,0) 20px, rgba(255,255,255,.14) 34px, rgba(0,0,0,.40) 56px),
    linear-gradient(#a82337, var(--velvet-mid) 55%, var(--velvet-deep));
  box-shadow: inset 0 -30px 40px rgba(0,0,0,.35);
  animation: curtain-part 1.6s cubic-bezier(.65, 0, .25, 1) .7s both;
}
.curtain--l { left: 0; transform-origin: 0 50%; border-right: 6px solid var(--gold); }
.curtain--r { right: 0; transform-origin: 100% 50%; border-left: 6px solid var(--gold); }
@keyframes curtain-part { from { transform: scaleX(1); } to { transform: scaleX(.16); } }
.theatre.restart .curtain { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .curtain { animation: none; transform: scaleX(.16); }
  .replay-row { display: none; }
}

.stage {
  position: relative; z-index: 2; padding: 34px calc(8% + 6px) 0; /* side padding keeps the cast clear of the gathered curtains */
  background:
    radial-gradient(ellipse 70% 55% at 50% 0, rgba(255, 224, 150, .38), transparent 70%),
    linear-gradient(#3a1119, #220910);
}
.marquee-wrap { padding: 8px 0 0; text-align: center; max-width: 760px; margin: 0 auto; }
.present { font-family: var(--playbill); font-style: italic; color: var(--gold-light); font-size: clamp(1.05rem, 3.4vw, 1.5rem); margin: 0 0 8px; }
.marquee {
  padding: 9px; border-radius: 18px;
  background: radial-gradient(circle, #fff6c8 0 2.6px, transparent 3.2px) 0 0 / 16px 16px, linear-gradient(var(--gold), var(--gold-deep));
  box-shadow: 0 6px 18px rgba(0,0,0,.55), 0 0 28px rgba(255, 214, 120, .35);
  animation: bulbs 1.3s steps(1) infinite;
}
@keyframes bulbs { 50% { background-position: 8px 8px, 0 0; } }
@media (prefers-reduced-motion: reduce) { .marquee { animation: none; } }
.marquee-panel { border-radius: 11px; padding: 16px 12px 14px; background: linear-gradient(#18325a, #0f2142); border: 3px solid var(--gold-light); }
.marquee-title {
  margin: 0; font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  font-size: clamp(.85rem, 4.7vw, 2.6rem); line-height: 1.12; color: var(--gold-light);
  text-shadow: 0 2px 0 #7a4f08, 0 0 18px rgba(255, 220, 130, .55);
}
.stage-hint { text-align: center; color: #f3e6c2; margin: 12px 0 0; font-size: .95rem; }

.cast {
  list-style: none; margin: 0 auto; padding: 14px 0 24px; max-width: 1040px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 10px;
}
.tile-item { flex: 0 0 calc((100% - 20px) / 3); max-width: 150px; }
@media (min-width: 600px) { .tile-item { flex-basis: calc((100% - 40px) / 5); } }
@media (min-width: 900px) { .tile-item { flex-basis: calc((100% - 60px) / 7); } .cast { gap: 18px 10px; } }
.tile {
  display: flex; flex-direction: column; align-items: center; gap: 7px; text-decoration: none; color: #fff3d2;
  min-height: 44px; transition: transform .28s cubic-bezier(.3, 1.4, .5, 1), opacity .25s, filter .25s;
}
.tile img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; border: 3px solid var(--gold); background: #e9dcb8;
  box-shadow: 0 10px 14px rgba(0,0,0,.5);
}
.tile-name {
  font-family: var(--display); font-weight: 600; font-size: .85rem; line-height: 1.15; text-align: center;
  background: rgba(0,0,0,.4); padding: 3px 9px; border-radius: 11px; min-height: 22px;
}
.tile:hover, .tile:focus-visible { transform: translateY(-6px); }
.tile.is-front { transform: translateY(-12px) scale(1.08); position: relative; z-index: 3; }
.tile.is-front img { border-color: var(--gold-light); box-shadow: 0 0 0 4px rgba(246, 220, 140, .45), 0 0 30px rgba(255, 224, 150, .9), 0 14px 18px rgba(0,0,0,.5); }
.cast.has-front .tile:not(.is-front) { opacity: .5; filter: saturate(.7); }
@media (prefers-reduced-motion: reduce) { .tile, .tile * { transition: none !important; } }
.stage-floor {
  margin-inline: calc(-8% - 6px);
  height: 38px; border-top: 5px solid var(--gold);
  background: repeating-linear-gradient(90deg, #8a5530 0 58px, #6c3f1d 58px 60px), #7a4a26;
  box-shadow: inset 0 14px 18px rgba(0,0,0,.4);
}

/* the card that slides up over the stage */
.spot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; margin: 0 auto; width: 100%; max-width: 680px;
  max-height: 78vh; overflow-y: auto; background: var(--paper); color: var(--ink);
  border: 4px solid var(--gold); border-bottom: 0; border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,.5); padding: 18px var(--gutter) 24px;
  display: grid; grid-template-columns: 96px 1fr; gap: 6px 16px;
  transform: translateY(110%); visibility: hidden; transition: transform .45s cubic-bezier(.2, .9, .3, 1), visibility 0s .45s;
}
.spot.is-open { transform: none; visibility: visible; transition: transform .45s cubic-bezier(.2, .9, .3, 1), visibility 0s; }
.spot-img { width: 96px; height: 96px; border-radius: 12px; border: 3px solid var(--blue); object-fit: cover; }
.spot-name { margin: 0 44px 2px 0; font-size: 1.5rem; }
.spot-role { margin: 0 0 8px; color: var(--velvet); font-weight: 700; font-size: .95rem; }
.spot-bio { font-size: 1rem; }
.spot-close {
  position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; border: 0; border-radius: 22px; cursor: pointer;
  background: var(--sand); color: var(--blue-deep); font: 700 1.7rem/1 var(--display);
}
.spot-close:hover { background: var(--gold-light); }
@media (min-width: 700px) { .spot { grid-template-columns: 140px 1fr; } .spot-img { width: 140px; height: 140px; } .spot-name { font-size: 1.8rem; } }
@media (prefers-reduced-motion: reduce) { .spot, .spot.is-open { transition: none; } }

.replay-row { display: flex; justify-content: flex-end; padding-top: 10px; }
.replay {
  min-height: 44px; padding: 0 18px; border-radius: 22px; cursor: pointer;
  background: var(--paper); color: var(--blue-deep); border: 2px solid var(--blue-deep); font: 600 .95rem var(--display);
}
.replay:hover { background: var(--blue-deep); color: #fff; }

/* ---------- sections below the stage ---------- */
.sec { padding: 22px 0 56px; }
.sec-tight { padding-top: 18px; }
.sec-last { padding-bottom: 72px; }
.sec h2 { margin-bottom: .6em; }
.more { margin: 14px 0 0; }

.board { display: grid; gap: 14px; }
@media (min-width: 700px) { .board { grid-template-columns: 1fr 1fr; } }
.board-half {
  background: linear-gradient(var(--velvet-mid), var(--velvet-deep)); color: #fff3d2; border: 4px solid var(--gold);
  border-radius: 16px; padding: 16px 18px 6px; box-shadow: 0 5px 0 rgba(0,0,0,.18);
}
.board-label { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--gold-light); font-size: .9rem; margin: 0 0 4px; }
.board-text { font-family: var(--display); font-weight: 500; font-size: 1.3rem; line-height: 1.3; }

.show-strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 359px) { .show-strip { grid-template-columns: minmax(0, 240px); justify-content: center; } }
@media (min-width: 760px) { .show-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.show-card a, .show-card--lost a {
  display: flex; flex-direction: column; gap: 8px; height: 100%; text-decoration: none; color: var(--ink);
  background: var(--paper); border: 3px solid var(--blue); border-radius: 14px; padding: 10px; box-shadow: 0 4px 0 rgba(23, 73, 127, .25);
}
.show-card a:hover { border-color: var(--velvet); }
.show-card img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 8px; border: 1px solid #d9ccaa; }
.show-num { font-family: var(--display); font-weight: 700; color: var(--velvet); text-transform: uppercase; letter-spacing: .1em; font-size: .85rem; }
.show-title { font-family: var(--display); font-weight: 600; color: var(--blue-deep); line-height: 1.2; font-size: clamp(.7rem, 3.8vw, 1.06rem); }
.lost-art {
  display: grid; place-items: center; aspect-ratio: 2 / 3; border-radius: 8px; border: 3px dashed #b9a77a; color: #b9a77a;
  font: 700 4rem var(--display); background: repeating-linear-gradient(45deg, transparent 0 10px, rgba(185, 167, 122, .15) 10px 20px);
}

.teaser { display: grid; gap: 18px; align-items: center; }
@media (min-width: 760px) { .teaser { grid-template-columns: 1fr 1fr; gap: 32px; } }
.teaser-img img { border-radius: 16px; border: 4px solid var(--gold); box-shadow: 0 8px 20px rgba(0,0,0,.25); width: 100%; }
.about-teaser { background: var(--paper); border: 3px solid var(--blue); border-radius: 18px; padding: 22px 20px 6px; max-width: 760px; }
.about-teaser.wrap { margin-inline: auto; width: calc(100% - 2 * var(--gutter)); padding-inline: 20px; }

/* ---------- inner pages ---------- */
.page-top { padding: 24px 0 0; }
.page-top h1 { margin-bottom: .25em; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 40rem; }
.small { font-size: .95rem; color: var(--muted); margin-bottom: .4em; }
.fine { font-size: .9rem; color: var(--muted); margin-top: 28px; }

.jumpbar { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.jump { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; background: var(--paper); border: 2px solid var(--blue); border-radius: 22px; text-decoration: none; font-family: var(--display); font-weight: 500; font-size: .95rem; }
.jump:hover { background: var(--blue-deep); color: #fff; }

.pgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
@media (min-width: 640px) { .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 980px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pcard {
  border-radius: 22px; padding: 9px; scroll-margin-top: 16px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold-deep) 45%, var(--gold-light) 70%, var(--gold-deep));
  box-shadow: 0 8px 18px rgba(80, 50, 10, .3);
}
.pcard:target { outline: 5px solid var(--blue); outline-offset: 4px; animation: pop .7s ease-out; }
@keyframes pop { 0% { transform: scale(.97); } 60% { transform: scale(1.025); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .pcard:target { animation: none; } }
.pcard-inner { background: var(--paper); border-radius: 14px; padding: 14px 14px 16px; height: 100%; display: flex; flex-direction: column; }
.pcard-no { margin: 0 0 6px; font-family: var(--display); text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; color: var(--muted); font-weight: 600; }
.pcard-name { background: var(--blue-deep); color: #fff; border-radius: 10px; padding: 8px 12px; font-size: 1.3rem; margin: 0 0 4px; }
.pcard-role { margin: 0 0 10px; color: var(--velvet); font-weight: 700; font-size: .95rem; }
.pcard-img { width: 100%; aspect-ratio: 1; object-fit: cover; border: 3px solid var(--blue); border-radius: 10px; margin-bottom: 12px; background: #e9dcb8; }
.pcard-bio { font-size: 1rem; }
.soon { font-size: .9rem; color: var(--muted); font-style: italic; }
.stats-h { font-size: .85rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: auto 0 6px; padding-top: 6px; }
.stats { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.stats li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; background: var(--sand); border-radius: 9px; padding: 8px 12px; font-size: .95rem; }
.stats b { font-family: var(--display); color: var(--velvet); font-weight: 600; text-align: right; }
.see { margin: 0; font-size: .95rem; }

.shows-wrap { padding-bottom: 40px; }
.show { padding-bottom: 36px; border-bottom: 2px dashed #d9c9a0; margin-bottom: 8px; scroll-margin-top: 12px; }
.show:last-child { border-bottom: 0; }
.show-badge { display: inline-block; background: var(--velvet); color: #fff; border-radius: 12px; padding: 2px 12px; font-size: .75em; letter-spacing: .06em; vertical-align: .12em; margin-right: 6px; }
.credits { font-family: var(--display); font-weight: 500; font-size: 1.08rem; color: var(--ink); }
.chips { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 3px 14px 3px 3px; background: var(--paper); border: 2px solid var(--blue); border-radius: 24px; text-decoration: none; font-family: var(--display); font-weight: 500; font-size: .95rem; }
.chip:hover { background: var(--blue-deep); color: #fff; }
.chip img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.playbill { margin: 14px 0 12px; }
.playbill img { width: 100%; border-radius: 10px; border: 3px solid var(--gold); box-shadow: 0 6px 16px rgba(0,0,0,.2); }
.playbill figcaption { font-size: .92rem; color: var(--muted); margin-top: 8px; }
.lost-note { background: var(--paper); border: 3px dashed #b9a77a; border-radius: 16px; padding: 16px 18px 6px; max-width: 46rem; }

.poster { margin: 0 auto; max-width: 900px; }
.poster img { width: 100%; border-radius: 18px; border: 5px solid var(--gold); box-shadow: 0 10px 28px rgba(0,0,0,.35); }
.poster figcaption { margin-top: 10px; text-align: center; color: var(--muted); font-size: .95rem; font-style: italic; }
.members { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
@media (min-width: 760px) { .members { grid-template-columns: repeat(3, 1fr); } }
.member { background: var(--paper); border: 3px solid var(--blue); border-radius: 18px; padding: 14px; }
.member img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; border: 3px solid var(--gold); margin-bottom: 10px; }
.member h3 { margin-bottom: 0; }
.member-inst { color: var(--velvet); font-weight: 700; margin-bottom: 6px; }
.fine-note { font-size: .9rem; color: var(--muted); }
.setlist { background: linear-gradient(#18325a, #0f2142); color: #fff3d2; border: 4px solid var(--gold); border-radius: 18px; padding: 20px 20px 10px; max-width: 46rem; }
.setlist h2 { color: var(--gold-light); }
.setlist ol { padding-left: 1.3em; margin: 0 0 1em; }
.setlist li { margin-bottom: .7em; }
.setlist .small { color: #d9ccaa; }
.band-line { margin-top: 22px; font-family: var(--display); font-size: 1.25rem; color: var(--blue-deep); max-width: 40rem; }

.two { display: grid; gap: 18px; }
@media (min-width: 760px) { .two { grid-template-columns: 1fr 1fr; } }
.about-card { background: var(--paper); border: 3px solid var(--blue); border-radius: 18px; padding: 20px 20px 8px; }
.guestbook { background: var(--paper); border: 3px dashed var(--gold-deep); border-radius: 18px; padding: 20px 20px 8px; max-width: 46rem; }
.guest-soon { font-family: var(--display); font-weight: 600; font-size: 1.5rem; color: var(--velvet); margin-bottom: .3em; }

/* 404 */
.nf-curtain { position: relative; }
.nf-body { padding: 56px var(--gutter) 90px; text-align: center; max-width: 40rem; }
.nf-links { margin-top: 22px; }

/* ---------- footer ---------- */
.site-footer { background: var(--blue-deep); color: #f6efdc; padding: 26px 0 30px; border-top: 5px solid var(--gold); }
.site-footer p { margin: 0; }
.foot-credits { font-family: var(--display); font-weight: 500; font-size: 1rem; line-height: 1.5; }
.foot-site { margin-top: 10px; font-size: .78rem; color: #d3dcec; }
.foot-site a { color: #f6efdc; }
.foot-site a:hover { color: var(--gold); }

/* ---------- no single-word last lines (Jeff's rule) ----------
   Headings and the marquee wrap evenly; body text avoids a lone last word. build_pages.py also joins the
   last two words of every heading, caption, lead, label and short paragraph with a non-breaking space. */
h1, h2, h3, h4, .marquee-title, .present, .show-title, .pcard-name, .spot-name { text-wrap: balance; }
p, li, figcaption, .tile-bio, .spot-bio, .pcard-bio, .board-text, .lead, .credits, .fine-note, .member-inst { text-wrap: pretty; }
