/* Archivo — self-hosted (sdílené s webem v ../../fonts/) */
@font-face { font-family:"Archivo"; font-style:normal; font-weight:400; font-display:swap; src:url("../../fonts/archivo-400-latin-ext.woff2") format("woff2"); unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family:"Archivo"; font-style:normal; font-weight:400; font-display:swap; src:url("../../fonts/archivo-400-latin.woff2") format("woff2"); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:"Archivo"; font-style:normal; font-weight:500; font-display:swap; src:url("../../fonts/archivo-500-latin-ext.woff2") format("woff2"); unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family:"Archivo"; font-style:normal; font-weight:500; font-display:swap; src:url("../../fonts/archivo-500-latin.woff2") format("woff2"); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:"Archivo"; font-style:normal; font-weight:600; font-display:swap; src:url("../../fonts/archivo-600-latin-ext.woff2") format("woff2"); unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family:"Archivo"; font-style:normal; font-weight:600; font-display:swap; src:url("../../fonts/archivo-600-latin.woff2") format("woff2"); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

@font-face {
  font-family: "Fraunces";
  src: url("assets/fonts/Fraunces.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg:        #F6F2EA;
  --surface:   #FDFBF6;
  --surface-2: #EFEADF;
  --line:      #E2DCCF;
  --text:      #211D17;
  --muted:     #6F675B;
  --faint:     #A69D8E;
  --accent:    #9E7544;
  --accent-grad: linear-gradient(180deg, #A87E4C 0%, #8E6739 100%);

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:    "Archivo", system-ui, -apple-system, sans-serif;

  --r-md: 8px;
  --r-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(33,29,23,.05);
  --shadow-md: 0 18px 50px -18px rgba(33,29,23,.22);
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 1440px;
  margin: 0 auto;
  padding: 26px 40px 46px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------- Header ---------- */
.topbar { display: flex; align-items: baseline; gap: 16px; }
.topbar .eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent);
}
.topbar h1 {
  font-family: var(--display); font-weight: 300; font-size: clamp(1.4rem, 2.2vw, 2rem);
  letter-spacing: -.015em; margin: 0; color: var(--text);
}

/* ---------- Styl — segmentový pill ---------- */
.styles-row { display: flex; justify-content: center; }
.styles {
  display: inline-flex; gap: 2px; padding: 4px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 100px; box-shadow: var(--shadow-sm);
  max-width: 100%; overflow: auto; scrollbar-width: none;
}
.styles::-webkit-scrollbar { display: none; }
.styles button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font-family: var(--sans); font-size: 12px; font-weight: 500;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); padding: 10px 22px; border-radius: 100px; white-space: nowrap;
  transition: color .25s var(--ease), background .25s var(--ease);
}
.styles button:hover { color: var(--text); }
.styles button[aria-pressed="true"] { background: var(--accent-grad); color: #fff; }

/* ---------- Stage ---------- */
.stage { display: flex; flex-direction: column; gap: 12px; }
.stage__inner {
  position: relative;
  background: var(--surface-2);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: 1440 / 770;
}
#preview { display: block; width: 100%; height: 100%; }

.caption {
  margin: 0 2px;
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted);
}
.caption b { color: var(--text); font-weight: 600; }

.loader {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(246,242,234,.5);
  backdrop-filter: blur(1px);
}
.loader[hidden] { display: none; }
.loader span {
  width: 26px; height: 26px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Controls (pod obrázkem) ---------- */
.controls {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px 52px;
  padding-top: 8px;
  align-items: start;
}
.group { display: flex; flex-direction: column; min-width: 0; }
.group h2 {
  font-family: var(--sans);
  font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 16px;
}

/* Podlahy — kulaté průhledné swatche v řadě */
.thumbs { display: flex; flex-wrap: wrap; gap: 16px 14px; }
.thumbs button {
  appearance: none; border: 0; background: none; cursor: pointer; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 9px; width: 64px;
}
.thumbs img {
  width: 62px; height: 62px; border-radius: 50%; object-fit: cover; display: block;
  box-shadow: 0 0 0 1px rgba(33,29,23,.06);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.thumbs button:hover img { transform: translateY(-2px); }
.thumbs button[aria-pressed="true"] img {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}
.thumbs span {
  font-size: 11px; color: var(--muted); text-align: center; line-height: 1.2;
}
.thumbs button[aria-pressed="true"] span { color: var(--text); }

/* Barvy — kulaté chipy */
.swatches { display: flex; gap: 14px; flex-wrap: wrap; }
.swatches button {
  appearance: none; border: 0; background: none; cursor: pointer; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px; width: 40px;
}
.swatches .chip {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(33,29,23,.12);
  transition: box-shadow .2s var(--ease);
  position: relative;
}
.swatches .chip--none::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: linear-gradient(135deg, transparent 45%, var(--accent) 45%, var(--accent) 55%, transparent 55%);
}
.swatches button[aria-pressed="true"] .chip {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}
.swatches small {
  font-size: 10px; color: var(--muted); text-align: center; line-height: 1.15; max-width: 52px;
}
.swatches button[aria-pressed="true"] small { color: var(--text); }

@media (max-width: 920px) {
  .app { padding: 20px; }
  .controls { grid-template-columns: 1fr; gap: 26px; }
  .styles-row { justify-content: flex-start; }
}

/* ---------- Preview režim (embed do náhledové dlaždice) ---------- */
body.preview { overflow: hidden; pointer-events: none; background: #211D17; }
body.preview .topbar,
body.preview .styles-row,
body.preview .controls,
body.preview .caption { display: none !important; }
body.preview .app { padding: 0; gap: 0; min-height: 100vh; max-width: none; }
body.preview .stage { gap: 0; height: 100vh; }
body.preview .stage__inner { aspect-ratio: auto; height: 100vh; border-radius: 0; box-shadow: none; }
body.preview #preview { width: 100%; height: 100%; object-fit: cover; }
