/* How it works (sections/how-it-works.liquid): numbered steps in gold double-ring badges.
   Phones: a vertical timeline. Tablets: two columns. Desktop: one row joined by a dotted gold line. */

.how__heading { margin-bottom: clamp(36px, 5vw, 64px); }
.how__title { margin: 0; }
.how__rule { margin-top: 18px; }
.how__intro {
  max-width: 34em;
  margin-inline: auto;
  color: var(--c-ink-soft);
  text-wrap: balance;
}

.how__steps {
  --badge: 64px;
  --col-gap: clamp(24px, 3vw, 44px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 560px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.how__step {
  position: relative;
  display: grid;
  grid-template-columns: var(--badge) minmax(0, 1fr);
  column-gap: 20px;
  align-items: start;
  align-content: start;
  padding-bottom: 30px;
}
.how__step:last-child { padding-bottom: 0; }
/* timeline line between badges */
.how__step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(var(--badge) / 2);
  top: calc(var(--badge) + 8px);
  bottom: 8px;
  width: 1px;
  background: repeating-linear-gradient(180deg, var(--c-gold) 0 5px, rgba(184, 134, 43, 0) 5px 11px);
  opacity: .75;
}

.how__badge {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--badge);
  height: var(--badge);
  border: 1px solid var(--c-gold);
  border-radius: 50%;
  background: var(--c-ivory);
  box-shadow: var(--shadow-card);
  color: var(--c-gold-text);
}
.how__badge::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid var(--c-gold-light);
  border-radius: 50%;
  pointer-events: none;
}
.how__number {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: calc(var(--badge) * .46);
  line-height: 1;
  font-variant-numeric: lining-nums;
  color: var(--c-gold-text);
  transform: translateY(-.04em);
}
.how__badge-icon { width: calc(var(--badge) * .46); height: calc(var(--badge) * .46); color: var(--c-green); }
.how__badge .icon--illustration { color: var(--c-green); }

.how__body { padding-top: 8px; }
.how__step-title {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(1.4rem, 2vw, 1.6rem);
  line-height: 1.15;
  color: var(--c-green);
}
.how__text {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--c-ink-soft);
}

.how__actions {
  display: flex;
  justify-content: center;
  margin-top: clamp(36px, 5vw, 56px);
}

@media (min-width: 750px) {
  .how__steps {
    --badge: 76px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--col-gap);
    row-gap: 44px;
    max-width: 860px;
  }
  .how__steps--1 { grid-template-columns: minmax(0, 1fr); max-width: 420px; }
  .how__step {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    row-gap: 18px;
    padding-bottom: 0;
    text-align: center;
  }
  .how__step:not(:last-child)::after { display: none; }
  .how__body { padding-top: 0; max-width: 20em; }
}

/* Two columns with an odd number of steps: centre the last step instead of leaving an empty cell */
@media (min-width: 750px) and (max-width: 989px) {
  .how__steps .how__step:nth-child(odd):last-child:not(:first-child) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc((100% - var(--col-gap)) / 2);
  }
}

@media (min-width: 990px) {
  .how__steps { max-width: none; }
  .how__steps--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .how__steps--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .how__steps--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .how__steps--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .how__steps--5 .how__step-title,
  .how__steps--6 .how__step-title { min-height: 2.3em; display: flex; align-items: flex-end; justify-content: center; }
  .how__steps--3 .how__step:not(:last-child)::after,
  .how__steps--4 .how__step:not(:last-child)::after,
  .how__steps--5 .how__step:not(:last-child)::after,
  .how__steps--6 .how__step:not(:last-child)::after {
    display: block;
    left: calc(50% + var(--badge) / 2 + 14px);
    top: calc(var(--badge) / 2);
    bottom: auto;
    width: calc(100% + var(--col-gap) - var(--badge) - 28px);
    height: 1px;
    background: repeating-linear-gradient(90deg, var(--c-gold) 0 5px, rgba(184, 134, 43, 0) 5px 11px);
  }
}

/* focus ring on parchment: the darker gold keeps 3:1 against the background */
.how.section--parchment :focus-visible { outline-color: var(--c-gold-text); }
