/* =================================================================
   PruTAN — Long-form Docs Theme
   Depends on: prutan-tokens.css
   Evolved from the original style.css — same look, now token-driven
   so it stays in lock-step with decks.
   ================================================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { min-height: 100vh; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding: 32px 24px;
}

/* --- Layout --- */
.wrap {
  max-width: 960px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  box-shadow: var(--shadow);
}
.wrap-wide { max-width: 1280px; }

/* --- Logo header (for docs) --- */
.docs-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.docs-header .docs-logo {
  width: 32px; height: 32px;
  color: var(--prutan-navy);
}
.docs-header .docs-wordmark {
  font-size: 18px;
  font-weight: 700;
  color: var(--prutan-navy);
  letter-spacing: -0.01em;
}
.docs-header .docs-kicker {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-left: auto;
}

/* --- Nav --- */
.nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; font-size: 12.5px; color: var(--muted); }
.nav a { color: var(--muted); text-decoration: none; padding: 3px 8px; border-radius: var(--radius-sm); border: 1px solid transparent; }
.nav a:hover { background: var(--prutan-indigo-soft); color: var(--prutan-indigo); border-color: var(--prutan-indigo-soft); }
.nav a.here { color: var(--ink); font-weight: 600; background: var(--card-soft); border-color: var(--line); }
.nav .sep { color: var(--line-strong); }
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--prutan-indigo); }

/* --- Headings --- */
h1 { font-size: 1.65rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; margin-bottom: 6px; color: var(--ink); }
h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; margin: 28px 0 10px; color: var(--ink); }
h3 { font-size: 0.95rem; font-weight: 600; margin: 20px 0 6px; color: var(--ink); }
h4 { font-size: 0.82rem; font-weight: 600; margin: 14px 0 4px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }

.sub { color: var(--muted); font-size: 0.95rem; margin-bottom: 6px; }
.tagline { color: var(--muted); font-size: 0.85rem; font-style: italic; margin-top: -2px; margin-bottom: 18px; }

/* --- Text --- */
p { margin-bottom: 10px; color: var(--ink); }
p.lead { font-size: 1.02rem; color: var(--muted); margin-bottom: 14px; }
strong { font-weight: 600; }
em { font-style: italic; color: var(--muted); }

/* --- Lists --- */
ul, ol { margin: 6px 0 12px 22px; }
ul li, ol li { margin-bottom: 4px; color: var(--ink); }
ul.tight li { margin-bottom: 2px; }
ul.bare { list-style: none; margin-left: 0; }

/* --- Inline code & code blocks --- */
code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--card-soft);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  color: var(--prutan-indigo-deep);
}
pre {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: var(--card-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 8px 0 14px;
  overflow-x: auto;
  line-height: 1.5;
}
pre code { background: none; padding: 0; border: none; color: var(--ink); }

/* --- Pills --- */
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 9999px;
  font-size: 11.5px; font-weight: 500;
  background: var(--prutan-indigo-soft); color: var(--prutan-indigo-deep);
  border: 1px solid #d6dcff;
}
.pill-neutral { background: var(--card-soft); color: var(--ink); border-color: var(--line); }
.pill-success { background: var(--success-bg); color: var(--success-ink); border-color: #bbf7d0; }
.pill-warning { background: var(--warning-bg); color: var(--warning-ink); border-color: #fde68a; }

/* --- Cards --- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 16px 18px; margin: 8px 0 14px;
}
.card-soft {
  background: var(--card-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px; margin: 8px 0 14px; font-size: 0.9rem;
}

/* --- Tables --- */
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; margin: 6px 0 14px; background: var(--card); }
thead th {
  text-align: left; padding: 8px 10px; background: var(--card-soft);
  color: var(--muted); font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--line);
}
tbody td { padding: 9px 10px; border-bottom: 1px solid var(--line); color: var(--ink); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
td.mono, th.mono, .mono { font-family: var(--font-mono); }
.t-compact td, .t-compact th { padding: 6px 9px; font-size: 0.82rem; }

/* --- Callouts --- */
.note {
  border-left: 3px solid var(--prutan-indigo);
  background: var(--prutan-indigo-soft);
  padding: 10px 14px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 8px 0 14px; font-size: 0.9rem;
}
.note-warn    { border-left-color: var(--warning); background: var(--warning-bg); }
.note-success { border-left-color: var(--success); background: var(--success-bg); }
.note-muted   { border-left-color: var(--line-strong); background: var(--card-soft); }
.note strong       { color: var(--prutan-indigo-deep); }
.note-warn strong  { color: var(--warning-ink); }

/* --- Two-column layout --- */
.flow-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 8px 0 14px; }
@media (max-width: 720px) { .flow-grid { grid-template-columns: 1fr; } }
.flow-grid > .card-soft { margin: 0; }

/* --- Focus mode (opt-in) — for tiles and flow-grid -------------- *
 * Add data-focus="hover" to any grid container. Same pattern as
 * the deck: dim siblings of the hovered card. Mostly useful on
 * landing pages with many tiles, or doc sections with parallel
 * options. Default OFF. Uses :has() so cards only dim when one
 * is actually being hovered — not when the cursor is in the gap. */
[data-focus="hover"] .tile,
[data-focus="hover"] > .card-soft,
[data-focus="hover"] > .card {
  transition: opacity 0.28s var(--ease), filter 0.28s var(--ease),
              transform 0.18s var(--ease), box-shadow 0.25s var(--ease);
}
[data-focus="hover"]:has(.tile:hover) .tile:not(:hover),
[data-focus="hover"]:has(> .card-soft:hover) > .card-soft:not(:hover),
[data-focus="hover"]:has(> .card:hover) > .card:not(:hover) {
  opacity: 0.28;
  filter: saturate(0.4);
}
@media (prefers-reduced-motion: reduce) {
  [data-focus="hover"]:has(.tile:hover) .tile:not(:hover),
  [data-focus="hover"]:has(> .card-soft:hover) > .card-soft:not(:hover),
  [data-focus="hover"]:has(> .card:hover) > .card:not(:hover) { filter: none; }
}

/* --- Footer --- */
.foot { margin-top: 32px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--faint); }

/* --- Misc helpers --- */
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.right { text-align: right; }
.center { text-align: center; }
.hr { height: 1px; background: var(--line); margin: 24px 0; border: none; }

/* --- Landing tiles (e.g. for presentations index) --- */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 14px 0; }
@media (max-width: 720px) { .tiles { grid-template-columns: 1fr; } }
.tile {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 16px 18px;
  text-decoration: none; color: var(--ink);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}
.tile:hover {
  border-color: var(--prutan-indigo);
  box-shadow: 0 4px 14px rgba(99,102,241,0.14);
  transform: translateY(-1px);
}
.tile-name { font-size: 1rem; font-weight: 600; color: var(--prutan-indigo-deep); margin-bottom: 4px; }
.tile-desc { font-size: 0.85rem; color: var(--muted); margin-bottom: 8px; }
.tile-meta { font-size: 11.5px; color: var(--faint); font-family: var(--font-mono); }
