/* Crestrio — the brand generators (generator.html posts, generator-vizitek.html business cards, generator-prezentaci.html
   presentations): form on the left, the preview sticky on the right; on phones the preview stays on top of the form. */
.gen-page { padding-block: clamp(1.25rem, 1rem + 2vw, 3rem) 4rem; }
.gen-back { margin: 0; font-family: var(--display); font-size: .95rem; }
.gen-back a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.gen-back a:hover { border-color: var(--ink); }
.gen-page h1 { margin: 1rem 0 .7rem; font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.6rem); letter-spacing: -.035em; line-height: 1; }
.gen-lead { max-width: 50rem; margin: 0 0 2rem; color: var(--ink-soft); }
.gen-lead code { font-size: .95em; background: var(--white); padding: .05em .3em; border-radius: 4px; }

.gen { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "form preview"; gap: 2.5rem; align-items: start; }
.gen-form { grid-area: form; gap: 1.4rem; }
.gen-preview { grid-area: preview; position: sticky; top: 1.5rem; display: grid; justify-items: center; gap: 1rem; }
.gen-stage { display: grid; place-items: center; width: 100%; }
.gen-stage canvas { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 10rem); border-radius: 4px; box-shadow: 0 22px 40px -24px rgba(20, 21, 19, .6); background: #fff; }
.gen-stage svg { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 10rem); border-radius: 4px; box-shadow: 0 22px 40px -24px rgba(20, 21, 19, .6); background: #fff; }
.gen-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }
.gen-meta { margin: 0; font-size: .9rem; color: var(--ink-soft); text-align: center; }
.gen-pager { display: flex; align-items: center; gap: .8rem; font-family: var(--display); font-size: .92rem; }
.gen-pager[hidden] { display: none; }

.gen-form legend em, .gen-form .field em { font-style: normal; font-weight: 400; color: var(--ink-soft); font-size: .88rem; }
.dot { display: inline-block; width: .85em; height: .85em; margin-right: .45em; border: 1px solid var(--line-strong); border-radius: 50%; vertical-align: -.08em; }
.pill input:checked + span .dot { border-color: var(--paper); }
.gen-file { display: inline-flex; margin-top: .4rem; font-weight: 500; }
.gen-file input { font: inherit; font-size: .9rem; max-width: 100%; }
.gen-file span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.gen-ranges { display: grid; gap: .6rem; margin-top: .6rem; font-size: .92rem; }
.gen-ranges label { display: grid; gap: .25rem; }
.gen-ranges input { width: 100%; accent-color: var(--copper); }
.gen-reset { justify-self: start; }
.gen-check { display: inline-flex; align-items: center; gap: .45rem; font-size: .92rem; cursor: pointer; }
.gen-check input { width: 1.05rem; height: 1.05rem; accent-color: var(--copper); }
.gen-info { margin: 0; padding: .9rem 1rem; border-radius: var(--radius); background: var(--white); border: 1px dashed var(--line-strong); font-size: .9rem; color: var(--ink-soft); }
.gen-info b { color: var(--ink); font-weight: 600; }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }

.gen-result { margin: 3rem auto 0; max-width: 420px; text-align: center; }
.gen-result img { display: block; width: 100%; height: auto; border-radius: 4px; box-shadow: 0 22px 40px -24px rgba(20, 21, 19, .6); }
.gen-result figcaption { margin-top: .8rem; font-size: .92rem; color: var(--ink-soft); }

@media (max-width: 860px) {
  .gen { grid-template-columns: minmax(0, 1fr); grid-template-areas: "preview" "form"; gap: 1.25rem; }
  /* the preview stays on top while the form scrolls under it */
  .gen-preview { position: sticky; top: 0; z-index: 5; margin-inline: calc(-1 * var(--gutter)); padding: .75rem var(--gutter) .9rem; gap: .6rem; background: var(--bg); box-shadow: 0 12px 16px -14px rgba(20, 21, 19, .45); }
  .gen-stage svg, .gen-stage canvas { max-height: 38vh; }
  .gen-actions .btn { padding: .6rem 1rem; font-size: .92rem; }
  .gen-meta { font-size: .8rem; }
  .field-pair { grid-template-columns: minmax(0, 1fr); }
}

/* business cards: front and back under each other, side by side on phones */
.card-stage { display: grid; gap: 1.25rem; width: 100%; }
.card-stage figure { margin: 0; }
.card-stage svg { display: block; width: 100%; height: auto; border-radius: 2px; box-shadow: 0 18px 30px -20px rgba(20, 21, 19, .55); background: #fff; }
.card-stage figcaption { margin-top: .45rem; font-family: var(--display); font-size: .85rem; color: var(--ink-soft); }
@media (max-width: 860px) {
  .card-stage { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .card-stage figcaption { margin-top: .25rem; font-size: .75rem; }
}

/* presentations: the big preview on the right, thumbnails, tools and the deck file on the left */
.gen--deck { grid-template-columns: minmax(0, .85fr) minmax(0, 1.25fr); grid-template-areas: "side preview"; }
.deck-side { grid-area: side; display: grid; gap: 1rem; min-width: 0; }
.gen--deck .gen-form { grid-area: auto; }
.gen--deck .gen-stage svg { width: 100%; max-height: none; }
.deck-strip { display: flex; gap: .6rem; overflow-x: auto; padding: .2rem .2rem .6rem; scroll-snap-type: x proximity; }
.thumb { position: relative; flex: none; width: 150px; padding: 0; border: 2px solid transparent; border-radius: 6px; background: none; cursor: pointer; scroll-snap-align: start; }
.thumb svg { display: block; width: 100%; height: auto; border-radius: 3px; box-shadow: 0 6px 12px -8px rgba(20, 21, 19, .6); }
.thumb span { position: absolute; left: .3rem; top: .3rem; min-width: 1.4rem; padding: .05rem .35rem; border-radius: 999px; background: var(--ink); color: var(--paper); font-family: var(--display); font-size: .72rem; font-weight: 500; line-height: 1.4; }
.thumb.is-current { border-color: var(--copper); }
.thumb--add { display: grid; place-items: center; aspect-ratio: 16 / 9; border: 1.5px dashed var(--line-strong); color: var(--ink); font-size: 2rem; font-weight: 300; }
.thumb--add span { position: static; background: none; color: var(--ink-soft); font-size: .78rem; padding: 0; margin-top: -1.6rem; }
.thumb--add:hover { border-color: var(--ink); }
.deck-tools, .deck-file { display: flex; flex-wrap: wrap; gap: .4rem; }
.deck-open { position: relative; cursor: pointer; }
.deck-open input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* presenting: the slide letterboxed on black, full screen where the browser allows it */
.show { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: #000; outline: none; cursor: pointer; user-select: none; }
.show[hidden] { display: none; }
.show svg { display: block; width: 100vw; height: 100vh; height: 100dvh; }
.show-count { position: absolute; right: 1rem; bottom: .8rem; color: rgba(255, 255, 255, .45); font-family: var(--display); font-size: .85rem; }
.show-close { position: absolute; right: .6rem; top: .6rem; width: 2.6rem; height: 2.6rem; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; opacity: .35; }
.show-close:hover, .show-close:focus-visible { opacity: 1; }
html.is-presenting { overflow: hidden; }

@media (max-width: 860px) {
  .gen--deck { grid-template-columns: minmax(0, 1fr); grid-template-areas: "preview" "side"; }
  .gen--deck .gen-actions .btn { padding: .5rem .8rem; font-size: .86rem; }
  .thumb { width: 120px; }
}
