/* tisk.css – společný základ tiskovin: papír na obrazovce, tisk, ořezové značky, typografie.
   Ukázka – fiktivní firma. */

*, *::before, *::after { box-sizing: border-box; }
* { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: #E4E2DD;
  background-image: radial-gradient(circle at 1px 1px, rgba(0, 0, 0, .05) 1px, transparent 0);
  background-size: 18px 18px;
  color: #1d1d1f;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- Ovládací lišta (jen obrazovka) ---------- */
.toolbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  padding: 10px clamp(12px, 3vw, 28px);
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, .08);
  font-size: 14px;
}
.toolbar a { color: inherit; }
.toolbar__back { text-decoration: none; font-weight: 600; white-space: nowrap; }
.toolbar__back:hover { text-decoration: underline; }
.toolbar__title { font-weight: 600; color: #555; margin-right: auto; min-width: 0; }
.toolbar__title small { font-weight: 400; color: #777; margin-left: 6px; white-space: nowrap; }
.toolbar label { display: inline-flex; align-items: center; gap: 6px; color: #444; }
.toolbar select, .toolbar button {
  font: inherit; font-size: 14px;
  border: 1px solid rgba(0, 0, 0, .18); border-radius: 8px;
  background: #fff; color: #1d1d1f;
  padding: 6px 10px; min-height: 36px; cursor: pointer;
}
.toolbar button[aria-pressed="true"] { background: #1d1d1f; color: #fff; border-color: #1d1d1f; }
.toolbar button.toolbar__print { background: var(--brand-primary); color: var(--brand-on-primary); border-color: transparent; font-weight: 600; }
.toolbar select:focus-visible, .toolbar button:focus-visible, .toolbar a:focus-visible { outline: 2px solid #1A73E8; outline-offset: 2px; }
.pill-demo {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  background: #FFF4CC; color: #5c4400; font-size: 12px; font-weight: 600; white-space: nowrap;
}

/* ---------- Plocha s papíry ---------- */
.stage {
  display: flex; flex-direction: column; align-items: center;
  gap: 36px;
  padding: clamp(18px, 4vw, 48px) clamp(12px, 3vw, 40px) 72px;
}
.stage__intro { max-width: 760px; text-align: center; color: #444; margin: 0 auto; font-size: 15px; }
.stage__intro h1 { font-size: clamp(22px, 3vw, 30px); margin: 0 0 6px; color: #1d1d1f; line-height: 1.2; }
.stage__intro p { margin: 0; text-wrap: pretty; }
.slot { width: 100%; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pair { width: 100%; max-width: 1240px; display: grid; gap: 28px 32px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sheet-caption {
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: #6b6b6b; font-weight: 600;
  text-align: center;
}
.group-title { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #333; font-weight: 700; margin: 8px 0 -16px; text-align: center; }

/* Papír */
.sheet {
  --bleed: 0mm;
  position: relative;
  flex: none;
  width: var(--w);
  height: var(--h);
  overflow: hidden;
  background: var(--sheet-bg, var(--brand-paper));
  color: var(--brand-ink);
  font-family: var(--brand-font-body);
  font-size: 9.5pt;
  line-height: 1.45;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  hyphens: auto;
  -webkit-hyphens: auto;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 12px 32px -8px rgba(0, 0, 0, .25);
}
.sheet *:where(h1, h2, h3, h4, p, ul, ol, dl, figure) { margin: 0; }
.sheet :where(h1, h2, h3, h4) { hyphens: manual; text-wrap: balance; }
.sheet p { text-wrap: pretty; }
.sheet svg { display: block; }

/* Štítek „Ukázka – fiktivní firma“ */
.demo-tag {
  position: absolute; z-index: 20;
  right: 3mm; bottom: 2.2mm;
  font: 500 5.5pt/1 var(--brand-font-body);
  letter-spacing: .04em;
  color: currentColor; opacity: .62;
  white-space: nowrap;
}
.demo-tag--tl { right: auto; bottom: auto; left: 3mm; top: 2.6mm; }
.demo-tag--tr { bottom: auto; top: 2.6mm; }
.demo-tag--bl { right: auto; left: 3mm; }

/* ---------- Typografické pomůcky ---------- */
.h {
  font-family: var(--brand-font-head);
  font-weight: 700;
  line-height: 1.05;
  text-transform: var(--brand-head-case, none);
  letter-spacing: var(--brand-head-track, 0);
}
.label {
  font-family: var(--brand-font-body);
  font-size: 6.5pt; line-height: 1.3; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--brand-muted);
}
.num { font-variant-numeric: tabular-nums lining-nums; }
.nowrap { white-space: nowrap; }
.lead { display: flex; align-items: baseline; gap: 2mm; }
.lead__dots { flex: 1 1 auto; min-width: 6mm; border-bottom: 0.7pt dotted color-mix(in srgb, currentColor 45%, transparent); transform: translateY(-0.28em); }
.lead__price { white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; font-weight: 600; }
.ph { color: var(--brand-muted); }

/* ---------- Ořezové značky a spadávka (.crop-marks na <html>) ---------- */
.marks { display: none; position: absolute; left: -10mm; top: -10mm; pointer-events: none; z-index: 60; overflow: visible; }
html.crop-marks .marks { display: block; }
html.crop-marks .sheet {
  --bleed: 3mm;
  overflow: visible;
  margin: 10mm;
  box-shadow: 0 0 0 3mm var(--sheet-bg, var(--brand-paper));
  outline: 7mm solid #fff; outline-offset: 3mm;
}
/* Prvky „na spadávku“ (dotýkají se okraje) */
.bleed-top { top: calc(-1 * var(--bleed)) !important; }
.bleed-bottom { bottom: calc(-1 * var(--bleed)) !important; }
.bleed-left { left: calc(-1 * var(--bleed)) !important; }
.bleed-right { right: calc(-1 * var(--bleed)) !important; }

/* Pomocné vodítko na obrazovce (bezpečná zóna) */
.guide { position: absolute; pointer-events: none; z-index: 40; border: 1px dashed rgba(26, 115, 232, .7); }

/* ---------- Tisk ---------- */
@media print {
  html, body { background: none !important; }
  body { margin: 0; }
  .toolbar, .screen-only, .sheet-caption, .stage__intro, .group-title, .guide { display: none !important; }
  .stage, .pair, .slot { display: block !important; padding: 0 !important; margin: 0 !important; gap: 0 !important; max-width: none !important; }
  .sheet { zoom: 1 !important; box-shadow: none; margin: 0; break-inside: avoid; }
  .sheet:not(.is-first) { break-before: page; }
  html.crop-marks .sheet { margin: 10mm; box-shadow: 0 0 0 3mm var(--sheet-bg, var(--brand-paper)); }
}

@media (prefers-reduced-motion: no-preference) {
  .sheet { transition: background-color .3s ease, color .3s ease; }
}

@media print { .marks .screen-bleed { display: none; } }

/* Editovatelné buňky (jen obrazovka) */
@media screen {
  [contenteditable="true"] { border-radius: 2px; outline: 1px dashed transparent; outline-offset: 1px; cursor: text; }
  [contenteditable="true"]:hover { outline-color: color-mix(in srgb, var(--brand-accent) 70%, transparent); }
  [contenteditable="true"]:focus { outline: 1.5px solid var(--brand-accent); background: color-mix(in srgb, var(--brand-accent) 8%, transparent); }
}

/* Plné plochy v toku dokumentu protažené do spadávky (border-image outset).
   Nastavte --fill (barva) nebo --fill-img (gradient). */
.fill-t, .fill-b, .fill-x, .fill-all { --fill: var(--brand-primary); }
.fill-t { border-image: var(--fill-img, conic-gradient(var(--fill) 0 0)) fill 0 / / var(--bleed) var(--bleed) 0 var(--bleed); }
.fill-b { border-image: var(--fill-img, conic-gradient(var(--fill) 0 0)) fill 0 / / 0 var(--bleed) var(--bleed) var(--bleed); }
.fill-x { border-image: var(--fill-img, conic-gradient(var(--fill) 0 0)) fill 0 / / 0 var(--bleed); }
.fill-all { border-image: var(--fill-img, conic-gradient(var(--fill) 0 0)) fill 0 / / var(--bleed); }
