/* Web preview of generated decks. Mirrors ppt_generator/renderer (themes.py, layouts.py):
   a 13.333 x 7.5 in slide where 1 in = 7.5% of the slide width and 1 pt = 1/72 in. */

.th-academic {
  --bg: #FFFFFF; --surface: #F3F5F9; --text: #1F2937; --muted: #6B7280;
  --accent: #1E3A8A; --accent-soft: #E8EDF8; --on-accent: #FFFFFF;
  --title-bg: #1E3A8A; --title-text: #FFFFFF; --title-bar: #E8EDF8; --title-muted: #E8EDF8;
  --decor: #2B4BA6; --figure-panel: transparent; --figure-pad: 0;
  --heading-font: Cambria, Caladea, Georgia, "Times New Roman", serif;
  --body-font: Calibri, Carlito, "Segoe UI", system-ui, -apple-system, sans-serif;
  --title-weight: 400;
}
.th-conference {
  --bg: #0F172A; --surface: #1E293B; --text: #F1F5F9; --muted: #94A3B8;
  --accent: #38BDF8; --accent-soft: #0C2A3D; --on-accent: #0F172A;
  --title-bg: #0B1120; --title-text: #F8FAFC; --title-bar: #38BDF8; --title-muted: #94A3B8;
  --decor: #15203A; --figure-panel: #FFFFFF; --figure-pad: calc(0.18 * var(--in));
  --heading-font: Calibri, Carlito, "Segoe UI", system-ui, -apple-system, sans-serif;
  --body-font: Calibri, Carlito, "Segoe UI", system-ui, -apple-system, sans-serif;
  --title-weight: 700;
}
.th-minimal {
  --bg: #FAFAF9; --surface: #F0EFEC; --text: #111111; --muted: #6B6B6B;
  --accent: #E11D48; --accent-soft: #FDECEF; --on-accent: #FFFFFF;
  --title-bg: #FAFAF9; --title-text: #111111; --title-bar: #E11D48; --title-muted: #6B6B6B;
  --decor: #EFEDE8; --figure-panel: transparent; --figure-pad: 0;
  --heading-font: Arial, "Liberation Sans", Helvetica, sans-serif;
  --body-font: Arial, "Liberation Sans", Helvetica, sans-serif;
  --title-weight: 700;
}

.ds-frame { container-type: inline-size; width: 100%; }
.ds {
  --in: 7.5cqw;
  --pt: calc(var(--in) / 72);
  --fit: 1;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body-font);
  transition: background-color .5s ease, color .5s ease;
}
.ds.ds-dark { background: var(--title-bg); }
.ds * { transition: background-color .5s ease, color .5s ease, border-color .5s ease; }

.ds-el { position: absolute; box-sizing: border-box; }
.ds-el, .ds-card-title, .ds-card-text, .ds-takeaway > div { font-size: calc(var(--fs, 18) * var(--pt) * var(--fit)); }
.ds-fit { overflow: hidden; }
.ds-heading { font-family: var(--heading-font); line-height: 1.12; }
.ds-title {
  display: flex; align-items: flex-end;
  font-family: var(--heading-font); font-weight: var(--title-weight); line-height: 1.1;
  color: var(--text);
}
.ds-bar { background: var(--accent); }
.ds-bar-title { background: var(--title-bar); }
.ds-decor { border-radius: 9999px; background: var(--decor); }
.ds-on-title { color: var(--title-text); }
.ds-title-muted { color: var(--title-muted); }
.ds-muted { color: var(--muted); }
.ds-accent { color: var(--accent); }
.ds-center { text-align: center; }
.ds-bottom { display: flex; align-items: flex-end; }
.ds-middle { display: flex; align-items: center; }
.ds-right { text-align: right; }
.ds-quote-mark { line-height: 1; font-weight: 700; }
.ds-footer { color: var(--muted); white-space: nowrap; line-height: 1.2; }
.ds-dark .ds-footer { color: var(--title-muted); }

.ds-body { line-height: 1.2; }
.ds-body p { margin: 0 0 .35em; }
.ds-body ul, .ds-body ol { margin: 0; padding-left: 1.1em; }
.ds-body ul { list-style: none; }
.ds-body ul > li { position: relative; }
.ds-body ul > li::before { content: "•"; position: absolute; left: -1.1em; color: var(--accent); }
.ds-body ul ul > li::before { content: "–"; }
.ds-body ol { list-style: decimal; }
.ds-body ol > li::marker { color: var(--accent); }
.ds-body li { margin: 0 0 .55em; }
.ds-body strong { font-weight: 700; }
.ds-body code { font-family: ui-monospace, Menlo, monospace; font-size: .9em; }

.ds-picture { display: flex; align-items: center; justify-content: center; }
.ds-picture img {
  max-width: 100%; max-height: 100%; object-fit: contain; display: block;
  background: var(--figure-panel); padding: var(--figure-pad); box-sizing: border-box;
  border-radius: calc(0.08 * var(--in));
}

.ds-card {
  display: flex; flex-direction: column; gap: calc(0.2 * var(--in));
  padding: calc(0.35 * var(--in)); padding-top: calc(0.43 * var(--in));
  background: var(--surface); border-radius: calc(0.18 * var(--in)); overflow: hidden;
}
.ds-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: calc(0.08 * var(--in)); background: var(--muted); }
.ds-card-b::before { background: var(--accent); }
.ds-card-title { font-family: var(--heading-font); font-weight: 700; line-height: 1.15; }
.ds-card-b .ds-card-title { color: var(--accent); }
.ds-card-text { flex: 1; min-height: 0; }

.ds-surface { background: var(--surface); border-radius: calc(0.12 * var(--in)); display: flex; align-items: center; justify-content: center; }
.ds-takeaway {
  display: flex; align-items: center;
  padding: calc(0.15 * var(--in)) calc(0.45 * var(--in));
  background: var(--accent-soft); border-radius: calc(0.12 * var(--in));
  border-left: calc(0.12 * var(--in)) solid var(--accent);
}
.ds-takeaway > div { max-height: 100%; line-height: 1.15; }

/* ---------- viewer ---------- */

.deck-stage { position: relative; display: grid; overflow-x: clip; overflow-clip-margin: 0; }
.deck-stage > .deck-slide { grid-area: 1 / 1; opacity: 0; visibility: hidden; transform: translateX(var(--enter, 24px)) scale(.985); transition: opacity .45s ease, transform .55s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .45s; }
.deck-stage > .deck-slide.is-active { opacity: 1; visibility: visible; transform: none; transition: opacity .45s ease, transform .55s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
.deck-stage .ds { border-radius: 14px; box-shadow: 0 30px 60px -20px rgb(15 23 42 / .35), 0 0 0 1px rgb(15 23 42 / .06); }

.deck-thumb { position: relative; flex: 0 0 auto; width: 9.5rem; border-radius: 8px; cursor: pointer; transition: transform .2s ease; }
.deck-thumb .ds { border-radius: 6px; box-shadow: 0 0 0 1px rgb(15 23 42 / .1); pointer-events: none; }
.deck-thumb:hover { transform: translateY(-2px); }
.deck-thumb.is-active .ds { box-shadow: 0 0 0 3px #6366F1, 0 10px 20px -8px rgb(99 102 241 / .6); }
.deck-thumb .deck-thumb-n { position: absolute; left: 6px; bottom: 5px; font-size: 10px; font-weight: 600; color: #fff; background: rgb(15 23 42 / .6); border-radius: 4px; padding: 0 5px; }

.deck-viewer:fullscreen { background: #05070d; display: flex; align-items: center; justify-content: center; padding: 0; }
.deck-viewer:fullscreen .deck-chrome { display: none; }
.deck-viewer:fullscreen .deck-stage { width: min(100vw, 177.78vh); }
.deck-viewer:fullscreen .deck-stage .ds { border-radius: 0; box-shadow: none; }

/* ---------- theme picker ---------- */

.theme-card { position: relative; display: block; cursor: pointer; border-radius: 14px; padding: 6px; transition: transform .2s ease, box-shadow .2s ease; box-shadow: 0 0 0 1px rgb(15 23 42 / .08); background: #fff; }
.theme-card:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px rgb(15 23 42 / .12), 0 18px 30px -18px rgb(15 23 42 / .45); }
.theme-card .ds { border-radius: 9px; pointer-events: none; }
.theme-card:has(input:checked) { box-shadow: 0 0 0 2px #6366F1, 0 18px 30px -16px rgb(99 102 241 / .55); }
.theme-card .theme-check { opacity: 0; transform: scale(.6); transition: all .2s ease; }
.theme-card:has(input:checked) .theme-check { opacity: 1; transform: none; }

/* ---------- progress ---------- */

@keyframes ptb-shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.ptb-shimmer { background: linear-gradient(90deg, rgb(226 232 240) 0%, rgb(241 245 249) 40%, rgb(226 232 240) 80%); background-size: 200% 100%; animation: ptb-shimmer 1.6s linear infinite; }
@keyframes ptb-pulse-ring { 0% { box-shadow: 0 0 0 0 rgb(99 102 241 / .55); } 100% { box-shadow: 0 0 0 12px rgb(99 102 241 / 0); } }
.ptb-pulse { animation: ptb-pulse-ring 1.4s ease-out infinite; }
@keyframes ptb-rise { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.ptb-rise { animation: ptb-rise .6s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes ptb-progress { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.ptb-indeterminate { animation: ptb-progress 1.8s ease-in-out infinite; }
.ptb-hero { background: radial-gradient(1200px 300px at 0% 0%, rgb(99 102 241 / .14), transparent 60%), radial-gradient(900px 300px at 100% 0%, rgb(56 189 248 / .14), transparent 60%); }

@media (prefers-reduced-motion: reduce) {
  .deck-stage > .deck-slide, .ptb-rise, .ptb-shimmer, .ptb-pulse, .ptb-indeterminate { animation: none !important; transition: none !important; }
}

/* Japanese/Chinese/Korean headings: break between phrases, not inside words (Chrome). */
html:is(:lang(ja), :lang(zh), :lang(ko)) :is(h1, h2, h3) { word-break: auto-phrase; }
