/* Styles for the archive section only (archive.php, production.php) -- loaded
   after assets/site.css, which supplies everything shared: .page, .page h1,
   .page .intro, .photo-grid, .photo-thumb, .tint-hover, the lightbox, the
   hamburger. Only what's specific to the archive lives here.

   Palette (Sep 2026): Coolors palette 8 -- dark-magenta #892D84, shadow-grey
   #2E303C, spicy-paprika #EA5721, grape-soda #7F507C. Same rule as every
   other page: only these four plus black/white for text. Background: the
   darkest of the four (shadow-grey, H=231.4 S=13.2 L=20.8) with HSL
   lightness halved -> L=10.4 -> #17181E, a near-neutral charcoal -- the one
   page on the site whose background isn't visibly tinted, which suits an
   archive. Picked over the other unassigned palettes by computing all of
   them: 2 and 10 leave the nav pills with no opacity that clears their
   contrast floors at all, 6 has no colour that reaches 4.5:1 as text, and 7/9
   sit too close to the purple pages. On this background all five nav pills
   clear their floors at their site-wide default opacities; only the home
   pill gets its usual per-page tuning (below).
   Text contrast against #17181E: spicy-paprika 4.96:1 (the only one of the
   four that clears the 4.5:1 text floor -- dark-magenta 2.34, grape-soda 2.82,
   shadow-grey 1.35 all fall short), so paprika is the h1 and link colour;
   everything else is white at reduced opacity, all >= 4.5:1. */
:root {
  --bg: #17181E;
  --nav-home-opacity: 0.74; /* computed passing range on this --bg is 0.723-0.894;
    0.74 = the minimum plus a little margin, same treatment as every page's value */
}

.page h1 { color: #EA5721; }
/* "by Samuel Beckett" after a show's title: same line, quieter (lib.php archive_byline). */
.archive-byline { font-size: clamp(1.1rem, 1.25vw, 2.2rem); font-weight: 400; color: rgba(255, 255, 255, 0.65); }   /* body copy's size and colour (= .page .intro) -- the owner's choice, Oct 2026 */
.page .intro { color: rgba(255, 255, 255, 0.65); }

/* House style: visible text displays lowercase, and the text underneath
   (including everything that comes out of the database) stays properly cased,
   so deleting this one rule reverts the whole archive to normal case. Form
   controls don't inherit text-transform, so the ones that need it say so. */
.archive { text-transform: lowercase; }
.archive select,
.archive button { text-transform: lowercase; }

.archive a {
  color: #EA5721;
  text-underline-offset: 3px;
}
.archive a:hover { color: #FFFFFF; }

.archive-back {
  font-size: 1.1rem;
  margin-bottom: 1.4rem;
  color: rgba(255, 255, 255, 0.65);
}

/* ── filters ── */
.archive-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.2rem;
  align-items: flex-end;
  margin: 0 0 2rem;
}

.archive-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.65);
}

/* "More options" (phones only): folds Show/Year/Venue/Sort... away so the
   page opens on the shows. archive-sections.js adds .collapsible (so without
   JavaScript nothing is ever hidden) and toggles .options-closed. */
.archive-options-toggle {
  display: none;
  font-family: 'DM Mono', monospace;
  font-size: 1.1rem;
  font-weight: 400;
  color: #FFFFFF;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 2px;
  padding: 6px 14px;
  cursor: pointer;
}
.archive-options-toggle::after { content: ' \25BE'; }                          /* ▾ */
.archive-options-toggle[aria-expanded="true"]::after { content: ' \25B4'; }    /* ▴ */

.archive-filters input[type="search"],
.archive-filters select {
  font-family: 'DM Mono', monospace;
  font-size: 1.1rem;
  font-weight: 400;
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.45); /* >= 3:1 against --bg, WCAG 1.4.11 */
  border-radius: 2px;
  padding: 6px 10px;
  min-width: 9rem;
}

.archive-filters input[type="search"] { min-width: 16rem; }
.archive-filters select option { background: #17181E; color: #FFFFFF; }
.archive-filters input::placeholder { color: rgba(255, 255, 255, 0.55); }

.archive-btn {
  font-family: 'DM Mono', monospace;
  font-size: 1.1rem;
  font-weight: 400;
  color: #0D0D0D;
  background: #EA5721;
  border: none;
  border-radius: 2px;
  padding: 7px 16px;
  cursor: pointer;
  transition: transform 0.15s;
}
/* Same scale "lift" as the site's pills (site.css .nav-link) rather than an
   opacity change: dimming a solid button would pull its black text below
   4.5:1 (5.45:1 at rest, 4.28:1 at 85% opacity). */
.archive-btn:hover,
.archive-btn:focus-visible { transform: scale(1.05); }

/* "Youth Theatre only" (Nov 2026, in place of the old Type menu): a tick box
   in line with the menus, its box in the button colour */
.archive-filters label.archive-check {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 7px;   /* level with the menus' text, beside them */
  cursor: pointer;
}
.archive-check input { width: 1.1rem; height: 1.1rem; accent-color: #EA5721; margin: 0; cursor: pointer; }

/* "Random photo" / "Random slideshow" on their own line under the search
   form's Search button (Nov 2026): outlined, so the orange Search button stays the
   one main action. Shown by the page's script only once the photo viewer is
   ready; folded away with the menus on a phone (.archive-option). */
.archive-random { display: flex; flex-wrap: wrap; gap: 0.8rem; flex-basis: 100%; margin: 0; }
.archive-random[hidden], .archive-random-pool[hidden] { display: none !important; }
.archive-random .archive-btn {
  color: #FFFFFF;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.45);
  padding: 6px 15px;
}
/* a random photo's caption links to it on its show's page */
@media (max-width: 599px) {   /* both on one line on a phone */
  .archive-random { gap: 0.5rem; }
  .archive-random .archive-btn { font-size: 0.95rem; padding: 5px 10px; }
}
.lightbox-caption a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 255, 255, 0.45); }
.lightbox-caption a:hover { text-decoration-color: #EA5721; }

.archive-count {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 1.4rem;
}

/* ── list of productions ── */
.archive-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 2rem 1.4rem;
}

.archive-card a {
  display: block;
  color: inherit;
  text-decoration: none;
}

/* The cover uses the shared .zoom-hover (below); its own height:auto is for
   uncropped thumbnails, so here the box sets the shape (square) and the
   picture is cropped to fill it. */
.archive-cover { aspect-ratio: 1 / 1; background: rgba(255, 255, 255, 0.05); }
.archive-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }

.archive-card h2 {
  font-size: 1.1rem;
  font-weight: 400;
  color: #FFFFFF;
  margin: 0.8rem 0 0.25rem;
}
.archive-card a:hover h2,
.archive-card a:focus-visible h2 { text-decoration: underline; text-underline-offset: 3px; }

.archive-card .meta {
  font-size: 1.1rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.65);
}

.archive-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  margin-top: 2.6rem;
  font-size: 1.1rem;
}
.archive-pager a,
.archive-pager span { padding: 4px 10px; border-radius: 2px; }
.archive-pager [aria-current="page"] {
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  text-decoration: none;
}
.archive-pager .gap { color: rgba(255, 255, 255, 0.55); }

/* ── one production ── */
.archive-meta {
  font-size: 1.1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 1.6rem;
}

/* Description paragraphs reuse the shared .intro type (same size and colour as
   every other page's body copy); only the spacing is tighter. All the archive's
   text (description, credits, notes, biographies, reviews, transcripts) runs
   the full page width -- the owner's choice, Oct 2026. */
.archive-description .intro { max-width: none; margin-bottom: 1.1rem; }

.archive-section { margin-top: 3rem; }
.archive-section h2 {
  font-size: 1.1rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* Makes a tile's image fill the tile -- without it a thumbnail renders at its
   natural width and overflows a phone. */
.archive .photo-thumb img { display: block; width: 100%; height: auto; }

/* Tried .tint-hover (grayscale + a colour duotone at rest, site.css) here --
   twice, two different tint colours -- and it just doesn't work for a photo
   archive the way it does for a portfolio page: full colour, all the time,
   is what these pictures are FOR. .zoom-hover keeps the one part that did
   earn its place -- the same scale-up on hover as every other gallery --
   without any of that. Used on every thumbnail in the archive, the list's
   cover cards included. */
.zoom-hover { position: relative; overflow: hidden; border-radius: 4px; }
.zoom-hover img { transition: transform 0.2s; }
.zoom-hover:hover img { transform: scale(1.04); }

/* Every grid in the archive reads left to right, top to bottom, like the
   camera's own file order -- not the masonry multi-column the site's other
   galleries use (site.css .photo-grid), because masonry fills a whole column
   top-to-bottom before starting the next one, which reads fine for loose
   photos but scrambles anything with a sequence (a programme's pages, a
   shoot's numbering). Packed without gaps AND in order at the same time
   needs a justified-rows layout -- assets/justified-grid.js measures each
   photo's real aspect ratio (from the <img>'s width/height attributes) and
   sets an explicit width+height per tile so consecutive photos share a row
   at one common height, scaled to fill the container exactly, the way a
   contact sheet or Flickr's old grid view lines up a strip of exposures.
   flex-wrap simply breaks a new row once a tile no longer fits -- the JS
   has already sized tiles so that happens exactly where each computed row
   ends. Until the script runs (or for a no-JS reader) tiles fall back to
   four per row (two on a phone) at their own heights -- never the thumbnail's
   full 640px width, which would make every photo a row of its own. */
.archive .photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.archive .photo-thumb {
  flex: 0 0 auto;
  width: calc((100% - 3rem) / 4);
}
@media (max-width: 640px) {
  .archive .photo-thumb { width: calc((100% - 1rem) / 2); }
}

/* A section is a <details>, so a page with hundreds of pictures stays usable:
   big ones start collapsed (see ARCHIVE_OPEN_LIMIT in production.php). The
   heading lives inside the summary, styled here as the section's rule line. */
.archive-section summary {
  cursor: pointer;
  color: rgba(255, 255, 255, 0.65);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}
.archive-section summary h2 {
  display: inline;
  font-size: 1.1rem;
  font-weight: 400;
  color: inherit;
  border: 0;
  padding: 0;
  margin: 0;
}

.archive-group {
  font-size: 1.1rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.65);
  margin: 1.6rem 0 0.8rem;
}
.archive-section summary + .archive-group { margin-top: 0; }

/* Programme PDF, radio interviews, other downloads. Players are made
   full-width and dark so their controls sit in with the page. */
.archive-media {
  list-style: none;
  font-size: 1.1rem;
  line-height: 1.6;
}
.archive-media li { margin-bottom: 1.4rem; }
.archive-media .media-title { display: block; color: rgba(255, 255, 255, 0.9); }
/* (the file details -- name, pixel size, size -- are a hover hint on the title,
   player and download link since Oct 2026, no longer a grey line: production.php) */
.archive-media audio,
.archive-media video { display: block; width: 100%; max-width: 640px; margin-top: 0.5rem; color-scheme: dark; }
/* height: auto only for video (its own shape from width/height); on <audio> it
   collapses the player to nothing */
.archive-media video { height: auto; }
/* Videos: a landscape player is up to 640 px wide (and never taller than 80% of
   the screen). Portrait ones (a phone held upright; class from production.php)
   sit side by side from the left, three to a row (two on a phone), the title,
   file and download link under each player (.media-caption).
   Width/height attributes keep each video's own shape. */
.archive-media video { width: auto; max-width: min(100%, 640px); max-height: 80vh; }
.archive-media:has(video.portrait) { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1rem; }
.archive-media:has(video.portrait) > li { flex: 0 0 auto; width: calc((100% - 2rem) / 3); margin-bottom: 0; }
@media (max-width: 640px) {
  .archive-media:has(video.portrait) > li { width: calc((100% - 1rem) / 2); }
}
.archive-media video.portrait { width: 100%; max-width: none; max-height: none; }
.archive-media .media-caption { margin-top: 0.5rem; }
/* "Copy link" beside a player's download link: looks like a link, it's a button */
.archive-media .media-copy-link {
  margin-left: 0.8em; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 0.15em; opacity: 0.75;
}
.archive-media .media-copy-link:hover, .archive-media .media-copy-link:focus-visible { opacity: 1; }
/* under a video the caption is narrow: Copy link on its own line, lined up with Download */
.archive-media .media-caption .media-copy-link { display: block; margin: 0.2rem 0 0; }

/* A media item's own text (a review article, a transcript): collapsed by
   default like a section, but plain -- no rule line, it's not a heading. */
.archive-media-text { margin-top: 0.6rem; }
.archive-media-text summary { cursor: pointer; color: rgba(255, 255, 255, 0.65); }
.archive-media-text p { color: rgba(255, 255, 255, 0.9); margin: 0.8rem 0 0; }
.archive-media-text .speaker { font-weight: 600; color: #fff; }

.archive-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.55rem 1.8rem;
  font-size: 1.1rem;
  line-height: 1.5;
}
.archive-facts dt { color: rgba(255, 255, 255, 0.65); }
.archive-facts dd { color: rgba(255, 255, 255, 0.9); margin: 0; }
.archive-facts .detail { color: rgba(255, 255, 255, 0.65); }

.archive-quote { margin: 0 0 1.6rem; }
.archive-quote p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}
.archive-quote footer {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 0.35rem;
}

.archive-bio { margin: 0 0 1.6rem; }
.archive-bio h3 { font-size: 1.1rem; margin: 0 0 0.4rem; }
.archive-bio h3 .detail { color: rgba(255, 255, 255, 0.65); font-weight: 400; }
.archive-bio p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  margin: 0.4rem 0 0;
}

.archive-links { list-style: none; font-size: 1.1rem; line-height: 1.6; }
.archive-links li { margin-bottom: 0.4rem; }
.archive-links .kind { color: rgba(255, 255, 255, 0.65); }

.archive-rights {
  margin-top: 2.4rem;
  font-size: 1.1rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 600px) {
  .archive-filters label,
  .archive-filters select,
  .archive-filters input[type="search"] { width: 100%; }
  .archive-filters.collapsible .archive-options-toggle { display: inline-block; }
  .archive-filters.collapsible.options-closed .archive-option { display: none; }
  .archive-facts { grid-template-columns: 1fr; gap: 0.1rem 0; }
  .archive-facts dd { margin-bottom: 0.7rem; }
}

/* ── admin.php (private) ── */
.admin-summary, .admin-filter { margin-bottom: 1rem; font-size: 1.1rem; }
.admin-filter { display: flex; gap: 0.8rem; align-items: end; flex-wrap: wrap; }
.admin-login { display: flex; gap: 0.8rem; align-items: end; flex-wrap: wrap; margin-bottom: 1rem; }
.admin-login input, .admin-filter input {
  font: inherit; color: inherit; background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.3); border-radius: 3px; padding: 0.3rem 0.5rem;
}
.admin-msg { padding: 0.5rem 0.8rem; border-radius: 3px; margin-bottom: 1rem; background: rgba(255,255,255,0.1); }
.admin-ok  { color: #B8E6A0; }
.admin-bad { color: #FFB199; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 1rem; line-height: 1.4; }
.admin-table th { text-align: left; font-weight: 400; color: rgba(255,255,255,0.65); border-bottom: 1px solid rgba(255,255,255,0.25); padding: 0.4rem 0.6rem; }
.admin-table td { padding: 0.5rem 0.6rem; border-bottom: 1px solid rgba(255,255,255,0.1); vertical-align: top; }
.admin-table .num { text-align: right; white-space: nowrap; }
.admin-off strong { color: rgba(255,255,255,0.5); }
.admin-sub { display: block; font-size: 0.9rem; color: rgba(255,255,255,0.6); }
.admin-flags { font-size: 0.9rem; color: #FFD9A0; }
.admin-pill { display: inline-block; padding: 0.05rem 0.5rem; border-radius: 999px; border: 1px solid rgba(255,255,255,0.35); font-size: 0.9rem; }
.admin-pill-on { border-color: #B8E6A0; color: #B8E6A0; }
.admin-row { display: flex; gap: 0.6rem; align-items: center; white-space: nowrap; }
.admin-link { font: inherit; background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; padding: 0; }
.admin-files { font-size: 0.9rem; word-break: break-all; }
.admin-detail td { background: rgba(255,255,255,0.05); }
@media (max-width: 720px) { .admin-table th:nth-child(n+3):nth-child(-n+5), .admin-table td:nth-child(n+3):nth-child(-n+5) { display: none; } }
.archive.admin { text-transform: none; } .archive.admin button, .archive.admin select { text-transform: none; }

/* Expand all / Collapse all (assets/archive-sections.js) */
.archive-toggles { display: flex; gap: 1.4rem; margin: 2rem 0 -1.4rem; font-size: 1.1rem; }
.archive-toggles button {
  font: inherit; color: #EA5721; background: none; border: 0; padding: 0;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.archive-toggles button:hover, .archive-toggles button:focus-visible { color: #FFFFFF; }

/* The archive's photo/file view: a file (PDF, audio, text) has no picture,
   so its card shows what it is instead. */
.archive-file-cover {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  padding: 1rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
  aspect-ratio: 1;
}
.archive-file-badge {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 3px;
  color: rgba(255, 255, 255, 0.75);
}
.archive-file-name { color: #fff; overflow-wrap: anywhere; }
.archive-file-info { font-size: 0.85rem; color: rgba(255, 255, 255, 0.65); }

/* An item reached from the archive's photo/file view, marked for a moment. */
.archive-target { outline: 2px solid rgba(255, 255, 255, 0.85); outline-offset: 3px; transition: outline-color 0.6s; }

/* "The archive in numbers", under the archive list */
/* heading exactly like a production page's section headings; the figures a
   step quieter -- same size and grey as the rights line (.archive-rights). */
.archive-stats { margin-top: 3.5rem; }
.archive-stats h2 {
  font-size: 1.1rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.archive-stats .archive-facts { font-size: 0.95rem; }
.archive-stats .archive-facts dt,
.archive-stats .archive-facts dd,
.archive-stats .archive-facts .detail { color: rgba(255, 255, 255, 0.5); }

/* Shows per year: one bar per year (single series, dark-magenta from the
   palette -- the owner's choice); the value on hover/focus, not on every bar. */
.archive-years { margin: 0 0 2rem; }
.archive-years figcaption { font-size: 0.95rem; color: rgba(255, 255, 255, 0.5); margin-bottom: 0.6rem; }
.archive-years-bars {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: flex-end; gap: 2px;
  height: 140px; max-width: 640px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}
.archive-years-bars li {
  position: relative; flex: 1 1 0; height: 100%;
  display: flex; align-items: flex-end; justify-content: center;
  outline: none; cursor: default;
}
.archive-years-bars .bar {
  display: block; width: 70%; min-height: 0;
  background: #892D84; border-radius: 4px 4px 0 0;
}
.archive-years-bars li:hover .bar, .archive-years-bars li:focus-visible .bar { background: #FFFFFF; }
.archive-years-bars .year {
  position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  font-size: 0.75rem; color: rgba(255, 255, 255, 0.5); white-space: nowrap;
}
.archive-years-bars li:hover::after, .archive-years-bars li:focus-visible::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  padding: 4px 8px; border-radius: 3px; white-space: nowrap; font-size: 0.85rem;
  background: #2E303C; color: #FFFFFF; z-index: 2; pointer-events: none;
}
.archive-years-max { margin: 2rem 0 0; font-size: 0.85rem; color: rgba(255, 255, 255, 0.5); }

/* The numbers under "The archive in numbers" link to what they count (Nov 2026):
   quiet underlines in the section's own grey, not orange links all over it */
.archive-stats .archive-facts a { color: inherit; text-decoration: underline; text-decoration-color: rgba(234, 87, 33, 0.55); }
.archive-stats .archive-facts a:hover { color: #FFFFFF; text-decoration-color: #EA5721; }
