/* ==========================================================================
   Waterline Flood Defence: homepage, barrier sections, product spec pages
   and media slots (round 2). Loaded after site.css. Uses tokens.css only.
   ========================================================================== */

:root { --wd-navy: var(--wd-brand-navy, #1F3A8A); }

/* ---------- Media slots (see MEDIA.md) ---------- */
.wd-slot {
  position: relative;
  overflow: hidden;
  border-radius: var(--wd-radius-3);
  background: var(--wd-foam);
  border: 1px dashed var(--wd-steel-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  aspect-ratio: 16 / 9;
}
.wd-slot--4x3 { aspect-ratio: 4 / 3; }
.wd-slot--1x1 { aspect-ratio: 1 / 1; }
.wd-slot__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--wd-space-2);
  padding: var(--wd-space-5);
  font-family: var(--wd-font-display);
  font-size: var(--wd-step--1);
  font-weight: 600;
  color: var(--wd-steel-blue);
}
.wd-slot__empty::before {
  /* simple camera glyph drawn in CSS so empty slots never look broken */
  content: "";
  width: 36px;
  height: 26px;
  border: 2px solid currentColor;
  border-radius: 5px;
  background: radial-gradient(circle at 50% 55%, transparent 6px, currentColor 6px, currentColor 8px, transparent 8px);
  opacity: 0.8;
}
.wd-slot.is-filled { border: 0; background: var(--wd-ink); }
.wd-slot.is-filled .wd-slot__empty { visibility: hidden; }
.wd-slot__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  display: block;
}
video.wd-slot__media, iframe.wd-slot__media { object-fit: contain; background: var(--wd-ink); }
.wd-slot__play {
  appearance: none;
  cursor: pointer;
  background: var(--wd-ink) center / cover no-repeat;
  color: var(--wd-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--wd-space-3);
  font-family: var(--wd-font-display);
  font-weight: 600;
}
.wd-slot__play-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--wd-safety-amber);
  position: relative;
}
.wd-slot__play-icon::after {
  content: "";
  position: absolute;
  left: 27px; top: 21px;
  border-style: solid;
  border-width: 13px 0 13px 20px;
  border-color: transparent transparent transparent var(--wd-ink);
}
.wd-slot__play-label {
  background: rgba(13, 27, 38, 0.75);
  padding: 2px 10px;
  border-radius: var(--wd-radius-2);
}
.wd-slot__play:hover .wd-slot__play-icon { background: #d4912f; }

/* ---------- Homepage hero (split: copy + Sean's garage photo) ---------- */
.wd-home-hero {
  background: var(--wd-deep-waterline);
  color: var(--wd-white);
}
.wd-home-hero__grid { display: grid; }
.wd-home-hero__photo {
  margin: 0;
  position: relative;
  /* Source is 812 x 452: never render it wider than that */
  max-width: 812px;
  width: 100%;
  aspect-ratio: 812 / 452;
  background: var(--wd-ink-soft);
}
.wd-home-hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.wd-home-hero__copy { padding: var(--wd-space-6) var(--wd-space-5) var(--wd-space-7); }
.wd-home-hero h1 {
  color: var(--wd-white);
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  max-width: 16ch;
}
.wd-home-hero__sub { font-size: var(--wd-step-1); color: var(--wd-foam-bright); max-width: 46ch; }
.wd-home-hero .wd-cta-pair { margin-top: var(--wd-space-5); }
.wd-home-hero .wd-licence { margin-top: var(--wd-space-2); }
.wd-btn--outline-light {
  background: transparent;
  color: var(--wd-white);
  border-color: var(--wd-foam);
}
.wd-btn--outline-light:hover { background: var(--wd-white); color: var(--wd-deep-waterline); border-color: var(--wd-white); }

@media (min-width: 960px) {
  .wd-home-hero__grid {
    max-width: 1200px;
    margin-inline: auto;
    padding: var(--wd-space-8) var(--wd-space-5);
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: var(--wd-space-7);
    align-items: center;
  }
  .wd-home-hero__copy { padding: 0; }
  .wd-home-hero__photo {
    order: 2;
    border-radius: var(--wd-radius-3);
    overflow: hidden;
    box-shadow: var(--wd-shadow-3);
    justify-self: end;
  }
}

/* ---------- Trust strip ---------- */
.wd-trust {
  background: var(--wd-white);
  border-bottom: 1px solid var(--wd-concrete);
}
.wd-trust__list {
  list-style: none;
  margin: 0;
  padding: var(--wd-space-5) 0;
  display: grid;
  gap: var(--wd-space-4);
}
@media (min-width: 768px) { .wd-trust__list { grid-template-columns: repeat(3, 1fr); gap: var(--wd-space-6); } }
.wd-trust__item {
  margin: 0;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: var(--wd-space-3);
  align-items: start;
}
.wd-trust__icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--wd-foam);
  color: var(--wd-navy);
  display: grid;
  place-items: center;
}
.wd-trust__icon svg { width: 22px; height: 22px; }
.wd-trust__item strong { display: block; font-family: var(--wd-font-display); font-size: var(--wd-step-0); color: var(--wd-ink); }
.wd-trust__item span { font-size: var(--wd-step--1); color: var(--wd-ink-soft); }

/* ---------- Section heading block ---------- */
.wd-kicker {
  display: inline-block;
  font-family: var(--wd-font-display);
  font-size: var(--wd-step--1);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wd-navy);
  margin-bottom: var(--wd-space-3);
}
.wd-on-dark .wd-kicker { color: var(--wd-safety-amber); }

/* ---------- Barrier feature section (repeatable, one per product) ---------- */
.wd-barrier { padding-block: var(--wd-space-8); background: var(--wd-paper); }
.wd-barrier--alt { background: var(--wd-white); }
.wd-barrier + .wd-barrier { border-top: 1px solid var(--wd-concrete); }
.wd-barrier__grid { display: grid; gap: var(--wd-space-6); align-items: center; }
@media (min-width: 900px) {
  .wd-barrier { padding-block: var(--wd-space-9); }
  .wd-barrier__grid { grid-template-columns: 1.1fr 1fr; gap: var(--wd-space-8); }
  .wd-barrier--flip .wd-barrier__media { order: 2; }
}
.wd-barrier h2 { margin-bottom: var(--wd-space-3); }
.wd-barrier__desc { color: var(--wd-ink-soft); max-width: 56ch; font-size: var(--wd-step-1); }
.wd-barrier__actions { display: flex; flex-wrap: wrap; gap: var(--wd-space-3); margin-top: var(--wd-space-5); }

/* Compact spec list */
.wd-specs {
  margin: var(--wd-space-5) 0 0;
  border-top: 2px solid var(--wd-navy);
}
.wd-specs__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px var(--wd-space-4);
  padding: var(--wd-space-3) 0;
  border-bottom: 1px solid var(--wd-concrete);
}
@media (min-width: 480px) { .wd-specs__row { grid-template-columns: 11rem 1fr; } }
.wd-specs dt { font-family: var(--wd-font-display); font-weight: 600; font-size: var(--wd-step--1); color: var(--wd-ink); }
.wd-specs dd { margin: 0; color: var(--wd-ink-soft); font-size: var(--wd-step--1); }
.wd-source {
  margin: var(--wd-space-2) 0 0;
  font-size: var(--wd-step--1);
  color: var(--wd-steel-blue);
}

/* "More styles coming" band */
.wd-more {
  background: var(--wd-foam);
  padding-block: var(--wd-space-6);
  text-align: center;
}
.wd-more p { margin: 0 auto; max-width: 60ch; color: var(--wd-ink-soft); }
.wd-more strong { color: var(--wd-ink); font-family: var(--wd-font-display); }

/* ---------- How it works ---------- */
.wd-steps {
  list-style: none;
  counter-reset: step;
  margin: var(--wd-space-6) 0 0;
  padding: 0;
  display: grid;
  gap: var(--wd-space-5);
}
@media (min-width: 768px) { .wd-steps { grid-template-columns: repeat(3, 1fr); } }
.wd-steps li {
  counter-increment: step;
  margin: 0;
  background: var(--wd-white);
  border: 1px solid var(--wd-concrete);
  border-radius: var(--wd-radius-3);
  padding: var(--wd-space-5);
}
.wd-steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--wd-navy);
  color: var(--wd-white);
  font-family: var(--wd-font-display);
  font-weight: 700;
  margin-bottom: var(--wd-space-4);
}
.wd-steps h3 { font-size: var(--wd-step-1); margin-bottom: var(--wd-space-2); }
.wd-steps p { margin: 0; color: var(--wd-ink-soft); }

/* Review slots re-use the media slot inside the existing review card */
.wd-review .wd-slot { border-radius: 0; border-width: 0 0 1px; aspect-ratio: 4 / 3; }

/* ---------- Final CTA band ---------- */
.wd-final {
  background: var(--wd-deep-waterline);
  color: var(--wd-white);
  text-align: center;
}
.wd-final h2 { color: var(--wd-white); }
.wd-final p { color: var(--wd-foam-bright); max-width: 52ch; margin-inline: auto; }
.wd-final .wd-cta-pair { margin: var(--wd-space-5) auto 0; }

/* ---------- Product spec pages ---------- */
.wd-prod-hero { background: var(--wd-deep-waterline); color: var(--wd-white); }
.wd-prod-hero__grid {
  display: grid;
  gap: var(--wd-space-6);
  padding-block: var(--wd-space-7);
  align-items: center;
}
@media (min-width: 900px) { .wd-prod-hero__grid { grid-template-columns: 1fr 1.1fr; padding-block: var(--wd-space-8); } }
.wd-prod-hero h1 { color: var(--wd-white); margin-bottom: var(--wd-space-3); }
.wd-prod-hero p { color: var(--wd-foam-bright); max-width: 50ch; font-size: var(--wd-step-1); }
.wd-prod-hero .wd-slot { background: var(--wd-ink-soft); border-color: var(--wd-steel-blue); }
.wd-prod-hero .wd-slot__empty { color: var(--wd-foam); }
.wd-prod-hero .wd-crumbs, .wd-prod-hero .wd-crumbs a { color: var(--wd-foam-bright); }
.wd-prod-hero .wd-crumbs { padding-top: var(--wd-space-5); margin: 0; }
.wd-prod-hero .wd-crumbs span { color: var(--wd-foam); }

.wd-jump {
  background: var(--wd-white);
  border-bottom: 1px solid var(--wd-concrete);
}
.wd-jump ul {
  list-style: none;
  margin: 0;
  padding: var(--wd-space-3) 0;
  display: flex;
  gap: var(--wd-space-2);
  overflow-x: auto;
  scrollbar-width: none;
}
.wd-jump li { margin: 0; flex-shrink: 0; }
.wd-jump a {
  display: inline-block;
  padding: var(--wd-space-2) var(--wd-space-4);
  border: 1px solid var(--wd-concrete);
  border-radius: 999px;
  font-family: var(--wd-font-display);
  font-size: var(--wd-step--1);
  font-weight: 600;
  text-decoration: none;
  color: var(--wd-navy);
  white-space: nowrap;
}
.wd-jump a:hover { border-color: var(--wd-navy); }

.wd-prod-section { padding-block: var(--wd-space-8); }
.wd-prod-section--alt { background: var(--wd-white); border-block: 1px solid var(--wd-concrete); }
.wd-prod-section h2 { margin-bottom: var(--wd-space-4); }
.wd-prod-section p { max-width: 70ch; }

.wd-spec-table { min-width: 0; font-size: var(--wd-step-0); }
.wd-spec-table caption {
  caption-side: top;
  text-align: left;
  font-family: var(--wd-font-display);
  font-weight: 600;
  font-size: var(--wd-step--1);
  color: var(--wd-steel-blue);
  padding-bottom: var(--wd-space-3);
}
.wd-spec-table th[scope="row"] { background: transparent; width: 38%; font-size: var(--wd-step--1); }
.wd-spec-table td { color: var(--wd-ink-soft); }
@media (max-width: 479px) {
  .wd-spec-table th[scope="row"], .wd-spec-table td { display: block; width: auto; }
  .wd-spec-table th[scope="row"] { border-bottom: 0; padding-bottom: 0; }
}

.wd-parts {
  list-style: none;
  margin: var(--wd-space-5) 0 0;
  padding: 0;
  display: grid;
  gap: var(--wd-space-4);
}
@media (min-width: 640px) { .wd-parts { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .wd-parts { grid-template-columns: repeat(3, 1fr); } }
.wd-parts li {
  margin: 0;
  background: var(--wd-paper);
  border: 1px solid var(--wd-concrete);
  border-top: 3px solid var(--wd-navy);
  border-radius: var(--wd-radius-3);
  padding: var(--wd-space-5);
}
.wd-parts h3 { font-size: var(--wd-step-1); margin-bottom: var(--wd-space-2); }
.wd-parts p { margin: 0; color: var(--wd-ink-soft); font-size: var(--wd-step--1); }

.wd-apps {
  list-style: none;
  padding: 0;
  margin: var(--wd-space-5) 0 0;
  display: grid;
  gap: var(--wd-space-3);
}
@media (min-width: 640px) { .wd-apps { grid-template-columns: repeat(2, 1fr); } }
.wd-apps li {
  margin: 0;
  display: flex;
  gap: var(--wd-space-3);
  align-items: baseline;
}
.wd-apps li::before {
  content: "";
  flex: 0 0 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--wd-safety-amber);
  transform: translateY(1px);
}

.wd-gallery {
  display: grid;
  gap: var(--wd-space-4);
  margin-top: var(--wd-space-5);
}
@media (min-width: 640px) { .wd-gallery { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .wd-gallery { grid-template-columns: repeat(3, 1fr); } }
.wd-gallery__wide { grid-column: 1 / -1; }
@media (min-width: 1024px) { .wd-gallery__wide { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; min-height: 100%; } }

.wd-coming {
  background: var(--wd-foam);
  border: 1px dashed var(--wd-steel-blue);
  border-radius: var(--wd-radius-3);
  padding: var(--wd-space-5);
  color: var(--wd-ink-soft);
}
.wd-coming strong { color: var(--wd-ink); font-family: var(--wd-font-display); }

/* Application pages: two barrier cards */
.wd-pick { display: grid; gap: var(--wd-space-5); margin-top: var(--wd-space-5); }
@media (min-width: 768px) { .wd-pick { grid-template-columns: 1fr 1fr; } }
.wd-pick__card {
  background: var(--wd-white);
  border: 1px solid var(--wd-concrete);
  border-top: 3px solid var(--wd-navy);
  border-radius: var(--wd-radius-3);
  padding: var(--wd-space-5);
}
.wd-pick__card h3 { margin-bottom: var(--wd-space-2); }
.wd-pick__card p { color: var(--wd-ink-soft); }
