/* ------------------------------------------------------------------
   /guides — grouped index

   Self-contained, `gd-` prefixed. Brand variables come from styles.css,
   loaded globally by root.tsx.

   The colour here is doing a job, not decoration: each group carries one
   of the three brand accents, so someone scanning for "the migration
   one" can find the block by colour before they have read a word.
   ------------------------------------------------------------------ */

/* The gap between groups has to clearly beat the largest gap *inside* one, or
   the groups stop reading as separate sections. Internally the widest is 24px
   (lead to cards) and rows sit 18px apart, so this is ~3.7x the internal
   rhythm rather than the 2.3x it was. */
.gd-groups {
  display: flex;
  flex-direction: column;
  gap: 88px;
}

/* ---------- Group heading ---------- */

.gd-group-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.gd-group-title {
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--primary);
  /* The accent reads as a rule under the heading rather than a swatch beside
     it, so it groups the cards below without competing with the text. */
  border-bottom: 3px solid var(--gd-accent);
  padding-bottom: 6px;
}

.gd-group-count {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(47, 72, 80, 0.45);
}

/* Intro, optionally with a customer quote beside it.
   A lone intro keeps a 720px measure so the line length stays readable; when a
   quote sits alongside, the grid column already does that job and the cap is
   dropped so the two halves balance. */
.gd-group-lead {
  margin-bottom: 24px;
}

.gd-group-lead-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 36px;
  align-items: center;
}

.gd-group-intro {
  color: rgba(47, 72, 80, 0.7);
  font-size: 1.02rem;
  line-height: 1.6;
  max-width: 720px;
  margin: 0;
}

.gd-group-lead-split .gd-group-intro {
  max-width: none;
}

/* The shared Testimonial centres itself in a 720px box. Inside a grid column
   that would float it off-centre, so both are neutralised here. */
.gd-group-quote .sodium-testimonial {
  margin: 0;
  max-width: none;
}

/* ---------- Cards ---------- */

/* Three per row at most, as an explicit count rather than auto-fill.
   auto-fill packed four 320px cards into a 1265px row, which squeezed every
   card and left the five-guide group with a lone orphan on row two. A fixed
   count keeps the cards roomy and the rows predictable as guides are added. */
.gd-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  list-style: none;
  padding: 0;
  margin: 0;
}

@media (max-width: 1040px) {
  .gd-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.gd-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 22px 24px;
  /* Square on the left, rounded on the right. A 4px accent bending around a
     rounded corner tapers and reads as a mistake; butting it against a flat
     edge keeps it a clean vertical bar. */
  border-radius: 0 12px 12px 0;
  background: white;
  border: 1px solid rgba(47, 72, 80, 0.13);
  /* The accent stripe is what makes a group scannable at a glance once the
     reader has scrolled past its heading. */
  border-left: 4px solid var(--gd-accent);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.gd-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(47, 72, 80, 0.12);
  border-color: rgba(47, 72, 80, 0.2);
  border-left-color: var(--gd-accent);
}

.gd-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.gd-card-title {
  font-size: 1.1rem;
  line-height: 1.35;
  color: var(--primary);
  margin: 0;
  flex: 1;
}

/* The third-party icon, beside the title.
   Expects a SQUARE mark. `object-fit: contain` means a non-square file is
   letterboxed rather than stretched, but it will look small — point the data
   at an icon, not a wordmark. The white ground keeps a logo with its own
   colours off the card's tinted background. */
.gd-card-logo {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  border: 1px solid rgba(47, 72, 80, 0.1);
  background: white;
  overflow: hidden;
}

.gd-card-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.gd-card p {
  margin: 0 0 16px;
  font-size: 0.94rem;
  line-height: 1.6;
  color: rgba(47, 72, 80, 0.68);
}

/* Pinned to the bottom so the meta rows line up across a row of cards
   whose descriptions differ in length. */
.gd-card-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  color: rgba(47, 72, 80, 0.5);
}

.gd-card-cta {
  font-weight: 600;
  color: var(--primary);
}

.gd-card:hover .gd-card-cta {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Featured (switching) treatment ---------- */

/* Migration guides are the highest-intent pages here, so they get roomier
   cards. Three across at full width — with three guides, a two-up grid left a
   lone card stranded on its own row. Steps to two, then one, as width drops. */
.gd-cards-featured {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1180px) {
  .gd-cards-featured {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.gd-cards-featured .gd-card {
  background: rgba(162, 185, 100, 0.06);
  padding: 26px 28px;
}

.gd-cards-featured .gd-card-title {
  font-size: 1.25rem;
}

/* ---------- Footer note ---------- */

.gd-note {
  margin-top: 56px;
  padding: 24px 28px;
  border-radius: 12px;
  background: rgba(47, 72, 80, 0.04);
  color: rgba(47, 72, 80, 0.78);
  line-height: 1.7;
}

.gd-note p {
  margin: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  /* Not enough width for prose and a quote side by side. */
  .gd-group-lead-split {
    grid-template-columns: 1fr;
    gap: 22px;
  }
}

@media (max-width: 720px) {
  .gd-groups {
    gap: 60px;
  }

  .gd-cards,
  .gd-cards-featured {
    grid-template-columns: 1fr;
  }

  .gd-card,
  .gd-cards-featured .gd-card {
    padding: 20px 22px;
  }

  .gd-note {
    margin-top: 44px;
    padding: 20px 22px;
  }
}
