/* =============================================================
   ways-to-connect.css
   The homepage "Ways to Connect" rail.

   Card width is solved rather than fixed, so exactly three cards
   sit in view with a slice of the fourth showing to advertise the
   scroll. For N full cards plus fraction f of the next, across a
   visible span V:

       V = N*C + N*gap + f*C   ->   C = (V - N*gap) / (N + f)

   The rail is inset by --wtc-pad on both sides, so the span visible
   from the left inset to the right edge of the screen is the rail's
   own content box plus one pad:  V = 100% + var(--wtc-pad).
   Desktop solves N = 3, f = 0.35.
   ============================================================= */

.wtc {
  --wtc-pad: 50px;
  --wtc-gap: 24px;
  --wtc-ink: #304049;
  --wtc-green: #7E8C6C;
  --wtc-green-dk: #4E5A3E;
  --wtc-gold: #C4A25F;
  --wtc-line: rgba(48, 64, 73, .13);
  position: relative;
  padding: 130px 0;
  background-color: #fff;
  overflow: hidden;
}

.wtc__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  /* matches the rail inset so the title lines up with card one */
  padding: 0 var(--wtc-pad);
  margin-bottom: 48px;
}
.wtc__head-text { max-width: 720px; }

.wtc__title {
  margin: 0 0 18px;
  font-family: var(--font-heading);
  font-size: 56px;
  line-height: 1.08;
  color: var(--wtc-ink);
}
.wtc__lede {
  margin: 0;
  font-size: 18px;
  line-height: 1.65;
  color: rgba(48, 64, 73, .72);
}

.wtc__nav { display: flex; gap: 10px; flex: 0 0 auto; }
.wtc__btn {
  width: 54px;
  height: 54px;
  border: 1px solid var(--wtc-line);
  border-radius: 50%;
  background: #fff;
  color: var(--wtc-green-dk);
  font-size: 16px;
  transition: .3s;
}
.wtc__btn:hover {
  border-color: var(--wtc-green);
  background: var(--wtc-green);
  color: #fff;
}

.wtc__rail {
  display: flex;
  gap: var(--wtc-gap);
  padding: 6px var(--wtc-pad) 34px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  /* without this, a snapped card jumps flush to the screen edge
     instead of holding the same inset it starts at */
  scroll-padding-left: var(--wtc-pad);
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.wtc__rail::-webkit-scrollbar { display: none; }

.wtc__card {
  position: relative;
  flex: 0 0 calc((100% + var(--wtc-pad) - 3 * var(--wtc-gap)) / 3.35);
  display: flex;
  flex-direction: column;
  /* the section is white now, so the card needs its own edge */
  border: 1px solid var(--wtc-line);
  border-radius: 22px;
  background: #fff;
  overflow: hidden;
  scroll-snap-align: start;
  transition: .35s var(--easing);
}
.wtc__card:hover {
  transform: translateY(-6px);
  border-color: transparent;
  box-shadow: 0 26px 50px rgba(48, 64, 73, .14);
}

/* aspect-ratio rather than a fixed height, so the image grows with
   the card instead of leaving a short strip on a wide screen. The
   source photos are 2.63:1 banners, so 16:10 keeps the crop modest;
   the cap stops the image ballooning past ~1900px wide. */
.wtc__media {
  aspect-ratio: 16 / 10;
  max-height: 360px;
  background-size: cover;
  background-position: center;
}

.wtc__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 32px 36px 36px;
}
.wtc__cat {
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--wtc-gold);
}
.wtc__name {
  margin: 0 0 14px;
  font-family: var(--font-heading);
  font-size: 34px;
  font-weight: 500;
  line-height: 1.14;
  color: var(--wtc-ink);
}
.wtc__blurb {
  margin: 0 0 26px;
  font-size: 17px;
  line-height: 1.62;
  color: rgba(48, 64, 73, .68);
}

.wtc__link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  align-self: flex-start;
  margin-top: auto;
  border-bottom: 1px solid transparent;
  font-size: 16px;
  font-weight: 600;
  color: var(--wtc-green-dk);
  transition: .3s;
}
.wtc__link i { font-size: 13px; transition: transform .3s; }
.wtc__card:hover .wtc__link { border-bottom-color: currentColor; }
.wtc__card:hover .wtc__link i { transform: translateX(4px); }

/* full-card click target, sits above the rest of the card */
.wtc__overlay { position: absolute; inset: 0; z-index: 3; }

/* closing card: the invitation for anyone who doesn't see themselves
   in the four above */
.wtc__card--end { justify-content: center; border-color: transparent; background: var(--wtc-green-dk); }
.wtc__card--end .wtc__body  { padding: 46px 36px; }
.wtc__card--end .wtc__name  { color: #fff; }
.wtc__card--end .wtc__blurb { color: rgba(255, 255, 255, .78); }
.wtc__card--end .wtc__link  { color: #fff; }

.wtc__foot { padding: 0 var(--wtc-pad); margin-top: 20px; text-align: center; }

/* Three cards get cramped below ~1200px, so drop to two full cards
   plus the same 0.35 slice: C = (V - 2*gap) / 2.35 */
@media (max-width: 1199px) {
  .wtc { --wtc-pad: 30px; --wtc-gap: 20px; padding: 100px 0; }
  .wtc__title { font-size: 44px; }
  .wtc__card { flex: 0 0 calc((100% + var(--wtc-pad) - 2 * var(--wtc-gap)) / 2.35); }
  .wtc__name { font-size: 28px; }
  .wtc__body { padding: 26px 28px 30px; }
}

/* One card plus a 0.28 slice: C = (V - gap) / 1.28 */
@media (max-width: 767px) {
  .wtc { --wtc-pad: 20px; --wtc-gap: 16px; padding: 80px 0; }
  .wtc__head { flex-direction: column; align-items: flex-start; gap: 24px; margin-bottom: 32px; }
  .wtc__title { font-size: 34px; }
  .wtc__lede { font-size: 16px; }
  .wtc__nav { display: none; }
  .wtc__rail { padding-bottom: 26px; }
  .wtc__card { flex: 0 0 calc((100% + var(--wtc-pad) - var(--wtc-gap)) / 1.28); }
  .wtc__name { font-size: 26px; }
}
