/* Home — Treatments (client round, 2026-10-26: "the most important section on the home page").
   Three layers, one hierarchy:
   1. three photo cards for the most requested treatments (the lead one wider)
   2. a navy band in the patient's own words: "I'm in pain" -> Root canal
   3. the four specialties, every treatment a chip; on desktop a sticky panel shows the hovered
      treatment's photo and, where a patient wrote about it, a verbatim line of their review.
   Markup: services.js homeTreatments(). Logic: tx.js. No backdrop-filter, transform/opacity only. */

.tx .rd-head { margin-bottom: var(--head-gap); }
.tx__head-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.tx__tally {
  margin: 0;
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

/* ---------- 1. featured cards ---------- */
.tx__feat {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(14px, 1.4vw, 22px);
}
.tx__card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  /* laptop 1366×645: the whole row fits on screen under the heading */
  min-height: clamp(380px, min(32vw, 68svh), 540px);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--navy-deep);
  color: var(--cream);
  text-decoration: none;
}
.tx__card > img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(.16, 1, .3, 1);
}
/* a navy floor under the text, so every photo reads the same way */
.tx__card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(6, 20, 46, 0) 32%, rgba(6, 20, 46, .55) 58%, rgba(6, 20, 46, .92) 100%);
}
.tx__card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: clamp(24px, 2.2vw, 36px);
}
.tx__badge {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--light-yellow);
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.tx__card-name {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(32px, 2.7vw, 46px);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.tx__card--lead .tx__card-name { font-size: clamp(38px, 3.4vw, 58px); }
.tx__card-text {
  max-width: 36ch;
  font-size: 15px;
  line-height: 1.55;
  color: rgba(253, 247, 235, .84);
}
.tx__card:hover > img,
.tx__card:focus-visible > img { transform: scale(1.04); }
.tx__card:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

/* the booking pill's tooth -> arrow chip */
.tx__arrow {
  position: absolute;
  top: clamp(18px, 1.8vw, 26px);
  right: clamp(18px, 1.8vw, 26px);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--navy);
  overflow: hidden;
  transition: background-color .35s ease;
}
.tx__arrow img,
.tx__arrow svg {
  position: absolute;
  inset: 0;
  margin: auto;
  transition: transform .55s cubic-bezier(.16, 1, .3, 1);
}
.tx__arrow img { width: 34px; height: 30px; object-fit: contain; }
.tx__arrow svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translate(-36px, 36px);
}
.tx__card:hover .tx__arrow,
.tx__card:focus-visible .tx__arrow { background: var(--light-yellow); }
.tx__card:hover .tx__arrow img,
.tx__card:focus-visible .tx__arrow img { transform: translate(36px, -36px); }
.tx__card:hover .tx__arrow svg,
.tx__card:focus-visible .tx__arrow svg { transform: none; }

/* ---------- 2. what brings you in ---------- */
.tx__need {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 2fr);
  gap: clamp(32px, 5vw, 96px);
  margin-top: clamp(14px, 1.4vw, 22px);
  padding: clamp(36px, 4.4vw, 72px);
  border-radius: var(--r-lg);
  background: var(--navy);
  color: var(--cream);
}
.tx__need-head { display: flex; flex-direction: column; gap: 18px; }
.tx__need-title {
  margin: 0;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(32px, 2.9vw, 48px);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.tx__need-title em { font-style: italic; color: var(--light-yellow); }
.tx__need-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(24px, 3vw, 56px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.tx__need-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: clamp(16px, 1.5vw, 22px) 0;
  border-top: 1px solid rgba(253, 247, 235, .16);
  color: var(--cream);
  text-decoration: none;
}
.tx__need-words {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(22px, 1.9vw, 30px);
  font-style: italic;
  font-weight: 300;
  line-height: 1.2;
  transition: translate .5s cubic-bezier(.16, 1, .3, 1), color .3s ease;
}
.tx__need-to {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(243, 211, 133, .78);
}
.tx__need-to svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .45s cubic-bezier(.16, 1, .3, 1);
}
.tx__need-link:hover .tx__need-words,
.tx__need-link:focus-visible .tx__need-words { translate: 8px 0; color: var(--light-yellow); }
.tx__need-link:hover .tx__need-to svg,
.tx__need-link:focus-visible .tx__need-to svg { transform: translateX(5px); }
.tx__need-link:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

/* ---------- 3. specialties + proof panel ---------- */
.tx__spec {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .56fr);
  gap: clamp(40px, 5.5vw, 104px);
  align-items: start;
  margin-top: clamp(64px, 7vw, 112px);
}
.tx__spec-label { margin-bottom: 22px; }
.tx__cat {
  padding: clamp(22px, 2.2vw, 34px) 0;
  border-top: 1px solid var(--line);
}
.tx__cat:last-child { border-bottom: 1px solid var(--line); }
.tx__cat-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.tx__cat-name {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(30px, 2.7vw, 44px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--navy);
  text-decoration: none;
}
.tx__cat-name svg {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: var(--gold-ink);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity .3s ease, transform .45s cubic-bezier(.16, 1, .3, 1);
}
.tx__cat-name:hover svg,
.tx__cat-name:focus-visible svg,
.tx__cat-name.is-active svg { opacity: 1; transform: none; }
.tx__count {
  flex: none;
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.tx__cat-text {
  max-width: 52ch;
  margin: 0;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink-soft);
}
.tx__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tx__chip {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(206, 158, 69, .5);
  border-radius: 999px;
  color: var(--navy);
  font-size: 15px;
  text-decoration: none;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}
.tx__chip:hover,
.tx__chip.is-active { background: var(--navy); border-color: var(--navy); color: var(--cream); }
.tx__chip:focus-visible,
.tx__cat-name:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 999px; }

.tx__panel {
  position: sticky;
  top: 112px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.tx__frame {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--navy);
}
.tx__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity .6s ease, transform 1.4s cubic-bezier(.16, 1, .3, 1);
}
.tx__img.is-on { opacity: 1; transform: none; }
.tx__tag {
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.tx__say { margin: 0; min-height: 6.4em; transition: opacity .3s ease; }
.tx__say.is-swapping { opacity: 0; }
.tx__quote {
  margin: 0;
  padding-left: 18px;
  border-left: 2px solid var(--gold);
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(20px, 1.6vw, 25px);
  font-style: italic;
  font-weight: 300;
  line-height: 1.35;
  color: var(--navy);
}
.tx__quote::before { content: "“"; }
.tx__quote::after { content: "”"; }
.tx__quote.is-plain {
  padding-left: 0;
  border-left: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  font-style: normal;
  font-weight: 400;
  line-height: var(--lh-body);
  color: var(--ink-soft);
}
.tx__quote.is-plain::before,
.tx__quote.is-plain::after { content: none; }
.tx__cite { margin-top: 10px; padding-left: 20px; font-size: 13px; color: var(--ink-soft); }
.tx__cite:empty { display: none; }
.tx__ba {
  margin: -6px 0 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold-deep);
  opacity: 0;
  transition: opacity .3s ease;
}
.tx__panel.has-ba .tx__ba { opacity: 1; }

/* phone-only photo + patient line per specialty (the hover panel's job on desktop) */
.tx__m-photo,
.tx__m-say { display: none; }

/* ---------- tablet & phone ---------- */
@media (max-width: 1099.98px) {
  .tx__need { grid-template-columns: 1fr; }
}
@media (max-width: 899.98px) {
  .tx__head-actions { align-items: flex-start; }
  /* cards: a swipeable row that peeks the next one */
  .tx__feat {
    display: flex;
    gap: 12px;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .tx__feat::-webkit-scrollbar { display: none; }
  .tx__card { flex: 0 0 min(84%, 420px); min-height: 440px; scroll-snap-align: start; }
  .tx__card--lead .tx__card-name { font-size: clamp(32px, 8vw, 40px); }
  .tx__need { margin-top: 16px; padding: 32px 22px; gap: 24px; border-radius: var(--r-md); }
  .tx__need-list { grid-template-columns: 1fr; }
  .tx__spec { grid-template-columns: 1fr; margin-top: 64px; }
  .tx__panel { display: none; }
  .tx__cat-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .tx__cat { padding: 28px 0 32px; }
  .tx__m-photo {
    display: block;
    aspect-ratio: 16 / 10;
    margin-bottom: 20px;
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--sand);
  }
  .tx__m-photo img { width: 100%; height: 100%; object-fit: cover; }
  .tx__m-say { display: block; margin: 22px 0 0; }
  .tx__m-say .tx__quote { font-size: 19px; }
  .tx__cat-name svg { opacity: 1; transform: none; width: 18px; height: 18px; }
  .tx__chip { font-size: 14px; padding: 0 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .tx__card > img, .tx__arrow img, .tx__arrow svg, .tx__need-words, .tx__need-to svg,
  .tx__cat-name svg, .tx__img, .tx__say, .tx__ba { transition: none; }
}
