/**
 * Bouw Blocks — Unified Component Styles
 * Consumes tokens from design-tokens.css. NO hardcoded colors/shadows/radii.
 *
 * If you need a value, check design-tokens.css first.
 * If it doesn't exist, add it there — not here.
 */

:root {
  /* Legacy aliases — consumed by blocks, defined by design-tokens.css */
  --bouw-card-bg:     var(--card-bg);
  --bouw-card-border: var(--card-border);
  --bouw-card-shadow: var(--card-shadow);
  --bouw-card-radius: var(--card-radius);
  --bouw-muted:       var(--ink-secondary);
  --bouw-primary:     var(--color-primary);
  --bouw-accent:      var(--color-accent);

  /* Stagger animation timing */
  --stagger-step: 80ms;

  /* Motion token aliases — bouw-blocks uses --duration-* / --ease-*
     which map to the canonical tokens defined in motion.css */
  --duration-fast:   var(--motion-fast, 120ms);
  --duration-normal: var(--motion-medium, 200ms);
  --duration-slow:   var(--motion-slow, 320ms);
  --ease-out-expo:   var(--ease-emphasized, cubic-bezier(0.05, 0.7, 0.1, 1));
}

/* ─── Pure CSS staggered reveal ───
   No JavaScript. Cards fade+slide on paint with incremental delays.
   GPU-only: transform + opacity = 60fps guaranteed. */

@keyframes bouw-reveal-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Every .bouw-reveal child inside a .bouw-stagger container
   plays the reveal animation once on first paint */
.bouw-stagger>.bouw-reveal {
  animation: bouw-reveal-up var(--duration-normal) var(--ease-out-expo) both;
}

/* Staggered delays per child — pure CSS, no JS */
.bouw-stagger>.bouw-reveal:nth-child(1) {
  animation-delay: calc(var(--stagger-step) * 0);
}

.bouw-stagger>.bouw-reveal:nth-child(2) {
  animation-delay: calc(var(--stagger-step) * 1);
}

.bouw-stagger>.bouw-reveal:nth-child(3) {
  animation-delay: calc(var(--stagger-step) * 2);
}

.bouw-stagger>.bouw-reveal:nth-child(4) {
  animation-delay: calc(var(--stagger-step) * 3);
}

.bouw-stagger>.bouw-reveal:nth-child(5) {
  animation-delay: calc(var(--stagger-step) * 4);
}

.bouw-stagger>.bouw-reveal:nth-child(6) {
  animation-delay: calc(var(--stagger-step) * 5);
}

.bouw-stagger>.bouw-reveal:nth-child(7) {
  animation-delay: calc(var(--stagger-step) * 6);
}

.bouw-stagger>.bouw-reveal:nth-child(8) {
  animation-delay: calc(var(--stagger-step) * 7);
}

.bouw-stagger>.bouw-reveal:nth-child(9) {
  animation-delay: calc(var(--stagger-step) * 8);
}

.bouw-stagger>.bouw-reveal:nth-child(10) {
  animation-delay: calc(var(--stagger-step) * 9);
}

.bouw-stagger>.bouw-reveal:nth-child(11) {
  animation-delay: calc(var(--stagger-step) * 10);
}

.bouw-stagger>.bouw-reveal:nth-child(12) {
  animation-delay: calc(var(--stagger-step) * 11);
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .bouw-stagger>.bouw-reveal {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* Shared block wrappers */
/* Block wrappers — override WordPress layout engine.
   WP's is-layout-flow / is-layout-constrained applies display:grid with
   hardcoded gridTemplateColumns on block wrappers, squeezing our inner
   grid containers into a single WP grid cell. Force display:block so
   our own grid/flex layouts control the columns. */
.wp-block-bouw-services-grid,
.wp-block-bouw-realizations-gallery,
.wp-block-bouw-testimonials-grid,
.wp-block-bouw-brands-carousel,
.wp-block-bouw-faq-accordion,
.wp-block-bouw-workflow-steps,
.wp-block-bouw-content-tabs,
.wp-block-bouw-team-members,
.wp-block-bouw-accordion {
  display: block !important;
  /* Kill WP's unwanted grid */
  grid-template-columns: none !important;
  /* Belt + suspenders */
  margin: clamp(2.5rem, 6vw, 4rem) auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
  width: min(100%, 1200px);
}

/* When these blocks are placed inside a padded wp-block-group (section),
   the section already provides vertical breathing room via padding.
   Zeroing vertical margin prevents double-stacking that creates large
   white-space gaps between sections (e.g. services → realisaties). */
.wp-block-group > .wp-block-bouw-services-grid,
.wp-block-group > .wp-block-bouw-realizations-gallery,
.wp-block-group > .wp-block-bouw-testimonials-grid,
.wp-block-group > .wp-block-bouw-faq-accordion,
.wp-block-group > .wp-block-bouw-workflow-steps,
.wp-block-group > .wp-block-bouw-team-members {
  margin-top: 0;
  margin-bottom: 0;
}

/* Realizations gallery is always placed inside a constrained wp-block-group
   that provides its own left/right padding (2rem) and max-width (contentSize).
   The shared wrapper rule above adds extra padding-inline, margin auto and a
   conflicting max-width — all of which we reset here so the gallery fills 100%
   of its parent content-box without cropping the right column. */
.wp-block-bouw-realizations-gallery {
  padding-inline: 0;
  width: 100%;
  max-width: 100%;
  margin-top: 0;
  margin-bottom: 0;
}

/* Core grid layout helpers for block containers
   NOTE: per-instance <style> from render.php sets exact column counts via repeat(N, 1fr).
   This global CSS acts as a sensible fallback for blocks without per-instance overrides. */
.bouw-services-grid-container,
.bouw-realizations-gallery-container,
.bouw-testimonials-grid-container,
.bouw-team-members-container {
  display: grid;
  gap: clamp(0.75rem, 2vw, 1.25rem);
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* Masonry layout override — CSS columns need display:block, not grid.
   The .bouw-gallery-masonry class is added by render.php when galleryStyle="masonry" */
.bouw-realizations-gallery-container.bouw-gallery-masonry {
  display: block;
  grid-template-columns: none;
}

@media (min-width: 1024px) {

  .bouw-services-grid-container,
  .bouw-realizations-gallery-container,
  .bouw-testimonials-grid-container,
  .bouw-team-members-container {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

/* Base card — consumes design tokens */
.bouw-card {
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  transition: transform var(--transition-base),
              box-shadow var(--transition-base);
}

.bouw-card:hover {
  transform: var(--hover-lift);
  box-shadow: var(--card-shadow-hover);
}

.bouw-card-body {
  padding: var(--card-padding, var(--space-lg));
}

.bouw-card-footer {
  padding: 0 var(--card-padding, var(--space-lg)) var(--card-padding, var(--space-lg));
}

/* Buttons — tokens */
.bouw-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: var(--btn-radius);
  padding: var(--btn-padding);
  font-weight: var(--btn-font-weight);
  font-family: var(--font-body);
  text-decoration: none;
  transition: var(--btn-transition);
  cursor: pointer;
}

.bouw-btn:active {
  transform: var(--hover-press);
}

.bouw-btn-primary {
  background: var(--color-primary);
  color: var(--ink-inverse);
}

.bouw-btn-primary:hover {
  transform: var(--hover-lift);
  box-shadow: var(--shadow-md);
  background: var(--color-primary-dark);
}

/* Services grid */
.bouw-services-grid-container {
  gap: var(--bouw-grid-gap, clamp(0.75rem, 2vw, 1rem));
}

.bouw-service-card {
  height: 100%;
}

.bouw-service-card .bouw-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
  min-width: 0;
  min-height: 380px;
  position: relative;
  overflow: hidden;
  border: none;
  border-radius: var(--card-radius);
  box-shadow: none;
  transition: transform var(--transition-base),
    box-shadow var(--transition-base);
}

.bouw-service-card .bouw-card:hover {
  transform: var(--hover-lift);
  box-shadow: var(--shadow-lg);
}

.bouw-service-card .bouw-card:hover .bouw-card-image img {
  transform: scale(1.05);
}

.bouw-service-card .bouw-card-image {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.bouw-service-card .bouw-card-image-link {
  display: block;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.bouw-service-card .bouw-card-image-link:focus-visible {
  outline: 3px solid var(--color-accent, #f7941d);
  outline-offset: -3px;
}

/* Override composition.css max-height/aspect-ratio for photo-background cards */
.bouw-service-card--has-image .bouw-card-image {
  aspect-ratio: auto !important;
  max-height: none !important;
  height: 100% !important;
  width: 100%;
}

.bouw-service-card .bouw-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 1;
  transition: transform var(--duration-slow) var(--ease-out-expo);
}

.bouw-service-card .bouw-card-body {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  margin: 0;
  min-width: 0;
  height: 100%;
  padding: 1.25rem 1rem;
}

.bouw-service-card .bouw-card-footer {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding: 0 1rem 1.25rem;
}

/* Ensure service card footer button fully visible, never clipped */
.bouw-service-card .bouw-btn-primary {
  display: inline-flex;
  white-space: nowrap;
  line-height: 1.2;
  margin-bottom: 0;
}

/* Gradient overlay — softer, let the photos shine */
.bouw-service-card .bouw-card::before {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
      color-mix(in srgb, black 70%, transparent) 0%,
      color-mix(in srgb, black 25%, transparent) 40%,
      color-mix(in srgb, black 5%, transparent) 70%,
      transparent 100%);
  z-index: 1;
  transition: background var(--duration-normal) var(--ease-out-expo);
}

.bouw-service-card .bouw-card:hover::before {
  background: linear-gradient(to top,
      color-mix(in srgb, black 75%, transparent) 0%,
      color-mix(in srgb, black 30%, transparent) 45%,
      color-mix(in srgb, black 8%, transparent) 70%,
      transparent 100%);
}

.bouw-service-icon-wrapper {
  display: none;
}

.bouw-service-title {
  text-align: left;
  font-size: 1.25rem;
  font-weight: 700;
  color: inherit;
  margin: 0 0 0.25rem;
  width: 100%;
  line-height: 1.25;
}

.bouw-service-description {
  text-align: left;
  color: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  width: 100%;
  max-width: 100%;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  text-shadow: var(--shadow-xs);
}

.bouw-service-description p,
.bouw-service-description li {
  margin: 0 0 0.25rem 0;
}

/* Service card CTA button — solid primary on ALL viewports.
   Previous semi-transparent glass was near-invisible against dark photo overlays. */
.bouw-service-card .bouw-btn-primary {
  background: var(--color-primary, #1565c0);
  color: var(--ink-inverse, #fff);
  border: none;
  font-size: 0.85rem;
  padding: 0.5rem 0.9rem;
  box-shadow: var(--shadow-md);
}

.bouw-service-card .bouw-btn-primary:hover {
  background: var(--color-primary-dark, #0d47a1);
  box-shadow: var(--shadow-lg);
}

.bouw-project-description,
.bouw-testimonial-text {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Service card — Styled fallback (when no photo available) */
.bouw-service-fallback-bg {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--color-primary-dark, #0d47a1) 0%, var(--color-primary, #1565c0) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bouw-service-fallback-icon {
  font-size: 3rem;
  color: var(--ink-inverse-subtle, rgba(255, 255, 255, 0.2));
}

/* ─── Service cards — mobile layout fix ───
   On mobile the card is photo-dominant (position:absolute image behind content).
   The default min-height:380px makes cards too tall and the button drifts away
   from the text. On small screens we switch to a stacked image-on-top layout:
   image is a fixed-height band, content sits below it in normal flow. */

@media (max-width: 767px) {

  /* Reduce minimum height — 220px image + ~150px content is plenty */
  .bouw-service-card .bouw-card {
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
  }

  /* Image band: fixed height on mobile instead of filling the whole card */
  .bouw-service-card .bouw-card-image {
    position: relative;
    inset: unset;
    width: 100%;
    height: 200px;
    flex-shrink: 0;
  }

  /* Same fix for has-image variant — reset the absolute-fill overrides */
  .bouw-service-card--has-image .bouw-card-image {
    position: relative !important;
    inset: unset !important;
    height: 200px !important;
    max-height: 200px !important;
    aspect-ratio: unset !important;
  }

  /* Image fills the band */
  .bouw-service-card .bouw-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Gradient overlay — re-anchor to image band bottom */
  .bouw-service-card .bouw-card::before {
    height: 200px;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    background: linear-gradient(to top,
        color-mix(in srgb, black 40%, transparent) 0%,
        transparent 60%);
    z-index: 1;
  }

  /* Card body: normal flow below the image, not overlaid */
  .bouw-service-card .bouw-card-body {
    position: relative;
    z-index: 2;
    height: auto;
    justify-content: flex-start;
    padding: 0.9rem 1rem 0.5rem;
    background: var(--card-bg, #fff);
    color: var(--ink-primary, #1e293b);
  }

  /* Title readable on white background */
  .bouw-service-card .bouw-service-title,
  .bouw-service-card .bouw-service-title a {
    color: var(--ink-primary, #1e293b);
    text-shadow: none;
  }

  /* Description readable on white background */
  .bouw-service-card .bouw-service-description {
    color: var(--ink-secondary, #475569);
    text-shadow: none;
  }

  /* Footer: snug below description, no gap */
  .bouw-service-card .bouw-card-footer {
    position: relative;
    z-index: 2;
    padding: 0 1rem 1rem;
    margin-top: 0.5rem;
    background: var(--card-bg, #fff);
  }

  /* Button: solid style on white background, full-width for easy tapping */
  .bouw-service-card .bouw-btn-primary {
    background: var(--color-primary, #1565c0);
    color: var(--ink-inverse, #fff);
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    width: 100%;
    justify-content: center;
    padding: 0.6rem 1rem;
  }

  .bouw-service-card .bouw-btn-primary:hover {
    background: var(--color-primary-dark, #0d47a1);
    border-color: transparent;
  }
}

/* "Bekijk alle diensten" link */
.bouw-services-more,
.bouw-gallery-more {
  text-align: center;
  margin-top: 1.5rem;
}

.bouw-more-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--bouw-primary);
  text-decoration: none;
  font-size: 1rem;
  transition: gap var(--duration-fast) var(--ease-out-expo);
}

.bouw-more-link:hover {
  gap: 0.7rem;
}

.bouw-more-arrow {
  transition: transform 0.2s ease;
}

.bouw-more-link:hover .bouw-more-arrow {
  transform: translateX(3px);
}

.bouw-service-link {
  color: inherit;
  text-decoration: none;
}

/* P2: Universal grid orphan centering — works on any grid container */
.bouw-grid--center-orphans {
  justify-content: center;
}

/* Orphan centering: only the last row's incomplete items, NOT all items.
   justify-items: center breaks all cards to content-width.
   Instead, we keep justify-content: center on the wrapper (above)
   and ensure grid items always stretch to fill their columns. */
.bouw-grid--center-orphans>.bouw-services-grid-container,
.bouw-grid--center-orphans>.bouw-team-members-container,
.bouw-grid--center-orphans>.bouw-testimonials-grid-container,
.bouw-grid--center-orphans .bouw-realizations-gallery-container {
  justify-items: stretch;
}

/* Realisations gallery */
/* ── Realisaties Gallery ── */
.bouw-realizations-gallery-container {
  gap: var(--bouw-grid-gap, 0.75rem);
}

/* Card: photo-dominant with thin text strip */
.bouw-project-card .bouw-card {
  overflow: hidden;
  padding: 0;
  border-radius: var(--card-radius);
  position: relative;
  transition: transform var(--transition-base),
    box-shadow var(--transition-base);
}

.bouw-project-card .bouw-card:hover {
  transform: var(--hover-lift);
  box-shadow: var(--shadow-hover);
}

.bouw-project-card .bouw-card:hover .bouw-project-image img {
  transform: scale(1.05);
}

.bouw-project-image {
  overflow: hidden;
  line-height: 0;
}

.bouw-project-main-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform var(--duration-slow) var(--ease-out-expo);
  object-fit: cover;
  will-change: transform;
}

.bouw-project-card:hover .bouw-project-main-image {
  transform: scale(1.04);
}

/* Compact text strip below photo */
.bouw-project-card .bouw-card-body {
  padding: 0.5rem 0.65rem 0.55rem;
  background: var(--bouw-base, #fff);
}

.bouw-project-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
  color: var(--bouw-contrast, #1e293b);
  line-height: 1.3;
}

.bouw-project-description {
  color: var(--bouw-muted);
  font-size: 0.85rem;
  line-height: 1.45;
  margin-top: 0.2rem;
}

.bouw-project-location-inline {
  font-size: 0.75rem;
  color: var(--bouw-muted, #94a3b8);
  display: block;
  margin-top: 0.1rem;
}

.bouw-project-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  color: var(--bouw-muted, #64748b);
  font-size: 0.8rem;
  margin-top: 0.35rem;
}

/* Tag pill — used across realisaties + other blocks */
.bouw-project-tag {
  margin-bottom: 0.2rem;
}

.bouw-tag-label {
  display: inline-block;
  background: var(--bouw-color-surface, #f1f5f9);
  color: var(--bouw-color-primary, #1565c0);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Grid mode: uniform aspect ratio */
.bouw-gallery-grid .bouw-project-image {
  aspect-ratio: 4 / 3;
}

/* Masonry mode: natural image heights — CSS Columns for masonry.
   NOTE: render.php puts both bouw-gallery-masonry and bouw-realizations-gallery-container
   on the SAME element, so we need compound selectors (no space). */
.bouw-realizations-gallery-container.bouw-gallery-masonry {
  display: block;
  columns: 3 280px;
  column-gap: 1rem;
}

.bouw-gallery-masonry .bouw-project-card {
  break-inside: avoid;
  margin-bottom: 1rem;
  display: inline-block;
  width: 100%;
}

.bouw-gallery-masonry .bouw-project-image {
  aspect-ratio: auto;
}

.bouw-gallery-masonry .bouw-project-main-image {
  height: auto;
}

/* Masonry visual rhythm: vary card heights for interest when images share aspect ratios */
.bouw-gallery-masonry .bouw-project-card:nth-child(3n+1) .bouw-project-image {
  aspect-ratio: 4 / 5;
}
.bouw-gallery-masonry .bouw-project-card:nth-child(3n+2) .bouw-project-image {
  aspect-ratio: 3 / 2;
}
.bouw-gallery-masonry .bouw-project-card:nth-child(3n+3) .bouw-project-image {
  aspect-ratio: 1 / 1;
}
.bouw-gallery-masonry .bouw-project-card:nth-child(5n+4) .bouw-project-image {
  aspect-ratio: 2 / 3;
}
.bouw-gallery-masonry .bouw-project-card:nth-child(7n) .bouw-project-image {
  aspect-ratio: 16 / 9;
}

/* Legacy badge — keep for backward compat, hidden by default */
.bouw-project-badge {
  display: none;
}

/* Testimonials */
.bouw-testimonials-grid-container {
  gap: clamp(1rem, 2.5vw, 1.5rem);
}

.bouw-testimonial-card .bouw-card {
  height: 100%;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  /* Fix runaway quote icons */
  transition: transform var(--duration-normal) var(--ease-out-expo),
    box-shadow var(--duration-normal) var(--ease-out-expo);
}

.bouw-testimonial-card .bouw-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.bouw-testimonial-card .bouw-card-body {
  padding: 1.25rem;
}

/* Avatar — photo or initials fallback */
.bouw-testimonial-avatar {
  margin-bottom: 0.75rem;
}

.bouw-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.bouw-avatar-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--bouw-base, #fff);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.bouw-testimonial-text {
  color: var(--bouw-contrast, #334155);
  line-height: 1.55;
  font-size: 0.95rem;
  margin: 0 0 0.75rem;
  font-style: italic;
}

.bouw-testimonial-meta {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--bouw-muted, #475569);
  flex-wrap: wrap;
}

.bouw-testimonial-name {
  font-weight: 600;
  color: var(--bouw-contrast, #1e293b);
}

.bouw-testimonial-location {
  color: var(--bouw-muted, #94a3b8);
}

.bouw-testimonial-location::before {
  content: "·";
  margin-right: 0.35rem;
}

.bouw-testimonial-rating {
  margin-top: 0.5rem;
}

.bouw-testimonial-rating .bouw-rating-stars {
  color: var(--bouw-rating-star, #f59e0b);
  font-size: 0.85rem;
}

/* Brands — Grid mode (static flex row, no JS) */
.bouw-brands-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding: 1.5rem 0;
}

.bouw-brand-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  height: 60px;
}

.bouw-brand-tile img {
  max-height: 50px;
  max-width: 140px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(0.3);
  opacity: 0.9;
  transition: filter 0.3s ease, opacity 0.3s ease;
}

.bouw-brand-tile:hover img {
  filter: grayscale(0);
  opacity: 1;
}

/* Brands — Styled fallback tile (when no logo available) */
.bouw-brand-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  padding: 0.5rem 1.5rem;
  background: var(--bouw-color-surface, #f7f8fa);
  border: var(--card-border);
  border-radius: 8px;
  transition: transform var(--duration-fast) var(--ease-out-expo),
    border-color var(--duration-fast) var(--ease-out-expo);
}

.bouw-brand-tile:hover .bouw-brand-fallback {
  transform: translateY(-2px);
  border-color: var(--color-primary-light, var(--color-primary));
}

.bouw-brand-fallback-name {
  font-family: var(--bouw-font-family-heading, "Montserrat", sans-serif);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--bouw-color-muted, #64748b);
  white-space: nowrap;
}

/* Brands — Carousel mode (original) */
.bouw-brands-carousel .bouw-brand-card {
  background: transparent;
  border: none;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bouw-brands-carousel .bouw-brand-card:hover {
  transform: translateY(-2px);
  box-shadow: none;
}

.bouw-brands-carousel img {
  max-height: 46px;
  width: auto;
  filter: grayscale(1);
  opacity: 0.85;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.bouw-brands-carousel .bouw-brand-card:hover img {
  filter: grayscale(0);
  opacity: 1;
}

/* ─── Accordion / FAQ ─── */
.bouw-accordion,
.bouw-faq-accordion {
  display: grid;
  gap: 0.75rem;
}

/* Legacy accordion item classes */
.bouw-accordion-item,
.bouw-faq-accordion .bouw-accordion-item {
  border: 1px solid var(--bouw-card-border, #e2e8f0);
  border-radius: 12px;
  background: var(--bouw-base, #fff);
}

.bouw-accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--bouw-contrast, #0f172a);
}

.bouw-accordion-content {
  padding: 0.75rem 1.25rem 1.1rem;
  color: var(--bouw-muted, #475569);
}

/* ─── FAQ accordion (render.php classes) ─── */
.bouw-faq-accordion-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.bouw-faq-item {
  border: 1px solid var(--bouw-card-border, #e2e8f0);
  border-radius: 10px;
  background: var(--bouw-base, #fff);
  overflow: hidden;
  transition: border-color var(--duration-normal) var(--ease-out-expo),
    box-shadow var(--duration-normal) var(--ease-out-expo);
}

.bouw-faq-item.bouw-faq-open {
  border-color: var(--bouw-color-primary, #1565c0);
  box-shadow: 0 0 0 1px var(--bouw-color-primary, #1565c0);
}

/* Question heading: reset heading margin */
.bouw-faq-question {
  margin: 0;
  font-size: inherit;
}

/* Button inside heading */
.bouw-faq-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 1.1rem 1.25rem;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-weight: 600;
  font-size: var(--bouw-font-size-base, 1.05rem);
  color: var(--bouw-color-contrast, #1e293b);
  line-height: 1.5;
  gap: 0.75rem;
  transition: background-color 0.15s ease;
}

.bouw-faq-button:hover {
  background: var(--surface-section-alt, #f8fafc);
}

.bouw-faq-question-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.bouw-faq-category {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bouw-color-primary, #1565c0);
  opacity: 0.7;
}

/* Toggle icon */
.bouw-faq-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--surface-section-alt, #f1f5f9);
  color: var(--bouw-color-primary, #1565c0);
  transition: transform 0.25s ease, background-color 0.2s ease;
  font-size: 0.85rem;
}

.bouw-faq-icon .dashicons {
  font-size: 1rem;
  width: 1rem;
  height: 1rem;
  transition: transform var(--duration-normal) var(--ease-out-expo);
}

.bouw-faq-open .bouw-faq-icon {
  background: var(--bouw-color-primary, #1565c0);
  color: var(--bouw-base, #fff);
}

.bouw-faq-open .bouw-faq-icon .dashicons {
  transform: rotate(180deg);
}

/* Answer panel */
.bouw-faq-answer {
  overflow: hidden;
}

.bouw-faq-answer[hidden] {
  display: none;
}

.bouw-faq-answer-content {
  padding: 0.5rem 1.25rem 1.25rem;
  font-size: var(--bouw-font-size-base, 1.05rem);
  line-height: var(--bouw-line-height-normal, 1.7);
  color: var(--bouw-color-muted, #475569);
}

.bouw-faq-answer-content p {
  margin: 0 0 0.5rem;
}

.bouw-faq-answer-content p:last-child {
  margin-bottom: 0;
}

/* Search bar */
.bouw-faq-search {
  margin-bottom: 1rem;
}

.bouw-search-container {
  position: relative;
}

.bouw-search-input {
  width: 100%;
  padding: 0.65rem 0.9rem 0.65rem 2.2rem;
  border: 1px solid var(--bouw-card-border, #e2e8f0);
  border-radius: 8px;
  font-size: 0.88rem;
  background: var(--bouw-base, #fff);
  transition: border-color 0.2s ease;
}

.bouw-search-input:focus {
  outline: none;
  border-color: var(--bouw-color-primary, #1565c0);
  box-shadow: var(--shadow-xs);
}

.bouw-search-icon {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--bouw-muted, #94a3b8);
  font-size: 1rem;
}

/* Team placeholder */
.bouw-member-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--wp--preset--color--primary, #1565c0) 0%, var(--wp--preset--color--accent, #0d47a1) 100%);
  color: var(--bouw-base, #fff);
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
}
.bouw-member-placeholder svg {
  width: 48px;
  height: 48px;
  opacity: 0.95;
}

.bouw-accordion-icon::after {
  content: '+';
  font-size: 1.2rem;
  color: var(--bouw-primary);
}

.bouw-accordion-toggle:checked+.bouw-accordion-header .bouw-accordion-icon::after {
  content: '–';
}

/* ─── Workflow steps ─── */

/* Mobile-first: vertical stack on mobile */
.bouw-workflow-steps-container.bouw-steps-layout-horizontal,
.bouw-workflow-steps-container.bouw-steps-layout-grid {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

/* Mobile-first: Each step stacked vertically */
.bouw-workflow-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
}

/* Step card */
.bouw-workflow-steps .bouw-step-card {
  background: var(--bouw-base, #fff);
  border: 1px solid var(--bouw-card-border, #e2e8f0);
  border-radius: 12px;
  padding: 1.25rem 1rem;
  box-shadow: var(--bouw-card-shadow);
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  transition: transform var(--duration-normal) var(--ease-out-expo),
    box-shadow var(--duration-normal) var(--ease-out-expo);
}

.bouw-workflow-steps .bouw-step-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* Step header: number + icon stacked */
.bouw-step-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

/* Number circle — prominent accent */
.bouw-workflow-steps .bouw-step-number {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: var(--bouw-color-primary, #1565c0);
  color: var(--bouw-base, #fff);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 0;
  position: relative;
  z-index: 2;
  box-shadow: var(--shadow-sm);
}

/* Icon below number */
.bouw-step-icon {
  font-size: 1.4rem;
  color: var(--bouw-color-primary, #1565c0);
  opacity: 0.7;
}

.bouw-step-icon .dashicons {
  font-size: 1.4rem;
  width: 1.4rem;
  height: 1.4rem;
}

/* Step body text */
.bouw-step-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: var(--bouw-contrast, #1e293b);
  line-height: 1.3;
}

.bouw-step-description {
  font-size: 0.82rem;
  color: var(--bouw-muted, #64748b);
  margin: 0;
  line-height: 1.5;
}

/* Duration meta */
.bouw-step-meta {
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--surface-section-alt, #f1f5f9);
}

.bouw-step-duration {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--bouw-muted, #94a3b8);
}

.bouw-step-duration .dashicons {
  font-size: 0.85rem;
  width: 0.85rem;
  height: 0.85rem;
}

/* Mobile-first: Connector for vertical layout */
.bouw-step-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: auto;
  height: 28px;
  align-self: center;
  margin-top: 0;
  transform: rotate(90deg);
  color: var(--bouw-color-primary, #1565c0);
  opacity: 0.35;
}

.bouw-step-connector .dashicons {
  font-size: 1.3rem;
  width: 1.3rem;
  height: 1.3rem;
}

.bouw-connector-line,
.bouw-connector-dash,
.bouw-connector-dots {
  font-size: 1.2rem;
  letter-spacing: -0.05em;
}

/* Arrow connector: nicer custom arrow */
.bouw-connectors-arrow .bouw-step-connector {
  opacity: 0.3;
}

/* Line connector: thin continuous line */
.bouw-connectors-line .bouw-step-connector {
  width: 32px;
}

.bouw-connectors-line .bouw-connector-line {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--bouw-color-primary, #1565c0);
  font-size: 0;
  border-radius: 1px;
}

/* Desktop: horizontal timeline layout */
@media (min-width: 769px) {

  .bouw-workflow-steps-container.bouw-steps-layout-horizontal,
  .bouw-workflow-steps-container.bouw-steps-layout-grid {
    flex-direction: row;
    gap: 0;
  }

  .bouw-workflow-step {
    flex-direction: row;
    align-items: flex-start;
  }

  .bouw-step-connector {
    width: 40px;
    height: auto;
    margin-top: -1rem;
    align-self: center;
    transform: none;
  }
}

/* ─── Vertical layout variant ─── */
.bouw-steps-layout-vertical {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.bouw-steps-layout-vertical .bouw-workflow-step {
  flex-direction: column;
  align-items: stretch;
}

.bouw-steps-layout-vertical .bouw-step-connector {
  width: auto;
  height: 28px;
  margin-top: 0;
  align-self: center;
  transform: rotate(90deg);
}

/* Content tabs */
.bouw-content-tabs .bouw-tab-nav,
.bouw-content-tabs .bouw-tabs-container {
  gap: 0.75rem;
}

.bouw-content-tabs .bouw-tab-button {
  border-radius: 3px;
  padding: 0.65rem 1.5rem;
  background: var(--surface-primary-tint, #e9f2ff);
  color: var(--bouw-primary);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.bouw-content-tabs .bouw-tab-button:hover:not(.bouw-tab-active) {
  background: var(--surface-primary-tint-hover, #d4e5ff);
  border-color: var(--bouw-primary);
}

.bouw-content-tabs .bouw-tab-button.bouw-tab-active {
  background: var(--bouw-primary);
  color: var(--bouw-base, #fff);
}

.bouw-content-tabs .bouw-tab-button .bouw-tab-icon {
  font-size: 1rem;
  width: 1.25rem;
  height: 1.25rem;
  line-height: 1.25;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bouw-content-tabs .bouw-tab-button .dashicons {
  font-size: 1rem;
  width: 1.25rem;
  height: 1.25rem;
  line-height: 1.25;
}

.bouw-content-tabs .bouw-tab-panel {
  background: var(--bouw-base, #fff);
  border: 1px solid var(--bouw-card-border);
  border-radius: 3px;
  padding: 1.5rem;
  margin-top: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--bouw-contrast, #374151);
}

.bouw-content-tabs .bouw-tab-content {
  display: block;
  padding: 0;
}

.bouw-content-tabs .bouw-tab-panel[hidden] {
  display: none !important;
}

/* Tab panel empty state — prevent empty white boxes */
.bouw-content-tabs .bouw-tab-panel-content:empty,
.bouw-content-tabs .bouw-tab-panel-content > p:only-child:empty {
  display: none;
}

/* Terms grid inside tabs */
.bouw-tab-terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.bouw-term-card {
  display: block;
  padding: 1rem;
  border-radius: 10px;
  background: var(--wp--preset--color--surface, #f7f8fa);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease, transform 0.2s ease;
}

.bouw-term-card:hover {
  background: var(--surface-primary-tint, #e9f2ff);
  transform: translateY(-2px);
}

.bouw-term-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.bouw-term-desc {
  font-size: 0.875rem;
  color: var(--bouw-muted);
  line-height: 1.5;
}

.bouw-tab-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.bouw-tab-links a {
  display: block;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  background: var(--surface-section-alt, #f1f5f9);
  color: var(--bouw-contrast, #0f172a);
  text-decoration: none;
  font-weight: 600;
}

.bouw-tab-links a:hover {
  background: var(--bouw-card-border, #e2e8f0);
}

/* Taxonomy Terms Grid in Tabs */
.bouw-tab-terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.bouw-term-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  background: var(--bouw-base, #fff);
  border: 1px solid var(--bouw-card-border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--bouw-contrast, #1e293b);
  min-height: 140px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Add a subtle decorative background image or gradient to the cards so the bottom area isn't completely imageless */
.bouw-term-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--color-primary) 3%, transparent) 0%, color-mix(in srgb, var(--color-primary) 8%, transparent) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.bouw-term-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--bouw-color-primary, #1565c0);
}

.bouw-term-card:hover::before {
  opacity: 1;
}

.bouw-term-title,
.bouw-term-desc {
  position: relative;
  z-index: 1;
}

.bouw-term-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--bouw-contrast, #0f172a);
}

.bouw-term-desc {
  font-size: 0.9rem;
  color: var(--bouw-muted, #475569);
  line-height: 1.5;
  margin: 0;
}

/* Team members */
.bouw-team-members .bouw-card {
  height: 100%;
  padding: 0;
  transition: transform var(--duration-normal) var(--ease-out-expo),
    box-shadow var(--duration-normal) var(--ease-out-expo);
}

.bouw-team-members .bouw-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.bouw-team-members .bouw-card-body {
  padding: 1.25rem 1rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.bouw-member-card {
  height: 100%;
  overflow: hidden;
}

.bouw-team-members .bouw-member-image {
  border-radius: 999px;
  width: 96px;
  height: 96px;
  object-fit: cover;
  margin-bottom: 0.75rem;
}

.bouw-team-members .bouw-member-name {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.bouw-team-members .bouw-member-position {
  color: var(--bouw-muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  text-align: center;
}

/* Ensure all team card child elements are centered */
.bouw-team-members .bouw-member-card,
.bouw-team-members .bouw-member-card > * {
  text-align: center;
}

.bouw-team-members .bouw-member-contact {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* WCAG 2.5.5 / Lighthouse: touch targets min 24×24px with 24px spacing */
.bouw-contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;  /* iOS HIG minimum */
  min-height: 44px;
  padding: 8px;
}

/* P1-2: Team member skills — tags need visible separation */
.bouw-member-skills {
  margin-top: 0.5rem;
}

.bouw-skills-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bouw-color-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.35rem;
}

.bouw-skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.bouw-skill-tag {
  display: inline-block;
  background: var(--bouw-color-surface, #f7f8fa);
  color: var(--bouw-color-primary, #1565c0);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
}

/* ─── Trust Bar Block ─── */

/* Main container - inline positioning for hero integration */
.bouw-trust-bar {
  background: transparent;
  width: 100%;
  overflow: hidden;
  padding: 1rem 0;
  margin: 0;
  color: var(--bouw-contrast, #1e293b);
}

/* Editor version - position relative for editing experience */
.bouw-trust-bar-editor {
  position: relative !important;
  width: 100% !important;
}

/* Content wrapper */
.bouw-trust-content {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* Mobile-first: Scrolling items container - for marquee animation */
.bouw-trust-items {
  display: flex;
  gap: 2rem;
  animation: trust-scroll var(--trust-bar-speed, 25s) linear infinite;
  animation-direction: var(--trust-bar-direction, normal);
  width: max-content;
  align-items: center;
}

/* Pause on hover */
.bouw-trust-bar:hover .bouw-trust-items {
  animation-play-state: paused;
}

/* Mobile-first: Individual trust item */
.bouw-trust-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0 0.5rem;
}

/* Mobile-first: Icon styling */
.bouw-trust-icon {
  font-size: 1.25rem;
  color: var(--bouw-primary, #1565c0); /* SVGs use fill="currentColor" — inherit this */
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
}

.bouw-trust-icon.dashicons {
  font-size: 1.5rem;
  width: 1.5rem;
  height: 1.5rem;
  line-height: 1;
}

.bouw-trust-icon.dashicons {
  font-size: 1.5rem;
  width: 1.5rem;
  height: 1.5rem;
  line-height: 1;
}

/* Text container */
.bouw-trust-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

/* Mobile-first: Title (main text) */
.bouw-trust-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--wp--preset--color--contrast, #171717);
  line-height: 1.2;
}

/* Mobile-first: Subtitle (smaller text) */
.bouw-trust-subtitle {
  font-size: 0.7rem;
  color: var(--ink-secondary);
  line-height: 1.2;
}

/* Scroll animation - moves exactly 50% since we duplicate items */
@keyframes trust-scroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

/* Reverse scroll animation */
.bouw-trust-bar[style*="reverse"] .bouw-trust-items {
  animation-direction: reverse;
}

/* Desktop: larger sizes */
@media (min-width: 769px) {
  .bouw-trust-item {
    padding: 0 1rem;
  }

  .bouw-trust-icon {
    font-size: 1.5rem;
  }

  .bouw-trust-title {
    font-size: 0.95rem;
  }

  .bouw-trust-subtitle {
    font-size: 0.75rem;
  }

  .bouw-trust-items {
    gap: 3rem;
  }
}
