/* The First 39: Read (/books/, /short-stories/, /comics/), the Read group in the Resources menu.
   Three coming-soon pages with one look: a shelf of planned titles, a note on what's imagined and
   what's from the text (VALUES.md 3), and sign-ups for the books, stories and comics lists.
   Nothing is drawn yet, so book covers and comic panels are type-only, drawn in CSS from the brand
   colors. They're decorative (aria-hidden): each card's title and details are in its own text.
   The one exception is the sample strip on /comics/, which is real content (an ordered list).
   cqi sizes type to its cover or panel: only use it on a container's children, since on the container
   itself it measures the next container up (or the viewport). Padding on a container is in %. */

.rd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); margin-bottom: var(--s-3); }
.rd-meta .pill--soon { color: var(--accent); }
.rd-kind { font-family: var(--font-display); font-weight: 700; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--stone); }
.rd-sub { margin: calc(-1 * var(--s-1)) 0 var(--s-3); font-family: var(--font-scripture); font-style: italic; font-size: 1.1rem; line-height: 1.35; color: var(--stone); }
.rd-ref { margin: var(--s-3) 0 0; font-size: var(--fs-small); color: var(--stone); }
.rd-ref cite { font-style: normal; }
.rd-list { margin: 0 0 var(--s-3); padding-left: 1.1rem; display: grid; gap: var(--s-1); font-size: .95rem; }
.rd-note { margin: var(--s-3) 0 0; padding-top: var(--s-3); border-top: 1px dashed var(--line); font-size: var(--fs-small); color: var(--stone); }
.rd-note b { color: var(--ink); }

/* ---------- Book covers (type only) ---------- */
.rd-cover {
  --c: var(--ink); --fg: var(--scroll); --title: var(--fg);
  container-type: inline-size; position: relative; aspect-ratio: 2 / 3; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; padding: 12% 11% 18% 15%;
  background: var(--c); color: var(--fg); border-radius: 2px 6px 6px 2px;
  box-shadow: inset 7px 0 0 rgba(0, 0, 0, .16), inset 9px 0 10px -6px rgba(255, 255, 255, .22), 0 20px 34px -20px rgba(22, 21, 20, .6);
}
.rd-cover::after { /* the 39 Bar along the foot of every cover */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5%;
  background: linear-gradient(90deg, var(--law) 0 12.82%, var(--history) 0 43.59%, var(--poetry) 0 56.41%, var(--major) 0 69.23%, var(--minor) 0);
}
.rd-cover-top { font-family: var(--font-display); font-weight: 700; font-size: .66rem; font-size: max(.5rem, 6cqi); letter-spacing: .22em; text-transform: uppercase; }
.rd-cover-title { font-family: var(--font-display); font-weight: 900; text-transform: uppercase; line-height: .9; letter-spacing: -.02em;
  font-size: 1.6rem; font-size: 17cqi; color: var(--title); text-wrap: balance; overflow-wrap: anywhere; hyphens: auto; }
.rd-cover-by { font-family: var(--font-scripture); font-style: italic; font-size: .9rem; font-size: max(.7rem, 8cqi); line-height: 1.25; }
@container (max-width: 110px) { /* a thumbnail-sized cover (small phones) shows only its title */
  .rd-cover-top, .rd-cover-by { display: none; }
  .rd-cover-title { margin-block: auto; font-size: 18cqi; }
}
.rd-cover--cedar { --c: var(--cedar); --title: var(--gold); }
.rd-cover--ink { --title: var(--gold); }
.rd-cover--gold { --c: var(--gold); --fg: var(--ink); }
.rd-cover--linen { --c: var(--linen); --fg: var(--ink); --title: var(--accent); }
.rd-cover--accent { --c: var(--accent); --fg: #fff; }

/* The lead title: cover beside its details */
.rd-feature { display: grid; grid-template-columns: minmax(0, 16rem) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: center;
  margin-bottom: var(--s-8); padding-bottom: var(--s-8); border-bottom: 1px solid var(--line); }
.rd-feature h3 { font-size: var(--fs-h2); font-weight: 900; text-transform: uppercase; letter-spacing: -.03em; line-height: .95; margin-bottom: var(--s-3); }
.rd-feature .rd-body { max-width: 60ch; }

/* The shelf: four across, two on tablets, cover beside text on small phones */
.rd-shelf { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-7) var(--s-5); }
.rd-book { display: grid; grid-template-rows: auto 1fr; gap: var(--s-4); align-content: start; }
.rd-book h3 { font-size: 1.3rem; font-weight: 800; line-height: 1.1; margin-bottom: var(--s-2); }
.rd-book p:not(.rd-sub, .rd-ref, .rd-note) { margin: 0; font-size: .95rem; }
.rd-book .rd-sub { font-size: 1rem; margin-top: 0; }

/* ---------- Two kinds of work (dark section) ---------- */
.rd-kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6); margin-bottom: var(--s-6); }
.rd-kinds > div { border-top: 1px solid var(--line-on-dark); padding-top: var(--s-4); }
.rd-kinds h3 { font-size: 1.35rem; margin-bottom: var(--s-2); }
.rd-kinds p { color: var(--muted-on-dark); margin: 0; }
.rd-wins { max-width: 62ch; border-left: 4px solid var(--gold); padding-left: var(--s-5); margin: 0; }
.rd-wins p { margin: 0; color: var(--muted-on-dark); }
.rd-wins b { color: var(--scroll); }
.rd-wins a { color: var(--scroll); text-underline-offset: 3px; }
.rd-wins a:hover { color: var(--gold); }

/* Numbered steps on Ink or Cedar */
.rd-steps { list-style: none; counter-reset: step; margin: 0 0 var(--s-7); padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-6); }
.rd-steps li { counter-increment: step; display: grid; gap: var(--s-2); align-content: start; border-top: 1px solid var(--line-on-dark); padding-top: var(--s-4); }
.rd-steps li::before { content: "0" counter(step); font-family: var(--font-display); font-weight: 900; font-size: 2.5rem; line-height: 1; color: var(--gold); }
.rd-steps b { font-family: var(--font-display); font-size: 1.25rem; font-weight: 800; }
.rd-steps span { color: var(--muted-on-dark); }

/* Ways to read */
.rd-formats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-5); }
.rd-formats li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s-5); border-top: 4px solid var(--c, var(--gold)); }
.rd-formats b { display: block; font-family: var(--font-display); font-size: 1.15rem; font-weight: 800; margin-bottom: var(--s-2); }
.rd-formats span { display: block; color: var(--stone); font-size: .95rem; }

/* Contributor invitation (links to /contribute) */
.rd-join { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-4) var(--s-6); align-items: center;
  padding: clamp(1.25rem, 3vw, 2rem); background: var(--ink); color: var(--scroll); border-radius: var(--radius); }
.rd-join h3 { margin: 0 0 var(--s-1); font-size: var(--fs-h4); }
.rd-join p { margin: 0; color: var(--muted-on-dark); }

/* ---------- Short stories ---------- */
.rd-stories { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5); }
.rd-story { --c: var(--gold); position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s-6) var(--s-6) var(--s-5); border-top: 6px solid var(--c); }
.rd-story--now { --c: var(--accent); }
.rd-story h3 { font-size: 1.5rem; font-weight: 900; text-transform: uppercase; letter-spacing: -.02em; line-height: 1; margin-bottom: var(--s-2); }
.rd-story .rd-ref { margin: 0 0 var(--s-3); }
.rd-story > p:not(.rd-ref, .rd-note, .rd-tag) { margin: 0; font-family: var(--font-scripture); font-size: 1.15rem; line-height: 1.5; flex: 1; }
.rd-tag { display: flex; justify-content: space-between; gap: var(--s-3); margin: 0 0 var(--s-4); font-family: var(--font-display); font-weight: 700; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--stone); }
.rd-tag b { color: var(--gold-deep); }
.rd-story--now .rd-tag b { color: var(--accent); }
.rd-shelf-head { display: flex; align-items: baseline; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-5); }
.rd-shelf-head h2 { margin: 0; }
.rd-shelf-head p { margin: 0; color: var(--stone); max-width: 52ch; }

/* ---------- Comics ---------- */
.rd-comics { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-7) var(--s-6); }
.rd-comic { display: grid; grid-template-rows: auto 1fr; gap: var(--s-4); align-content: start; }
.rd-comic h3 { font-size: 1.5rem; font-weight: 900; text-transform: uppercase; letter-spacing: -.02em; line-height: 1; margin-bottom: var(--s-2); }
.rd-comic p:not(.rd-sub, .rd-ref, .rd-note) { margin: 0; }

/* A panel: thick ink frame, halftone dots and a burst of speed lines, a big title and a speech bubble */
.rd-panel {
  --c: var(--ink); --fg: var(--scroll); --title: var(--gold); --dot: rgba(247, 243, 236, .13);
  container-type: inline-size; position: relative; aspect-ratio: 16 / 10; overflow: hidden; border: 3px solid var(--ink); border-radius: 2px;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 6% 6% 7%; color: var(--fg);
  background:
    radial-gradient(circle, var(--dot) 1.3px, transparent 1.7px) 0 0 / 9px 9px,
    repeating-conic-gradient(from 0deg at 82% 18%, rgba(255, 255, 255, .06) 0 3deg, transparent 3deg 11deg),
    var(--c);
  box-shadow: 6px 6px 0 rgba(22, 21, 20, .14);
}
.rd-panel-no { position: absolute; left: 5cqi; top: 5cqi; font-family: var(--font-display); font-weight: 900; font-size: 1.4rem; font-size: 9cqi; line-height: 1; }
.rd-panel-title { font-family: var(--font-display); font-weight: 900; text-transform: uppercase; letter-spacing: -.03em; line-height: .86;
  font-size: 2.6rem; font-size: 15cqi; color: var(--title); }
.rd-panel-cap { align-self: flex-start; margin-top: 3cqi; padding: .3em .6em; background: var(--scroll); color: var(--ink); border: 2px solid var(--ink);
  font-family: var(--font-display); font-weight: 700; font-size: .8rem; font-size: max(.7rem, 3.4cqi); letter-spacing: .1em; text-transform: uppercase; }
.rd-panel--history { --c: var(--history); --title: #fff; --fg: #fff; --dot: rgba(22, 21, 20, .16); }
.rd-panel--linen { --c: var(--linen); --fg: var(--ink); --title: var(--ink); --dot: rgba(22, 21, 20, .1); }
.rd-panel--cedar { --c: var(--cedar); }

.rd-bubble { position: relative; display: inline-block; max-width: 100%; padding: .45em .8em; background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 1.2em;
  font-family: var(--font-display); font-weight: 800; font-size: .95rem; line-height: 1.15; }
.rd-bubble::after { content: ""; position: absolute; left: 1.1em; bottom: -9px; width: 14px; height: 14px; background: #fff;
  border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: skewX(-20deg) rotate(45deg); }
.rd-panel .rd-bubble { position: absolute; right: 6cqi; top: 7cqi; max-width: 52%; font-size: max(.75rem, 4.4cqi); }
.rd-panel .rd-bubble::after { left: auto; right: 1.3em; }

/* One-pagers: the front and back of a printed page */
.rd-pages { position: absolute; inset: 9cqi 8cqi auto auto; display: flex; gap: 3cqi; }
.rd-pages i { width: 17cqi; aspect-ratio: 8.5 / 11; background: #fff; border: 2px solid var(--ink); display: grid; grid-template-rows: 1fr 1fr; gap: 1.5cqi; padding: 1.5cqi; }
.rd-pages i::before, .rd-pages i::after { content: ""; border: 1.5px solid var(--ink); }
.rd-pages i + i { transform: rotate(5deg); }
.rd-pages i + i::before, .rd-pages i + i::after { border: 0; background: repeating-linear-gradient(transparent 0 2cqi, rgba(22, 21, 20, .3) 0 calc(2cqi + 1px)); }

/* The sample strip: four panels in a row (two by two on phones) */
.rd-strip { margin: 0; }
.rd-strip ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; aspect-ratio: 16 / 10;
  border: 3px solid var(--ink); background: var(--ink); box-shadow: 6px 6px 0 rgba(22, 21, 20, .14); }
.rd-strip li { container-type: inline-size; position: relative; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: var(--s-2); padding: 9%;
  background: radial-gradient(circle, rgba(22, 21, 20, .09) 1.2px, transparent 1.6px) 0 0 / 8px 8px, var(--scroll); }
.rd-strip li:last-child { background: radial-gradient(circle, rgba(22, 21, 20, .1) 1.2px, transparent 1.6px) 0 0 / 8px 8px, var(--gold); }
.rd-strip .rd-cap { align-self: flex-start; padding: .2em .45em; background: var(--ink); color: var(--scroll); font-family: var(--font-display); font-weight: 700;
  font-size: .7rem; font-size: max(.62rem, 11cqi); letter-spacing: .08em; text-transform: uppercase; }
.rd-strip .rd-bubble { font-size: .8rem; font-size: max(.68rem, 12.5cqi); padding: .4em .55em; margin-bottom: 12px; }
.rd-strip figcaption { margin-top: var(--s-3); font-size: var(--fs-small); color: var(--stone); }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .rd-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rd-formats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rd-steps { grid-template-columns: 1fr; gap: var(--s-5); margin-bottom: var(--s-6); }
  .rd-comics { gap: var(--s-6) var(--s-5); }
}
@media (max-width: 767px) {
  .rd-feature { grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); align-items: start; }
  .rd-kinds, .rd-stories, .rd-comics { grid-template-columns: 1fr; }
  .rd-join { grid-template-columns: 1fr; }
  .rd-join .btn { justify-self: start; }
  .rd-story { padding: var(--s-5) var(--s-5) var(--s-4); }
}
@media (max-width: 479px) {
  .rd-feature { grid-template-columns: 7rem minmax(0, 1fr); gap: var(--s-4); }
  .rd-feature h3 { font-size: 1.6rem; }
  .rd-shelf { grid-template-columns: 1fr; gap: var(--s-6); }
  .rd-book { grid-template-columns: 7rem minmax(0, 1fr); grid-template-rows: auto; align-items: start; }
  .rd-formats { grid-template-columns: 1fr; }
  .rd-strip ol { grid-template-columns: repeat(2, minmax(0, 1fr)); aspect-ratio: 1; }
  .rd-story h3, .rd-comic h3 { font-size: 1.3rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .rd-cover, .rd-panel { transition: transform .4s var(--ease); }
  .rd-book:hover .rd-cover { transform: translateY(-4px) rotate(-1deg); }
}
