/* ==========================================================================
   Location pages — Des Moines / Granger
   Local hero, info card, services list, map, partners strip.
   ========================================================================== */

.loc-hero {
  position: relative;
  background: var(--c-ink);
  color: var(--c-paper);
  overflow: hidden;
  isolation: isolate;
}

.loc-hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.loc-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.loc-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(17, 17, 17, 0.45) 0%,
    rgba(17, 17, 17, 0.7) 100%
  );
}

.loc-hero__inner {
  position: relative;
  z-index: 2;
  padding-block: var(--s-16) var(--s-12);
  display: grid;
  gap: var(--s-10);
  grid-template-columns: 1fr;
}

@media (min-width: 880px) {
  .loc-hero__inner {
    grid-template-columns: 1.4fr 1fr;
    align-items: end;
    padding-block: var(--s-20) var(--s-16);
  }
}

.loc-hero__title {
  font-size: var(--fs-display);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  color: var(--c-paper);
  margin-bottom: var(--s-4);
}

.loc-hero__subtitle {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.88);
  max-width: 50ch;
  margin-bottom: var(--s-8);
}

.loc-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

@media (max-width: 480px) {
  .loc-hero__actions .btn {
    width: 100%;
  }
}

/* Side info card — appears beside the hero */
.loc-info {
  background: var(--c-paper);
  color: var(--c-ink);
  border-radius: var(--radius);
  padding: var(--s-8);
  box-shadow: var(--shadow-lift);
}

.loc-info h2 {
  font-size: var(--fs-h3);
  color: var(--c-ink);
  margin-bottom: var(--s-4);
}

.loc-info address {
  font-style: normal;
  color: var(--c-charcoal);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--s-5);
}

.loc-info dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--s-2) var(--s-5);
  margin: 0 0 var(--s-5);
  font-size: var(--fs-small);
}
.loc-info dt {
  font-weight: var(--fw-semibold);
  color: var(--c-ink);
}
.loc-info dd {
  margin: 0;
  color: var(--c-charcoal);
}

.loc-info__cta {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

/* ---------- Certification strip ---------- */
.cert-strip {
  background: var(--c-fog);
  padding-block: var(--s-10);
  border-bottom: 1px solid var(--c-mist);
}

.cert-strip__intro {
  text-align: center;
  margin-bottom: var(--s-8);
}

.cert-strip__intro h2 {
  font-size: var(--fs-h3);
  margin-bottom: var(--s-2);
}

.cert-strip__intro p {
  color: var(--c-slate);
  max-width: 60ch;
  margin: 0 auto;
}

.cert-strip__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-3);
  /* Constrain so wrap behavior creates balanced rows. 
     ~6 pills per row at 1200px, ~4 at 800px, ~2 at 480px. */
  max-width: 1100px;
  margin-inline: auto;
}

.cert-pill,
.cert-logo {
  background: var(--c-paper);
  border: 1px solid var(--c-mist);
  border-radius: var(--radius);
  text-align: center;
  flex: 0 0 auto;
  width: 160px;
  max-width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

/* On narrow viewports, let tiles flex to two-up so we never overflow. */
@media (max-width: 480px) {
  .cert-pill,
  .cert-logo {
    width: calc(50% - var(--s-3) / 2);
  }
}

.cert-pill:hover,
.cert-logo:hover {
  border-color: var(--c-signal);
  transform: translateY(-1px);
}

.cert-pill {
  padding: var(--s-4) var(--s-5);
  font-weight: var(--fw-semibold);
  color: var(--c-ink);
  font-size: var(--fs-small);
  letter-spacing: 0.04em;
}

.cert-pill__type {
  display: block;
  font-size: 0.6875rem;
  font-weight: var(--fw-bold);
  color: var(--c-signal);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* Logo tile — same footprint as a pill, with the SVG centered.
   Fixed height so logos and pills wrap into tidy uniform rows. */
.cert-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: var(--s-3) var(--s-4);
  height: 96px;
}

.cert-logo__type {
  font-size: 0.6875rem;
  font-weight: var(--fw-bold);
  color: var(--c-signal);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
}

/* Default logo size — normalized so all single-logo tiles have similar
   optical weight regardless of the source logo's intrinsic aspect ratio. */
.cert-logo__img {
  display: block;
  max-width: 100%;
  max-height: 52px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Square-format logos (I-CAR Gold Class seal, ASE gear) read too "loud" at
   the default height because they're high-contrast circular marks. Cap them
   slightly smaller so they don't overpower the wide wordmark logos. */
.cert-logo--square .cert-logo__img {
  max-height: 60px;
  max-width: 72px;
}

/* Wide wordmark logos (Assured Performance, Volvo) need more horizontal
   space to read; they're not as tall, so we let them go a bit wider. */
.cert-logo--wide .cert-logo__img {
  max-height: 32px;
}

/* Variant for logos that sit on a pure-white card so light marks don't
   disappear into the section's grey background. */
.cert-logo--filled {
  background: #ffffff;
  border-color: var(--c-mist);
  box-shadow: 0 1px 2px rgba(11, 95, 255, 0.04);
}

/* Pair of logos in one tile — used for INFINITI/Nissan and Jaguar/Land Rover. */
.cert-logo--pair {
  padding: var(--s-2) var(--s-3);
}
.cert-logo__pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-4);
  width: 100%;
  flex: 1 1 auto;
}
.cert-logo--pair .cert-logo__img {
  max-height: 44px;
  max-width: 50%;
}

/* ---------- Local services list ---------- */
.loc-services {
  display: grid;
  gap: var(--s-5);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .loc-services {
    grid-template-columns: repeat(2, 1fr);
  }
}

.loc-service {
  display: flex;
  gap: var(--s-4);
  padding: var(--s-5);
  background: var(--c-paper);
  border: 1px solid var(--c-mist);
  border-radius: var(--radius);
  transition:
    transform var(--motion-base) var(--easing),
    box-shadow var(--motion-base) var(--easing),
    border-color var(--motion-base) var(--easing);
}

.loc-service:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: var(--c-signal);
}

.loc-service__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--c-signal-soft);
  color: var(--c-signal);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--fw-bold);
  font-size: 1.125rem;
}

.loc-service__title {
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  color: var(--c-ink);
  margin-bottom: 2px;
}

.loc-service__desc {
  color: var(--c-slate);
  font-size: var(--fs-small);
  margin: 0;
  line-height: var(--lh-relaxed);
}

/* ---------- Map (loc-map: legacy, may not be used anywhere now) ---------- */
.loc-map {
  width: 100%;
  aspect-ratio: 16 / 7;
  border: 0;
  border-radius: var(--radius);
  display: block;
  background: var(--c-mist);
}

@media (max-width: 640px) {
  .loc-map {
    aspect-ratio: 4 / 3;
  }
}

/* Lazy-loaded map styling lives in lazy-map.css (loaded by all map-using pages) */

/* ---------- Insurance partners strip ---------- */
.partners-strip {
  text-align: center;
}

.partners-strip__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-3);
  margin-top: var(--s-5);
}

.partner-pill {
  background: var(--c-paper);
  border: 1px solid var(--c-mist);
  border-radius: 999px;
  padding: var(--s-2) var(--s-5);
  font-weight: var(--fw-semibold);
  color: var(--c-ink);
  font-size: var(--fs-small);
}

.partner-pill--highlight {
  background: var(--c-signal-soft);
  border-color: var(--c-signal);
  color: var(--c-signal-deep);
}

/* ---------- Insurance partner LOGO grid (two-tier: DRP / others) ---------- */
.partners-tier {
  margin-top: var(--s-8);
}

.partners-tier + .partners-tier {
  margin-top: var(--s-12);
}

.partners-tier__label {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-family: inherit;
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-slate);
  margin: 0 0 var(--s-5);
  max-width: none;
}

/* Stop the label text from wrapping mid-phrase between the two
   divider rules. The label sits in its own flex item, the rules
   take up the rest. */
.partners-tier__label > span {
  white-space: nowrap;
  flex-shrink: 0;
}

.partners-tier--drp .partners-tier__label {
  color: var(--c-signal-deep);
}

.partners-tier__label::before,
.partners-tier__label::after {
  content: "";
  flex: 1 1 4rem;
  height: 1px;
  background: var(--c-mist);
}

.partners-tier__label--centered,
.partners-tier__label {
  /* Match width across tiers so divider rules don't differ in length
     between DRP and 'Other' tier headings. */
  width: 100%;
  max-width: 32rem;
  margin-inline: auto;
  margin-bottom: var(--s-5);
}

/* Both tiers share a content frame and use a flex layout. By giving
   tiles a fixed `flex-basis` plus `flex-grow: 0`, the row holds its
   shape and trailing items naturally center via `justify-content: center`
   on the parent. No nth-child gymnastics needed.

   Tile target widths:
     >=720px : ~200px tiles → 3 fit per row in a 720px container
     <720px  : 50% width tiles (2-up)
     <420px  : 100% width tiles (1-up) for very narrow phones
*/
.partners-tier__grid {
  max-width: 720px;
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-3);
}

.partners-tier--drp .partners-tier__grid {
  gap: var(--s-4);
}

.partners-tier__grid > .partner-logo {
  flex: 0 0 auto;
  width: calc(33.333% - var(--s-3) * 2 / 3);
}

.partners-tier--drp .partners-tier__grid > .partner-logo {
  width: calc(33.333% - var(--s-4) * 2 / 3);
}

@media (max-width: 720px) {
  .partners-tier__grid > .partner-logo,
  .partners-tier--drp .partners-tier__grid > .partner-logo {
    width: calc(50% - var(--s-3) / 2);
  }
  .partners-tier--drp .partners-tier__grid > .partner-logo {
    width: calc(50% - var(--s-4) / 2);
  }
}

@media (max-width: 420px) {
  .partners-tier__grid > .partner-logo,
  .partners-tier--drp .partners-tier__grid > .partner-logo {
    width: 100%;
  }
}

.partner-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-paper);
  border: 1px solid var(--c-mist);
  border-radius: 12px;
  padding: var(--s-4) var(--s-5);
  min-height: 72px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.partner-logo:hover {
  border-color: var(--c-slate);
}

.partners-tier--drp .partner-logo {
  background: var(--c-paper);
  border-color: var(--c-signal);
  box-shadow: 0 0 0 3px var(--c-signal-soft);
  min-height: 88px;
  padding: var(--s-5) var(--s-6);
}

.partner-logo__img {
  width: 100%;
  height: 40px;
  max-height: 40px;
  object-fit: contain;
  object-position: center;
}

/* USAA is square; cap its rendered height a bit shorter so it doesn't
   visually dwarf horizontal wordmarks beside it. */
.partner-logo__img--square {
  height: 44px;
  max-height: 44px;
}

.partners-tier--drp .partner-logo__img {
  height: 48px;
  max-height: 48px;
}

.partners-tier--drp .partner-logo__img--square {
  height: 52px;
  max-height: 52px;
}

.partners-tier__footnote {
  margin: var(--s-5) 0 0;
  max-width: none;
  text-align: center;
}

/* Footnote pill — re-uses .partner-logo so it visually matches the
   logo tiles exactly (same border, radius, min-height). The pill
   variant overrides display so it sizes to its content and centers
   inside .partners-tier__footnote rather than spanning full width. */
.partner-logo--pill {
  display: inline-flex;
  min-width: 240px;
  max-width: max-content;
  font-size: var(--fs-h4);
  font-weight: var(--fw-bold);
  color: var(--c-ink);
  letter-spacing: 0.01em;
}

/* ---------- Page contents two-column ---------- */
.loc-grid {
  display: grid;
  gap: var(--s-12);
  grid-template-columns: 1fr;
}

@media (min-width: 960px) {
  .loc-grid {
    grid-template-columns: 1.3fr 1fr;
    align-items: start;
  }
}
