/*
 * stdsquare² — reveal.js theme
 * Slide deck theme for academic presentations.
 * Canvas: 1280×720 (16:9) — matches Reveal config.
 * All colors use CSS variables from main site.
 */

@import "../reset.css";
@import "../reveal.css";

/* ── Global ── */
.reveal-viewport {
  background: #eef0f4;
}

.reveal {
  font-family: var(--font-ui, system-ui, sans-serif);
  font-size: clamp(18px, 2vw, 24px);
  color: var(--text, #1c1d24);
}

/* ── Headings ── */
.reveal h1, .reveal h2, .reveal h3, .reveal h4 {
  font-family: var(--font-ui, system-ui, sans-serif);
  font-weight: 700;
  color: var(--text, #1c1d24);
  text-transform: none;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-shadow: none;
}
.reveal h1 { font-size: 1.8em; margin-bottom: 0.2em; }
.reveal h2 { font-size: 1.35em; color: var(--accent, #00c853); margin-bottom: 0.4em; }
.reveal h3 { font-size: 1.1em; color: var(--text-muted, #3a3d48); }
.reveal h4 { font-size: 0.95em; }

/* ── Links ── */
.reveal a {
  color: var(--accent, #00c853);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.reveal a:hover { color: var(--accent-pop, #00e676); }

/* ══════════════════════════════════════════════════
   SLIDE SECTION — PPT Card Look
   Each <section> is a white card floating on grey
   ══════════════════════════════════════════════════ */
.reveal .slide-background { background: transparent; }
.reveal .slides section {
  /* Full-canvas card: every slide fills the 1280×720 stage so content is
     framed consistently (no grey dead-space below short slides). Content
     flows from the top; use .cover / .vc to centre vertically. Hard budget:
     content must fit within 720px (overflow is clipped — verify per slide). */
  height: 720px;
  box-sizing: border-box;
  overflow: hidden;
  text-align: left;
  background: #ffffff;
  border-radius: 12px;
  box-shadow:
    0 8px 32px rgba(0,0,0,0.10),
    0 2px 8px rgba(0,0,0,0.06);
  padding: 40px 52px;
  border: 1px solid rgba(0,0,0,0.06);
}
/* Reveal sets display:block inline on the live slide — override it to flex on
   the VISIBLE slide only (never global, or hidden slides would reappear). */
/* Centre the WHOLE slide content (title + body + footer) as one group so the
   breathing room is split evenly top & bottom — no void pooled at the bottom or
   middle, and boxes keep their natural size (no empty stretched containers). */
.reveal .slides section.present { display: flex !important; flex-direction: column; justify-content: center; gap: 4px; }
.reveal .num-box .desc { font-size: 0.95rem; }
/* Vertical-centre utility (covers, section dividers, single-focus slides) */
.reveal .slides section.vc { justify-content: center; }
.reveal .slides section h2:first-child,
.reveal .slides section h1:first-child { margin-top: 0; }

/* ── Lists ── */
.reveal ul, .reveal ol {
  display: block;
  text-align: left;
  margin-left: 1.2em;
}
.reveal li { margin-bottom: 0.35em; }

/* ── Code ── */
.reveal code {
  font-family: var(--font-mono, 'Courier New', monospace);
  background: #f1f5f9;
  color: var(--accent-deep, #006b2d);
  padding: 0.1em 0.3em;
  border-radius: 3px;
  font-size: 0.85em;
}
.reveal pre code {
  display: block;
  padding: 0.8em 1em;
  overflow: auto;
  max-height: 55vh;
  background: #f1f5f9;
  color: var(--text, #1c1d24);
  border-left: 3px solid var(--accent, #00c853);
  border-radius: 4px;
  font-size: 0.78em;
}

/* ── Block quotes ── */
.reveal blockquote {
  background: #f8fafc;
  border-left: 4px solid var(--accent, #00c853);
  padding: 0.6em 1em;
  border-radius: 0 6px 6px 0;
  box-shadow: none;
  font-style: normal;
  color: var(--text, #1c1d24);
  width: auto;
}

/* ── Tables (base) ── */
.reveal table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.88em;
}
.reveal table th {
  background: var(--accent, #00c853);
  color: #fff;
  padding: 0.4em 0.7em;
  font-weight: 600;
  text-align: left;
}
.reveal table td {
  padding: 0.35em 0.7em;
  border-bottom: 1px solid #e2e8f0;
  color: var(--text, #1c1d24);
}
.reveal table tr:nth-child(even) td {
  background: #f8fafc;
}

/* ── Controls + progress ── */
.reveal .controls { color: var(--accent, #00c853); }
.reveal .progress { background: #cbd5e1; }
.reveal .progress span { background: var(--accent, #00c853); }

/* ── Slide number ── */
.reveal .slide-number {
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.75em;
  font-family: var(--font-mono, monospace);
  border-radius: 4px;
  padding: 2px 6px;
}

/* ── Divider sub-bab (W2.1, 2026-07-15; DIREVISI 2026-07-15 — lihat catatan bug) ──
   Akar masalah alignment: .vc hanya center VERTIKAL; center horizontal dulu
   bergantung inline style yang cuma ada di ~43% file → divider tampil
   kiri-campur-tengah di ~794 deck. Fix terpusat di sini, NOL sentuhan file deck.

   ⚠️ BUG (ditemukan Boss via screenshot, sama hari): draf pertama pakai selector
   `:has()` untuk merata-tengahkan SELURUH section.vc ber-divider (termasuk h2/p.lead
   di ~78 deck varian title-only yang bukan class .divider-*). `:has()` TIDAK didukung
   Firefox <121 dan sejumlah browser lama — di sana rule itu senyap tak pernah berlaku,
   bug lama (kiri-campur-tengah) muncul lagi. Diperbaiki jadi 2 lapis TANPA :has() sama
   sekali:
   1) Class .divider-kicker/-title/-sub langsung dirata-tengah (kerja di SEMUA browser,
      classnya eksklusif dipakai divider — diverifikasi grep, aman disentuh langsung).
   2) Section pembungkusnya ditandai `.divider-slide` oleh JS (layouts/slides/deck.html,
      guard file — dijalankan sebelum Reveal.initialize, sama seperti fragmentHygiene)
      supaya elemen SIBLING non-class (h2/p.lead di deck varian title-only) ikut
      ter-rata-tengah — deteksi via querySelector biasa, bukan :has(). */
.reveal .slides section.vc.divider-slide { text-align: center; }
.divider-kicker { text-align: center; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent2); }
.divider-title { text-align: center; font-size: 2.2rem; font-weight: 700; color: var(--text, #1a1a1a); line-height: 1.15; margin: 8px 0 14px; }
.divider-sub { text-align: center; font-size: 1.05rem; color: var(--text-soft, #586072); max-width: 80%; margin: 0 auto; line-height: 1.6; }

/* Entrance divider (W2.2, 2026-07-15) — penanda ganti bab: kicker/judul/sub
   naik-halus berurutan + garis aksen wipe di bawah judul. Berjalan saat slide
   divider menjadi .present (mode baca & mengajar), ±0,5 dtk, sekali per kedatangan. */
@media (prefers-reduced-motion: no-preference) {
  .reveal .slides section.vc.present .divider-kicker { animation: sq-divider-in 0.4s ease both; }
  .reveal .slides section.vc.present .divider-title  { animation: sq-divider-in 0.4s ease 0.08s both; }
  .reveal .slides section.vc.present .divider-sub    { animation: sq-divider-in 0.4s ease 0.16s both; }
  .reveal .slides section.vc.present .divider-title::after {
    content: ""; display: block; width: 64px; height: 3px;
    background: var(--accent, #00c853); margin: 14px auto 0;
    animation: sq-divider-line 0.45s ease 0.28s both;
  }
}
@keyframes sq-divider-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes sq-divider-line { from { transform: scaleX(0); } to { transform: scaleX(1); } }
/* Aksesibilitas (W2.2): OS minta gerak minimal → matikan transisi/animasi deck */
@media (prefers-reduced-motion: reduce) {
  .reveal .slides section, .reveal .slides section * { animation: none !important; transition: none !important; }
  .reveal .fragment { visibility: visible !important; opacity: 1 !important; transform: none !important; }
}

/* ── Cover slide ── */
.reveal .slides section.cover { text-align: center; justify-content: center; align-items: center; }
.reveal .slides section.cover > * { max-width: 90%; }
.reveal .slides section.cover h1 { font-size: 2em; color: var(--accent, #00c853); margin-bottom: 0.3em; }
.reveal .slides section.cover .subtitle { font-size: 1em; color: #64748b; margin-bottom: 0.8em; }
.reveal .slides section.cover .meta { font-size: 0.8em; color: #94a3b8; }

/* ── Badge pill ── */
.reveal .badge {
  display: inline-block;
  background: #f0fdf4;
  color: #15803d;
  border-radius: 100px;
  padding: 0.15em 0.7em;
  font-size: 0.75em;
  font-weight: 600;
  margin: 0.1em;
}

/* ── Widget iframe ── */
.reveal .widget-wrap {
  width: 100%;
  max-height: 55vh;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.reveal .widget-wrap iframe {
  width: 100%;
  height: 55vh;
  border: none;
  display: block;
}

/* ── SVG figures ── */
.reveal .v2fig, .reveal figure svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* ── MathJax ── */
.reveal .MathJax { font-size: 1.1em !important; }

/* ── Fragment highlight ── */
.reveal .fragment.highlight-current { color: var(--accent-pop, #00e676); }

/* ── Print / PDF ── */
@media print {
  .reveal-viewport { background: #fff !important; }
  .reveal { font-size: 18px; color: #000; }
  .reveal h2 { color: #000; }
  .reveal a { color: #000; text-decoration: underline; }
  .reveal .controls, .reveal .progress, .reveal .slide-number { display: none; }
}
