/*
 * Súbor: css/components/work-process.css
 * Obsah: Jeden spoločný pracovný proces pre betón, sanácie, prípojky a homepage. Varianty obsahujú iba rozdielny počet stĺpcov, fotografiu a rozmery.
 * Použitie: index.html, betonove-a-oporne-mury.html, inzinierske-siete-a-pripojky.html, sanacie-stavieb-a-staticke-zabezpecenie.html.
 * Zapojenie: Po css/main.css; presné poradie uvádza css/README.md.
 * Závislosti: css/main.css, jeho farebné premenné a triedy komponentu.
 */

.work-process {
  --process-dark: var(--palette-dark, #4B4A46);
  --process-light: var(--palette-light, #F3EEE7);
  --process-sand: var(--palette-sand, #D5C1A0);
  padding: clamp(40px, 5vw, 80px) 0;
  color: var(--process-light);
  background: var(--process-dark) url("../../VSETKY_IMG/SLUZBA_MURY/betonove_mury/betonovy_mur_rubalova.webp") center / cover no-repeat;
}

.work-process__inner {
  width: min(1600px, calc(100% - 48px));
  margin-inline: auto;
}

.work-process__heading {
  width: fit-content;
  max-width: 1120px;
  margin: 0 auto 36px;
  padding: 20px 28px;
  background: rgb(var(--process-overlay-rgb, 75 74 70) / 75%);
  border-radius: 12px;
  text-align: center;
}

.work-process__eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 18px;
  color: var(--process-sand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
}

.work-process__eyebrow::before,
.work-process__eyebrow::after {
  content: "";
  width: 64px;
  height: 1px;
  background: var(--process-sand);
}

.work-process__heading h2 {
  margin: 0;
  font-size: clamp(30px, 3.3vw, 52px);
  line-height: 1.16;
  color: var(--process-light);
}

.work-process__heading h2 span {
  color: var(--process-sand);
}

.work-process__track {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 4px 0 0;
  list-style: none;
}

.work-process__track:focus-visible {
  outline: 2px solid var(--process-sand);
  outline-offset: 6px;
}

.work-process__step {
  position: relative;
  min-width: 0;
  padding-top: 52px;
}

.work-process__step::before {
  content: "";
  position: absolute;
  top: 23px;
  left: -3px;
  right: -3px;
  height: 1px;
  background: var(--process-sand);
}

.work-process__step:first-child::before {
  left: 50%;
}

.work-process__step:last-child::before {
  right: 50%;
}

.work-process__number {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid var(--process-sand);
  border-radius: 50%;
  background: rgb(var(--process-overlay-rgb, 75 74 70) / 75%);
  color: var(--process-light);
  font-size: 18px;
  font-weight: 600;
}

.work-process__number::after {
  content: "";
  position: absolute;
  top: 52px;
  left: 50%;
  height: 10px;
  border-left: 2px dotted var(--process-sand);
}

.work-process__card {
  height: 100%;
  padding: 16px 8px 18px;
  border: 1px solid var(--process-sand);
  border-radius: 10px;
  background: rgb(var(--process-overlay-rgb, 75 74 70) / 75%);
  text-align: center;
}

.work-process__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
  border: 1px solid var(--process-sand);
  border-radius: 50%;
}

.work-process__icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.work-process__card h3 {
  margin: 0;
  color: var(--process-light);
  font-size: clamp(12px, 1.05vw, 16px);
  line-height: 1.4;
  letter-spacing: -.015em;
  overflow-wrap: anywhere;
}

.work-process__card p {
  margin: 12px 0 0;
  color: var(--process-light);
  font-size: 14px;
  line-height: 1.55;
}

.work-process__hint {
  display: none;
}

:where(html[data-palette="pripojky"]) .work-process__track {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

:where(html[data-palette="pripojky"]) .work-process__icon img {
  width: 25px;
  height: 25px;
}

:where(html[data-palette="homepage"]) .work-process {
  background: var(--process-dark) url("../../VSETKY_IMG/HOME_PAGE/pracovny_proces.webp") center / cover no-repeat;
}

:where(html[data-palette="homepage"]) .work-process__track {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

:where(html[data-palette="homepage"]) .work-process__card {
  padding: 24px 20px;
}

:where(html[data-palette="homepage"]) .work-process__card h3 {
  font-size: clamp(18px, 1.5vw, 22px);
}

:where(html[data-palette="homepage"]) .work-process__card p {
  font-size: 15px;
  line-height: 1.6;
}

@media (min-width: 768px) and (max-width: 1099px) {
  .work-process__track {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 24px;
  }

  :where(html:not([data-palette="homepage"])) .work-process__step:nth-child(3n)::before {
    right: 50%;
  }

  :where(html:not([data-palette="homepage"])) .work-process__step:nth-child(3n + 1)::before {
    left: 50%;
  }

  .work-process__card h3 {
    font-size: 14px;
  }

  :where(html[data-palette="homepage"]) .work-process__track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  :where(html[data-palette="homepage"]) .work-process__step:nth-child(2n)::before {
    right: 50%;
  }

  :where(html[data-palette="homepage"]) .work-process__step:nth-child(2n + 1)::before {
    left: 50%;
  }

  :where(html[data-palette="homepage"]) .work-process__card h3 {
    font-size: 18px;
  }
}

@media (max-width: 767px) {
  .work-process__inner {
    width: calc(100% - 32px);
  }

  .work-process__heading {
    margin-bottom: 24px;
    padding: 18px 14px;
  }

  .work-process__heading h2 {
    font-size: clamp(25px, 6.5vw, 36px);
  }

  .work-process__eyebrow {
    font-size: 10px;
    gap: 10px;
    letter-spacing: .18em;
  }

  .work-process__eyebrow::before,
  .work-process__eyebrow::after {
    width: 24px;
  }

  .work-process__track {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 72%;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 12px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: var(--process-sand) rgb(var(--process-overlay-rgb, 75 74 70) / 35%);
  }

  .work-process__step {
    padding-top: 58px;
    scroll-snap-align: start;
  }

  .work-process__step::before {
    top: 19px;
    left: -5px;
    right: -5px;
  }

  .work-process__number {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }

  .work-process__number::after {
    top: 43px;
    height: 9px;
  }

  .work-process__card {
    padding: 14px 12px 16px;
  }

  .work-process__icon {
    width: 38px;
    height: 38px;
    margin-bottom: 10px;
  }

  .work-process__icon svg {
    width: 22px;
    height: 22px;
  }

  .work-process__card h3 {
    font-size: 15px;
    line-height: 1.4;
  }

  .work-process__hint {
    display: block;
    margin: 12px 0 0;
    color: var(--process-light);
    font-size: 12px;
    text-shadow: 0 1px 3px var(--process-dark);
  }

  :where(html[data-palette="pripojky"]) .work-process__icon svg,
  :where(html[data-palette="pripojky"]) .work-process__icon img {
    width: 22px;
    height: 22px;
  }
}

:where(html[data-palette="homepage"]) .work-process {
  --process-overlay-rgb: 36 49 66;
}

:where(html[data-palette="sanacie"]) .sanacie-process {
  background-image: url("../../VSETKY_IMG/SLUZBA_SANACIE/hero/priebeh.webp");
}

@media (min-width: 1100px) {
  :where(html[data-palette="sanacie"]) .sanacie-process .work-process__track {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

html[data-palette="havarie"] .work-process {
  --process-sand: var(--palette-yellow);
}

html:is([data-palette="havarie"],[data-palette="pripojky"]) .work-process__heading,
html:is([data-palette="havarie"],[data-palette="pripojky"]) .work-process__number,
html:is([data-palette="havarie"],[data-palette="pripojky"]) .work-process__card {
  background: rgb(var(--palette-dark-rgb) / 85%);
}

html[data-palette="pripojky"] .work-process {
  --process-sand: var(--palette-blue);
}

html[data-palette="sanacie"] .eyebrow,
html[data-palette="sanacie"] .section-head .eyebrow,
html[data-palette="sanacie"] .turnkey-services__heading .eyebrow,
html[data-palette="sanacie"] .work-process__eyebrow {
  color: var(--accent);
}

html[data-palette="sanacie"] .work-process__eyebrow::before,
html[data-palette="sanacie"] .work-process__eyebrow::after {
  background: var(--accent);
}

html[data-palette="sanacie"] .work-process {
  --process-sand: var(--palette-sand);
}

html[data-palette="sanacie"] .work-process__heading,
html[data-palette="sanacie"] .work-process__number,
html[data-palette="sanacie"] .work-process__card {
  background: rgb(var(--palette-dark-rgb) / 75%);
}

html[data-palette="stavba-domu"] .work-process {
  --process-light: var(--text);
  --process-sand: var(--palette-taupe);
  color: var(--text);
}

html[data-palette="stavba-domu"] .work-process__heading,
html[data-palette="stavba-domu"] .work-process__card {
  background: rgb(244 239 231 / 97%);
}

html[data-palette="stavba-domu"] .work-process__number {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent-hover);
}

html[data-palette="stavba-domu"] .work-process__heading h2 span {
  color: var(--accent-ink);
}

html[data-palette="stavba-domu"] .work-process__icon {
  background: var(--surface);
  color: var(--accent-ink);
}
