/* ==========================================================================
   Willis Collision — Community page
   Page-specific styles. Reuses .section, .cta-strip, .eyebrow, .partners-*
   patterns from site.css/location.css/components.css where possible.
   ========================================================================== */

/* ---------- Hero ---------- */
.community-hero {
  padding-block: var(--s-20) var(--s-12);
  background: linear-gradient(180deg, var(--c-signal-soft) 0%, var(--c-paper) 100%);
  text-align: center;
}

.community-hero__title {
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
  margin-block: var(--s-4) var(--s-6);
  max-width: 18ch;
  margin-inline: auto;
}

.community-hero__lede {
  font-size: var(--fs-h4);
  line-height: var(--lh-relaxed);
  color: var(--c-charcoal);
  max-width: 62ch;
  margin-inline: auto;
}

@media (max-width: 640px) {
  .community-hero {
    padding-block: var(--s-12) var(--s-10);
  }
  .community-hero__title {
    font-size: 2.25rem;
  }
  .community-hero__lede {
    font-size: 1rem;
  }
}

/* ---------- Partners section ----------
   Body sections on this page follow the rest of the site's convention:
   eyebrow + H2 + intro paragraph all LEFT-aligned, intros constrained to
   a readable max-width. Hero stays centered (typical hero treatment).
   --------------------------------------- */
.community-partners__intro {
  color: var(--c-slate);
  max-width: 62ch;
  margin-block: var(--s-4) var(--s-10);
}

.community-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-6);
  margin-block: var(--s-8);
}

@media (max-width: 980px) {
  .community-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .community-grid {
    grid-template-columns: 1fr;
  }
}

.community-card {
  background: var(--c-paper);
  border: 1px solid var(--c-mist);
  border-radius: var(--radius-lg);
  padding: var(--s-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--s-4);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

/* Pin the name+subtitle block to the bottom of the card so captions
   land at the same baseline across the row regardless of each logo's
   intrinsic aspect ratio. Margin/etc shared with main .community-card__name
   rule below. */

.community-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-subtle);
  border-color: var(--c-signal-soft);
}

.community-card__logo-wrap {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-3) var(--s-2);
  flex: none;
}

/* The img-or-picture wrapper inside .community-card__logo-wrap should
   fill the container so horizontal lockups can use the full width
   while vertical/square logos remain capped by height. */
.community-card__logo-wrap > picture,
.community-card__logo-wrap > img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.community-card__logo {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Two-part caption: name (allowed to wrap to 2 lines with a reserved
   min-height) + subtitle. Wrapping the pair in a flex column with a
   reserved name height keeps subtitle baselines aligned across cards. */
.community-card__caption {
  margin: auto 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-1);
  width: 100%;
}

.community-card__name {
  font-weight: var(--fw-bold);
  color: var(--c-ink);
  font-size: var(--fs-body);
  line-height: var(--lh-snug);
  margin: 0;
  text-wrap: balance;
  /* Reserve 2 lines of name so subtitle baselines align across the
     row even when one card's name fits on a single line. */
  min-height: 2.3em;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}

/* At 4-up tablet/laptop widths the longest name ("United Way of Central
   Iowa") wraps to 3 lines while shorter names stay at 1-2; bump the
   name reservation so subtitle baselines stay aligned. */
@media (min-width: 981px) and (max-width: 1200px) {
  .community-card__name {
    min-height: 3.5em;
  }
}

.community-card__sub {
  display: inline-block;
  margin: 0;
  font-weight: var(--fw-regular);
  color: var(--c-slate);
  font-size: var(--fs-small);
  font-style: italic;
}

.community-partners__footnote {
  color: var(--c-slate);
  font-style: italic;
  margin-top: var(--s-8);
}

/* ---------- Team-in-action photo band ---------- */
.community-action__intro {
  color: var(--c-slate);
  max-width: 62ch;
  margin-block: var(--s-4) var(--s-10);
}

.community-photos {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: var(--s-4);
  margin-top: var(--s-8);
  min-height: 520px;
}

@media (min-width: 721px) and (max-width: 900px) {
  /* On narrow tablets the 2:1 column ratio leaves the right column too
     narrow to match the left column's height. Boost the grid min-height
     so both columns visibly match. */
  .community-photos {
    min-height: 600px;
  }
}

.community-photos > .community-photo:nth-child(1) {
  grid-row: span 2;
}

@media (max-width: 720px) {
  .community-photos {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    min-height: 0;
  }
  .community-photos > .community-photo:nth-child(1) {
    grid-row: auto;
    aspect-ratio: 4 / 3;
  }
  .community-photos > .community-photo {
    aspect-ratio: 4 / 3;
  }
}

.community-photo {
  margin: 0;
  background: var(--c-fog);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  height: 100%;
  min-height: 0;
}

.community-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Caption under each photo — sits in a small dark band over the bottom
   of the image so the photo can still cover the full tile. */
.community-photo__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: var(--s-3) var(--s-4);
  background: linear-gradient(180deg, rgba(17, 17, 17, 0) 0%, rgba(17, 17, 17, 0.78) 100%);
  color: var(--c-paper);
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  text-align: left;
}

@media (max-width: 720px) {
  .community-photo__caption {
    font-size: var(--fs-micro);
    padding: var(--s-2) var(--s-3);
  }
}

/* ---------- Core values grid ----------
   Black cards with a huge ghost numeral behind the text.
   Recreates the layered-typography treatment from the Willis Automotive
   core values poster (NOT a screenshot — fully responsive HTML).
   --------------------------------------- */

.community-values__intro {
  color: var(--c-slate);
  max-width: 62ch;
  margin-block: var(--s-4) var(--s-12);
}

.values-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--s-4);
}

@media (max-width: 1100px) {
  .values-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .values-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s-3);
  }
}

.value-card {
  position: relative;
  background: var(--c-ink);
  color: var(--c-paper);
  border-radius: var(--radius-lg);
  padding: var(--s-6) var(--s-5);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
  transition: transform 200ms ease;
}

.value-card:hover {
  transform: translateY(-2px);
}

/* Huge ghost numeral, centered, sitting BEHIND the text. */
.value-card__numeral {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-sans);
  font-weight: var(--fw-extrabold);
  font-size: clamp(8rem, 14vw, 13rem);
  line-height: 1;
  color: rgba(255, 255, 255, 0.08);
  user-select: none;
  pointer-events: none;
  z-index: 0;
}

.value-card__text {
  position: relative;
  z-index: 1;
  margin: 0;
  text-align: center;
  font-size: var(--fs-body);
  line-height: 1.45;
  font-weight: var(--fw-regular);
  color: var(--c-paper);
}

.value-card__text strong {
  font-weight: var(--fw-extrabold);
}

@media (max-width: 640px) {
  .value-card {
    padding: var(--s-5) var(--s-4);
  }
  .value-card__text {
    font-size: var(--fs-small);
  }
}

/* ---------- Homepage community-strip teaser card ---------- */
.community-strip {
  background: linear-gradient(135deg, var(--c-signal) 0%, var(--c-signal-deep) 100%);
  color: var(--c-paper);
  padding-block: var(--s-12);
}

.community-strip__inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--s-12);
  align-items: center;
}

@media (max-width: 820px) {
  .community-strip__inner {
    grid-template-columns: 1fr;
    gap: var(--s-8);
  }
}

.community-strip__copy .eyebrow {
  color: rgba(255, 255, 255, 0.85);
}

.community-strip__copy h2 {
  color: var(--c-paper);
  margin-block: var(--s-3) var(--s-4);
  line-height: var(--lh-snug);
}

.community-strip__copy p {
  color: rgba(255, 255, 255, 0.92);
  font-size: var(--fs-h4);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--s-6);
}

.community-strip__copy .btn {
  background: var(--c-paper);
  color: var(--c-signal-deep);
}

.community-strip__copy .btn:hover {
  background: var(--c-fog);
}

.community-strip__logos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-4);
}

.community-strip__logo {
  background: var(--c-paper);
  border-radius: var(--radius);
  padding: var(--s-4);
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* <picture> wrappers are inline by default; force them to honor the
   parent's aspect-ratio so logos can't push the tile taller than its
   container. (Same fix as .community-card__logo-wrap on the
   /community page.) */
.community-strip__logo > picture,
.community-strip__logo > img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.community-strip__logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
