/* =================================================================
   PruTAN — Reveal.js Deck Theme
   Depends on: prutan-tokens.css, reveal.js@5 base CSS
   ================================================================= */

/* --- Reveal frame --------------------------------------------- */
.reveal {
  font-family: var(--font-body);
  font-size: 28px;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-weight: 400;
  letter-spacing: -0.005em;
}

.reveal .slides {
  text-align: left;
}

.reveal .slides section,
.reveal .slides section > section {
  text-align: left;
  padding: 60px 80px;
  height: 100%;
  display: flex !important;
  flex-direction: column;
  justify-content: flex-start;
}

/* Vertical-center variant */
.reveal .slides section.deck-center {
  justify-content: center !important;
}

/* Headings */
.reveal h1, .reveal h2, .reveal h3, .reveal h4, .reveal h5, .reveal h6 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 18px 0;
  text-transform: none;
  text-shadow: none;
}
.reveal h1 { font-size: 64px; }
.reveal h2 { font-size: 44px; }
.reveal h3 { font-size: 28px; }
.reveal h4 { font-size: 20px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.reveal p { margin: 0 0 14px 0; line-height: 1.5; color: var(--ink-soft); }

/* Eyebrow — set via class OR data-eyebrow attribute */
.deck-eyebrow,
.reveal section[data-eyebrow]::before {
  display: block;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--prutan-indigo);
  margin-bottom: 12px;
}
.reveal section[data-eyebrow]::before { content: attr(data-eyebrow); }

/* Subtitle */
.deck-subtitle {
  font-size: 24px;
  color: var(--muted);
  font-weight: 400;
  margin: -10px 0 24px 0;
  line-height: 1.4;
}

/* Lead body text */
.reveal .deck-lead {
  font-size: 26px;
  color: var(--ink-soft);
  line-height: 1.5;
  font-weight: 400;
}

/* --- Bullets -------------------------------------------------- */
.reveal ul, .reveal ol {
  display: block;
  margin: 4px 0 14px 0;
  padding-left: 28px;
  font-size: 24px;
  line-height: 1.55;
}
.reveal ul li, .reveal ol li {
  margin: 10px 0;
  color: var(--ink-soft);
}
.reveal ul li strong, .reveal ol li strong { color: var(--ink); font-weight: 600; }
.reveal ul { list-style: none; padding-left: 4px; }
.reveal ul > li { position: relative; padding-left: 22px; }
.reveal ul > li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.65em;
  width: 8px; height: 8px;
  border-radius: 2px;
  background: var(--prutan-indigo);
}
.reveal ul.deck-bullets-tight li { margin: 4px 0; }
.reveal ul.deck-bullets-dash > li::before {
  width: 10px; height: 2px; top: 0.75em; background: var(--line-strong); border-radius: 1px;
}

/* --- Links, emphasis, inline code ----------------------------- */
.reveal strong { font-weight: 600; color: var(--ink); }
.reveal em { font-style: italic; color: var(--muted); }
.reveal a { color: var(--prutan-indigo); text-decoration: none; border-bottom: 1px solid var(--prutan-indigo-soft); }
.reveal a:hover { border-bottom-color: var(--prutan-indigo); }

.reveal code {
  font-family: var(--font-mono);
  font-size: 0.78em;
  background: var(--prutan-indigo-soft);
  color: var(--prutan-indigo-deep);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid #d6dcff;
}

/* --- Code blocks ---------------------------------------------- */
.reveal pre {
  font-family: var(--font-mono);
  font-size: 18px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 12px 0;
  line-height: 1.55;
  overflow-x: auto;
  box-shadow: var(--shadow);
  width: 100%;
}
.reveal pre code {
  background: none;
  color: inherit;
  border: none;
  padding: 0;
  font-size: inherit;
  display: block;
}

/* --- Callout / note ------------------------------------------- */
.deck-callout {
  border-left: 3px solid var(--prutan-indigo);
  background: var(--prutan-indigo-soft);
  padding: 16px 22px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 22px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 12px 0;
}
.deck-callout strong { color: var(--prutan-indigo-deep); }
.deck-callout.success { border-left-color: var(--success); background: var(--success-bg); }
.deck-callout.success strong { color: var(--success-ink); }
.deck-callout.warning { border-left-color: var(--warning); background: var(--warning-bg); }
.deck-callout.warning strong { color: var(--warning-ink); }
.deck-callout.danger  { border-left-color: var(--danger);  background: var(--danger-bg);  }
.deck-callout.danger strong  { color: var(--danger-ink); }
.deck-callout.muted   { border-left-color: var(--line-strong); background: var(--card-soft); }

/* --- Grids ---------------------------------------------------- */
.deck-grid    { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 12px 0; }
.deck-grid-3  { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 12px 0; }
.deck-grid-4  { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 12px 0; }

/* --- Focus mode (opt-in) -------------------------------------- *
 * Add data-deck-focus="hover" to any grid. When the user hovers a card,
 * the others dim and desaturate. Default is OFF — only activate on
 * slides that will be viewed self-paced (URL share), not on live decks.
 * Uses :has() so dimming only fires when a card is actually hovered —
 * not just when the cursor is over the grid container's empty gap.    */
[data-deck-focus="hover"] .deck-card {
  transition: opacity 0.28s var(--ease), filter 0.28s var(--ease),
              transform 0.18s var(--ease), box-shadow 0.25s var(--ease);
}
[data-deck-focus="hover"]:has(.deck-card:hover) .deck-card:not(:hover) {
  opacity: 0.22;
  filter: saturate(0.4);
  transform: scale(0.985);
}
[data-deck-focus="hover"] .deck-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  z-index: 2;
}
/* Honor reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  [data-deck-focus="hover"] .deck-card { transition: opacity 0.15s; }
  [data-deck-focus="hover"]:has(.deck-card:hover) .deck-card:not(:hover) { filter: none; transform: none; }
  [data-deck-focus="hover"] .deck-card:hover { transform: none; }
}

/* --- Cards ---------------------------------------------------- */
.deck-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  font-size: 20px;
  line-height: 1.5;
  position: relative;
}
.deck-card .card-title {
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}
.deck-card .card-body { font-size: 18px; color: var(--muted); line-height: 1.5; }

/* Optional small category tag inside a card (top-right or below body) */
.deck-card .card-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--card-soft);
  color: var(--muted);
  margin-top: 10px;
}

/* Accent variants — left bar + subtle tinted top + matching tag */
.deck-card.accent {
  border-left: 3px solid var(--accent-indigo);
  background: linear-gradient(180deg, var(--accent-indigo-bg) 0%, var(--card) 65%);
}
.deck-card.accent .card-tag { background: var(--accent-indigo-bg); color: var(--accent-indigo-ink); }

.deck-card.accent-blue {
  border-left: 3px solid var(--accent-blue);
  background: linear-gradient(180deg, var(--accent-blue-bg) 0%, var(--card) 65%);
}
.deck-card.accent-blue .card-tag { background: var(--accent-blue-bg); color: var(--accent-blue-ink); }

.deck-card.accent-teal {
  border-left: 3px solid var(--accent-teal);
  background: linear-gradient(180deg, var(--accent-teal-bg) 0%, var(--card) 65%);
}
.deck-card.accent-teal .card-tag { background: var(--accent-teal-bg); color: var(--accent-teal-ink); }

.deck-card.accent-amber {
  border-left: 3px solid var(--accent-amber);
  background: linear-gradient(180deg, var(--accent-amber-bg) 0%, var(--card) 65%);
}
.deck-card.accent-amber .card-tag { background: var(--accent-amber-bg); color: var(--accent-amber-ink); }

.deck-card.accent-rose {
  border-left: 3px solid var(--accent-rose);
  background: linear-gradient(180deg, var(--accent-rose-bg) 0%, var(--card) 65%);
}
.deck-card.accent-rose .card-tag { background: var(--accent-rose-bg); color: var(--accent-rose-ink); }

.deck-card.accent-violet {
  border-left: 3px solid var(--accent-violet);
  background: linear-gradient(180deg, var(--accent-violet-bg) 0%, var(--card) 65%);
}
.deck-card.accent-violet .card-tag { background: var(--accent-violet-bg); color: var(--accent-violet-ink); }

/* Filled card variants */
.deck-card.filled-indigo {
  background: var(--prutan-indigo-soft);
  border-color: #d6dcff;
}
.deck-card.filled-indigo .card-title { color: var(--prutan-indigo-deep); }

/* --- Stats / KPIs --------------------------------------------- */
.deck-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin: 14px 0; }
.deck-stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.deck-stat .stat-value {
  font-size: 40px;
  font-weight: 700;
  color: var(--prutan-indigo-deep);
  letter-spacing: -0.02em;
  font-family: var(--font-display);
  line-height: 1;
}
.deck-stat .stat-label {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 8px;
  font-weight: 600;
}
.deck-stat .stat-sub { font-size: 14px; color: var(--faint); margin-top: 4px; }

/* --- Tables --------------------------------------------------- */
.reveal table {
  width: 100%;
  border-collapse: collapse;
  font-size: 20px;
  margin: 12px 0;
  background: var(--card);
}
.reveal table thead th {
  text-align: left;
  padding: 12px 14px;
  background: var(--card-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--line);
}
.reveal table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  vertical-align: top;
}
.reveal table tbody tr:last-child td { border-bottom: none; }

/* --- Pills / tags --------------------------------------------- */
.deck-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 500;
  background: var(--prutan-indigo-soft);
  color: var(--prutan-indigo-deep);
  border: 1px solid #d6dcff;
  margin-right: 4px;
}
.deck-pill.neutral { background: var(--card-soft); color: var(--ink); border-color: var(--line); }
.deck-pill.success { background: var(--success-bg); color: var(--success-ink); border-color: #bbf7d0; }
.deck-pill.warning { background: var(--warning-bg); color: var(--warning-ink); border-color: #fde68a; }
.deck-pill.danger  { background: var(--danger-bg);  color: var(--danger-ink);  border-color: #fecaca; }

/* --- Quote ---------------------------------------------------- */
.reveal blockquote, .deck-quote {
  background: none;
  border: none;
  border-left: 4px solid var(--prutan-indigo);
  padding: 8px 0 8px 28px;
  margin: 16px 0;
  font-size: 30px;
  font-weight: 400;
  font-style: normal;
  color: var(--ink);
  line-height: 1.4;
  letter-spacing: -0.01em;
  box-shadow: none;
}
.deck-quote .quote-attr {
  display: block;
  font-size: 18px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 14px;
  font-style: normal;
}
.deck-quote .quote-attr::before { content: '— '; }

/* --- Slide types ---------------------------------------------- */

/* Title slide — navy background, white text */
.reveal section.deck-title-slide {
  background:
    radial-gradient(ellipse at 75% 30%, rgba(99,102,241,0.32), transparent 55%),
    radial-gradient(ellipse at 20% 80%, rgba(255,255,255,0.05), transparent 60%),
    linear-gradient(135deg, var(--prutan-navy) 0%, var(--prutan-navy-deep) 100%);
  color: #ffffff;
  justify-content: center !important;
}
.reveal section.deck-title-slide::before { color: rgba(255,255,255,0.7); }
.reveal section.deck-title-slide h1,
.reveal section.deck-title-slide h2 { color: #ffffff; }
.reveal section.deck-title-slide .deck-subtitle { color: rgba(255,255,255,0.78); }
.reveal section.deck-title-slide p { color: rgba(255,255,255,0.7); }
.reveal section.deck-title-slide .deck-meta {
  margin-top: 36px;
  font-size: 15px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 500;
}

/* Section divider — indigo, big quiet number */
.reveal section.deck-section-slide {
  background: linear-gradient(135deg, var(--prutan-indigo) 0%, var(--prutan-indigo-deep) 100%);
  color: #ffffff;
  justify-content: center !important;
}
.reveal section.deck-section-slide h1,
.reveal section.deck-section-slide h2 { color: #ffffff; font-size: 56px; }
.reveal section.deck-section-slide .deck-section-number {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.reveal section.deck-section-slide .deck-section-sub {
  font-size: 22px;
  color: rgba(255,255,255,0.8);
  font-weight: 400;
  margin-top: 8px;
  line-height: 1.4;
  max-width: 720px;
}

/* Quote slide — center, big */
.reveal section.deck-quote-slide {
  justify-content: center !important;
  background: var(--card-soft);
}
.reveal section.deck-quote-slide .deck-quote {
  font-size: 40px;
  border-left-width: 5px;
}

/* End / Thank-you slide */
.reveal section.deck-end-slide {
  background: linear-gradient(135deg, var(--prutan-navy) 0%, var(--prutan-navy-deep) 100%);
  color: #ffffff;
  justify-content: center !important;
}
.reveal section.deck-end-slide h1 { color: #ffffff; font-size: 80px; }
.reveal section.deck-end-slide p { color: rgba(255,255,255,0.75); font-size: 22px; }

/* --- Logo watermark ------------------------------------------- *
 * Appears on every slide. Hidden on title/section/end slides.
 * Customize via [data-deck-logo="none|left|right"] on .reveal      */
.deck-logo {
  position: fixed;
  top: 24px;
  right: 28px;
  width: 86px;
  height: auto;
  z-index: 30;
  opacity: 0.85;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}
.deck-logo svg { width: 100%; height: auto; display: block; }
.deck-logo svg path { fill: var(--prutan-navy); transition: fill 0.25s var(--ease); }
[data-deck-logo="left"] .deck-logo  { right: auto; left: 28px; }
[data-deck-logo="none"] .deck-logo  { display: none; }

/* On dark slides, the JS adds body.deck-on-dark — flip the logo to white.
   Body-class approach is more reliable than :has() and works in all browsers
   where Reveal runs. */
body.deck-on-dark .deck-logo svg path { fill: #ffffff; }
body.deck-on-dark .deck-logo { opacity: 0.95; }

/* --- Reveal chrome (controls / progress / slide-number) -------- */
.reveal .progress { color: var(--prutan-indigo); height: 3px; }
.reveal .controls { color: var(--prutan-indigo); }
.reveal .slide-number {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  background: rgba(255,255,255,0.7);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

/* --- Speaker notes color -------------------------------------- */
.reveal aside.notes { display: none; }

/* --- Print / PDF export tweaks -------------------------------- */
@media print {
  .deck-nav, .deck-nav-toggle { display: none !important; }
  .reveal section.deck-title-slide,
  .reveal section.deck-section-slide,
  .reveal section.deck-end-slide {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* --- Responsive scaling --------------------------------------- *
 * Reveal already scales via its width/height config; this keeps
 * dropdown + logo readable on mobile preview.                    */
@media (max-width: 720px) {
  .deck-logo { width: 64px; top: 14px; right: 16px; }
  [data-deck-logo="left"] .deck-logo { left: 16px; }
}
