/* Hallmark v2 | Index-first download catalogue | warm paper, green ink */
/* The download controls and file sizes carry the hierarchy. */
:root {
  color-scheme: light;
  --paper: #f6f6ee;
  --surface: #fffef8;
  --ink: #1d2e27;
  --secondary: #4b5d53;
  --line: #d5ddd2;
  --action: #175a42;
  --active: #104432;
  --wash: #e7eee5;
  --on-action: #f8fff8;
  --font: system-ui, "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
body { background: var(--paper); color: var(--ink); font: 1rem/1.55 var(--font); }
main { max-width: 52rem; margin: auto; padding: clamp(1rem, 4vw, 3rem); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 6vw, 3.65rem); line-height: 1.15; letter-spacing: -.05em; overflow-wrap: break-word; }
h2 { font-size: clamp(1.25rem, 3vw, 1.6rem); word-break: keep-all; }
h1, h2 { text-wrap: balance; }
a { color: var(--action); }
:focus-visible { outline: 3px solid var(--action); outline-offset: 3px; }
.intro { padding: clamp(1.25rem, 5vw, 3rem) 0 1.1rem; border-bottom: 2px solid var(--ink); }
.intro p { margin: .55rem 0 1.25rem; color: var(--secondary); word-break: keep-all; }
nav { display: flex; flex-wrap: wrap; gap: .35rem; }
nav a { display: grid; place-content: center; min-height: 44px; padding: .2rem .7rem; border-radius: .3rem; text-underline-offset: .2em; }
nav a:hover, summary:hover, li a:hover { background: var(--wash); }
.book { margin-top: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: .5rem; scroll-margin-top: 1rem; }
.book:target { border-color: var(--action); }
.book-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem; }
.book-head p { color: var(--secondary); font-size: .9rem; }
.download { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: .15rem .6rem; min-height: 44px; padding: .35rem .75rem; border-radius: .3rem; background: var(--action); color: var(--on-action); font-weight: 700; text-decoration: none; }
.download:hover { background: var(--active); }
.download:active { box-shadow: inset 0 0 0 2px var(--ink); }
nav a:active, summary:active, li a:active { text-decoration: underline; }
.download span, summary span, .size { font-size: .85rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.download span { font-weight: 500; }
.exam { margin: 0 .95rem .95rem; background: var(--wash); border: 1px solid var(--line); border-radius: .35rem; }
.exam a { display: flex; justify-content: space-between; align-items: center; gap: .65rem; min-height: 44px; padding: .55rem .7rem; text-decoration: none; }
.exam a:hover { border-radius: inherit; text-decoration: underline; text-underline-offset: .2em; }
.exam-range { display: block; color: var(--secondary); font-size: .86rem; word-break: keep-all; }
summary { cursor: pointer; min-height: 44px; padding: .7rem 1rem; border-top: 1px solid var(--line); font-weight: 650; }
summary span { margin-left: .5rem; color: var(--secondary); font-weight: 400; }
ul { margin: 0; padding: 0; list-style: none; }
li a { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 44px; padding: .55rem 1rem; border-top: 1px solid var(--line); text-decoration: none; }
li a span:first-child { word-break: keep-all; overflow-wrap: anywhere; }
.size { color: var(--secondary); }
.arrow { margin-left: .65rem; color: var(--action); font-size: 1.15rem; }
@media (max-width: 380px) {
  .book-head { align-items: stretch; flex-direction: column; gap: .5rem; }
  .download { width: fit-content; }
}
