/* Reading pages (privacy). Needs tokens.css and base.css.
   docs/design.md 5.5: paper page, a landscape strip on top, the text on one paper sheet. */

.doc-page { overflow-x: hidden; }

.doc-scene {
  position: absolute;
  inset: 0 0 auto 0;
  height: 220px;
  --land-h: 70%;
  --sun-y: 18%;
  --sun-x: 12%;
}

.doc-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 52rem;
  margin: 0 auto;
  padding:
    max(12px, env(safe-area-inset-top))
    max(var(--gutter), env(safe-area-inset-right))
    max(var(--s-7), env(safe-area-inset-bottom))
    max(var(--gutter), env(safe-area-inset-left));
}

.doc-top { display: flex; align-items: center; min-height: 64px; }
.doc-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: var(--hit);
  padding: 0 var(--s-3) 0 var(--s-1);
  font-size: var(--fs-lg);
  color: var(--ink);
  text-decoration: none;
  background: var(--paper-hi);
  border: 2px solid var(--ink);
  border-radius: var(--r-chip);
}
.doc-brand img { width: 34px; height: 34px; }

.doc {
  margin-top: 96px;
  padding: var(--s-6) var(--s-4) var(--s-6);
}
.doc > * + * { margin-top: var(--s-4); }
.doc section { margin-top: var(--s-7); }
.doc section > * + * { margin-top: var(--s-3); }

.doc-title { font-size: var(--fs-3xl); }
.doc-meta { color: var(--ink-soft); font-weight: 700; }
.doc h2 { font-size: var(--fs-xl); }
.doc p, .doc li { max-width: 40em; }
.doc a:not(.btn) { color: var(--map-deep); font-weight: 700; text-underline-offset: 3px; text-decoration-thickness: 2px; }
.doc code {
  font-size: 0.9em;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--paper-lo);
  overflow-wrap: anywhere;
}

/* "쉽게 말하면": the part a child or a parent reads first. */
.doc-easy {
  position: relative;
  padding: var(--s-5) var(--s-4) var(--s-4);
  background: var(--role-producer-tint);
  border: 2.5px solid var(--ink);
  border-radius: var(--r-panel);
}
.doc-easy h2 { font-size: var(--fs-xl); padding-right: 72px; }
.doc-easy ul { margin: var(--s-3) 0 0; padding-left: 1.2em; display: grid; gap: var(--s-2); font-size: var(--fs-md); }
.doc-easy-art { position: absolute; right: 12px; top: -34px; width: 76px; height: 76px; }

.doc-list { margin: var(--s-3) 0 0; padding-left: 1.2em; display: grid; gap: var(--s-2); }
.doc-note { color: var(--ink-soft); font-size: var(--fs-sm); }

/* Tables: rows become cards on phones, each cell with its column name. */
.doc-table table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.doc-table caption { text-align: left; font-weight: 700; padding-bottom: var(--s-2); }
.doc-table th, .doc-table td { text-align: left; vertical-align: top; padding: var(--s-3); }
.doc-table thead th { background: var(--paper-lo); border-bottom: 2px solid var(--ink); white-space: nowrap; }
.doc-table tbody tr { border-bottom: 1.5px solid var(--line); }
.doc-table tbody th { font-weight: 800; overflow-wrap: normal; }

@media (max-width: 719px) {
  .doc-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .doc-table table, .doc-table tbody, .doc-table tr, .doc-table th, .doc-table td { display: block; }
  .doc-table tbody tr {
    margin-bottom: var(--s-3);
    padding: var(--s-2) 0;
    border: 2px solid var(--line);
    border-radius: var(--r-control);
    background: var(--paper);
  }
  .doc-table th, .doc-table td { padding: var(--s-2) var(--s-3); }
  .doc-table td::before {
    content: attr(data-label);
    display: block;
    font-size: var(--fs-xs);
    font-weight: 800;
    color: var(--ink-soft);
  }
}

.doc-back { margin-top: var(--s-7); }

@media (min-width: 900px) {
  .doc-scene { height: 280px; }
  .doc { margin-top: 120px; padding: var(--s-7) var(--s-7) var(--s-7); }
  .doc-easy { padding: var(--s-5) var(--s-6); }
  .doc-easy-art { right: 24px; top: -44px; width: 96px; height: 96px; }
}

.doc-sub { margin-top: var(--s-5); font-size: var(--fs-lg); font-weight: 800; }

/* The public maps' food-web sources (section 7, made by pnpm sources): a folded paper card per map. */
.doc-sources-list { display: grid; gap: var(--s-2); }
.doc-sources {
  background: var(--paper-hi);
  border: 2px solid var(--line);
  border-radius: var(--r-control);
}
.doc-sources[open] { border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.doc-sources summary {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-height: var(--hit);
  padding: var(--s-2) var(--s-4);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.doc-sources summary::-webkit-details-marker { display: none; }
.doc-sources summary::before {
  content: '';
  flex: none;
  width: 0.55em;
  height: 0.55em;
  border-right: 2.5px solid var(--ink);
  border-bottom: 2.5px solid var(--ink);
  transform: rotate(-45deg);
  transition: transform var(--t-ui) var(--ease-out);
}
.doc-sources[open] summary::before { transform: rotate(45deg); }
.doc-sources summary strong { font-family: var(--font-display); font-weight: 800; font-synthesis: none; font-size: var(--fs-lg); }
.doc-sources ol { margin: 0; padding: 0 var(--s-4) 0 calc(var(--s-4) + 1.4em); display: grid; gap: var(--s-1); font-size: var(--fs-sm); color: var(--ink-soft); }
.doc-sources p { padding: var(--s-3) var(--s-4) var(--s-4); font-size: var(--fs-sm); }
