/* Slide Layout System reference page — page "chrome" only.
 * The example slides reuse /slides.css (tokens + .slide.role-* layouts) so they
 * render identically to the real /slides decks. This file styles the document
 * around them: the prose, the mapping table, the gallery grid, the swatches. */

#doc {
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 22px 80px;
}

.doc-block { margin: 0 0 56px; }

.eyebrow {
  font-size: .82rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin: 0 0 8px;
}
.doc-h {
  font-size: 1.9rem; line-height: 1.18; font-weight: 800; color: var(--ink);
  margin: 0 0 14px;
}
.doc-h .muted { font-size: 1.1rem; font-weight: 700; }
.doc-h3 {
  font-size: 1.15rem; font-weight: 800; color: var(--ink); margin: 30px 0 14px;
}
.lede { font-size: 1.12rem; line-height: 1.6; color: var(--ink); max-width: 880px; margin: 0 0 6px; }
.lede.sm { font-size: 1rem; color: var(--muted); }

.principles { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.principles li {
  position: relative; padding: 14px 16px 14px 46px; font-size: 1.02rem; line-height: 1.5;
  background: var(--box); border: 1px solid var(--box-line); border-radius: 12px;
}
.principles li::before {
  content: ""; position: absolute; left: 16px; top: 19px;
  width: 13px; height: 13px; border-radius: 3px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
}

/* ---- Mapping table ----------------------------------------------------- */
.map {
  width: 100%; border-collapse: collapse; margin-top: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; font-size: 1rem;
}
.map th, .map td { text-align: left; padding: 13px 16px; vertical-align: top; }
.map thead th {
  background: var(--accent-soft); color: var(--accent);
  font-size: .8rem; letter-spacing: .05em; text-transform: uppercase;
  border-bottom: 2px solid var(--accent);
}
.map tbody tr + tr td { border-top: 1px solid var(--line); }
.map td:first-child { color: var(--ink); width: 32%; }
.map td .lay {
  display: inline-block; font-weight: 800; color: var(--accent);
}
.map td .mm { color: var(--muted); }

/* ---- Layout gallery ---------------------------------------------------- */
#gallery {
  display: grid; gap: 26px;
  grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
  margin-top: 16px;
}
.lay-card {
  background: var(--card); border: 1px solid var(--line);
  border-top: 5px solid var(--accent); border-radius: 16px;
  padding: 18px 18px 20px; box-shadow: 0 6px 18px rgba(31, 45, 61, .07);
  display: flex; flex-direction: column;
}
.lay-card.is-mermaid { border-top-color: var(--sienna); }
.lay-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.lay-name { font-size: 1.16rem; font-weight: 800; color: var(--ink); margin: 0; }
.lay-name .zh { font-size: .9rem; color: #2a6bbf; font-weight: 700; margin-left: 6px; }
.lay-tag {
  font-size: .68rem; letter-spacing: .05em; text-transform: uppercase; font-weight: 700;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--box-line);
  border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
.lay-card.is-mermaid .lay-tag { color: var(--sienna); background: #fbf3ec; border-color: #e7cdb6; }
.lay-when { font-size: .96rem; color: var(--muted); margin: 6px 0 14px; line-height: 1.45; }
.lay-when b { color: var(--ink); }

/* The mini viewport holds a real 1280x720 .slide scaled to fit the card. */
.mini {
  width: 100%; overflow: hidden; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--line);
}
.mini .slide {
  transform-origin: top left;
  box-shadow: none; border-radius: 0;
  margin: 0;
}
.lay-model {
  margin: 14px 0 0; font-size: .92rem; line-height: 1.5; color: var(--ink);
  background: var(--box); border-left: 4px solid var(--accent); border-radius: 8px;
  padding: 10px 13px;
}
.lay-model b { color: var(--sienna); }

/* Mermaid lives inside a normal .slide-body so the chrome (title/foot) matches. */
.slide-body .mermaid {
  width: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.slide-body .mermaid svg { max-width: 100%; height: auto; }
.slide-body .mermaid-fallback {
  color: var(--muted); font-size: 22px; font-style: italic; text-align: center;
}

/* ---- Color swatches --------------------------------------------------- */
#swatches {
  display: grid; gap: 14px; margin-top: 14px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.sw {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden;
}
.sw-chip { height: 64px; }
.sw-meta { padding: 10px 12px; }
.sw-name { font-weight: 800; font-size: .96rem; color: var(--ink); }
.sw-hex { font-size: .82rem; color: var(--muted); font-family: ui-monospace, Menlo, Consolas, monospace; }
.sw-use { font-size: .85rem; color: var(--muted); margin-top: 4px; line-height: 1.4; }

/* ---- Type scale ------------------------------------------------------- */
.type-scale { display: grid; gap: 12px; margin-top: 8px; }
.ts-row {
  display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap;
  padding: 12px 16px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px;
}
.ts-demo { color: var(--ink); }
.ts-demo.t1 { font-size: 2.2rem; font-weight: 800; color: var(--accent); }
.ts-demo.t2 { font-size: 1.35rem; font-weight: 600; }
.ts-demo.t3 { font-size: 1rem; color: var(--muted); }
.ts-meta { font-size: .85rem; color: var(--muted); margin-left: auto; }

/* ---- Mental models ---------------------------------------------------- */
#models {
  display: grid; gap: 16px; margin-top: 14px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.model {
  background: var(--card); border: 1px solid var(--line);
  border-top: 4px solid var(--sienna); border-radius: 14px; padding: 16px 18px;
}
.model h4 { margin: 0 0 8px; font-size: 1.05rem; font-weight: 800; color: var(--ink); }
.model p { margin: 0; font-size: .95rem; line-height: 1.55; color: var(--muted); }
.model p b { color: var(--ink); }

/* ---- Footer ----------------------------------------------------------- */
.doc-foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line);
  font-size: .85rem; color: var(--muted);
}

@media (max-width: 560px) {
  .doc-h { font-size: 1.5rem; }
  #gallery { grid-template-columns: 1fr; }
  .map td:first-child { width: auto; }
}
