/* VulgatAI — tutorial pages (/tutorial/, /es/tutorial/).
   Loaded after style.css: reuses its custom properties, only adds tutorial-only components. */

.tutorial-hero { padding-bottom: 0; }
.tutorial-hero .meta { margin-top: 18px; font-size: .86rem; color: var(--muted); font-family: var(--mono); }

.callout {
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 18px 22px;
  margin: 28px 0;
}
.callout p { margin-bottom: 10px; }
.callout p:last-child { margin-bottom: 0; }
.callout .label { color: var(--accent); }

/* ---------- Sticky sidebar TOC (wiki-style: always reachable while scrolling) ---------- */
.tutorial-layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  padding: 44px 0 80px;
}
.toc-sidebar { position: sticky; top: 88px; max-height: calc(100vh - 108px); overflow-y: auto; }
.toc-sidebar h2 {
  font-size: .78rem; font-family: var(--mono); text-transform: uppercase;
  letter-spacing: .1em; color: var(--muted); margin: 0 0 14px; font-weight: 400;
}
.toc-sidebar ol {
  margin: 0; padding: 0; list-style: none; counter-reset: toc;
  display: flex; flex-direction: column; gap: 1px;
  border-left: 2px solid var(--border);
}
.toc-sidebar li { counter-increment: toc; }
.toc-sidebar a {
  display: flex; gap: 10px; align-items: baseline; color: var(--muted); font-size: .92rem;
  padding: 7px 0 7px 15px; margin-left: -2px; border-left: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.toc-sidebar a::before {
  content: counter(toc, decimal-leading-zero); font-family: var(--mono);
  font-size: .74rem; color: var(--muted); flex: none; opacity: .7;
}
.toc-sidebar a:hover { color: var(--accent); text-decoration: none; }
.toc-sidebar a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.toc-sidebar a.active::before { color: var(--accent); opacity: 1; }

.tutorial-content > section + section {
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding-top: 48px;
}

@media (max-width: 980px) {
  .tutorial-layout { grid-template-columns: 1fr; gap: 8px; padding-top: 8px; }
  .toc-sidebar {
    position: static; max-height: none; overflow: visible;
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px 24px; margin-bottom: 40px; background: var(--bg);
  }
  .toc-sidebar ol { border-left: 0; display: grid; gap: 8px; }
  @media (min-width: 640px) { .toc-sidebar ol { grid-template-columns: 1fr 1fr; } }
  .toc-sidebar a { padding-left: 12px; }
}

.tutorial-step h2 { margin-bottom: 10px; }
.tutorial-step .lede { margin-bottom: 8px; }
.tutorial-step p { color: var(--muted); }
.tutorial-step p code, .callout code {
  font-family: var(--mono); font-size: .86em; color: var(--text);
  background: var(--surface-2); padding: 2px 6px; border-radius: 6px;
}
.tutorial-step strong { color: var(--text); }

.shot {
  margin: 26px 0; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--surface); box-shadow: var(--card-shadow);
}
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { padding: 12px 18px; font-size: .86rem; color: var(--muted); border-top: 1px solid var(--border); }

.shot-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.shot-row .shot { margin: 26px 0 0; }
@media (max-width: 900px) { .shot-row { grid-template-columns: 1fr; } }

.step-num-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px; margin-right: 10px;
  background: var(--accent); color: var(--on-accent); font-family: var(--font-display);
  font-weight: 700; font-size: .92rem; flex: none;
}
.tutorial-step .section-head { display: flex; align-items: flex-start; gap: 0; flex-wrap: wrap; }
.tutorial-step .section-head > div { flex: 1; min-width: 260px; }

.next-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; margin-top: 12px;
}
.next-box h3 { margin-bottom: 8px; }
.next-box p { margin-bottom: 0; }

/* ── Screenshot lightbox ─────────────────────────────────────────
   The captures are 1500px wide but render at column width, so a click
   opens them full size. Markup is built by assets/tutorial.js. */
.shot-zoomable { position: relative; }
.shot-zoomable img { cursor: zoom-in; }
.shot-hint { position: absolute; top: 10px; right: 10px; z-index: 2;
  font-size: .75rem; line-height: 1; padding: 6px 10px; border-radius: 20px;
  background: color-mix(in srgb, var(--ink) 78%, transparent); color: #fff;
  opacity: 0; transition: opacity .18s ease; pointer-events: none; }
.shot-zoomable:hover .shot-hint,
.shot-zoomable img:focus-visible ~ .shot-hint,
.shot-zoomable:focus-within .shot-hint { opacity: 1; }
.shot-zoomable img:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }

html.lb-on, html.lb-on body { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 999; display: flex; align-items: center;
  justify-content: center; padding: 28px 88px; background: rgba(12, 8, 24, .88); }
.lb[hidden] { display: none; }
.lb-figure { margin: 0; max-width: min(1500px, 100%); max-height: 92vh;
  display: flex; flex-direction: column; min-width: 0; background: var(--bg);
  border-radius: var(--radius); overflow: hidden; animation: lb-in .16s ease-out; }
/* min-height:0 is what lets the image shrink inside the column flexbox;
   without it the flex item keeps its intrinsic height and gets clipped. */
.lb-figure img { display: block; width: auto; height: auto;
  max-width: 100%; max-height: 100%; min-height: 0; min-width: 0; object-fit: contain; }
.lb-figure figcaption { padding: 12px 18px; font-size: .86rem; color: var(--muted);
  border-top: 1px solid var(--border); background: var(--surface); }
.lb-close, .lb-nav { position: absolute; z-index: 2; border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.12); color: #fff; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; line-height: 1;
  transition: background .15s ease; }
.lb-close:hover, .lb-nav:hover { background: rgba(255,255,255,.26); }
.lb-close:focus-visible, .lb-nav:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.lb-close { top: 18px; right: 18px; width: 42px; height: 42px; font-size: 26px; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 30px; }
.lb-prev { left: 18px; }
.lb-next { right: 18px; }
@keyframes lb-in { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .lb-figure { animation: none; }
  .shot-hint { transition: none; }
}
@media (max-width: 640px) {
  .lb { padding: 12px 48px; }
  .lb-nav { width: 40px; height: 40px; font-size: 24px; }
  .lb-prev { left: 6px; }
  .lb-next { right: 6px; }
  .lb-close { top: 10px; right: 10px; }
}
