/*
 * sections.css: composition rules for each band of the page.
 * Widgets used inside these sections are defined in components.css.
 */

/* ===============================================================
 * Hero
 * Outcome first, service second: the headline names what the
 * visitor gets back, because that is what they searched for.
 * The founders sit on their own yellow field, so the brand colour
 * enters the page as a photographic block rather than a swatch.
 * =============================================================== */
.hero { padding-block: clamp(1.5rem, 3vw, 2.75rem) clamp(2rem, 4vw, 3.25rem); }

.hero-in {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
}

/* The subject is set as the dominant element and the promise follows
 * at a third of its size. The scale jump is the hierarchy; no word is
 * tinted or italicised to fake emphasis. */
.hero h1 { display: grid; margin-bottom: 1.35rem; }
.h1-lead {
  font-size: var(--step-5);
  line-height: 0.9;
  letter-spacing: -0.035em;
  font-weight: 700;
}
.h1-rest {
  font-size: var(--step-2);
  line-height: 1.1;
  letter-spacing: -0.012em;
  font-weight: 400;
  margin-top: 0.2em;
  max-width: 18ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.4rem; }

/* The founders are cut from their studio backdrop and lit from behind
 * with the brand yellow, so they stand in the page rather than inside
 * a pasted-in rectangle. The base of the photograph is feathered into
 * the ground, which removes the hard crop line at their feet. */
.hero-figure {
  --fig-h: min(56vh, 500px);
  position: relative;
  margin: 0;
  margin-inline: auto;
  max-width: calc(var(--fig-h) * 532 / 699);
  isolation: isolate;
}
.hero-figure::before {
  content: "";
  position: absolute;
  inset: 2% -16% 4% -16%;
  z-index: -1;
  background:
    radial-gradient(56% 52% at 52% 48%,
      color-mix(in srgb, var(--gold) 55%, transparent) 0%,
      color-mix(in srgb, var(--gold) 20%, transparent) 48%,
      transparent 74%);
  filter: blur(10px);
}
.hero-figure img {
  width: 100%;
  height: auto;
  -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 99%);
          mask-image: linear-gradient(180deg, #000 72%, transparent 99%);
}

@media (max-width: 900px) {
  .hero-in { grid-template-columns: 1fr; }
  .hero-figure { --fig-h: 42vh; max-width: min(20rem, 70vw); }
}

/* ===============================================================
 * Insurance: the clinic's own claim, and the single fact most
 * likely to decide whether a Jamaican patient calls at all.
 * =============================================================== */
.insurance { padding-block: clamp(2.75rem, 6vw, 4.5rem); }
.insurance-note { margin-top: 1.75rem; max-width: 46ch; font-size: var(--step-0); }

/* ===============================================================
 * Section headers
 * No tracked-out label above the heading: the heading and its lede
 * carry the meaning between them.
 * =============================================================== */
.head { display: grid; gap: 1.1rem; max-width: 54rem; margin-bottom: clamp(1.75rem, 2vw + 1vh, 3.25rem); }
.head .read { max-width: 50ch; }
.head-split {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: end;
  max-width: none;
}
@media (max-width: 820px) { .head-split { grid-template-columns: 1fr; align-items: start; } }

/* ===============================================================
 * Who we are: the clinic's statement of purpose set beside the
 * outcome it produced for one patient. The promise and the proof
 * carry more together than either does alone, which is why they
 * share a band rather than occupying two.
 * =============================================================== */
.creed-in {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  /* The quote runs shorter than the statement beside it. Centring it
   * splits the difference above and below instead of leaving a hole
   * under the attribution. */
  align-items: center;
}

.pull { margin: 0; }
/* The measure and the size are declared together: a ch unit resolves
 * against the element's own font-size, so splitting them collapses
 * the column. */
.pull blockquote {
  margin: 0;
  font-size: var(--step-4);
  line-height: 1.1;
  letter-spacing: -0.022em;
  max-width: 13ch;
}
.pull q {
  font-family: var(--face-display);
  font-size: inherit;
  font-weight: 500;
  font-style: italic;
  text-wrap: balance;
}
.pull figcaption { margin-top: 1.6rem; }
.pull cite {
  font-family: var(--face-sans);
  font-style: normal;
  font-size: var(--step--1);
  line-height: 1.5;
  color: color-mix(in srgb, var(--ink) 74%, transparent);
}
.pull cite b { font-weight: 600; color: var(--ink); }

.creed-body h2 { font-size: var(--step-3); margin-bottom: 1.25rem; }
.creed-lead {
  font-family: var(--face-display);
  font-size: var(--step-1);
  line-height: 1.5;
  max-width: 54ch;
}

.creed-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.25rem, 3vw, 2.25rem);
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
  padding-top: clamp(1.5rem, 3vw, 2rem);
  border-top: 1px solid color-mix(in srgb, var(--ink) 26%, transparent);
}
.creed-pair h3 {
  font-family: var(--face-sans);
  font-size: var(--step-0);
  font-weight: 500;
  letter-spacing: 0;
  margin-bottom: 0.55rem;
}
.creed-pair p {
  font-size: var(--step-0);
  line-height: 1.6;
  color: color-mix(in srgb, var(--ink) 80%, transparent);
}

.creed-since {
  margin-top: clamp(1.5rem, 3vw, 2rem);
  font-size: var(--step--1);
  color: color-mix(in srgb, var(--ink) 68%, transparent);
}

@media (max-width: 900px) {
  .creed-in { grid-template-columns: 1fr; align-items: start; }
  .pull blockquote { max-width: 18ch; }
}
@media (max-width: 560px) {
  .creed-pair { grid-template-columns: 1fr; }
}

/* ===============================================================
 * Approach: a genuine sequence, so it is genuinely numbered.
 * =============================================================== */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  counter-reset: step;
}
.step { display: grid; gap: 0.65rem; align-content: start; padding-top: 1.3rem; border-top: 1px solid var(--ink-line); }
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--face-sans);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--gold);
}
.step p { font-size: var(--step-0); color: var(--bone-dim); }

/* ===============================================================
 * Review ribbon: social proof moved directly under the hero,
 * where it decides whether the visitor keeps reading.
 *
 * It scrolls sideways under the visitor's own finger, arrow keys or
 * trackpad rather than advancing on a timer: auto-playing carousels
 * move content out from under people who are still reading it, and
 * the page already spends its one authored motion on the preloader.
 * The rail bleeds past the shell so the last card runs off the edge,
 * which is what says "there are more of these".
 * =============================================================== */
.rail {
  display: flex;
  gap: clamp(0.75rem, 2vw, 1.25rem);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  /* The inset lines the first card up with the headline above it.
   * It is also the scroll-padding: without that, snap-align start
   * targets the scrollport edge and scrolls the inset away. */
  --rail-inset: max(var(--gutter), calc((100vw - var(--shell)) / 2 + var(--gutter)));
  padding-block: 0.5rem 1.5rem;
  padding-inline: var(--rail-inset);
  scroll-padding-inline: var(--rail-inset);
  /* Cards fade out at the edges instead of being guillotined. */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 2.5%, #000 93%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 2.5%, #000 93%, transparent 100%);
}
.rail > .voice {
  flex: 0 0 min(23rem, 76vw);
  scroll-snap-align: start;
}
.rail:focus-visible { outline-offset: -3px; }

@media (max-width: 620px) {
  .rail { scroll-snap-type: x mandatory; }
}

/* ===============================================================
 * Rating: the Google score carried as a figure rather than a
 * sentence, because a number and five stars are read faster than
 * a claim about them.
 * =============================================================== */
.rating {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding-bottom: clamp(1.5rem, 3vw, 2.25rem);
  margin-bottom: clamp(1rem, 2vw, 1.5rem);
  border-bottom: 1px solid var(--ink-line);
}
.rating-score { display: flex; align-items: baseline; gap: 0.75rem; }
.rating-score b {
  font-variant-numeric: tabular-nums;
  font-family: var(--face-display);
  font-size: var(--step-4);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--bone);
}
.rating-stars { font-size: var(--step-1); }
.rating-source { margin: 0; font-size: var(--step-0); color: var(--bone-dim); }
.rating-split { display: flex; gap: clamp(1.25rem, 3vw, 2.5rem); margin: 0; margin-left: auto; }
.rating-split dt { font-size: var(--step-0); color: var(--gold); }
.rating-split dd { margin: 0.3rem 0 0; font-size: var(--step-0); color: var(--bone-dim); }
@media (max-width: 720px) { .rating-split { margin-left: 0; } }

/* ===============================================================
 * Patient voices
 * =============================================================== */
.voice {
  flex: 0 0 min(23rem, 76vw);
  scroll-snap-align: start;
}
.rail:focus-visible { outline-offset: -3px; }

@media (max-width: 620px) {
  .rail { scroll-snap-type: x mandatory; }
}

/* ===============================================================
 * Rating: the Google score carried as a figure rather than a
 * sentence, because a number and five stars are read faster than
 * a claim about them.
 * =============================================================== */
.rating {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding-bottom: clamp(1.5rem, 3vw, 2.25rem);
  margin-bottom: clamp(1rem, 2vw, 1.5rem);
  border-bottom: 1px solid var(--ink-line);
}
.rating-score { display: flex; align-items: baseline; gap: 0.75rem; }
.rating-score b {
  font-variant-numeric: tabular-nums;
  font-family: var(--face-display);
  font-size: var(--step-4);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--bone);
}
.rating-stars { font-size: var(--step-1); }
.rating-source { margin: 0; font-size: var(--step-0); color: var(--bone-dim); }
.rating-split { display: flex; gap: clamp(1.25rem, 3vw, 2.5rem); margin: 0; margin-left: auto; }
.rating-split dt { font-size: var(--step-0); color: var(--gold); }
.rating-split dd { margin: 0.3rem 0 0; font-size: var(--step-0); color: var(--bone-dim); }
@media (max-width: 720px) { .rating-split { margin-left: 0; } }

/* ===============================================================
 * Patient voices
 * =============================================================== */
.voices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr));
  gap: clamp(1.25rem, 3vw, 2rem);
}
.voice {
  display: grid; gap: 0.9rem; align-content: start;
  margin: 0;
  padding: clamp(1.4rem, 3vw, 2rem);
  background: var(--ink-raised);
  border-radius: 2px;
}
.voice q {
  font-family: var(--face-display);
  font-size: var(--step-1);
  font-weight: 400;
  font-style: italic;
  line-height: 1.42;
  color: var(--bone);
}
.voice cite {
  font-family: var(--face-sans);
  font-style: normal;
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--gold);
}
.voice .stars, .rating-stars { display: inline-flex; gap: 0.18em; }
.voice .stars svg, .rating-stars svg { width: 0.95em; height: 0.95em; fill: var(--gold); }
.voice .stars { font-size: var(--step-0); }


/* ===============================================================
 * Clinics
 * =============================================================== */
.clinics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(21rem, 100%), 1fr));
  gap: clamp(1.25rem, 3vw, 2rem);
}
.clinic {
  display: grid; gap: 1rem; align-content: start;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border: 1px solid var(--ink-line);
  border-radius: 2px;
  background: var(--ink);
}
.clinic h3 { font-size: var(--step-1); }
.clinic dl { display: grid; grid-template-columns: auto 1fr; gap: 0.55rem 1.25rem; margin: 0; font-size: var(--step-0); }
.clinic dt {
  font-family: var(--face-sans);
  font-size: var(--step-0);
  color: var(--gold);
  align-self: start;
}
.clinic dd { margin: 0; color: var(--bone-dim); }
.clinic-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.3rem; }
.clinic-actions .btn { padding: 0.7rem 1.1rem; font-size: var(--step--1); }

/* ===============================================================
 * Booking
 * =============================================================== */
.booking-in {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
@media (max-width: 900px) { .booking-in { grid-template-columns: 1fr; } }

.booking-aside { display: grid; gap: 1.5rem; align-content: start; }
.booking-aside h2 { font-size: var(--step-3); }

.whatsapp-card {
  display: grid; gap: 0.9rem;
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent);
  border-radius: 2px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}
.whatsapp-card .btn { justify-self: start; }
.whatsapp-number {
  font-family: var(--face-display);
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

/* ===============================================================
 * Footer
 * =============================================================== */
.footer { padding-block: clamp(3rem, 6vw, 4.5rem) 2rem; border-top: 1px solid var(--ink-line); }
.footer-in {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.25fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  margin-bottom: 2.5rem;
}
/* The printed mark is black line-work; on the dark footer it is
 * recoloured to the brand yellow with a mask rather than shipped twice. */
.footer-mark {
  display: block;
  width: min(15rem, 100%);
  aspect-ratio: 655 / 310;
  background: var(--gold);
  -webkit-mask: url("../img/logo-mark.png") no-repeat center / contain;
          mask: url("../img/logo-mark.png") no-repeat center / contain;
}
@media (max-width: 900px) { .footer-in { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-in { grid-template-columns: 1fr; } }

.footer-tag { margin-top: 1.1rem; max-width: 28ch; }
.footer h4 { font-size: var(--step-0); margin-bottom: 0.9rem; font-family: var(--face-sans); font-weight: 500; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.footer a { color: var(--bone-dim); text-decoration: none; font-size: var(--step-0); }
.footer a:hover { color: var(--gold); }
.footer-base {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between;
  padding-top: 1.75rem;
  border-top: 1px solid var(--ink-line);
  font-size: var(--step--1);
  color: var(--bone-dim);
}

/* ===============================================================
 * Posts: the clinic's own Instagram graphics.
 * These are finished artwork in the brand's colours, so they are
 * framed plainly and left alone; the only treatment is a slight
 * hold-back that lifts on hover, so the grid reads as a set rather
 * than four competing posters.
 * =============================================================== */
.posts-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.posts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
  gap: clamp(0.75rem, 2vw, 1.25rem);
  padding: 0;
  margin: 0;
  list-style: none;
}
.posts a {
  display: block;
  border: 1px solid var(--ink-line);
  border-radius: 2px;
  overflow: hidden;
  transition: border-color var(--fast) var(--ease-out);
}
.posts img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  opacity: 0.86;
  transition: opacity var(--fast) var(--ease-out);
}
.posts a:hover { border-color: var(--gold); }
.posts a:hover img, .posts a:focus-visible img { opacity: 1; }
