/* Format, the style guides (MLA, APA, Chicago). Loads after site.css and
   draws with its tokens, buttons, window frame, sheets and FAQ. New here: a
   reading column beside a sticky contents list, rule lists, and samples set
   in a serif so they read like the paper they describe. */

.guide-page {
  --read-max: 70ch;
  --toc-w: 220px;
  --toc-top: 86px;            /* under the 62px sticky header */
  --part-gap: 64px;           /* between the guide's parts */
}

/* Hero: words only, centered on the dots. */
.guide-hero { padding: 64px 0 72px; text-align: center; border-bottom: 1px solid var(--line); }
.guide-hero .wrap { display: flex; flex-direction: column; align-items: center; }
.guide-hero h1 { font-size: clamp(36px, 3.4vw, 46px); }
.guide-hero h1 .accent { color: var(--accent); }
.guide-hero .lead { margin-top: 18px; }
.guide-hero .cta-row { justify-content: center; margin-top: 26px; }
.crumbs ol { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; font-size: 14px; color: var(--text-faint); }
.crumbs li + li::before { content: '/'; margin-right: 8px; color: var(--line-strong); }
.crumbs a { color: var(--text-dim); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }

/* Layout: contents on the left at desk width, one reading column. */
.guide {
  display: grid; grid-template-columns: var(--toc-w) minmax(0, var(--read-max));
  gap: 64px; justify-content: center; align-items: start;
}
.toc-desk { position: sticky; top: var(--toc-top); max-height: calc(100vh - var(--toc-top) - 24px); overflow-y: auto; }
.toc-title { font: 600 12px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 10px; }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line); }
.toc a {
  display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 1px solid transparent;
  color: var(--text-dim); font-size: 14.5px; line-height: 1.4; text-decoration: none;
  transition: color var(--dur), border-color var(--dur);
}
.toc a:hover { color: var(--text); border-left-color: var(--accent); }
.toc-phone { display: none; }

/* The reading column */
.article { min-width: 0; }
.part + .part { margin-top: var(--part-gap); }
.part { scroll-margin-top: var(--toc-top); }
.article h2 { font-size: 28px; line-height: 1.2; letter-spacing: -.02em; }
/* One rhythm inside a part: 16px between blocks, 12px under a heading. */
.part > * + * { margin-top: 16px; }
.part > h2 + *, .part > h3 + * { margin-top: 12px; }
.article .part > h3 { margin-top: 28px; font-size: 19px; }
.article ul:not([class]) { padding-left: 1.25em; display: grid; gap: 8px; }
.article ul:not([class]) li::marker { color: var(--text-faint); }
.article code { font: .92em var(--mono); background: var(--bg-tint); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.note { font-size: 15px; color: var(--text-dim); }

/* Quick rules: a two-column list of exact values. */
.specs { display: grid; grid-template-columns: minmax(8.5em, 11em) minmax(0, 1fr); margin: 0; border-top: 1px solid var(--line); }
.specs dt, .specs dd { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--line); }
.specs dt { font-weight: 650; padding-right: 16px; }
.specs dd { color: var(--text-dim); }

/* Samples: set like the paper, on a raised sheet. */
.sample {
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-card); padding: var(--card-pad);
  font: 17px/1.9 var(--serif); color: var(--text); overflow-wrap: anywhere;
}
.sample p + p { margin-top: 0; }
.sample-label { font: 600 11.5px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.sample p + .sample-label { margin-top: 18px; }
.sample .entry { padding-left: 2em; text-indent: -2em; }
.sample .note-entry { text-indent: 2em; line-height: 1.55; }
.sample .note-entry + .note-entry { margin-top: 1em; }   /* single-spaced, a blank line between notes */
.sample .center { text-align: center; }
.sample .right { text-align: right; }
.sample .bold { font-weight: 700; }
.sample .indent { text-indent: 2em; }
.sample .run { font-weight: 700; }
.sample .muted { color: var(--text-faint); }
.sample sup { font-size: .7em; line-height: 0; }
.sample .page-gap { height: 1.9em; }
.sample .block { padding-left: 2em; }
.sample .hd1 { text-align: center; font-weight: 700; }
.sample .hd2 { font-weight: 700; }
.sample .hd3 { font-weight: 700; font-style: italic; }
.sample .hd4 { text-indent: 2em; }
.sample .hd4 b, .sample .hd5 b { font-weight: 700; }
.sample .hd5 { text-indent: 2em; }
.sample .hd5 b { font-style: italic; }

/* Pairs: a case on the left, what to type on the right. */
.pairs { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.pairs li { display: grid; grid-template-columns: minmax(9em, 13em) minmax(0, 1fr); gap: 4px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pair-k { font-size: 15px; color: var(--text-dim); }
.pair-v { font: 17px/1.55 var(--serif); overflow-wrap: anywhere; }

/* What you type, what you get: the real app and the real export. */
.compare { margin-top: 20px; display: grid; gap: 28px; }
.compare-label { font: 600 12px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 12px; }
.compare .sheets { gap: 20px; }
.compare .sheet { width: min(320px, 100%); }
.compare-note { font-size: 15px; color: var(--text-dim); }

/* The mistakes list: numbered, one line of why each. */
.marks { list-style: none; padding: 0; margin: 16px 0 0; counter-reset: mark; display: grid; gap: 14px; }
.marks li { position: relative; padding-left: 40px; counter-increment: mark; }
.marks li::before {
  content: counter(mark); position: absolute; left: 0; top: 1px;
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font: 600 12px/1 var(--mono); color: var(--accent); background: var(--accent-soft);
}
.marks b { font-weight: 650; }

/* Or let Format do it: one calm card. */
.let {
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-card); padding: var(--card-pad);
}
.let h2 { font-size: 24px; }
.let p { margin-top: 10px; color: var(--text-dim); }
.let .cta-row { margin-top: 20px; }

.article .faq { max-width: none; margin: 16px 0 0; }

/* Related guides */
.related { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; max-width: 960px; margin: 0 auto; }
.related a {
  display: flex; flex-direction: column; gap: 6px; padding: var(--card-pad);
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  color: var(--text); text-decoration: none; transition: border-color var(--dur);
}
.related a:hover { border-color: var(--line-strong); }
.related .rel-k { font: 600 11.5px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.related h3 { font-size: 19px; }
.related p { color: var(--text-dim); font-size: 15px; }

@media (max-width: 1100px) {
  .guide-page { --toc-w: 200px; }
  .guide { gap: 48px; }
}
@media (max-width: 960px) {
  .guide { grid-template-columns: minmax(0, var(--read-max)); }
  .toc-desk { display: none; }
  .toc-phone {
    display: block; margin-bottom: 40px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-raised);
  }
  .toc-phone summary {
    display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 18px;
    cursor: pointer; list-style: none; font-weight: 650;
  }
  .toc-phone summary::-webkit-details-marker { display: none; }
  .toc-phone summary::after {
    content: ''; width: 8px; height: 8px; margin-right: 4px;
    border-right: 1.6px solid var(--text-faint); border-bottom: 1.6px solid var(--text-faint);
    transform: translateY(-2px) rotate(45deg); transition: transform var(--dur) var(--ease);
  }
  .toc-phone[open] summary::after { transform: translateY(2px) rotate(-135deg); }
  .toc-phone ol { margin: 0 18px 14px; }
  .toc-phone a { min-height: 44px; display: flex; align-items: center; padding-top: 0; padding-bottom: 0; }
  .related { grid-template-columns: 1fr; max-width: 560px; }
}
@media (max-width: 720px) {
  .guide-page { --part-gap: 48px; }
  .guide-hero { padding: 44px 0 56px; }
  .guide-hero h1 { font-size: 34px; }
  .article h2 { font-size: 24px; }
  .article .part > h3 { font-size: 18px; }
  .let h2 { font-size: 22px; }
  .sample { font-size: 16px; }
  .compare .sheets { gap: 12px; }
}
@media (max-width: 520px) {
  .specs { grid-template-columns: 1fr; }
  .specs dt { border-bottom: 0; padding-bottom: 0; }
  .specs dd { padding-top: 2px; }
  .pairs li { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .guide-hero h1 { font-size: 31px; }
}
