/* ScormDeck — lapisan "template library" (landing, katalog, detail template).
   Dimuat SETELAH style.css dan hanya di index.html, catalog.html, dan template.html,
   jadi tampilan player (play.html) tidak tersentuh. */

/* ---------- Badge ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.6875rem; font-weight: 700; line-height: 1.4; letter-spacing: 0.01em;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--card-border); background: var(--bg-subtle); color: var(--text-2);
}
.badge svg { width: 12px; height: 12px; flex: none; }
.badge-blue { background: var(--primary-soft); border-color: #dbeafe; color: var(--blue-600); }
.badge-dna { background: #f5f3ff; border-color: #ede9fe; color: #6d28d9; }
.badge-ok { background: var(--ok-bg); border-color: #dcfce7; color: var(--ok); }

/* ---------- Kartu template ---------- */
.tpl-card { position: relative; }
.tpl-card .card-body { padding: 18px 20px 16px; }
.tpl-card h3 { margin: 6px 0 0; font-size: 1rem; font-weight: 700; line-height: 1.375; }
.card-link { color: inherit; text-decoration: none; }
.card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.card-link:focus-visible { outline: none; }
.tpl-card:has(.card-link:focus-visible) { outline: 2px solid var(--blue-600); outline-offset: 3px; }
.card-desc {
  margin: 6px 0 0; color: var(--text-2); font-size: 0.8125rem; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tpl-card .badges { margin-top: 12px; }
.tpl-card .card-meta { justify-content: space-between; }
.card-play {
  position: relative; z-index: 2;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.75rem; font-weight: 700; color: var(--blue-600); text-decoration: none;
  padding: 4px 10px; margin: -4px -10px -4px 0; border-radius: 999px;
}
.card-play:hover { background: var(--primary-soft); }
.card-play svg { width: 13px; height: 13px; }

/* ---------- Katalog ---------- */
.featured-actions .btn-outline { box-shadow: none; }
.chips-note { margin: 12px 0 0; font-size: 0.8125rem; color: var(--text-2); }

/* ---------- Landing ---------- */
.landing.landing-tpl { height: auto; min-height: 88vh; min-height: 88svh; }
.landing-tpl .landing-main { padding: 48px 0 72px; }
.landing-tpl h1 { font-size: 2.4rem; }
@media (min-width: 640px) { .landing-tpl h1 { font-size: 3.4rem; } }
@media (min-width: 1024px) { .landing-tpl h1 { font-size: 4.1rem; } }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }
.hero-actions .btn { padding: 14px 28px; }
.value-strip { padding: 8px 0 72px; }
.value-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .value-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.value-card {
  position: relative; overflow: hidden;
  border: 1px solid var(--card-border); border-radius: var(--radius); background: var(--white);
  padding: 24px; box-shadow: var(--shadow-soft);
}
.value-card .kicker { margin-bottom: 8px; }
.value-card h3 { margin: 0; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
.value-card p { margin: 6px 0 0; color: var(--text-2); }
.value-icon {
  width: 44px; height: 44px; border-radius: 12px; margin-bottom: 16px;
  display: grid; place-items: center; background: var(--primary-soft); color: var(--blue-600);
}
.value-icon svg { width: 22px; height: 22px; }
.how { background: var(--bg-subtle); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 72px 0; scroll-margin-top: 24px; }
.how h2 { margin: 0; font-size: 1.875rem; font-weight: 800; letter-spacing: -0.025em; }
.how .lede-sm { margin: 8px 0 0; color: var(--text-2); max-width: 60ch; }
.steps { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 16px; grid-template-columns: 1fr; counter-reset: step; }
@media (min-width: 640px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.steps li { background: var(--white); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 20px; }
.steps .num {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background-image: var(--grad); color: #fff; font-weight: 800; font-size: 0.875rem;
}
.steps h3 { margin: 14px 0 0; font-size: 1.0625rem; font-weight: 800; }
.steps p { margin: 4px 0 0; color: var(--text-2); font-size: 0.9375rem; }
.how-cta { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.soon-note { font-size: 0.8125rem; color: var(--text-2); }
.soon-note b { color: var(--text); font-weight: 700; }

/* ---------- Detail template ---------- */
.tpl-page { padding: 24px 0 72px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 0.8125rem; color: var(--text-2); }
.crumbs a { color: var(--text-2); text-decoration: none; font-weight: 600; }
.crumbs a:hover { color: var(--blue-600); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--border); }
.crumbs [aria-current] { color: var(--text); font-weight: 600; }

.tpl-hero { display: grid; gap: 28px; margin-top: 20px; }
@media (min-width: 1024px) { .tpl-hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: start; } }
.tpl-visual {
  border-radius: 20px; padding: 16px;
  background: linear-gradient(to bottom right, var(--primary-soft), var(--bg-subtle));
  border: 1px solid var(--card-border);
}
@media (min-width: 640px) { .tpl-visual { padding: 24px; } }
.tpl-visual img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius-sm); box-shadow: var(--shadow-soft); }
.tpl-info .kicker { margin-bottom: 10px; }
.tpl-info h1 { margin: 0; font-size: 1.875rem; line-height: 1.15; letter-spacing: -0.03em; font-weight: 800; overflow-wrap: anywhere; }
@media (min-width: 640px) { .tpl-info h1 { font-size: 2.375rem; } }
.tpl-info .desc { margin: 14px 0 0; color: var(--text-2); font-size: 1.0625rem; line-height: 1.6; }
.tpl-info .badges { margin-top: 16px; }
.tpl-meta {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0;
  margin: 24px 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
}
@media (min-width: 640px) { .tpl-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tpl-meta div { padding: 12px 14px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); min-width: 0; margin-right: -1px; margin-bottom: -1px; }
.tpl-meta dt { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2); }
.tpl-meta dd { margin: 3px 0 0; font-weight: 700; font-size: 0.9375rem; overflow-wrap: anywhere; }
.tpl-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.tpl-actions .btn { flex: 1 1 auto; }
@media (min-width: 640px) { .tpl-actions .btn { flex: 0 0 auto; } }
.btn .btn-sub { font-weight: 600; font-size: 0.75rem; opacity: 0.75; }
.btn-ghost { background: transparent; color: var(--text-2); border-color: transparent; font-weight: 600; }
.btn-ghost:hover { color: var(--blue-600); background: var(--primary-soft); }
.btn-ghost:disabled, .btn-ghost:disabled:hover { color: var(--text-2); background: transparent; opacity: 0.7; }
.copied { color: var(--ok) !important; }
.action-note { margin: 12px 0 0; font-size: 0.8125rem; color: var(--text-2); }

.tpl-section { margin-top: 64px; scroll-margin-top: 88px; }
.tpl-section > h2 { margin: 0; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
@media (min-width: 640px) { .tpl-section > h2 { font-size: 1.75rem; } }
.tpl-section > .intro { margin: 8px 0 0; color: var(--text-2); max-width: 70ch; }
.section-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }

/* Prompt block */
.prompt-box { position: relative; margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #0f172a; overflow: hidden; }
.prompt-box pre {
  margin: 0; padding: 16px 18px; color: #e2e8f0;
  font: 500 0.8125rem/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word;
}
.prompt-box[data-collapsed="true"] pre { max-height: 11.5em; overflow: hidden; }
.prompt-box[data-collapsed="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 56px; pointer-events: none;
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0), #0f172a);
}
.box-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.mini-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 0.8125rem; font-weight: 700; line-height: 1.2;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--white); color: var(--text);
  transition: border-color .2s, color .2s, background-color .2s;
}
.mini-btn:hover { border-color: var(--blue-600); color: var(--blue-600); }
.mini-btn svg { width: 14px; height: 14px; flex: none; }
.mini-btn[aria-expanded="true"] svg.chev { transform: rotate(180deg); }

.starter { border: 1px solid var(--card-border); border-radius: var(--radius); padding: 20px; margin-top: 20px; background: var(--white); box-shadow: var(--shadow-soft); }
.starter .note { margin: 0; font-size: 0.8125rem; color: var(--text-2); }

/* Prompt DNA timeline */
.dna-summary { display: flex; flex-wrap: wrap; gap: 6px; }
.dna-list { list-style: none; margin: 20px 0 0; padding: 0; position: relative; }
.dna-list::before { content: ""; position: absolute; left: 19px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--blue-400), #e9d5ff); border-radius: 2px; }
.dna-item { position: relative; padding: 0 0 28px 56px; }
.dna-item:last-child { padding-bottom: 0; }
.dna-num {
  position: absolute; left: 0; top: 0; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; font-weight: 800; font-size: 0.875rem;
  background: var(--white); border: 2px solid var(--blue-500); color: var(--blue-600);
}
.dna-item[data-source="reconstructed"] .dna-num { border-color: #a78bfa; color: #6d28d9; }
.dna-stage { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--blue-600); }
.dna-item h3 { margin: 4px 0 0; font-size: 1.0625rem; font-weight: 800; letter-spacing: -0.01em; }
.src { letter-spacing: 0; text-transform: none; }
.src-original { background: var(--ok-bg); border-color: #dcfce7; color: var(--ok); }
.src-reconstructed { background: #f5f3ff; border-color: #ede9fe; color: #6d28d9; }
.dna-prov { margin: 6px 0 0; font-size: 0.8125rem; color: var(--text-2); }
.dna-legend { margin: 14px 0 0; font-size: 0.8125rem; color: var(--text-2); max-width: 80ch; }
.empty-card {
  margin-top: 20px; padding: 28px; border-radius: var(--radius);
  border: 2px dashed var(--border); background: var(--bg-subtle);
}
.empty-card h3 { margin: 0; font-size: 1.125rem; font-weight: 800; }
.empty-card p { margin: 6px 0 0; color: var(--text-2); max-width: 70ch; }

/* About */
.about-grid { display: grid; gap: 16px; margin-top: 20px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .about-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .about-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.about-item { border: 1px solid var(--card-border); border-radius: var(--radius); padding: 18px 20px; background: var(--white); min-width: 0; }
.about-item h3 { margin: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue-600); }
.about-item p { margin: 8px 0 0; line-height: 1.6; overflow-wrap: anywhere; }
.about-item ul { margin: 8px 0 0; padding-left: 18px; }
.about-item li { margin-top: 4px; }
.track-list { list-style: none; padding: 0 !important; display: grid; gap: 6px; }
.track-list li { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; }
.track-list .tick { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 0.75rem; font-weight: 800; }
.track-list .yes .tick { background: var(--ok-bg); color: var(--ok); }
.track-list .no { color: var(--text-2); font-weight: 500; }
.track-list .no .tick { background: var(--bg-subtle); color: var(--text-2); }
.track-detail { margin-top: 10px !important; font-size: 0.8125rem; color: var(--text-2); }
.track-detail code { font-size: 0.8125rem; background: var(--bg-subtle); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }

/* What's included */
.files { list-style: none; margin: 20px 0 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--white); }
.files li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); }
.files li:first-child { border-top: 0; }
.files .ext { font: 700 0.6875rem/1 ui-monospace, Menlo, Consolas, monospace; padding: 5px 7px; border-radius: 6px; background: var(--primary-soft); color: var(--blue-600); min-width: 44px; text-align: center; }
.files .name { font: 600 0.875rem/1.4 ui-monospace, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.files .what { font-size: 0.8125rem; color: var(--text-2); text-align: right; }
@media (max-width: 520px) { .files li { grid-template-columns: auto minmax(0, 1fr); } .files .what { grid-column: 2; text-align: left; } }
.files-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; color: var(--text-2); font-size: 0.875rem; }
.files-foot strong { color: var(--text); }

/* Error */
.tpl-error { text-align: center; padding: 64px 16px; }
.tpl-error h1 { margin: 0; font-size: 1.875rem; font-weight: 800; letter-spacing: -0.02em; }
.tpl-error p { margin: 10px auto 24px; color: var(--text-2); max-width: 52ch; }
.tpl-skeleton { min-height: 360px; margin-top: 20px; border-radius: 20px; background: linear-gradient(to bottom right, var(--primary-soft), var(--bg-subtle)); }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: reduce) {
  .tpl-card, .tpl-card .card-thumb img, .btn { transition: none !important; }
}
