/* ==========================================================================
   Výkup střešních konstrukcí – jen to, co sdílené komponenty nepokrývají
   Signature „Pod krytinou“ (.roofx) – řez střechou, tašky → latě → krov
   ========================================================================== */

/* ---------- Signature: Pod krytinou ---------- */

.roofx__inner {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  align-items: center;
  gap: var(--s-6) clamp(2rem, 4.5vw, 5rem);
}

.roofx__title {
  max-width: 13ch;
  text-wrap: balance;
}

.roofx__lead {
  max-width: 28rem;
  margin-top: var(--s-3);
  color: var(--c-muted);
  text-wrap: pretty;
}

/* Etapy: krytina → laťování → krov */
.roofx__stages {
  max-width: 28rem;
  margin-top: var(--s-5);
  border-top: 1px solid var(--hairline);
}

.roofx__stage {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding-block: var(--s-2);
  border-bottom: 1px solid var(--hairline);
  color: var(--c-muted-2);
  transition: color var(--dur) var(--ease-out);
}

/* realistická ikonka etapy místo čísla (assets/img/icons) */
.roofx__num {
  flex: none;
  display: grid;
  place-items: center;
  width: 4rem;
  height: 3rem;
}

.roofx__icon {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  opacity: 0.45;
  filter: grayscale(1);
  transition: opacity var(--dur) var(--ease-out), filter var(--dur) var(--ease-out), transform var(--dur) var(--ease-spring);
}

.roofx__stage-body {
  display: grid;
  line-height: 1.4;
}

.roofx__stage-title {
  font-weight: var(--fw-medium);
}

.roofx__stage.is-active {
  color: var(--c-ink);
}

.roofx__stage.is-active .roofx__icon {
  opacity: 1;
  filter: none;
  transform: scale(1.12) rotate(-4deg);
}

/* Nákres */
.roofx__drawing {
  position: relative;
}

.roofx__svg {
  display: block;
  width: 100%;
  height: auto;
}

.roofx__svg * {
  vector-effect: non-scaling-stroke;
}

.roofx__ground {
  fill: none;
  stroke: rgba(5, 17, 7, 0.28);
  stroke-width: 1;
}

.roofx__wall {
  fill: var(--c-white);
  stroke: rgba(5, 17, 7, 0.42);
  stroke-width: 1;
}

/* boční stěna a štít – o tón tmavší než průčelí (plasticita bez stínů) */
.roofx__side {
  fill: #eeece7;
  stroke: rgba(5, 17, 7, 0.42);
  stroke-width: 1;
}

.roofx__gable {
  fill: #f3f1ed;
  stroke: rgba(5, 17, 7, 0.42);
  stroke-width: 1;
}

.roofx__plinth {
  fill: none;
  stroke: rgba(5, 17, 7, 0.16);
  stroke-width: 1;
}

.roofx__window {
  fill: rgba(5, 17, 7, 0.86);
}

.roofx__door {
  fill: rgba(5, 17, 7, 0.7);
}

.roofx__mullion {
  fill: none;
  stroke: rgba(255, 255, 255, 0.45);
  stroke-width: 1.5;
}

.roofx__chimney {
  fill: #ebe8e2;
  stroke: rgba(5, 17, 7, 0.42);
  stroke-width: 1;
}

/* dřevo krovu – hotový stav je „zlatý“ (hodnota); JS ho na začátku scény zbělí */
.roofx__wood {
  fill: var(--c-gold-mid);
  stroke: rgba(103, 60, 0, 0.55);
  stroke-width: 1;
}

.roofx__rafter {
  fill: var(--c-gold);
}

/* krokve zadní roviny – viděné skrz přední, tlumeněji */
.roofx__wood--far {
  fill: var(--c-gold-soft);
  stroke: rgba(103, 60, 0, 0.35);
}

.roofx__batten {
  fill: #efe9df;
  stroke: rgba(5, 17, 7, 0.38);
  stroke-width: 0.8;
}

.roofx__tile {
  stroke: rgba(5, 17, 7, 0.3);
  stroke-width: 0.8;
}

/* tóny bobrovek – tlumená pálená hlína (ilustrační tóny, ne barvy UI) */
.roofx__tile--t1 { fill: #d9cfc2; }
.roofx__tile--t2 { fill: #d1c4b3; }
.roofx__tile--t3 { fill: #ded6cb; }
.roofx__tile--t4 { fill: #cabdab; }

.roofx__cap {
  fill: #bfb19e;
  stroke: rgba(5, 17, 7, 0.34);
  stroke-width: 0.8;
}

/* Hotový stav (bez JS / reduced motion): krytina a latě jsou dole, zůstal krov.
   Nejde o obsah čekající na JS – JS je zviditelní jen jako výchozí bod scény. */
.roofx__tiles,
.roofx__battens {
  visibility: hidden;
}

/* Popisky prvků krovu (HTML nad SVG, aby měly 16 px při každém měřítku) */
.roofx__label {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem 0.5rem 0.5rem;
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.94);
  color: var(--c-ink);
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  line-height: 1.3;
  white-space: nowrap;
  transform: translate(-0.75rem, -50%);
  pointer-events: none;
}

.roofx__label::before {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 2px;
  background: var(--c-brown);
}

/* desktop: scéna se připne – obsah na výšku obrazovky, svisle na střed */
@media (min-width: 1024px) {
  .roofx {
    display: flex;
    align-items: center;
    min-height: 100svh;
    padding-block: calc(var(--nav-clear) + var(--s-3)) var(--s-6);
  }

  .roofx > .container {
    width: 100%;
  }
}

@media (max-width: 1023px) {
  .roofx__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .roofx__title {
    max-width: 16ch;
  }

  /* etapy vedle sebe nad nákresem */
  .roofx__stages {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s-2);
    max-width: none;
    border-top: 0;
  }

  .roofx__stage {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--s-1);
    padding-block: var(--s-2) 0;
    border-top: 1px solid var(--hairline);
    border-bottom: 0;
  }
}

@media (max-width: 599px) {
  .roofx__stages {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    border-top: 1px solid var(--hairline);
  }

  .roofx__stage {
    flex-direction: row;
    align-items: center;
    padding-block: 0.75rem;
    border-top: 0;
    border-bottom: 1px solid var(--hairline);
  }

  /* popisky by se v malém nákresu překrývaly – stačí výčet etap nad ním */
  .roofx__label {
    display: none;
  }
}

/* ---------- Proč prodat – na desktopu tři řádky jako ve wireframu (věty se nelámou uprostřed) ---------- */
.sec-head__main:has(> #why-title) {
  max-width: 64rem;
}

#why-title {
  max-width: none;
}

