/* Documentation pages (site/docs/, generated by scripts/build_docs.py) and the
   Film page. Loaded after style.css and builds on its .doc prose styles. */

/* In the docs, "Docs" in the top bar is the section you are in. */
.bar nav a[aria-current="true"] {
  text-decoration: underline; text-decoration-color: #ff5a1f;
  text-decoration-thickness: 3px; text-underline-offset: 6px;
}
@media (max-width: 720px) {
  .bar nav a[aria-current="true"] { text-decoration: none; background: var(--sun); }
}

/* ---- layout: a doc list beside the page on wide screens, a menu above it on phones ---- */
.docs-layout { display: block; }
.docs-main { margin: 0 auto; min-width: 0; }
.docs-side { display: none; }
@media (min-width: 1000px) {
  .docs-layout {
    display: grid; grid-template-columns: 14.5rem minmax(0, 46rem);
    gap: 3rem; justify-content: center; align-items: start;
  }
  .docs-main { margin: 0; }
  .docs-side {
    display: block; position: sticky; top: 1rem; max-height: calc(100vh - 2rem);
    overflow-y: auto; padding: clamp(1.5rem, 5vw, 3rem) .2rem 1rem 0;
  }
  .docs-menu { display: none; }
}

.docs-list .group {
  margin: 1.1rem 0 .35rem; font: 500 .7rem/1.2 var(--data);
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft);
}
.docs-list .group:first-child { margin-top: 0; }
.docs-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.docs-list a {
  display: block; padding: .28rem .6rem; border-radius: 10px;
  font-weight: 600; font-size: .95rem; text-decoration: none; line-height: 1.3;
}
.docs-list a:hover { background: var(--label); }
.docs-list a[aria-current="page"] { background: var(--sun); border: 2px solid var(--line); padding: .18rem .5rem; }

.docs-menu { margin: 0 0 1.5rem; padding: 0; }
.docs-menu summary {
  cursor: pointer; padding: .7rem 1rem; font-weight: 700; list-style: none;
  display: flex; align-items: center; justify-content: space-between;
}
.docs-menu summary::-webkit-details-marker { display: none; }
.docs-menu summary::after { content: "+"; font: 500 1.2rem/1 var(--data); }
.docs-menu[open] summary::after { content: "\2212"; }
.docs-menu .docs-list { padding: 0 .6rem .9rem; }

/* ---- prose from Markdown ---- */
.prose { overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose h2 { scroll-margin-top: 1rem; }
.prose h3, .prose h4 { scroll-margin-top: 1rem; }
.prose h4 { font: 700 1rem/1.3 var(--body); margin: 1.3rem 0 .3rem; }
.prose a { text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.prose hr { border: 0; border-top: 2px dashed #cfd6ea; margin: 2.2rem 0; }
.prose blockquote {
  margin: 1.2rem 0; padding: .6rem 1rem; border-left: 4px solid var(--sun);
  background: var(--label); border-radius: 0 12px 12px 0;
}
.prose img { height: auto; border-radius: 12px; }
/* Code: the block scrolls sideways, never the page. */
.prose pre { max-width: 100%; margin: 1.1rem 0; white-space: pre; tab-size: 4; }
.prose pre code { font-size: inherit; white-space: inherit; }
.prose .table-scroll {
  margin: 1rem 0; background: var(--label); border: 2px solid var(--line);
  border-radius: 14px; box-shadow: 3px 3px 0 var(--line);
}
.prose .table-scroll table { margin: 0; min-width: 32rem; }
.prose th { background: var(--ground); white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
.prose td code { white-space: nowrap; }
.prose li { min-width: 0; }
.prose li.task { list-style: none; position: relative; }
.prose li.task > p:first-child { margin-top: 0; }
.prose li.task .box {
  position: absolute; left: -1.35rem; top: .35em; width: .95rem; height: .95rem;
  border: 2px solid var(--line); border-radius: 4px; background: var(--label);
}
.prose li.task .box.done { background: var(--good); }
.prose li.task > ul, .prose li.task > .table-scroll { margin-top: .4rem; }

.docs-edit {
  display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.2rem;
  margin: 3rem 0 0; padding-top: 1.5rem; border-top: 2px dashed #cfd6ea;
  font-size: .92rem; color: var(--ink-soft);
}
.docs-edit .btn { font-size: .95rem; padding: .65rem 1rem; }
.docs-edit code { overflow-wrap: anywhere; }

/* ---- docs home: the catalogue ---- */
.docs-groups { display: grid; gap: 1.1rem; margin: 0 0 1rem; }
@media (min-width: 640px) { .docs-groups { grid-template-columns: 1fr 1fr; } }
.docs-group { padding: 1.1rem 1.2rem 1.2rem; }
.docs .docs-group h2, .doc .docs-group h2 { margin: 0 0 .2rem; font-size: 1.45rem; }
.docs-group p { margin: 0 0 .7rem; color: var(--ink-soft); font-size: .93rem; line-height: 1.45; }
.doc .docs-group ul { list-style: none; padding: 0; margin: 0; gap: .55rem; }
.docs-group li { display: grid; gap: .05rem; line-height: 1.35; }
.docs-group li a { font-weight: 700; }
.docs-group li span { color: var(--ink-soft); font-size: .9rem; }
.doc .docs-overview { margin-top: 3rem; }

/* ---- the Film page ---- */
.film-page { max-width: 64rem; padding-top: clamp(1.5rem, 5vw, 3rem); }
.film-page .kicker { display: inline-block; margin-bottom: 1rem; }
.film-page h1 { margin-bottom: 1.4rem; }
.film-frame video { aspect-ratio: 16 / 9; background: #000; }
.film-note { margin: 1.3rem 0 1.4rem; font-size: 1.2rem; line-height: 1.45; max-width: 40rem; }
.film-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin: 0 0 2.6rem; }
.film-cast h2 { font-size: clamp(1.6rem, 4.5vw, 2.2rem); margin: 0 0 .9rem; }
.film-cast ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
@media (min-width: 760px) { .film-cast ol { grid-template-columns: 1fr 1fr; } }
.film-cast li { padding: .8rem 1rem; display: grid; gap: .15rem; }
.film-cast b { font: 500 .72rem/1.2 var(--data); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.film-cast q { font-weight: 600; font-size: 1.05rem; line-height: 1.4; }
.film-cast p { margin: 1rem 0 0; color: var(--ink-soft); font-size: .93rem; }
