/* Optimalizace skladu (/publikace/optimalizace-skladu) – jen prvky specifické pro tuto příručku.
   Základ (layout, obsah, typografie, karty, rámečky, ilustrace, tabulky) je ve sdíleném publication-guide.css (proměnné --pg-* z .pg),
   cover v publication-cover.css. Načítá <PageStyles name="optimalizace-skladu" /> v
   src/components/pages/(publications)/warehouseoptimization/page.tsx. Čisté CSS (mimo Tailwind), třídy s prefixem os-. */

/* ------------------------------------------------------------------ */
/* Text + ilustrace vedle sebe (blok „split“): od 1100 px text 40 % vlevo, ilustrace 60 % vpravo */
/* ------------------------------------------------------------------ */
.os-split { display: grid; gap: 20px; margin-top: 20px !important; }
.os-split > * { min-width: 0; }
@media (min-width: 1100px) {
  .os-split { grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: 36px; align-items: center; }
}
.os-split-text > p:first-child { margin-top: 0; }
.os-split .pg-figure { float: none; width: 100%; max-width: none; margin: 0 !important; }
.os-split .pg-figure .pg-svg { max-height: none; }
@media (min-width: 1100px) { .os-split .pg-figure .pg-svg { min-width: 0; } }

/* Ilustrace bez obtékání (blok figure s wide): na střed, šířka jako text */
.os-figure-wide { clear: both; }
.os-figure-wide .pg-figure { float: none !important; width: 100% !important; max-width: 860px !important; margin: 20px 0 0 !important; }
.os-figure-wide .pg-svg { max-height: none; }
@media (min-width: 1100px) { .os-figure-wide .pg-figure .pg-svg { min-width: 0; } }

.os-split,
.os-legend,
.os-flow,
.os-process,
.os-formulas,
.os-calc,
.os-videos { clear: both; }

.os-calc-grid > *,
.os-process-cols > *,
.os-flow > li { min-width: 0; }

/* ------------------------------------------------------------------ */
/* Fáze postupu (úvod) – souvislý pás jako „workflow“ na homepage.
   Mobil/tablet: karty vodorovně se snapem. Od 1100 px: jeden rámeček, úseky oddělené šikmou linkou se šipkou (.os-flow-sep). */
/* ------------------------------------------------------------------ */
.os-flow {
  display: flex;
  gap: 12px;
  margin: 22px -20px 0 !important;
  padding: 4px 20px 14px !important;
  list-style: none !important;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 20px;
  scrollbar-width: none;
}
.os-flow::-webkit-scrollbar { display: none; }
.os-flow > li {
  position: relative;
  display: flex;
  flex: 0 0 min(78%, 300px);
  flex-direction: column;
  margin: 0 !important;
  padding: 24px !important;
  border: 1px solid var(--pg-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--pg-shadow);
  scroll-snap-align: start;
}
.os-flow-icon { display: block; width: 36px; height: 36px; color: var(--pg-brand); }
.os-flow-icon svg { width: 100%; height: 100%; }
.os-flow-range {
  margin-top: 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pg-brand);
}
.pg-prose .os-flow strong { display: block; margin-top: 4px; font-size: 17px; font-weight: 700; line-height: 1.3; color: var(--pg-ink); }
.os-flow-text { display: block; margin-top: 8px; font-size: 14px; line-height: 1.6; color: #66706c; }
.os-flow-steps { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: auto; padding-top: 16px; }
.pg-prose .os-flow-steps a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--pg-ink);
  text-decoration: none;
  transition: color 0.15s;
}
.pg-prose .os-flow-steps a:hover { color: var(--pg-brand-2); }
.os-flow-steps b {
  display: grid;
  flex: none;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  font-size: 11px;
  color: #fff;
  background: var(--pg-brand);
}
.os-flow-sep { display: none; }

@media (min-width: 1100px) {
  .os-flow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 0;
    margin: 22px 0 0 !important;
    padding: 0 !important;
    overflow: hidden;
    border: 1px solid var(--pg-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--pg-shadow);
  }
  .os-flow > li { padding: 26px 34px 26px 26px !important; border: 0; border-radius: 0; box-shadow: none; }
  .os-flow > li + li { padding-left: 38px !important; }
  .os-flow-sep {
    position: absolute;
    top: 0;
    right: -15px;
    z-index: 2;
    display: block;
    width: 30px;
    height: 100%;
    pointer-events: none;
  }
}
@media (prefers-reduced-motion: reduce) { .pg-prose .os-flow-steps a { transition: none; } }

/* ------------------------------------------------------------------ */
/* Legenda stavby kapitol (úvod) – zmenšeniny skutečných rámečků       */
/* ------------------------------------------------------------------ */
.os-legend {
  display: grid;
  gap: 12px;
  margin: 18px 0 0 !important;
  padding: 0 !important;
  list-style: none !important;
}
@media (min-width: 768px) { .os-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .os-legend { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.os-legend li {
  margin: 0 !important;
  padding: 16px 18px !important;
  border: 1px solid var(--pg-line);
  border-radius: 12px;
  background: #fff;
}
.os-legend strong { display: block; font-size: 11.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.os-legend span { display: block; margin-top: 6px; font-size: 14px; line-height: 1.55; }
.os-legend--lead strong { font-size: 16px; letter-spacing: 0; text-transform: none; color: var(--pg-ink); }
.os-legend--lead span { color: var(--pg-text); }
.os-legend li.os-legend--analogy { border-color: transparent; background: #fff8e6; }
.os-legend--analogy strong { color: #a16207; }
.os-legend--analogy span { color: #3f3a2c; }
.os-legend li.os-legend--example { border: 1px dashed #b9d9c6; }
.os-legend--example strong { color: var(--pg-brand); }
.os-legend--example span { color: var(--pg-text); }
.os-legend li.os-legend--takeaway { border-color: transparent; background: var(--pg-dark); }
.os-legend li.os-legend--takeaway strong { color: var(--pg-accent); }
.os-legend li.os-legend--takeaway span { color: #e8f3ed; }

/* Rozcestník */
.os-table--finder tbody th { font-weight: 500; }
.os-table--finder td { width: 34%; }
.os-table--finder a { font-weight: 700; text-decoration: none; }
.os-table--finder a:hover { text-decoration: underline; }

/* První sloupec běžných tabulek tučně a užší zalomení */
.pg-prose .pg-table tbody th { min-width: 150px; }

/* ------------------------------------------------------------------ */
/* Proces (kapitola 3)                                                 */
/* ------------------------------------------------------------------ */
.os-process {
  margin: 18px 0 0 !important;
  padding: 22px 22px 20px;
  border: 1px solid var(--pg-line);
  border-radius: var(--pg-radius);
  background: #fff;
  box-shadow: var(--pg-shadow);
}
.os-process header { display: flex; align-items: center; gap: 14px; }
.os-process-no {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--pg-brand);
}
.os-process-no::before { content: "#"; }
.pg-prose .os-process h4 { margin: 0; font-size: 19px; }
.os-process-body { max-width: 860px; }
.os-process-body p { margin: 12px 0 0; font-size: 15.5px; line-height: 1.75; }
.os-process-cols { display: grid; gap: 14px; margin-top: 16px; }
@media (min-width: 768px) { .os-process-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.os-process-cols > div { padding: 14px 16px; border-radius: 12px; background: var(--pg-soft); }
.os-process-label {
  display: block;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pg-brand-2);
}
.pg-prose .os-process-cols ul { margin: 6px 0 0; padding-left: 18px; }
.pg-prose .os-process-cols li { margin: 4px 0; font-size: 14.5px; line-height: 1.55; }
.pg-prose .os-process-task {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-left: 3px solid var(--pg-brand);
  border-radius: 0 10px 10px 0;
  font-size: 14.5px;
  line-height: 1.55;
  background: var(--pg-mint);
}

/* ------------------------------------------------------------------ */
/* Vzorce                                                              */
/* ------------------------------------------------------------------ */
.os-formulas {
  display: grid;
  gap: 10px;
  margin: 20px 0 0 !important;
}
.os-formulas > div {
  display: grid;
  gap: 6px 18px;
  padding: 14px 18px;
  border: 1px solid var(--pg-line);
  border-radius: 12px;
  background: #fff;
}
@media (min-width: 900px) { .os-formulas > div { grid-template-columns: 230px minmax(0, 1fr); align-items: baseline; } }
.os-formulas dt { font-size: 14.5px; font-weight: 700; color: var(--pg-ink); }
.os-formulas dd { margin: 0; }
.os-formulas code {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--pg-dark);
  background: var(--pg-mint);
}
.os-formulas dd span { display: block; margin-top: 6px; font-size: 13.5px; line-height: 1.55; color: var(--pg-muted); }

/* ------------------------------------------------------------------ */
/* Kalkulačky (StockCalculator.tsx, SpaceCalculator.tsx)               */
/* ------------------------------------------------------------------ */
.os-calc {
  margin: 24px 0 0 !important;
  padding: 24px;
  border: 1px solid var(--pg-line);
  border-radius: var(--pg-radius);
  background: #fff;
  box-shadow: var(--pg-shadow);
}
.os-calc-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.os-calc-head strong { font-size: 17px; color: var(--pg-ink); }
.os-calc-head span { font-size: 13px; color: var(--pg-muted); }
.os-calc-grid { display: grid; gap: 24px; margin-top: 18px; }
@media (min-width: 900px) { .os-calc-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; } }
.os-calc-fields { display: grid; gap: 14px; }
@media (min-width: 560px) { .os-calc-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.os-calc-field label { display: block; font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--pg-ink); }
.os-calc-field small { display: block; min-height: 2.6em; margin-top: 2px; font-size: 12px; line-height: 1.3; color: var(--pg-muted); }
.os-calc-input {
  display: flex;
  align-items: center;
  margin-top: 6px;
  border: 1px solid #cfdcd4;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.os-calc-input:focus-within { border-color: var(--pg-brand); box-shadow: 0 0 0 3px rgba(0, 169, 79, 0.15); }
.os-calc-input input,
.os-calc-input select {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: 0;
  outline: none;
  font: inherit;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: var(--pg-ink);
  background: transparent;
}
.os-calc-input span {
  display: flex;
  align-items: center;
  align-self: stretch;
  padding: 0 12px;
  font-size: 13px;
  white-space: nowrap;
  color: var(--pg-muted);
  background: var(--pg-soft);
}
.os-calc-result { padding: 22px; border-radius: 14px; background: var(--pg-soft); }
@media (min-width: 900px) { .os-calc-result { position: sticky; top: 24px; } }
.os-calc-result p { margin: 0; }
.os-calc-out { display: grid; gap: 10px; margin: 0; }
.os-calc-out > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #dfe9e3;
}
.os-calc-out dt { font-size: 13.5px; font-weight: 600; color: var(--pg-text); }
.os-calc-out dd { margin: 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--pg-ink); }
.os-calc-out .is-main dd { font-size: 24px; color: var(--pg-brand-2); }
.os-calc-out small { font-size: 13px; font-weight: 600; color: var(--pg-muted); }
.os-calc-meter {
  position: relative;
  height: 12px;
  margin-top: 16px;
  border-radius: 999px;
  background: #e3e8e5;
  overflow: visible;
}
.os-calc-meter i { display: block; height: 100%; border-radius: inherit; background: var(--pg-brand); transition: width 0.2s; }
.os-calc[data-level="high"] .os-calc-meter i { background: #d93f3f; }
.os-calc[data-level="low"] .os-calc-meter i { background: #9aa5a0; }
.os-calc-meter b { position: absolute; top: -4px; bottom: -4px; width: 2px; border-radius: 2px; background: var(--pg-dark); }
.os-calc-result p.os-calc-verdict { margin-top: 16px; font-size: 16px; line-height: 1.5; font-weight: 600; color: var(--pg-ink); }
.os-calc[data-level="high"] .os-calc-verdict { color: #b42323; }
.os-calc-result p.os-calc-note { margin-top: 10px; font-size: 13px; line-height: 1.55; color: var(--pg-muted); }
@media (prefers-reduced-motion: reduce) { .os-calc-meter i { transition: none; } }

/* ------------------------------------------------------------------ */
/* Videa (kapitola 12)                                                 */
/* ------------------------------------------------------------------ */
.os-video { margin: 0; }
.os-video figcaption { margin-top: 8px; font-size: 13.5px; color: var(--pg-muted); }
.os-videos > .os-video:only-child { max-width: 780px; }

/* Mobil: legenda jako vodorovný karusel (stejně jako karty ve sdíleném CSS) */
@media (max-width: 767.98px) {
  .pg-prose .os-legend {
    display: flex !important;
    gap: 12px;
    margin: 18px -20px 0 !important;
    padding: 4px 20px 14px !important;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 20px;
    scrollbar-width: none;
  }
  .pg-prose .os-legend > li { flex: 0 0 min(78%, 300px); scroll-snap-align: start; }
  .pg-prose .os-legend::-webkit-scrollbar { display: none; }
}
