/* Slide themes page: a gallery of sample slides plus the theme editor. */
body.themes-page { height: auto; min-height: 100vh; display: block; }
.themes-main { max-width: 1400px; margin: 0 auto; padding: 1.25rem; }
.themes-intro { max-width: 70ch; color: var(--muted); line-height: 1.5; margin: 0 0 1rem; }
.themes-intro code { font-size: 0.9em; }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.25rem; }
.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 0.3rem 0.85rem; font: inherit; font-size: 0.85rem; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 1.25rem; }
.theme-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 0.85rem; display: flex; flex-direction: column; gap: 0.6rem;
}
.theme-card h3 { margin: 0; font-size: 1.05rem; display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.theme-card .tag {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--accent); background: var(--accent-light); border-radius: 999px; padding: 0.1rem 0.5rem;
}
.theme-card p { margin: 0; color: var(--muted); font-size: 0.85rem; line-height: 1.4; }
.theme-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--muted); }
.swatch { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(128, 128, 128, 0.5); display: inline-block; }
.card-actions { display: flex; gap: 0.4rem; margin-top: auto; }

/* A 1920x1080 slide drawn at any width: the inner canvas is scaled by js (fitSlide). */
.slide-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 6px; background: #000; }
.slide-canvas { position: absolute; top: 0; left: 0; width: 1920px; height: 1080px; transform-origin: 0 0; overflow: hidden; }
.slide-canvas > div { box-sizing: border-box; }
.thumbs { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.thumbs .slide-frame { cursor: pointer; border-radius: 3px; outline: 2px solid transparent; }
.thumbs .slide-frame.active { outline-color: var(--accent); }
.loading { color: var(--muted); font-size: 0.85rem; padding: 2rem 0; text-align: center; }

.library { margin-top: 2.5rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.library-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.library-item { display: flex; align-items: center; gap: 0.5rem; border: 1px solid var(--border); border-radius: 8px; padding: 0.4rem 0.6rem; background: var(--surface); }

.theme-dialog { width: min(1100px, 96vw); max-width: none; }
.theme-editor { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 1.25rem; }
.theme-editor-fields { display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
.theme-editor-fields .dialog-field input, .theme-editor-fields .dialog-field select { width: 100%; }
.theme-editor-preview { position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
.te-colors { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; font-size: 0.8rem; }
.te-colors label { display: flex; flex-direction: column; gap: 4px; }
.te-colors input[type="color"] { width: 100%; height: 34px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; }
.te-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.te-art { border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 0.75rem; margin: 0; }
.te-art legend { font-size: 0.8rem; padding: 0 0.3rem; }
.te-art #te-art { display: grid; grid-template-columns: 1fr 1fr; gap: 0.15rem 0.75rem; }
.te-check { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; }

@media (max-width: 820px) {
  .theme-editor { grid-template-columns: 1fr; }
  .theme-editor-preview { position: static; order: -1; }
  .thumbs { grid-template-columns: repeat(4, 1fr); }
}
