/**
 * acf-local-perks-section — 2×2 guarantee badges + loyalty CTA (Html-css-components/perks-section).
 */

.acf-local-perks-section {
  position: relative;
  padding-block: 0;
  padding-inline: var(--block-pad-inline);
  overflow: hidden;
}

.acf-local-perks-section:not([class*="bpa-local-grass-color--"]) {
  background-color: var(--color-light);
}

/* Flush handoff from additional-services bottom wave (FSE section siblings) */
.acf-local-additional-services-section:has(> .acf-local-additional-services-section__wave--bottom) + .acf-local-perks-section {
  margin-block-start: -4px; /* styleguide-exception: cover wave SVG fringe */
  position: relative;
  z-index: 1;
}

.wp-block-acf-acf-local-additional-services-section:has(.acf-local-additional-services-section__wave--bottom) + .wp-block-acf-acf-local-perks-section {
  margin-block-start: 0 !important;
}

.wp-block-acf-acf-local-additional-services-section:has(.acf-local-additional-services-section__wave--bottom) + .wp-block-acf-acf-local-perks-section .acf-local-perks-section {
  margin-block-start: -4px;
  position: relative;
  z-index: 1;
}

.acf-local-perks-section.alignfull,
.acf-local-perks-section.alignwide {
  inline-size: 100%;
  max-inline-size: none;
  margin-inline: 0;
}

.acf-local-perks-section__inner {
  padding-block: var(--block-pad-block) var(--block-pad-block);
}

.acf-local-perks-section__container {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  padding-inline: 0;
}

.acf-local-perks-section__header {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  align-items: center;
  text-align: center;
}

/* Beat .entry-content h2 { color + font-size } from reset.css */
.acf-local-perks-section h2.acf-local-perks-section__heading {
  margin: 0;
  max-inline-size: 48rem; /* styleguide-exception: prototype heading-max */
  font-family: var(--font-family-serif);
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  text-align: center;
  color: var(--color-brand-forest);
}

.acf-local-perks-section__intro {
  max-inline-size: 42.25rem; /* styleguide-exception: prototype intro 676px */
  font-weight: 500; /* styleguide-exception: prototype .text medium */
  color: #000;
}

/* Dark band — light copy when section background is a dark token. */
.acf-local-perks-section--dark-band h2.acf-local-perks-section__heading,
.acf-local-perks-section--dark-band .acf-local-perks-section__intro,
.acf-local-perks-section--dark-band h3.acf-local-perks-section__card-title,
.acf-local-perks-section--dark-band .acf-local-perks-section__card-text,
.acf-local-perks-section--dark-band .acf-local-perks-section__footer-note {
  color: var(--color-light);
}

.acf-local-perks-section__intro p {
  margin: 0;
}

.acf-local-perks-section__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-lg);
}

.acf-local-perks-section__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  text-align: center;
}

.acf-local-perks-section__badge {
  display: flex;
  justify-content: center;
  inline-size: min(100%, 232px);
}

.acf-local-perks-section__badge-img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  max-inline-size: 232px;
}

/* Beat .entry-content h3 { font-size + color } from reset.css */
.acf-local-perks-section h3.acf-local-perks-section__card-title {
  margin: 0;
  font-family: var(--font-family-base);
  font-size: clamp(1.25rem, 1.1rem + 0.35cqi, 1.875rem); /* styleguide-exception: text-h3-size */
  font-weight: var(--font-weight-bold);
  line-height: 1.19;
  color: var(--color-brand-forest);
}

.acf-local-perks-section__card-text {
  margin: 0;
  max-inline-size: 32.5rem; /* styleguide-exception: perk body 520px */
  font-size: clamp(1rem, 0.95rem + 0.25cqi, 1.25rem); /* styleguide-exception: text-h5-size */
  font-weight: 500; /* styleguide-exception: prototype perk-card__text */
  line-height: 1.3;
  color: var(--color-brand-forest);
}

/* Price Match asterisk. Sits under the 2×2 cards, above the CTA. */
.acf-local-perks-section__footer-note {
  margin: 0;
  max-inline-size: 42.25rem; /* styleguide-exception: match perk intro width */
  align-self: center;
  text-align: center;
  font-weight: 500;
  color: var(--color-muted-text);
}

.acf-local-perks-section__footer-note p {
  margin: 0;
}

.acf-local-perks-section__actions {
  display: flex;
  justify-content: center;
  align-self: center;
}

.acf-local-perks-section__cta.bpa-button.bpa-button--secondary {
  gap: var(--space-xs);
}

.acf-local-perks-section__cta-icon {
  flex-shrink: 0;
  inline-size: 0.875rem;
  block-size: 0.875rem;
  color: var(--color-brand-green);
}

.acf-local-perks-section__wave {
  display: block;
  margin-inline: calc(-1 * var(--block-pad-inline));
  inline-size: calc(100% + (2 * var(--block-pad-inline)));
  line-height: 0;
}

.acf-local-perks-section__wave svg {
  display: block;
  inline-size: 100%;
  block-size: auto;
  min-block-size: 50px; /* styleguide-exception: wave decorative min */
  transform: scaleY(-1);
  margin-block-end: -1px; /* styleguide-exception: cover SVG subpixel fringe */
}

/*
 * Handoff: perks bottom wave → trust logos (memberships_awards).
 * Keep perks wave; overlap trust band to kill hairline below the curve.
 */
.acf-local-perks-section:has(+ .acf-local-trust-logos-section) .acf-local-perks-section__wave,
.wp-block-acf-acf-local-perks-section:has(+ .wp-block-acf-acf-local-trust-logos-section) .acf-local-perks-section__wave {
  margin-block-end: -1px; /* styleguide-exception: cover wave → trust fringe */
}

.acf-local-perks-section + .acf-local-trust-logos-section.acf-local-trust-logos-section--layout-memberships_awards,
.wp-block-acf-acf-local-perks-section + .wp-block-acf-acf-local-trust-logos-section .acf-local-trust-logos-section--layout-memberships_awards {
  margin-block-start: -6px; /* styleguide-exception: cover wave → trust fringe */
  position: relative;
  z-index: 1;
}

/* Perks bottom wave owns the transition — hide duplicate trust top wave. */
.acf-local-perks-section:has(.acf-local-perks-section__wave) + .acf-local-trust-logos-section.acf-local-trust-logos-section--has-top-wave .acf-local-trust-logos-section__wave--top,
.wp-block-acf-acf-local-perks-section:has(.acf-local-perks-section__wave) + .wp-block-acf-acf-local-trust-logos-section .acf-local-trust-logos-section--has-top-wave .acf-local-trust-logos-section__wave--top {
  display: none;
}

.wp-block-acf-acf-local-perks-section + .wp-block-acf-acf-local-trust-logos-section {
  margin-block-start: 0 !important;
}

@media (max-width: 1023px) {
  .acf-local-perks-section__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .acf-local-perks-section {
    padding-inline: var(--space-sm);
  }

  .acf-local-additional-services-section:has(> .acf-local-additional-services-section__wave--bottom) + .acf-local-perks-section {
    margin-block-start: -6px; /* styleguide-exception: tighter mobile seam */
  }

  .wp-block-acf-acf-local-additional-services-section:has(.acf-local-additional-services-section__wave--bottom) + .wp-block-acf-acf-local-perks-section .acf-local-perks-section {
    margin-block-start: -6px;
  }

  .acf-local-perks-section__wave {
    margin-inline: calc(-1 * var(--space-sm));
    inline-size: calc(100% + (2 * var(--space-sm)));
  }

  .acf-local-perks-section h2.acf-local-perks-section__heading {
    font-size: var(--font-size-3xl);
  }
}
