/* ==========================================================
   Cartoon portfolio: one stylesheet shared by every page.
   Change the colors and fonts in :root and the whole site follows.
   ========================================================== */

:root {
  --paper: #FFEED7;      /* page background (soft cream) */
  --panel: #FFFAF2;      /* "white" of comic panels (lighter cream) */
  --ink: #0259DD;        /* headings, links in the menu, borders (blue) */
  --text: #000000;       /* all text except the SOUNDSTAGE COMICS wordmark */
  --muted: #595959;      /* secondary text (dates, small print): soft grey */
  --accent: #FF6648;     /* bright orange accent */
  --border: 3px solid #000;
  --max: 1120px;
  --font-head: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Newsreader", Georgia, serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid #000;
  outline-offset: 3px;
}

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 20;
  padding: .5rem 1rem;
  background: var(--ink);
  color: var(--paper);
}
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- Header and navigation ---------- */

.site-header { padding-block: 1.25rem; }

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 2rem;
}

.site-name {
  color: var(--text);
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: -.02em;
  text-transform: uppercase;
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 1rem;
}

.nav a {
  color: var(--text);
  padding-block: .25rem;
  border-bottom: 3px solid transparent;
  text-decoration: none;
  transition: color .15s ease, border-color .15s ease;
}
.nav a:hover,
.nav a:focus-visible { color: var(--ink); border-color: var(--ink); }
.nav a[aria-current] { border-color: var(--accent); }

/* ---------- Home page ---------- */

.hero { padding-block: clamp(2rem, 6vw, 4.5rem) 2rem; }

/* The wordmark uses a tall, narrow, widely spaced font. */
.hero h1 {
  margin: 0;
  font-family: "Antonio", "Arial Narrow", "Helvetica Neue", sans-serif;
  font-weight: 700;
  font-size: clamp(2.25rem, 8.2vw, 6.5rem);
  line-height: 1;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink);
}
.hero h1 span:last-child { color: var(--accent); }

.hero p {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-family: "Antonio", "Arial Narrow", "Helvetica Neue", sans-serif;
  font-weight: 500;
  font-size: clamp(.9rem, 2.4vw, 1.2rem);
  letter-spacing: .32em;
  line-height: 1.5;
  text-transform: uppercase;
}

/* The home page is laid out like a comic page: three panels, each a link. */
.comic-page {
  display: grid;
  gap: 14px;
  grid-template-columns: 1.35fr 1fr;
  grid-template-areas:
    "ed strips"
    "ed gn";
  margin-bottom: 3rem;
  padding: 14px;
  background: var(--panel);
  border: var(--border);
}

.panel {
  position: relative;
  display: block;
  min-height: 240px;
  overflow: hidden;
  background: var(--panel);
  border: var(--border);
  text-decoration: none;
}
.panel--ed { grid-area: ed; min-height: 500px; }
.panel--strips { grid-area: strips; }
.panel--gn { grid-area: gn; }

.panel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.panel:hover img { transform: scale(1.04); }

/* Red halftone dots in the top-right corner of each panel. */
.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(var(--accent) 1.6px, transparent 1.8px);
  background-size: 9px 9px;
  -webkit-mask-image: linear-gradient(225deg, #000, transparent 50%);
  mask-image: linear-gradient(225deg, #000, transparent 50%);
  opacity: .8;
}

/* The label is styled like a comic caption box. */
.panel-label {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 1;
  max-width: calc(100% - 1.5rem);
  padding: .6rem 1rem .7rem;
  background: var(--paper);
  border: solid #000;
  border-width: 3px 3px 0 0;
}
.panel-label h2 {
  color: var(--text);
  margin: 0;
  font: 900 1.5rem/1 var(--font-head);
  letter-spacing: -.03em;
  text-transform: uppercase;
}
.panel-label p {
  margin: .15rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.35;
}

/* Collection chooser (Editorial cartoons page): same comic-page look as the home page. */
.collections {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  margin-bottom: 3rem;
  padding: 14px;
  background: var(--panel);
  border: var(--border);
}
.collections .panel { min-height: 360px; }

/* ---------- Gallery pages ---------- */

.page-head { padding-block: clamp(1.5rem, 4vw, 3rem) 1.5rem; }

.page-head h1 {
  margin: 0;
  color: var(--text);
  font-family: "Antonio", "Arial Narrow", "Helvetica Neue", sans-serif;
  font-weight: 700;
  font-size: clamp(2.75rem, 8vw, 5rem);
  line-height: .95;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.page-head p {
  max-width: 52ch;
  margin: .75rem 0 0;
  color: var(--muted);
}

.section-title {
  color: var(--text);
  margin: 2.5rem 0 1rem;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 2rem;
  letter-spacing: -.03em;
  text-transform: uppercase;
}

.gallery {
  display: grid;
  align-items: start;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  padding-bottom: 3rem;
}
.gallery--strips { grid-template-columns: 1fr; max-width: 920px; }
.gallery--pages { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }

.work {
  margin: 0;
  background: var(--panel);
  border: var(--border);
}
.work a.zoom { display: block; cursor: zoom-in; }

.work figcaption {
  padding: .75rem 1rem 1rem;
  border-top: var(--border);
}
.work .title {
  display: block;
  color: var(--text);
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.25;
}
.work .meta {
  display: block;
  color: var(--muted);
  font-size: 1rem;
}
.work .blurb {
  margin: .5rem 0 0;
  font-size: 1rem;
  line-height: 1.45;
}

/* ---------- YouTube videos ---------- */

.videos {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
}

.video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000 center / cover no-repeat;
}
.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-play {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(26, 34, 51, .35);
  color: #fff;
  font: 700 1.25rem var(--font-head);
  cursor: pointer;
}
.video-play:hover { background: rgba(26, 34, 51, .15); }
.video-play:disabled { background: transparent; cursor: default; }

/* ---------- About page ---------- */

.prose { max-width: 60ch; padding-bottom: 3rem; }
.prose h2 {
  color: var(--text);
  margin: 2rem 0 .5rem;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: -.03em;
  text-transform: uppercase;
}
.prose p { margin: 0 0 1rem; }

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 1.5rem 2.5rem;
  border-top: var(--border);
  color: var(--muted);
  font-size: 1rem;
}

/* ---------- Image viewer (opens when you tap a cartoon) ---------- */
/* Narrow screens: picture on top, text below. Wide screens: picture left, text right. */

.lightbox {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-family: var(--font-body);
}
.lightbox::backdrop { background: rgba(4, 22, 62, .97); }

.lightbox-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  height: 100%;
  padding: 1rem;
}
.lightbox img {
  flex: 0 1 auto;
  min-height: 0;
  max-width: 100%;
  max-height: 46vh;
  object-fit: contain;
  background: var(--panel);
}
.lightbox-side {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: .75rem;
  width: min(100%, 60ch);
  min-height: 0;
}
.lightbox-caption {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  font-size: 1.0625rem;
  line-height: 1.5;
  text-align: left;
}
.lightbox-caption strong {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.25;
  letter-spacing: -.01em;
}
.lightbox-caption span { display: block; opacity: .8; }
.lightbox-caption p { margin: .75rem 0 0; }
.lightbox-caption .published,
.lightbox-caption .republished {
  margin-top: 1rem;
  padding-top: .75rem;
  border-top: 1px solid rgba(255, 255, 255, .35);
  font-size: 1rem;
}
.lightbox-caption .published + .republished { margin-top: .5rem; padding-top: 0; border-top: 0; }
.lightbox-caption a { color: #fff; text-underline-offset: 3px; }
.lightbox-caption a:hover { color: var(--paper); text-decoration-thickness: 2px; }
.lightbox-controls { display: flex; flex: 0 0 auto; gap: .75rem; }
.lightbox-controls button {
  padding: .5rem 1.1rem;
  border: 2px solid #fff;
  background: transparent;
  color: #fff;
  font: 500 1rem var(--font-head);
  cursor: pointer;
}
.lightbox-controls button:hover { background: #fff; color: var(--ink); }

@media (min-width: 900px) {
  .lightbox-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
    align-items: center;
    gap: 2rem;
    max-width: 1400px;
    margin-inline: auto;
    padding: 2rem;
  }
  .lightbox img {
    justify-self: center;
    max-height: calc(100vh - 4rem);
  }
  .lightbox-side {
    width: auto;
    max-height: calc(100vh - 4rem);
  }
}

/* ---------- Small screens ---------- */

@media (max-width: 720px) {
  .comic-page {
    grid-template-columns: 1fr;
    grid-template-areas:
      "ed"
      "strips"
      "gn";
  }
  .panel--ed { min-height: 340px; }
}

@media (prefers-reduced-motion: reduce) {
  .nav a { transition: none; }
  .panel img { transition: none; }
  .panel:hover img { transform: none; }
}

/* About page picture */
.about-art { margin: 0 0 2rem; border: var(--border); background: var(--panel); }
.about-art img { display: block; width: 100%; height: auto; }

.empty { color: var(--muted); font-style: italic; }

/* ---------- Book list and book pages ---------- */

.books {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}
.books .book-link { cursor: pointer; }
.books .book-link img { display: block; width: 100%; height: auto; }
.books .title { text-decoration: none; }
.books .title:hover { text-decoration: underline; }
.back { margin: 0 0 .5rem; font-size: 1rem; }

/* ---------- Written notes (long text beside a cartoon) ---------- */

.note { max-width: 42rem; padding-block: clamp(1.5rem, 4vw, 3rem) 3rem; }
.note h1 { margin-bottom: .25rem; }
.note-date { margin: 0 0 1.5rem; color: var(--muted); }
.note-art { margin: 0 0 2rem; border: var(--border); background: var(--panel); }
.note-art img { display: block; width: 100%; height: auto; }
.note p { font-family: var(--font-body, "Newsreader", Georgia, serif); font-size: 1.15rem; line-height: 1.65; }
.note > .back, .note > .note-date { font-family: inherit; font-size: 1rem; }

/* Author's note on the graphic novel page */
.author-note { padding-block: 0 1.5rem; }
.author-note .section-title { margin-top: 0; }

/* ---------- Footer email, breadcrumbs, switcher ---------- */
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: .25rem .6rem; }
.switcher { display: flex; flex-wrap: wrap; gap: .25rem .75rem; margin: 0 0 1rem; font-family: var(--font-head, "Inter Tight", sans-serif); font-weight: 700; font-size: 1rem; }
.switcher a { text-decoration: none; }
.switcher a[aria-current] { border-bottom: 3px solid var(--accent); }
.switcher span { color: var(--muted); }
.title--banner { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Comic strips: collection boxes and intros ---------- */
.intro { max-width: 46rem; margin-bottom: 2rem; }
.intro .section-title { margin-top: 0; }
.strip-collections { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }
.collection { background: #fff; border: var(--border); }
.collection-link { display: block; background: #fff; }
.collection-link img { aspect-ratio: 4 / 3; }
.collection-link img { width: 100%; object-fit: contain; display: block; }
.collection .panel-label { position: static; display: block; padding: .6rem 1rem; background: var(--paper); border-top: var(--border); }
.collection .label-title { display: block; font-family: var(--font-head); font-weight: 900; font-size: 1.5rem; letter-spacing: -.03em; text-transform: uppercase; color: var(--text); }
.collection .label-sub { display: block; color: var(--muted); font-size: 1rem; }
.sampler { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: .5rem; border-top: var(--border); background: var(--panel); }
.sampler button { min-width: 3rem; min-height: 2.5rem; font: 700 1.25rem var(--font-head); background: var(--paper); border: 2px solid #000; cursor: pointer; }
.sampler button:hover, .sampler button:focus-visible { background: var(--accent); }

/* ---------- Graphic novels: even card shapes, start button ---------- */
.gallery--pages .work { display: flex; flex-direction: column; }
.gallery--pages .work a.zoom { position: relative; flex: 1; aspect-ratio: var(--page-ratio, .7); background: #fff; }
.gallery--pages .work img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.gallery--pages .work--spread { grid-column: span 2; }
.gallery--pages .work--spread a.zoom { aspect-ratio: calc(var(--page-ratio, .7) * 2 + .12); }
.start-reading { display: inline-block; margin: 1rem 0 0; padding: .7rem 1.25rem; font: 800 1.1rem var(--font-head); text-transform: uppercase; letter-spacing: .02em; color: #fff; background: var(--ink); border: var(--border); cursor: pointer; }
.start-reading:hover, .start-reading:focus-visible { background: var(--accent); color: #000; }
@media (max-width: 479px) { .gallery--pages .work--spread { grid-column: auto; } }

/* ---------- About: portrait left, text right on wide screens ---------- */
.about-layout { display: grid; gap: 2rem; align-items: start; padding-bottom: 3rem; }
.about-layout .about-art { margin: 0; }
.about-text { max-width: 40rem; }
.about-text h2:first-of-type { margin-top: 2rem; }
.copy-email { margin-left: .5rem; padding: .15rem .6rem; font: 700 .9rem var(--font-head); background: var(--paper); border: 2px solid #000; cursor: pointer; }
.copy-email:hover, .copy-email:focus-visible { background: var(--accent); }
@media (min-width: 900px) {
  .about-layout { grid-template-columns: minmax(300px, 5fr) 6fr; gap: 3rem; }
  .about-layout .about-art { position: sticky; top: 1.5rem; }
}
.gallery--pages { align-items: stretch; }
.collection-link, .collection-link:hover { text-decoration: none; }
.collection .panel-label { width: auto; max-width: none; text-decoration: none; }
.collection-link img { aspect-ratio: 3 / 2; }
.books { margin-bottom: 3rem; }
.collection .panel-label { border-width: 3px 0 0 0; border-style: solid; }

/* ---------- Home panels with picture toggles ---------- */
.panel-slot { position: relative; display: flex; }
.panel-slot > .panel { flex: 1; }
.panel-toggle { position: absolute; right: 10px; bottom: 10px; z-index: 3; display: flex; align-items: center; gap: .35rem; padding: .2rem .35rem; background: var(--paper); border: 2px solid #000; }
.panel-toggle button { min-width: 2.25rem; min-height: 2rem; font: 700 1.1rem var(--font-head); background: var(--panel); border: 2px solid #000; cursor: pointer; }
.panel-toggle button:hover, .panel-toggle button:focus-visible { background: var(--accent); }
.panel-count { min-width: 3rem; text-align: center; font: 700 .9rem var(--font-head); color: var(--text); }
/* Three strips stacked in one collection box */
.collection--stack .collection-link { display: flex; flex-direction: column; background: #fff; }
.collection--stack .collection-link img { aspect-ratio: auto; border-bottom: 2px solid #000; }
.strip-collections { align-items: stretch; }
.collection { display: flex; flex-direction: column; }
.collection-link { flex: 1; display: flex; flex-direction: column; }
.collection-link img { flex: 0 0 auto; }
.collection .panel-label { margin-top: auto; }
.intro-note { margin-top: 1.25rem; }
.collection-link img { margin-block: auto; }
.collection .panel-label { margin-top: 0; }

/* Smaller labels and toggles on the two small home panels, so less of the art is covered */
.panel--strips .panel-label, .panel--gn .panel-label { padding: .45rem .8rem; }
.panel--strips .panel-label h2, .panel--gn .panel-label h2 { font-size: 1.45rem; }
.panel--strips .panel-label p, .panel--gn .panel-label p { font-size: .95rem; }
.panel--strips .panel-toggle, .panel--gn .panel-toggle { right: 6px; bottom: 6px; gap: .2rem; padding: .12rem .25rem; }
.panel--strips .panel-toggle button, .panel--gn .panel-toggle button { min-width: 1.9rem; min-height: 1.6rem; font-size: .95rem; }
.panel--strips .panel-count, .panel--gn .panel-count { min-width: 2.4rem; font-size: .8rem; }
