/* WDM Wave 6 — Animations + responsive enhancements (2026-05-14)
 *
 * Adds:
 *  - Smooth fade-up-on-scroll for new section-break images and cards
 *  - Hover lift on .wdm-card (Industries/Locations grids)
 *  - Subtle parallax-style gradient on inline images
 *  - Mobile breakpoints for new wdm-geo-pair + dashboard mockup sections
 *  - Touch-target sizing for mobile CTAs
 *
 * Sovereignty: no external animation libraries, no GSAP, no AOS.js.
 * Pure CSS @keyframes + IntersectionObserver-less progressive enhancement.
 */

/* ─────────────────────────────────────────────────────────────
   1. Fade-up-on-scroll for new sections
   Uses CSS-only approach via animation-delay on initial load.
   For future enhancement, JS could add .wdm-anim-in class on scroll.
   ───────────────────────────────────────────────────────────── */

.wdm-inline-img,
.wdm-hero-img,
.wdm-geo-pair,
.wdm-dashboard-mockup,
.wdm-industry-casestudy {
  opacity: 0;
  transform: translateY(20px);
  animation: wdm-fadeup 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.1s;
}

@keyframes wdm-fadeup {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger fade-up for grid items */
.wdm-grid--3 > .wdm-card:nth-child(1) { animation-delay: 0.05s; }
.wdm-grid--3 > .wdm-card:nth-child(2) { animation-delay: 0.10s; }
.wdm-grid--3 > .wdm-card:nth-child(3) { animation-delay: 0.15s; }
.wdm-grid--3 > .wdm-card:nth-child(4) { animation-delay: 0.20s; }
.wdm-grid--3 > .wdm-card:nth-child(5) { animation-delay: 0.25s; }
.wdm-grid--3 > .wdm-card:nth-child(6) { animation-delay: 0.30s; }
.wdm-grid--4 > .wdm-card:nth-child(1) { animation-delay: 0.05s; }
.wdm-grid--4 > .wdm-card:nth-child(2) { animation-delay: 0.08s; }
.wdm-grid--4 > .wdm-card:nth-child(3) { animation-delay: 0.11s; }
.wdm-grid--4 > .wdm-card:nth-child(4) { animation-delay: 0.14s; }

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .wdm-inline-img,
  .wdm-hero-img,
  .wdm-geo-pair,
  .wdm-dashboard-mockup,
  .wdm-industry-casestudy,
  .wdm-grid--3 > .wdm-card,
  .wdm-grid--4 > .wdm-card {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* ─────────────────────────────────────────────────────────────
   2. Hover lift on cards (Industries-served / Locations-served / Industries grid)
   ───────────────────────────────────────────────────────────── */

.wdm-card {
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.32s ease;
}

.wdm-card:hover,
.wdm-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(29, 29, 29, 0.08), 0 2px 6px rgba(29, 29, 29, 0.04);
}

/* ─────────────────────────────────────────────────────────────
   3. Subtle zoom on inline images on hover (only on devices that hover)
   ───────────────────────────────────────────────────────────── */

@media (hover: hover) and (pointer: fine) {
  .wdm-inline-img img,
  .wdm-hero-img img {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s ease;
  }

  .wdm-inline-img:hover img,
  .wdm-hero-img:hover img {
    transform: scale(1.02);
    filter: brightness(1.02);
  }
}

/* ─────────────────────────────────────────────────────────────
   4. Mobile responsive — new wdm-geo-pair (UK/Spain home pair)
   ───────────────────────────────────────────────────────────── */

.wdm-geo-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 32px auto 48px auto;
  max-width: 1200px;
}

@media (max-width: 768px) {
  .wdm-geo-pair {
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 24px auto 32px auto;
  }
  .wdm-geo-pair figcaption {
    padding: 8px 4px;
    font-size: 11px;
  }
}

/* ─────────────────────────────────────────────────────────────
   5. Dashboard mockup section (service pages)
   ───────────────────────────────────────────────────────────── */

.wdm-dashboard-mockup {
  padding: 64px 0;
}

.wdm-dashboard-mockup__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.wdm-dashboard-mockup__image img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  box-shadow: 0 8px 32px rgba(29, 29, 29, 0.08);
}

.wdm-dashboard-mockup__copy h2 {
  margin-top: 0;
  margin-bottom: 16px;
}

.wdm-dashboard-mockup__copy ul {
  list-style: none;
  padding: 0;
  margin: 24px 0 0 0;
}

.wdm-dashboard-mockup__copy ul li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 12px;
  font-size: 16px;
  line-height: 1.5;
}

.wdm-dashboard-mockup__copy ul li::before {
  content: "→";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--wdm-gold, #947f57);
  font-weight: bold;
}

@media (max-width: 768px) {
  .wdm-dashboard-mockup {
    padding: 40px 0;
  }
  .wdm-dashboard-mockup__inner {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 0 16px;
  }
  .wdm-dashboard-mockup__copy ul li {
    font-size: 15px;
  }
}

/* ─────────────────────────────────────────────────────────────
   6. Industry case-study card section
   ───────────────────────────────────────────────────────────── */

.wdm-industry-casestudy {
  padding: 64px 0;
}

.wdm-industry-casestudy__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.wdm-industry-casestudy__image img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  box-shadow: 0 8px 32px rgba(29, 29, 29, 0.08);
}

@media (max-width: 768px) {
  .wdm-industry-casestudy {
    padding: 40px 0;
  }
  .wdm-industry-casestudy__inner {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 0 16px;
  }
}

/* ─────────────────────────────────────────────────────────────
   7. Mobile responsive — wdm-grid--3 + wdm-grid--4 collapse
   (verify existing breakpoints in main CSS work; add safety net here)
   ───────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .wdm-grid--4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 640px) {
  .wdm-grid--3,
  .wdm-grid--4 {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   8. Touch-target safety net for mobile CTAs
   ───────────────────────────────────────────────────────────── */

@media (hover: none) and (pointer: coarse) {
  .wdm-btn,
  .wdm-card a,
  .wdm-card[role="listitem"] a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* ─────────────────────────────────────────────────────────────
   9. Image weight optimisation — fade-in on intersection (graceful)
   For browsers that support it; modern Safari/Chrome/Firefox.
   ───────────────────────────────────────────────────────────── */

@supports (content-visibility: auto) {
  .wdm-inline-img,
  .wdm-dashboard-mockup,
  .wdm-industry-casestudy {
    content-visibility: auto;
    contain-intrinsic-size: 1px 600px;
  }
}

/* ─────────────────────────────────────────────────────────────
   10. Smooth scroll for in-page anchor links (industries-served, locations-served)
   ───────────────────────────────────────────────────────────── */

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
