/*
 * Atlas genre guides (/atlas/<family>/<slug>) — layered over /legal/legal.css,
 * which already imports /tokens.css (so .cta-btn and the base type scale are
 * here for free). Only the guide-specific pieces live in this file.
 *
 * Loaded via renderHead({ extraCss }) from scripts/build-atlas.mjs.
 */

.wrap {
  max-width: 820px;
}

.guide-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim, rgba(255, 255, 255, 0.5));
  margin: 0 0 0.4em;
}

.guide-eyebrow a {
  color: inherit;
}

.lead {
  max-width: 62ch;
}

/* ── format cards ──────────────────────────────────────────────────── */
.fmt {
  background: var(--panel, #16161d);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: 16px;
  padding: 24px;
  margin: 16px 0 2.5rem;
}

.fmt > p:last-child {
  margin-bottom: 0;
}

.fmt-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.fmt-head h3 {
  margin: 0;
  font-size: 1.15rem;
}

.tag {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent, #8ea2ff);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.demo {
  background: var(--panel2, #1c1c25);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: 12px;
  padding: 20px;
  margin: 14px 0;
  overflow-x: auto;
}

.demo-label {
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim, rgba(255, 255, 255, 0.5));
  margin: 0 0 12px;
}

/* ── cryptogram ────────────────────────────────────────────────────── */
.crypt {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.crypt .cw {
  display: flex;
  gap: 3px;
}
.crypt .cl {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 22px;
}
.crypt .cl b {
  font: 600 15px ui-monospace, Menlo, Consolas, monospace;
  color: var(--heading, #fff);
}
.crypt .cl i {
  font-style: normal;
  font-size: 9px;
  color: var(--text-dim, rgba(255, 255, 255, 0.5));
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  width: 100%;
  text-align: center;
  padding-top: 2px;
}

/* ── drop quote ────────────────────────────────────────────────────── */
.qf {
  display: inline-block;
}
.qf-row {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-bottom: 4px;
}
.qf-c {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font: 600 13px ui-monospace, Menlo, Consolas, monospace;
  color: var(--text, rgba(255, 255, 255, 0.88));
}
.qf-grid {
  border-bottom: 2px solid var(--accent, #8ea2ff);
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.qf-slot {
  width: 24px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 4px;
  background: #0e0e14;
}
.qf-slot.blk {
  background: #333;
  border-color: #333;
}

/* ── word scramble ─────────────────────────────────────────────────── */
.scr {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.scr span {
  font: 600 15px ui-monospace, Menlo, Consolas, monospace;
  color: var(--heading, #fff);
  background: #0e0e14;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: 6px;
  padding: 6px 10px;
  letter-spacing: 0.08em;
}

/* ── tile swap ─────────────────────────────────────────────────────── */
#guide-board {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
}
#guide-board .row {
  display: flex;
  gap: 5px;
}
#guide-board .tile {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: 19px;
  cursor: pointer;
  user-select: none;
  position: relative;
  background: linear-gradient(180deg, #2c2c3b, #1a1a22);
  color: var(--text, rgba(255, 255, 255, 0.88));
  border: 1px solid #2c2c3b;
  transition: transform 0.12s ease, background 0.15s ease;
}
#guide-board .tile.correct {
  background: linear-gradient(180deg, #4e88e0, #1f4aa8);
  border-color: #5a90e6;
  color: #fff;
}
#guide-board .tile.correct::after {
  content: "";
  position: absolute;
  top: 13%;
  right: 13%;
  width: 8%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
}
#guide-board .tile.sel {
  outline: 3px solid #fff;
  outline-offset: -1px;
  transform: scale(1.06);
  z-index: 1;
}
#guide-board .tile:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}
.guide-prog {
  text-align: center;
  font: 12px ui-monospace, Menlo, Consolas, monospace;
  color: var(--text-dim, rgba(255, 255, 255, 0.5));
  margin-top: 12px;
}
.guide-done {
  display: none;
  text-align: center;
  margin-top: 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--heading, #fff);
}

@media (prefers-reduced-motion: reduce) {
  #guide-board .tile {
    transition: none;
  }
}

/* ── comparison table ──────────────────────────────────────────────── */
.tblwrap {
  overflow-x: auto;
  margin: 1rem 0 2rem;
}
.tblwrap table {
  border-collapse: collapse;
  width: 100%;
  min-width: 640px;
  font-size: 0.9rem;
}
.tblwrap th,
.tblwrap td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  vertical-align: top;
}
.tblwrap th {
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim, rgba(255, 255, 255, 0.5));
  font-weight: 600;
}
.tblwrap td strong {
  color: var(--heading, #fff);
  font-weight: 600;
}
/* These carry real table content ("Poor" / "Good"), not decoration, so the
   word says it too — colour is never the only channel (WCAG 1.4.1) — and .no
   uses --text-mute rather than the dimmer --text-dim so it stays readable. */
.yes {
  color: #5fd08a;
}
.no {
  color: var(--text-mute, rgba(255, 255, 255, 0.55));
}

/* ── closing CTA ───────────────────────────────────────────────────── */
.cta {
  background: var(--panel, #16161d);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: 16px;
  padding: 28px;
  margin-top: 2.5rem;
  text-align: center;
}
.cta h3 {
  margin: 0 0 0.4em;
}
.cta p {
  margin: 0 auto;
}
.cta .foot {
  color: var(--text-dim, rgba(255, 255, 255, 0.5));
  font-size: 0.8rem;
  margin-top: 10px;
}

/* ── back-link to the Atlas ────────────────────────────────────────── */
.guide-back {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  font-size: 0.9rem;
}
