/* Hepifun - halaman tutorial (/id/tutorial). Di atas tokens.css + public.css. Tanpa inline style; warna hanya dari token. */
.tutorial-page { overflow-x: clip; }
.tut-hero .wrap { max-width: 920px; }
.tut-intro p { max-width: 62ch; }
.tut-layout { display: block; padding-bottom: var(--sp-10); }
.tut-main { min-width: 0; }
.tut-toc { margin: var(--sp-4) 0; }
details.toc { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
details.toc summary { list-style: none; cursor: pointer; padding: var(--sp-3) var(--sp-4); min-height: var(--tap); display: flex; align-items: center; justify-content: space-between; font-weight: 600; color: var(--text); }
details.toc summary::-webkit-details-marker { display: none; }
details.toc summary::after { content: "+"; font-size: 20px; color: var(--text-faint); }
details.toc[open] summary::after { content: "\2212"; }
details.toc ol { list-style: none; margin: 0; padding: 0 var(--sp-2) var(--sp-3); }
details.toc li a { display: block; padding: 8px var(--sp-3); min-height: 36px; border-radius: var(--r-md); color: var(--text-muted); font-size: var(--fs-sm); overflow-wrap: anywhere; }
details.toc li a:hover { background: var(--raised); color: var(--text); }
details.toc li a[aria-current] { background: var(--accent-soft); color: var(--text); }
@media (min-width: 1024px) {
  .tut-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--sp-8); align-items: start; }
  .tut-toc { position: sticky; top: 76px; margin: 0; max-height: calc(100vh - 96px); overflow: auto; }
  details.toc summary { cursor: default; }
  details.toc summary::after { content: none; }
}

.tut-sec { padding: var(--sp-6) 0; border-top: 1px solid var(--border); scroll-margin-top: 76px; }
.tut-sec:first-child { border-top: 0; }
.tut-sec h2 { font-size: clamp(22px, 3.6vw, 30px); letter-spacing: -.02em; line-height: 1.15; margin: 0 0 var(--sp-4); }
.tut-sec h3 { font-size: var(--fs-xl); margin: var(--sp-6) 0 var(--sp-2); }
.tut-sec p, .tut-sec li { color: var(--text-muted); line-height: 1.65; overflow-wrap: anywhere; }
.tut-sec p { max-width: 70ch; margin: 0 0 var(--sp-4); }
.tut-sec strong { color: var(--text); }
.tut-sec a:not(.btn) { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
.tut-sec ul { padding-left: 1.3em; list-style: revert; margin: 0 0 var(--sp-4); }
.tut-sec code { font-family: var(--font-mono); font-size: .9em; background: var(--raised); padding: 1px 6px; border-radius: var(--r-sm); }

/* kartu sorotan @ */
.tut-key { border: 1px solid var(--accent-line); background: linear-gradient(180deg, var(--accent-soft), transparent 220px), var(--surface); border-radius: var(--r-lg); padding: var(--sp-5) var(--sp-4); margin-bottom: var(--sp-6); }
.tut-key + .tut-sec { border-top: 0; }
@media (min-width: 768px) { .tut-key { padding: var(--sp-8); } }
.tut-badge { display: inline-block; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--on-primary); background: var(--accent-fill); padding: 2px 10px; border-radius: var(--r-pill); margin-bottom: var(--sp-3); }
.mention { display: inline-block; font-family: var(--font-mono); font-size: .92em; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--r-sm); padding: 0 5px; white-space: nowrap; }

/* diagram Image -> prompt -> video */
.tag-flow { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); margin: var(--sp-4) 0 var(--sp-6); align-items: start; }
.tf-col { min-width: 0; }
.tf-title { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-faint); margin: 0 0 var(--sp-2); }
.tf-ins { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.tf-item { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0; min-width: 0; }
.tf-item .tut-media, .tf-ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-md); background: var(--sunken); border: 1px solid var(--border); height: auto; }
.tf-ph { display: grid; place-items: center; color: var(--text-faint); }
.tf-ph-video { aspect-ratio: 16/9; font-size: 28px; }
.tf-item .mention { font-size: var(--fs-xs); }
.tf-arrow { height: 22px; position: relative; }
.tf-arrow::before { content: ""; position: absolute; left: 50%; top: 2px; width: 10px; height: 10px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: translateX(-50%) rotate(45deg); }
@media (min-width: 900px) {
  .tag-flow { grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1.2fr) 28px minmax(0, 1fr); }
  .tf-arrow { height: auto; align-self: center; }
  .tf-arrow::before { top: 50%; transform: translate(-50%, -50%) rotate(-45deg); }
  .tf-ins { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* slot tanpa media (hasil AI diunggah admin): tidak ada kotak kosong */
.tut-fig[data-empty] .tut-media, .tut-fig[data-empty] figcaption { display: none; }
.tf-item[hidden], .tf-out[hidden], .tut-fig[hidden] { display: none; }
.tf-out { min-width: 0; }
.tf-out .tut-media { width: 100%; }
.tag-flow.tf-noin .tf-col-in, .tag-flow.tf-noin .tf-a1, .tag-flow.tf-noout .tf-col-out, .tag-flow.tf-noout .tf-a2 { display: none; }
@media (min-width: 900px) {
  .tag-flow.tf-noin { grid-template-columns: minmax(0, 1.2fr) 28px minmax(0, 1fr); }
  .tag-flow.tf-noout { grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1.2fr); }
  .tag-flow.tf-noin.tf-noout { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
}

/* media */
.tut-fig { margin: var(--sp-5) 0; max-width: 760px; }
.tut-media { display: block; width: 100%; height: auto; border-radius: var(--r-lg); background: var(--sunken); border: 1px solid var(--border); }
.tut-fig figcaption { margin-top: var(--sp-2); font-size: var(--fs-sm); color: var(--text-muted); }
.tut-missing .video-slot { max-width: 100%; }

/* blok prompt */
.prompt-box { margin: var(--sp-3) 0 0; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--sunken); min-width: 0; }
.prompt-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: 6px var(--sp-2) 6px var(--sp-3); border-bottom: 1px solid var(--border); }
.prompt-label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-faint); }
.prompt-text { margin: 0; padding: var(--sp-3); white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-mono); font-size: var(--fs-sm); line-height: 1.55; color: var(--text); }
.prompt-meta { margin: 0; padding: 0 var(--sp-3) var(--sp-2); font-size: var(--fs-xs); color: var(--text-faint); }
.tut-sec .prompt-meta { max-width: none; }

/* langkah bernomor */
ol.steps { list-style: none; padding: 0; margin: 0 0 var(--sp-5); counter-reset: step; max-width: 70ch; }
ol.steps > li { counter-increment: step; position: relative; padding: 2px 0 var(--sp-4) 44px; margin: 0; }
ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: var(--fs-sm); color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line); }
ol.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 34px; bottom: 4px; width: 2px; background: var(--border); }

/* callout */
.callout { display: block; margin: 0 0 var(--sp-4); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--border-strong); border-left-width: 4px; border-radius: var(--r-md); background: var(--surface); max-width: 70ch; }
.callout p { margin: 0 0 var(--sp-2); } .callout p:last-child { margin: 0; }
.callout-tip { border-color: var(--accent-line); border-left-color: var(--accent); background: var(--accent-soft); }
.callout-warn { border-color: var(--warn); background: var(--warn-bg); }
.callout-warn strong:first-child { color: var(--warn); }
.callout-tip strong:first-child { color: var(--accent); }

.tut-cta { text-align: center; }
.tut-cta p { margin-inline: auto; }
.tut-cta .cta-row { justify-content: center; }
.tut-hero .cta-row { margin-top: var(--sp-5); }
.tf-item .tut-fig { margin: 0; width: 100%; max-width: none; }
.tf-item .video-slot { aspect-ratio: 1; font-size: 10px; padding: 4px; margin: 0; overflow: hidden; overflow-wrap: anywhere; }
