/*
 * Link pages: shared components for links.alvinsvitzer.com and
 * links.mythicmatters.com. Both sites ship an identical copy of this file;
 * change one, copy it to the other.
 *
 * Built to the brand book (alvinsvitzer-brand/brand-book/README.md) and the
 * alvinsvitzer.com theme, so the link pages read as part of the same library:
 * the arch and arched plate, catalog-card labels, pills, hairlines instead of
 * shadows, no gradients, a 150ms color fade as the only motion.
 *
 * Colors are tokens only. Load order: tokens.css, sections.css, this file.
 * Never put a hex value here; change brand/tokens.json in alvinsvitzer-brand.
 */

/* ---- Fonts: self-hosted, Latin subset, variable (copied from the theme) ---- */
@font-face { font-family: "Inter"; src: url("assets/fonts/inter-100-900.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("assets/fonts/jetbrains-mono-100-800.woff2") format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Cinzel"; src: url("assets/fonts/cinzel-400-900.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("assets/fonts/cormorant-garamond-300-700.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("assets/fonts/eb-garamond-400-800.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; }
/* Full Spectrum Aerial's own face, for its name only (links.alvinsvitzer.com ships the file). */
@font-face { font-family: "Space Grotesk"; src: url("assets/fonts/space-grotesk-300-700.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }

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

html { -webkit-text-size-adjust: 100%; }
/* In-page links glide to their section; under reduced motion they jump. */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

/* Every link, button and field: 2px focus ring, 2px offset. */
:where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- Type roles (brand book, Sizing on the web) ---- */
.record-label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.inscription {
  margin: 0;
  font-family: var(--font-inscription);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

/* ---- Hero: arched portrait or plate, name, one line, one button ---- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 48px 0 40px;
  text-align: center;
}

.hero__name {
  margin: 4px 0 0;
  font-family: var(--font-inscription);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.hero__line {
  max-width: 30ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.2;
}

.hero__sub {
  max-width: 40ch;
  margin: 0;
  color: var(--text-muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

/* The arch: top corners round, bottom corners radius-md, a 1px hairline frame
   with space inside it. Never on buttons. */
.arch {
  width: 200px;
  margin: 0 0 6px;
  padding: 8px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-arch) var(--radius-arch) var(--radius-md) var(--radius-md);
}
.arch img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius-arch) var(--radius-arch) var(--radius-sm) var(--radius-sm);
}

/* The arched plate: square art in an arch, a crown with a star and a label. */
.plate {
  flex: none;
  width: 168px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-arch) var(--radius-arch) var(--radius-md) var(--radius-md);
}
.plate__body {
  display: flex;
  flex-direction: column;
  aspect-ratio: 320 / 480;
  overflow: hidden;
  border-radius: var(--radius-arch) var(--radius-arch) var(--radius-sm) var(--radius-sm);
  background: var(--bg-deep);
}
.plate__crown {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-top: 18px;
  color: var(--accent-strong); /* small gold text: accent-strong (brand book, Contrast) */
}
.plate__star {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1;
}
.plate__label {
  font-family: var(--font-inscription);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.plate__body img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.plate--hero { width: 220px; }
/* Podcast: the crown is butter in both themes, the label deep copper (theme). */
.section-podcast .plate__body { background: var(--dos-butter); }
.section-podcast .plate__label { color: var(--dos-copper-deep); }

/* ---- Pills (buttons) ---- */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--field-border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}
.pill--fill {
  border-color: var(--button);
  background: var(--button);
  color: var(--on-button);
}

/* ---- Text links: underlines belong to links, never to buttons ---- */
.textlink {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 150ms ease, text-decoration-color 150ms ease;
}

/* ---- Entries: one per collection, in the collection's ground ---- */
.entries {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 0;
  padding: 0 0 48px;
  list-style: none;
}

.entry {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
}

/* A wrapper that only carries a section's tokens (its card paints itself). */
.entry-shell { background: none; }

/* Catalog-card head: call number and subject in mono over a hairline. */
.entry__label {
  display: flex;
  justify-content: space-between;
  gap: 4px 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
/* On narrow cards the subject drops to its own line whole, never mid-phrase. */
.entry__label { flex-wrap: wrap; }
.entry__label span + span { margin-left: auto; text-align: right; white-space: nowrap; }

.entry__name {
  margin: 14px 0 16px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
}

.entry__row {
  display: flex;
  gap: 22px;
  align-items: center;   /* text sits in the middle of the arch, not at its top */
}
.entry .plate { width: 140px; }
.entry .cover { width: 112px; }

.entry__text {
  min-width: 0;
  flex: 1;
}
.entry__text p {
  margin: 0 0 12px;
  color: var(--text-muted);
}
.entry__text p:last-child { margin-bottom: 0; }
.entry__text > .textlink { margin-top: 4px; }
/* A line in the book's own voice: reading face, full text color. */
.entry__text .entry__hook {
  font-family: var(--font-reading);
  font-size: 20px;
  line-height: 1.4;
  color: var(--text);
}
.arch--small {
  flex: none;
  width: 150px;
  margin: 0;
}

.entry__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 20px;
}

/* Book covers keep their own shape; the only shadow is under covers. */
.cover {
  flex: none;
  width: 120px;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 24px var(--shadow);
}

/* A quoted review or excerpt: reading face. */
.quote {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.quote p {
  margin: 0;
  font-family: var(--font-reading);
  font-size: 19px;
  line-height: 1.5;
  color: var(--text);
}
.quote footer {
  margin-top: 8px;
  font-size: 14px;
  text-align: right;      /* a review's credit sits under its end, as in print */
  color: var(--accent);   /* the gold of a review line's credit */
}

/* Lists of stores or platforms: quiet text links. */
.stores {
  margin-top: 16px;
}
.stores__label {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
}
.stores__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.stores__list a {
  font-size: 15px;
}

/* The archive: no ground or color of its own; it uses the house, quietly. */
.entry--archive {
  background: transparent;
}
.entry--archive .entry__name { margin-bottom: 8px; }

/* A card's one-line intro under its name (the contents page). */
.entry__intro {
  max-width: 60ch;
  margin: -4px 0 22px;
  color: var(--text-muted);
}

/* Full Spectrum Aerial (an endorsed brand): Tech's ground, its own face for the
   name only (brand book, Type). A dated aerial photo. */
.entry__name--fsa {
  font-family: var(--font-fsa-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.photo {
  flex: none;
  width: 168px;
  margin: 0;
}
.photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 24px var(--shadow);
}
.entry__fine {
  margin: 18px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
}

/* ---- "Prefer another store?": other stores stay collapsed (theme .as-stores) ---- */
.disclose {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.disclose summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 0 16px;
  color: var(--accent-strong);
  font-size: 15px;
  cursor: pointer;
  list-style: none;
  transition: background-color 150ms ease, color 150ms ease;
}
.disclose summary::-webkit-details-marker { display: none; }
.disclose summary svg { flex: none; transition: transform 240ms ease; }
.disclose[open] summary svg { transform: rotate(180deg); }
.disclose summary:hover {
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
}
/* One rhythm for every store list (same values as the theme's .as-stores):
   links wrap with an even 24px between them, never a stretched grid. */
.disclose__group {
  padding: 8px 16px 12px;
  border-top: 1px solid var(--border);
}
.disclose__label {
  margin: 12px 0 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.disclose ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.disclose ul .textlink { margin: 0; }

/* ---- The contents page: stories as a book's table of contents ---- */
.contents__list {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.contents__link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text);
  text-decoration: none;
}
.contents__row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-height: 44px;
  padding-block: 7px;
}
.contents__title {
  font-family: var(--font-display);
  font-size: 26px; /* under the card's 30px name; display never goes below 26px */
  font-weight: 600;
  line-height: 1.15;
  transition: text-decoration-color 150ms ease;
}
.contents__leader {
  flex: 1;
  min-width: 24px;
  border-bottom: 2px dotted var(--field-border);
}
.contents__meta {
  font-family: var(--font-reading);
  font-size: 20px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--accent-strong);
}
.contents__sub {
  font-family: var(--font-reading);
  font-size: 19px;
  line-height: 1.5;
  color: var(--text);
}
.contents__link:hover .contents__title {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 6px;
}

/* ---- A plain product or photo image (not cover art): 4px corners ---- */
.photo {
  flex: none;
  width: 168px;
  border-radius: var(--radius-sm);
}

/* ---- Link-hub header: who this is, in one glance (about a third of a phone
   screen), so the first card is visible without scrolling. Like the main
   site's phone hero: words on the left, a small arch on the right. ---- */
.hub-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 20px;
  padding: 32px 0 20px;
}
.hub-head__text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.hub-head .hero__name { margin: 0; font-size: 28px; }
.hub-head .hero__line { max-width: none; font-size: 26px; }
.hub-head__note {
  margin: 0;
  font-size: 15px;
  color: var(--text-muted);
}
.hub-head .arch,
.hub-head .plate { width: 112px; margin: 0; padding: 6px; }
.hub-head .plate__crown { padding-top: 10px; gap: 2px; }
.hub-head .plate__star { font-size: 18px; }
.hub-head .plate__label { font-size: 12px; letter-spacing: 0.14em; }
.hub-head__links {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
}

/* A shelf heading over the cards: says what the call numbers are. */
.shelf-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.shelf-head > * { margin: 0; }
.shelf-head__note { font-size: 14px; color: var(--text-muted); }

/* One review line under a title (as on the book page). */
.reviewline { margin: -8px 0 0; }
.reviewline a {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  min-height: 44px;
  padding-block: 8px;
  color: var(--text);
  text-decoration: none;
}
.reviewline__quote { font-family: var(--font-reading); font-size: 19px; }
.reviewline__by { font-size: 14px; color: var(--accent); }
.reviewline a:hover .reviewline__by { text-decoration: underline; text-underline-offset: 4px; }

/* "Prefer it in print? Paperback, $16.99" under the buy buttons. */
.also-format {
  margin: 10px 0 0;
  font-size: 15px;
  color: var(--text-muted);
}
.also-format a {
  color: var(--text);
  text-decoration-color: var(--accent);
  text-underline-offset: 4px;
}

/* Two more house grounds, so neighbouring house cards are told apart. */
.entry--deep { background: var(--bg-deep); }
.entry--deep .entry__text p { color: var(--text); } /* muted text is under 4.5:1 on bg-deep */
.entry--surface { background: var(--surface); }

/* Contents entries with a picture: a 3:2 thumbnail beside the title. */
.contents__link--thumb {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  grid-template-areas: "thumb head" "thumb sub";
  align-items: start;
  gap: 4px 18px;
}
.contents__thumb {
  grid-area: thumb;
  align-self: center;   /* centred against the title and teaser beside it */
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius-sm);
}
.contents__link--thumb .contents__row { grid-area: head; }
.contents__link--thumb .contents__sub { grid-area: sub; }
/* Beside a picture there is no room for a dotted leader: the kind of story
   sits on its own line under the title instead. */
.contents__link--thumb .contents__row { flex-wrap: wrap; gap: 2px 12px; min-height: 0; padding-block: 0; }
.contents__link--thumb .contents__leader { display: none; }
.contents__link--thumb .contents__meta { flex-basis: 100%; font-size: 19px; }

/* ---- Footer ---- */
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 32px 0 40px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer__links a { font-size: 15px; }
.footer__copy {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

/* ---- Hover: one system (theme assets/css/interactions.css) ---- */
.pill--fill:hover {
  border-color: var(--button-hover);
  background: var(--button-hover);
  color: var(--on-button);
}
.pill:not(.pill--fill):hover {
  border-color: var(--text);
  background: color-mix(in srgb, var(--text) 14%, transparent);
  color: var(--text);
}
.textlink:hover {
  color: var(--text);
  text-decoration-thickness: 2px;
}
.pill:active { filter: brightness(0.92); }

/* ---- Phones ---- */
@media (max-width: 520px) {
  .hero { padding: 36px 0 32px; }
  .hero__name { font-size: 26px; }
  .hero__line { font-size: 26px; }
  .hub-head { padding: 24px 0 18px; gap: 8px 16px; }
  .hub-head .hero__name { font-size: 24px; }
  .hub-head .arch, .hub-head .plate { width: 92px; }
  .entry { padding: 20px; }
  .entry__row { gap: 16px; }
  .entry .plate { width: 104px; padding: 6px; }
  .entry .plate__crown { padding-top: 10px; gap: 2px; }
  .entry .plate__star { font-size: 18px; }
  .entry .plate__label { letter-spacing: 0.12em; }
  .entry .cover { width: 96px; }
  .photo { width: 128px; }
  .entry__row--photo.entry__row--wrap { grid-template-columns: 128px minmax(0, 1fr); }
  .entry__name--fsa { font-size: 26px; }
  .arch--small { width: 104px; padding: 6px; }
  /* A card with a longer blurb: the hook beside the cover, the blurb full
     width beneath it, so the cover never floats beside a thin column. */
  .entry__row--wrap {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: center;
    gap: 0 16px;
  }
  .entry__row--wrap .entry__text { display: contents; }
  .entry__row--wrap .entry__hook { grid-column: 2; margin: 0; }
  .entry__row--wrap .entry__text > p:not(.entry__hook) { grid-column: 1 / -1; margin: 14px 0 0; }
  .entry__name { font-size: 28px; }
  .entry__actions .pill { flex: 1 1 100%; }
  .contents__row { flex-wrap: wrap; gap: 2px 12px; }
  .contents__title { font-size: 26px; }
  .contents__leader { display: none; }
  .contents__meta { flex-basis: 100%; font-size: 19px; }
  .contents__link--thumb {
    grid-template-columns: 96px minmax(0, 1fr);
    grid-template-areas: "thumb head" "sub sub";
    align-items: center;
  }
  .photo { width: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  .pill, .textlink, .disclose summary, .disclose summary svg, .contents__title { transition: none; }
}

/* Link under the shelves (personal hub): the book comes first, this follows. */
.hub-foot-link {
  margin-top: 32px;
}
#stories-title { font-size: 1.5em; }
