/* The Most Adapted Stories page (landing/most-adapted-stories.html), on top
   of formatter-page.css (the base, .wrap, .section, .pitch, .others, .btn).
   Copied to landing/most-adapted-stories/page.css by the page's build.mjs.

   A printed literary almanac: a sheet of laid paper, Newsreader for every
   word that is not a control, and one small mark per film, a book spine set
   on a shelf, one shelf per decade. Three inks and a hollow mark carry the
   kind of story: oxblood for novels and stories, indigo for the stage, moss
   for comics, an outline for tales, poems and nonfiction. The same values
   are repeated in page.js (INK) because the share image is drawn on a canvas
   that cannot read CSS. Change one, change both.
   See .claude/data-pages-registry.md. */

.ma {
  --paper: #f5f3ec;
  --paper-2: #ece9df;
  --rule: #d9d4c7;
  --rule-2: #c4beae;
  --ink: #1c1a17;
  --ink-2: #4a4641;
  --ink-3: #7d776d;
  --oxblood: #7b2d2d;
  --oxblood-2: #a24747;
  --indigo: #2c3e6b;
  --moss: #4e6a37;
  --hollow: #8f897d;
  --focus: #7b2d2d;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
}
.ma ::selection { background: var(--oxblood); color: #fff; }
.ma-about a:not(.btn), .ma-ch-body a, .ma-shelf a { color: var(--oxblood); text-decoration: underline; text-decoration-color: rgba(123, 45, 45, 0.35); text-underline-offset: 0.14em; }
.ma-about a:not(.btn):hover, .ma-ch-body a:hover, .ma-shelf a:hover { text-decoration-color: currentColor; }
.ma button:not(.ma-name) { font-family: var(--sans); }
.ma :focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 3px; }

/* ───────────────────── the title page ───────────────────── */
.ma-open { padding: 64px 0 10px; }
.ma-open h1 {
  font-size: clamp(42px, 6.2vw, 84px);
  font-weight: 500; letter-spacing: -0.028em; line-height: 0.98;
  margin: 0; max-width: 16ch; text-wrap: balance;
  font-variation-settings: "opsz" 72;
}
.ma-open h1 i { font-style: italic; font-weight: 400; }
.ma-top { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 26px 56px; align-items: end; margin-top: 28px; }
.ma-lede { margin: 0; font-size: 21px; line-height: 1.5; color: var(--ink-2); max-width: 52ch; }
.ma-lede b { font-weight: 600; color: var(--ink); }
.ma-headline {
  margin: 0; font-size: 17px; line-height: 1.55; color: var(--ink-2);
  padding: 14px 0 0; border-top: 1px solid var(--rule-2);
}
.ma-headline b { color: var(--ink); font-weight: 600; }
.ma-headline:empty { display: none; }

/* ───────────────────── the key ───────────────────── */
.ma-key { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 28px 0 0; font-size: 15px; color: var(--ink-2); }
.ma-key span { display: inline-flex; align-items: center; gap: 9px; }
.ma-key i { display: inline-block; width: 4px; height: 15px; }
.ma-spine, .ma-key i { background: var(--ink); }
.ma-spine.prose, .ma-key i.prose { background: var(--oxblood); }
.ma-spine.stage, .ma-key i.stage { background: var(--indigo); }
.ma-spine.comic, .ma-key i.comic { background: var(--moss); }
.ma-spine.other, .ma-key i.other { background: transparent; box-shadow: inset 0 0 0 1px var(--hollow); }

/* ───────────────────── the controls ───────────────────── */
.ma-form { margin: 26px 0 0; display: grid; gap: 14px; }
.ma-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.ma-line > label, .ma-line > .ma-lab { font-size: 15px; color: var(--ink-3); margin-right: 4px; min-width: 7.5em; }
.ma-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ma-chip {
  font-size: 13.5px; font-weight: 500; line-height: 1;
  padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--rule-2); background: transparent; color: var(--ink-2);
  cursor: pointer;
}
.ma-chip:hover { border-color: var(--ink-3); color: var(--ink); }
.ma-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.ma-chip i { display: inline-block; width: 3px; height: 11px; vertical-align: -1px; margin-right: 7px; }
.ma-chip[aria-pressed="true"] i.other { box-shadow: inset 0 0 0 1px var(--paper); }
.ma-select {
  position: relative; display: inline-block;
}
.ma-select select {
  -webkit-appearance: none; appearance: none;
  font-family: var(--sans); font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  padding: 8px 30px 8px 12px; border-radius: 999px;
  border: 1px solid var(--rule-2); background: transparent; cursor: pointer; max-width: 260px;
}
.ma-select select:hover { border-color: var(--ink-3); color: var(--ink); }
.ma-select.on select { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.ma-select svg { position: absolute; right: 11px; top: 50%; margin-top: -6px; width: 12px; height: 12px; pointer-events: none; color: inherit; }
.ma-select.on svg { color: var(--paper); }
.ma-line input[type="search"] {
  font-family: var(--sans); font-size: 14px; color: var(--ink);
  flex: 1 1 200px; max-width: 320px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--rule-2); background: #fff;
}
.ma-line input::placeholder { color: var(--ink-3); }
.ma-line input:focus { outline: 2px solid var(--focus); outline-offset: 2px; }
.ma-reset {
  font-size: 13.5px; font-weight: 600; color: var(--oxblood);
  background: none; border: 0; padding: 6px 2px; cursor: pointer;
}
.ma-reset:hover { text-decoration: underline; }

/* ───────────────────── the count ───────────────────── */
.ma-count { margin: 34px 0 0; font-size: 18px; color: var(--ink-2); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.ma-count strong { font-size: clamp(40px, 4.4vw, 56px); font-weight: 500; letter-spacing: -0.03em; color: var(--ink); line-height: 1; }
.ma-read { margin: 6px 0 0; font-size: 16px; color: var(--ink-3); }

/* ───────────────────── the register ───────────────────── */
.ma-register { margin: 22px 0 0; }
.ma-axis {
  display: grid; grid-template-columns: var(--name-col, 260px) minmax(0, 1fr) var(--n-col, 64px);
  align-items: end; font-family: var(--sans); font-size: 11.5px; color: var(--ink-3);
  padding: 0 0 6px; border-bottom: 1px solid var(--ink);
}
.ma-axis .ma-strip span { text-align: left; padding-left: 1px; }
.ma-axis .ma-n { text-align: right; }
.ma-strip { display: grid; grid-template-columns: repeat(var(--decades, 14), minmax(0, 1fr)); gap: 0 4px; min-width: 0; }
.ma-row {
  display: grid; grid-template-columns: var(--name-col, 260px) minmax(0, 1fr) var(--n-col, 64px);
  align-items: start; gap: 0 10px;
  padding: 11px 0 10px; border-bottom: 1px solid var(--rule);
}
.ma-row.is-open { border-bottom-color: transparent; }
.ma-name {
  font-family: var(--serif); text-align: left; background: none; border: 0; padding: 0; margin: 0;
  color: var(--ink); cursor: pointer; line-height: 1.25; min-width: 0;
}
.ma-name b { font-weight: 500; font-size: 19px; display: block; }
.ma-name span { display: block; font-size: 13.5px; color: var(--ink-3); margin-top: 2px; }
.ma-name:hover b { color: var(--oxblood); }
.ma-name:not(button) { cursor: default; }
.ma-name:not(button):hover b { color: inherit; }
.ma-row .ma-strip { padding-top: 5px; }
.ma-cell { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 1px; min-height: 14px; border-left: 1px solid var(--paper-2); padding-left: 2px; outline-offset: 1px; }
.ma-cell:focus-visible { outline: 2px solid var(--focus); border-radius: 2px; }
.ma-spine { display: block; width: 3px; height: 14px; border-radius: 0.5px; flex: none; }
.ma-spine.is-dim { opacity: 0.22; }
.ma-row .ma-n { text-align: right; font-size: 19px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.25; }
.ma-row .ma-n small { display: block; font-size: 12.5px; color: var(--ink-3); font-weight: 400; }
.ma-more { margin: 18px 0 0; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ma-more button { font-size: 14px; font-weight: 600; color: var(--oxblood); background: none; border: 0; padding: 6px 2px; cursor: pointer; }
.ma-more button:hover { text-decoration: underline; }
.ma-more span { font-size: 14px; color: var(--ink-3); }
.ma-empty { margin: 24px 0 0; font-size: 17px; color: var(--ink-2); }

/* ───────────────────── an author's shelf ───────────────────── */
.ma-shelf {
  margin: 0 0 4px; padding: 20px 22px 22px;
  background: #fff; border: 1px solid var(--rule); border-left: 4px solid var(--oxblood);
  border-radius: 0 10px 10px 0;
}
.ma-shelf[hidden] { display: none; }
.ma-shelf-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; }
.ma-shelf-head h3 { margin: 0; font-size: 26px; font-weight: 500; letter-spacing: -0.015em; }
.ma-shelf-head p { margin: 0; font-size: 15px; color: var(--ink-2); }
.ma-shelf-close {
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  background: none; border: 1px solid var(--rule-2); border-radius: 999px; padding: 6px 12px; cursor: pointer;
}
.ma-shelf-close:hover { border-color: var(--ink); color: var(--ink); }
.ma-shelf .ma-row { grid-template-columns: var(--name-col, 260px) minmax(0, 1fr) var(--n-col, 64px); }
.ma-shelf .ma-row:last-child { border-bottom: 0; }
.ma-shelf .ma-name b { font-size: 17px; font-style: italic; font-weight: 400; }
.ma-shelf .ma-axis { margin-top: 14px; border-bottom-color: var(--rule-2); }
.ma-shelf .ma-cell { gap: 2px; }
.ma-shelf .ma-spine { width: 5px; height: 16px; border: 0; padding: 0; cursor: pointer; }
.ma-shelf .ma-spine:hover, .ma-shelf .ma-spine:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.ma-shelf-foot { margin: 16px 0 0; font-size: 14px; color: var(--ink-3); }

/* ───────────────────── share ───────────────────── */
.ma-share { margin: 30px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.ma-btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 14px; font-weight: 600; padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper); cursor: pointer;
}
.ma-btn:hover { background: var(--oxblood); border-color: var(--oxblood); }
.ma-btn:disabled { opacity: 0.6; cursor: default; }
.ma-btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule-2); }
.ma-btn-ghost:hover { background: transparent; color: var(--ink); border-color: var(--ink); }
.ma-share-note { font-size: 14px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.ma-share-note svg { color: var(--moss); }

/* ───────────────────── the tooltip ───────────────────── */
.ma-tip {
  position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none;
  max-width: 300px; padding: 10px 13px 11px;
  background: var(--ink); color: var(--paper);
  border-radius: 8px; box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.5);
  font-family: var(--serif); font-size: 14.5px; line-height: 1.4;
}
.ma-tip[hidden] { display: none; }
.ma-tip .t { font-size: 16.5px; font-weight: 500; margin: 0; }
.ma-tip .y { color: #c9c3b4; font-weight: 400; }
.ma-tip .m { margin: 4px 0 0; color: #c9c3b4; font-size: 13.5px; font-family: var(--sans); }
.ma-tip ul { margin: 6px 0 0; padding: 0; list-style: none; font-size: 13.5px; }
.ma-tip li { margin: 2px 0 0; }
.ma-tip li i { display: inline-block; width: 3px; height: 11px; vertical-align: -1px; margin-right: 7px; background: var(--paper); }
.ma-tip li i.prose { background: var(--oxblood-2); }
.ma-tip li i.stage { background: #7f94c7; }
.ma-tip li i.comic { background: #8db36e; }
.ma-tip li i.other { background: transparent; box-shadow: inset 0 0 0 1px #c9c3b4; }

/* ───────────────────── the chapters ───────────────────── */
.ma-chapters { padding: 40px 0 70px; }
.ma-ch { padding: 56px 0 0; margin-top: 56px; border-top: 1px solid var(--rule-2); }
.ma-ch:first-child { margin-top: 0; border-top: 0; padding-top: 30px; }
.ma-ch-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); gap: 20px 56px; align-items: start; }
.ma-ch-head {
  font-size: clamp(27px, 3vw, 38px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.12;
  margin: 0; text-wrap: balance;
}
.ma-ch-head b { font-weight: 500; color: var(--oxblood); }
.ma-ch-body { margin: 16px 0 0; font-size: 17px; line-height: 1.6; color: var(--ink-2); }
.ma-ch-body a { color: var(--oxblood); }
.ma-ch-chart { min-width: 0; }
.ma-ch-chart .ma-register { margin-top: 0; }
.ma-ch-chart .ma-axis, .ma-ch-chart .ma-row { --name-col: 230px; --n-col: 68px; }

/* decades: one column per decade, stacked by ink */
.ma-decades { display: grid; grid-template-columns: repeat(var(--decades, 14), minmax(0, 1fr)); gap: 0 5px; align-items: end; height: 260px; }
.ma-dec { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; min-width: 0; }
.ma-dec .bar { display: flex; flex-direction: column-reverse; height: var(--h); border-bottom: 1px solid var(--ink); }
.ma-dec .seg { flex: none; }
.ma-dec .seg.prose { background: var(--oxblood); }
.ma-dec .seg.stage { background: var(--indigo); }
.ma-dec .seg.comic { background: var(--moss); }
.ma-dec .seg.other { background: rgba(143, 137, 125, 0.22); box-shadow: inset 0 0 0 1px var(--hollow); }
.ma-dec .lab { font-family: var(--sans); font-size: 11px; color: var(--ink-3); margin-top: 6px; white-space: nowrap; }
.ma-dec .top { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; margin-bottom: 4px; white-space: nowrap; }
.ma-dec:hover .bar, .ma-dec:focus-visible .bar { filter: brightness(0.86); }

/* the wait: publication to first film, first film to latest */
.ma-waits { display: grid; gap: 7px; }
.ma-wait { display: grid; grid-template-columns: 250px minmax(0, 1fr) 96px; gap: 0 12px; align-items: center; font-size: 15px; }
.ma-wait .t { min-width: 0; line-height: 1.25; }
.ma-wait .t i { font-style: italic; }
.ma-wait .t small { display: block; color: var(--ink-3); font-size: 13px; margin-top: 1px; }
.ma-wait .bar { position: relative; height: 12px; }
.ma-wait .w { position: absolute; left: 0; top: 2px; height: 8px; border: 1px solid var(--hollow); border-right: 0; }
.ma-wait .s { position: absolute; top: 0; height: 12px; background: var(--oxblood); }
.ma-wait .s.stage { background: var(--indigo); }
.ma-wait .s.comic { background: var(--moss); }
.ma-wait .s.other { background: var(--hollow); }
.ma-waits { gap: 10px; }
.ma-wait .d { position: absolute; top: -1px; width: 3px; height: 14px; background: var(--ink); }
.ma-wait .n { text-align: right; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ma-wait-axis { display: flex; justify-content: space-between; margin-top: 10px; font-family: var(--sans); font-size: 11.5px; color: var(--ink-3); }

/* countries */
.ma-lands { display: grid; gap: 14px; }
.ma-land { display: grid; grid-template-columns: 230px minmax(0, 1fr) 56px; gap: 4px 12px; align-items: baseline; padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.ma-land .t { font-size: 17px; font-weight: 500; min-width: 0; }
.ma-land .t small { display: block; font-size: 13.5px; color: var(--ink-3); font-weight: 400; }
.ma-land .c { font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.ma-land .c b { font-weight: 500; color: var(--ink); }
.ma-land .n { text-align: right; font-size: 19px; font-weight: 500; font-variant-numeric: tabular-nums; }
.ma-land .n small { display: block; font-size: 12.5px; color: var(--ink-3); font-weight: 400; }

.ma-numbers { margin: 18px 0 0; max-width: 100%; overflow-x: auto; }
.ma-numbers summary { cursor: pointer; font-family: var(--sans); font-size: 13.5px; color: var(--ink-3); list-style: none; display: inline-block; }
.ma-numbers summary::-webkit-details-marker { display: none; }
.ma-numbers summary:hover { color: var(--ink); }
.ma-numbers table { margin-top: 10px; border-collapse: collapse; font-size: 13.5px; font-family: var(--sans); }
.ma-numbers th, .ma-numbers td { text-align: left; padding: 5px 16px 5px 0; border-bottom: 1px solid var(--rule); color: var(--ink-2); white-space: nowrap; }
.ma-numbers th { font-weight: 600; font-size: 12.5px; color: var(--ink-3); }
.ma-numbers td + td { font-variant-numeric: tabular-nums; }
.ma-ch-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 18px 0 0; font-family: var(--sans); font-size: 14px; }
.ma-ch-foot .ma-btn { font-size: 13px; padding: 8px 14px; }
.ma-show-in { font-size: 14px; font-weight: 600; color: var(--oxblood); background: none; border: 0; cursor: pointer; padding: 6px 2px; }
.ma-show-in:hover { text-decoration: underline; }

/* ───────────────────── about the data ───────────────────── */
.ma-about { padding: 70px 0 10px; border-top: 1px solid var(--rule-2); }
.ma-about h2 { font-size: clamp(30px, 3.6vw, 42px); font-weight: 500; letter-spacing: -0.018em; margin: 0; }
.ma-about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 56px; margin-top: 6px; }
.ma-about h3 { font-size: 20px; font-weight: 500; margin: 26px 0 0; }
.ma-about p, .ma-about li { font-size: 16.5px; line-height: 1.6; color: var(--ink-2); }
.ma-about p { margin: 10px 0 0; max-width: 60ch; }
.ma-about ul { margin: 12px 0 0; padding: 0 0 0 18px; }
.ma-about li { margin: 6px 0 0; }
.ma-about li strong { color: var(--ink); font-weight: 500; }
.ma-about p.ma-download { margin-top: 24px; }
.ma-about p.ma-small { font-size: 14.5px; color: var(--ink-3); }

/* the base's pitch and others sit on the paper too */
.ma .pitch { font-family: var(--sans); }
.ma .section { font-family: var(--sans); }
.ma .section h2 { font-family: var(--serif); font-weight: 500; }
.ma .pitch { background: #fff; border-color: var(--rule); }

/* ───────────────────── narrow screens ───────────────────── */
@media (max-width: 980px) {
  .ma-top { grid-template-columns: minmax(0, 1fr); }
  .ma-ch-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .ma-about-grid { grid-template-columns: minmax(0, 1fr); }
  .ma-axis, .ma-row, .ma-shelf .ma-row, .ma-ch-chart .ma-axis, .ma-ch-chart .ma-row { --name-col: 190px; --n-col: 52px; }
}
@media (max-width: 720px) {
  .ma-open { padding: 44px 0 6px; }
  .ma-lede { font-size: 18px; }
  .ma-line > label, .ma-line > .ma-lab { min-width: 0; flex-basis: 100%; }
  .ma-select select { max-width: 100%; }
  .ma-line input[type="search"] { max-width: none; }
  .ma-axis, .ma-row, .ma-shelf .ma-row, .ma-ch-chart .ma-axis, .ma-ch-chart .ma-row {
    grid-template-columns: minmax(0, 1fr) 64px; gap: 4px 10px;
  }
  .ma-row .ma-n small { white-space: nowrap; }
  .ma-axis > .ma-lab { display: none; }
  .ma-axis .ma-strip { grid-column: 1; }
  .ma-axis .ma-n { grid-column: 2; }
  .ma-axis .ma-strip span { font-size: 10px; }
  .ma-axis .ma-strip span:nth-child(odd) { visibility: hidden; }
  .ma-row .ma-name { grid-column: 1; grid-row: 1; }
  .ma-row .ma-n { grid-column: 2; grid-row: 1; }
  .ma-row .ma-strip { grid-column: 1 / -1; grid-row: 2; padding-top: 6px; gap: 0 3px; }
  .ma-name b { font-size: 17px; }
  .ma-spine { width: 2px; height: 12px; }
  .ma-shelf { padding: 16px 14px 18px; }
  .ma-shelf .ma-spine { width: 4px; height: 14px; }
  .ma-decades { height: 200px; gap: 0 3px; }
  .ma-dec .lab { font-size: 10px; }
  .ma-dec:nth-child(even) .lab { visibility: hidden; }
  .ma-dec .top { display: none; }
  .ma-wait { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
  .ma-wait .bar { grid-column: 1 / -1; grid-row: 2; }
  .ma-wait .n { font-size: 12.5px; }
  .ma-land { grid-template-columns: minmax(0, 1fr) 56px; }
  .ma-land .t { grid-column: 1; grid-row: 1; }
  .ma-land .n { grid-column: 2; grid-row: 1; }
  .ma-land .c { grid-column: 1 / -1; grid-row: 2; }
  .ma-chapters { padding: 24px 0 50px; }
  .ma-ch { padding-top: 40px; margin-top: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .ma * { transition: none !important; }
}
