/* Статья «Водостойкость». Только своё: общие компоненты — в styles.css, фигура человека — в body.css.
   Ведущий поток — вода: акценты из --water*. Куртка на фигуре остаётся подложкой тепла (body.css),
   мокрые пятна — основной тон воды. */

/* ---------- Ведущий поток: вода ---------- */

.flow-water .jump a {
  background: var(--water-wash);
  color: var(--water-ink);
}

.flow-water .jump a:hover {
  background: color-mix(in srgb, var(--water) 22%, var(--water-wash));
}

.flow-water .check li::before {
  border-color: var(--water);
}

.article-head .flows i {
  width: 28px;
  height: 5px;
}

/* Без JS переключатели ничего не делают: прячем их, статичная панель показывает исходную сцену. */
.needs-js {
  display: none !important;
}

.is-live .needs-js {
  display: revert !important;
}

.is-live fieldset.needs-js {
  display: flex !important;
}

.is-live .wp-controls.needs-js {
  display: grid !important;
}

/* ---------- Главный интерактив: где вы промокнете ---------- */

.wp-top {
  padding: clamp(20px, 3vw, 32px) clamp(16px, 3vw, 32px) 0;
}

.wp-top h2 {
  font-size: clamp(24px, 3vw, 32px);
  margin-bottom: 16px;
}

.scenes span {
  padding: 8px 14px;
}

.wp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 24px 40px;
  padding: clamp(20px, 3vw, 28px) clamp(16px, 3vw, 32px) 8px;
  align-items: start;
}

.wp-controls {
  display: grid;
  gap: 18px;
  align-content: start;
}

.wp-controls .control-label {
  margin-bottom: 8px;
}

.wp-controls .segmented span {
  padding: 7px 14px;
}

.wp-hint {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-3);
}

.wp-panel {
  display: grid;
  grid-template-columns: minmax(140px, 230px) minmax(0, 1fr);
  grid-template-areas:
    "fig state"
    "legend legend"
    "nums nums";
  gap: 8px 24px;
  align-items: center;
}

.wp-fig {
  grid-area: fig;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.is-live .wp-fig {
  cursor: ew-resize;
}

.wp-state {
  grid-area: state;
  min-width: 0;
}

.wp-state p {
  margin: 0;
}

.wp-word {
  margin-top: 4px !important;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-wrap: balance;
}

.wp-word[data-level="1"],
.wp-word[data-level="2"] {
  color: var(--water-ink);
}

.wp-warm {
  margin-top: 10px !important;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
}

.wp-warm b {
  font-weight: 600;
  color: var(--heat-ink);
}

.wp-cond {
  margin-top: 10px !important;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-3);
}

.wp-legend {
  grid-area: legend;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  color: var(--ink-2);
}

.wp-legend li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.wp-legend i {
  width: 18px;
  height: 12px;
  border-radius: 6px;
}

.wp-legend i.likely {
  background: color-mix(in srgb, var(--water) 75%, transparent);
}

.wp-legend i.maybe {
  background: color-mix(in srgb, var(--water) 25%, transparent);
  border: 1.5px dashed var(--water);
}

.wp-numbers {
  grid-area: nums;
}

.wp-numbers .bn-list dd {
  line-height: 1.5;
}

/* Пятна и детали поверх фигуры из body.js */
.wp-wet.likely {
  fill: var(--water);
  opacity: 0.78;
}

.wp-wet.maybe {
  fill: color-mix(in srgb, var(--water) 28%, transparent);
  stroke: var(--water);
  stroke-width: 1.8;
  stroke-dasharray: 3 3;
}

.wp-snow {
  fill: var(--water-wash);
  stroke: var(--line);
  stroke-width: 1.5;
}

.wp-pack {
  fill: var(--ink-3);
}

.wp-strap {
  fill: none;
  stroke: var(--ink-2);
  stroke-width: 7;
  stroke-linecap: round;
}

.wp-foot {
  padding: 16px clamp(16px, 3vw, 32px) clamp(20px, 3vw, 28px);
  border-top: 1px solid var(--line-soft);
}

.wp-foot .sim-note {
  max-width: 78ch;
}

.wp-tnote {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--ink-3);
}

.wp-table td.lv {
  white-space: normal;
}

.wp-table td.lv2 {
  color: var(--water-ink);
  font-weight: 600;
}

.wp-table td small {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-3);
}

/* ---------- Схема «что давит на ткань» ---------- */

.wp-figure {
  max-width: var(--wide);
  margin: 32px auto 0;
  padding: 0 var(--gutter);
}

.wp-figure figcaption {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-2);
}

.press-fig figcaption {
  margin-top: 14px;
  max-width: 70ch;
}

.press-axis,
.press-rows li {
  display: grid;
  grid-template-columns: 15em minmax(0, 1fr);
  gap: 4px 20px;
  align-items: center;
}

.press-axis {
  font-size: 14px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  margin-bottom: 6px;
}

.press-axis .lbl {
  text-align: right;
}

.press-axis .ax {
  position: relative;
  height: 20px;
}

.press-axis .ax b {
  position: absolute;
  top: 0;
  font-weight: 600;
  transform: translateX(-50%);
  white-space: nowrap;
}

.press-axis .ax b:last-child {
  transform: translateX(-100%);
}

.press-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.press-rows li {
  padding: 8px 0;
  font-size: 15px;
  line-height: 1.3;
}

.press-rows .nm {
  color: var(--ink-2);
}

.press-rows .track {
  position: relative;
  height: 14px;
  /* Линии бирок 3 000, 10 000 и 20 000 мм на линейной шкале до 20 000 мм. */
  background:
    linear-gradient(var(--ink-3), var(--ink-3)) 15% 0 / 1.5px 100% no-repeat,
    linear-gradient(var(--ink-3), var(--ink-3)) 50% 0 / 1.5px 100% no-repeat,
    linear-gradient(var(--ink-3), var(--ink-3)) 100% 0 / 1.5px 100% no-repeat,
    linear-gradient(var(--line-soft), var(--line-soft)) 0 50% / 100% 2px no-repeat;
}

.press-rows .bar {
  position: absolute;
  top: 1px;
  bottom: 1px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--water) 80%, transparent);
}

.press-rows .dot {
  position: absolute;
  left: 0;
  top: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--water);
}

.press-rows em {
  position: absolute;
  left: 16px;
  top: -2px;
  font-style: normal;
  font-size: 13px;
  color: var(--ink-3);
  white-space: nowrap;
}

/* ---------- Схема теста на бирку ---------- */
.wp-iso {
  display: grid;
  grid-template-columns: minmax(0, 460px) minmax(0, 1fr);
  gap: 24px 40px;
  align-items: center;
}

.wp-iso-card svg {
  max-width: 460px;
  margin: 0 auto;
}

.wp-iso svg text {
  font-family: var(--font-body);
  font-size: 15px;
}

.iso-tube {
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 2;
}

.iso-water {
  fill: var(--water);
  opacity: 0.32;
}

.iso-pipe {
  fill: none;
  stroke: var(--water);
  stroke-width: 4;
  opacity: 0.45;
}

.iso-arrow,
.iso-lead {
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.iso-lead {
  stroke-width: 1.5;
}

.iso-clamp {
  fill: var(--ink-3);
}

.iso-fabric {
  fill: var(--ink);
}

.iso-drop {
  fill: var(--water);
}

.iso-num {
  font-weight: 700;
  fill: var(--water-ink);
}

.iso-lbl {
  fill: var(--ink-3);
}

.iso-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: iso;
  max-width: 46ch;
}

.iso-steps li {
  counter-increment: iso;
  display: grid;
  grid-template-columns: 2em 1fr;
  gap: 0 8px;
  margin-bottom: 0.9em;
}

.iso-steps li::before {
  content: counter(iso);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.2;
  color: var(--water-ink);
}


/* ---------- Карта протечек ---------- */

.wp-leak {
  margin-top: 32px;
}

.leak-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 24px 48px;
  padding: clamp(20px, 3vw, 32px);
  align-items: start;
}

.wp-leak .sim-top {
  padding-bottom: 0;
}

.jacket {
  position: relative;
  max-width: 360px;
  margin: 0 auto;
}

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

.jk-body {
  fill: var(--line-soft);
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linejoin: round;
}

.jk-face {
  fill: var(--surface);
  stroke: var(--ink);
  stroke-width: 2;
}

.jk-zip {
  stroke: var(--ink-3);
  stroke-width: 3;
  stroke-dasharray: 2 4;
}

.jk-seam {
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
}

.jk-wear {
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 6;
  stroke-linecap: round;
  opacity: 0.35;
}

.spot {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--water-ink);
  font-variant-numeric: tabular-nums;
}

.spot::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--water);
  transition: background-color 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}

.spot:hover::before {
  transform: scale(1.1);
}

.spot.on {
  color: var(--surface);
}

.spot.on::before {
  background: var(--water-ink);
  border-color: var(--water-ink);
}

.spot {
  isolation: isolate;
}

.spot::before {
  z-index: -1;
}

.leak-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.leak-item {
  margin-bottom: 28px;
}

.wp-leak.is-live .leak-item {
  margin-bottom: 0;
}

.leak-item h3 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: clamp(19px, 2.2vw, 23px);
  margin-bottom: 10px;
}

.leak-item h3 .n {
  color: var(--water-ink);
  font-variant-numeric: tabular-nums;
}

.leak-item .factor {
  font-size: 15px;
  color: var(--ink-2);
  margin-bottom: 14px;
}

.leak-item .factor strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--water-ink);
}

.leak-item p {
  line-height: 1.55;
}

.seam-bars {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--ink-3);
}

.seam-bars .row {
  display: grid;
  grid-template-columns: 7.5em 1fr;
  gap: 10px;
  align-items: center;
}

.seam-bars .tr {
  position: relative;
  height: 10px;
}

.seam-bars .b {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: 2px;
}

.seam-bars .fabric {
  width: 100%;
  background: var(--water);
}

/* Шов с лентой держит от 1/2 до полной силы ткани, без ленты — от 1/4 до 1/1,5 [19]:
   сплошная часть — худший случай, бледная — разброс. */
.seam-bars .taped {
  width: 100%;
  background: linear-gradient(to right, var(--water) 50%, color-mix(in srgb, var(--water) 30%, transparent) 50%);
}

.seam-bars .seam {
  width: 66.7%;
  background: linear-gradient(to right, var(--water) 37.5%, color-mix(in srgb, var(--water) 30%, transparent) 37.5%);
}

/* ---------- «Как это устроено» и источники ---------- */

.how,
.sources-box {
  border-top: 1px solid var(--line);
}

.how {
  margin-top: clamp(56px, 8vw, 88px);
}

.how > summary,
.sources-box > summary {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 22px 0;
  cursor: pointer;
  list-style: none;
}

.how > summary::-webkit-details-marker,
.sources-box > summary::-webkit-details-marker {
  display: none;
}

.how > summary h2,
.sources-box > summary h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 30px);
}

.sources-box > summary .count {
  font-size: 15px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.how > summary::after,
.sources-box > summary::after {
  content: "";
  width: 10px;
  height: 10px;
  margin-left: auto;
  align-self: center;
  border-right: 2px solid var(--ink-2);
  border-bottom: 2px solid var(--ink-2);
  transform: translateY(-3px) rotate(45deg);
  transition: transform 0.25s var(--ease-out);
}

.how[open] > summary::after,
.sources-box[open] > summary::after {
  transform: translateY(2px) rotate(225deg);
}

.how > summary:hover h2,
.sources-box > summary:hover h2 {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

.how-body {
  padding-bottom: 12px;
}

.how-body h3:first-child {
  margin-top: 4px;
}

.how-body p,
.how-body td {
  font-size: 16px;
}

.how-body ul {
  padding-left: 1.2em;
}

.how-body li {
  font-size: 16px;
}

/* ---------- Телефон ---------- */

@media (max-width: 760px) {
  .wp-grid,
  .wp-iso,
  .leak-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* На телефоне фигура — главный результат: она крупно сверху, слова под ней. */
  .wp-panel {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "fig"
      "legend"
      "state"
      "nums";
    gap: 4px;
  }

  .wp-fig {
    width: 200px;
    justify-self: center;
  }

  .wp-legend {
    justify-content: center;
    margin: 0 0 12px;
  }

  .wp-word {
    font-size: 25px;
  }

  .press-axis,
  .press-rows li {
    grid-template-columns: minmax(0, 1fr);
  }

  .press-axis .lbl {
    display: none;
  }

  .press-rows li {
    padding: 6px 0 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spot::before,
  .how > summary::after,
  .sources-box > summary::after {
    transition: none;
  }
}
