/* Rockland Beauty — /treatments.
   Adopts the canonical DESIGN.md "light clinic-atelier" world as shipped on the
   Homepage: warm ivory, pale lavender, deep plum text + compact CTA, Hatton
   display serif + Helvetica Now, generous 20-40px radii, capsule buttons,
   layered soft-shadow imagery, and the signature arched portrait. */

:root {
  --rbw-cream: #fdf9f2;
  --rbw-cream-2: #f6edde;
  --rbw-cream-3: #efe3d1;
  --rbw-plum: #413033;
  --rbw-plum-2: #573f43;
  --rbw-plum-3: #2c1f21;
  --rbw-gold: #e7c091;
  --rbw-gold-2: #d9a867;
  --rbw-ink: #2e2022;
  --rbw-muted: #7a6a68;
  --rbw-muted-on-plum: #ddcac6;
  --rbw-lilac: #f4f3fb;
  --rbw-lilac-2: #e7e6f5;
  --rbw-lilac-3: #d9d8ee;
  --rbw-line: rgba(65, 48, 51, .12);
  --rbw-line-on-plum: rgba(253, 249, 242, .2);
  --rbw-radius-lg: 40px;
  --rbw-radius-md: 28px;
  --rbw-radius-sm: 20px;
  --rbw-shadow: 0 28px 64px -34px rgba(46, 32, 34, .45), 0 10px 26px -18px rgba(46, 32, 34, .22);
  --rbw-shadow-soft: 0 20px 44px -28px rgba(46, 32, 34, .32);
  --rbw-gutter: clamp(24px, 5vw, 96px);
  --rbw-shell: 1320px;
}

/* Horizontal overflow is clipped at the root: on the body it would break
   position: sticky for the site header (Chrome treats the body as the
   sticky containing block once it clips). */
html {
  overflow-x: clip;
}

.treatments-page {
  margin: 0;
  background: var(--rbw-cream);
  color: var(--rbw-plum);
}

.treatments-page *,
.treatments-page *::before,
.treatments-page *::after {
  box-sizing: border-box;
}

.treatments-page a,
.treatments-page button {
  -webkit-tap-highlight-color: transparent;
}

/* ---------------------------------------------------------------- header */
/* Sit in flow on the ivory ground, like the Homepage; plum foreground via
   the shared light header's dark theme (Header.astro maps dark -> plum). */
.treatments-page .site-header {
  position: static;
}

.treatments-page .site-header .container {
  max-width: var(--rbw-shell);
  margin: 0 auto;
  padding: clamp(20px, 2.2vw, 28px) var(--rbw-gutter) 16px;
}

/* ---------------------------------------------------------------- focus */
.treatments-page a:focus-visible,
.treatments-page button:focus-visible {
  outline: 3px solid var(--rbw-gold);
  outline-offset: 3px;
}

/* ---------------------------------------------------------------- hero */
.treatments-hero {
  padding: 0 0 clamp(44px, 6vw, 76px);
}

.treatments-hero__panel {
  position: relative;
  max-width: var(--rbw-shell);
  margin: 0 auto;
  min-height: clamp(480px, 72vh, 740px);
  border-radius: 32px;
  overflow: hidden;
  background-size: cover;
  background-position: 62% 30%;
  box-shadow: var(--rbw-shadow);
  display: flex;
  align-items: center;
}

.treatments-hero__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(253, 249, 242, .94) 0%, rgba(253, 249, 242, .6) 34%, rgba(253, 249, 242, 0) 66%);
  pointer-events: none;
}

.treatments-hero__content {
  position: relative;
  z-index: 1;
  max-width: 40rem;
  padding: clamp(30px, 5vw, 64px);
}

.treatments-hero h1 {
  margin: 0 0 18px;
  font-family: "Hatton-Medium", Georgia, serif;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.02em;
  color: var(--rbw-plum);
  text-wrap: balance;
}

.treatments-hero__lede {
  margin: 0 0 8px;
  font-family: "HelveticaNowDisplay-Medium", Arial, sans-serif;
  font-size: clamp(1.05rem, 1.5vw, 1.22rem);
  line-height: 1.45;
  color: var(--rbw-plum);
  max-width: 32ch;
}

.treatments-hero__sub {
  margin: 0 0 30px;
  font-family: "HelveticaNowDisplay-Regular", Arial, sans-serif;
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--rbw-muted);
  max-width: 32ch;
}

.treatments-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px;
}

/* ---------------------------------------------------------------- pill CTA */
/* Shared capsule CTA language from the Homepage (index2-button), no ripple. */
.treatments-hero__cta,
.treatment-panel__contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  padding: 1.12em 1.95em;
  border: 0;
  border-radius: 999px !important; /* app.css zeroes legacy button radii */
  cursor: pointer;
  font-family: "HelveticaNowDisplay-Medium", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1;
  white-space: nowrap;
  color: var(--rbw-cream);
  background: var(--rbw-plum);
  box-shadow: 0 16px 30px -18px rgba(46, 32, 34, .6);
  transition: transform .3s ease, box-shadow .3s ease, background .3s ease;
}

.treatments-hero__cta:hover,
.treatment-panel__contact:hover {
  transform: translateY(-2px);
  background: var(--rbw-plum-2);
  box-shadow: 0 22px 40px -20px rgba(46, 32, 34, .55);
}

/* ---------------------------------------------------------------- catalog */
.treatments-catalog {
  padding: clamp(44px, 6vw, 64px) 0 clamp(80px, 9vw, 140px);
  background: var(--rbw-cream);
}

.treatments-interface {
  display: grid;
  grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
  max-width: var(--rbw-shell);
  margin: 0 auto;
  padding: 0 var(--rbw-gutter);
}

/* Rail: the full 22-item selection list; names only, no numbering.
   One document scroll, with the right scene following at a proportional
   speed. Neither column intercepts the wheel or creates an inner scrollbar. */
.treatments-index {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

.treatments-index__heading {
  margin: 0;
  font-family: "HelveticaNowDisplay-Medium", Arial, sans-serif;
  font-size: .95rem;
  line-height: 1.4;
  color: var(--rbw-muted);
}

.treatments-index__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.treatments-index__control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 14px 22px;
  border: 1px solid var(--rbw-line);
  border-radius: var(--rbw-radius-sm);
  background: transparent;
  color: var(--rbw-plum);
  font-family: "Hatton-Medium", Georgia, serif;
  font-size: 1.22rem;
  line-height: 1.2;
  text-decoration: none;
  transition: background .3s ease, color .3s ease, transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

.treatments-index__control:hover {
  background: var(--rbw-cream-2);
  /* app.css legacy `a:hover{color:#2d9bff}` is more specific than the base
     rule above — keep the name plum explicitly on hover. */
  color: var(--rbw-plum);
  transform: translateY(-2px);
}

.treatments-index__control.is-active,
.treatments-index__control[aria-current="true"] {
  background: var(--rbw-plum);
  color: var(--rbw-cream);
  border-color: var(--rbw-plum);
  box-shadow: var(--rbw-shadow-soft);
}

.treatments-index__name {
  min-width: 0;
}

.treatments-index__arrow {
  flex: none;
  width: 20px;
  height: 20px;
  margin-left: auto;
  opacity: .4;
}

.treatments-index__arrow svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .3s ease, opacity .3s ease;
}

.treatments-index__control:hover .treatments-index__arrow,
.treatments-index__control.is-active .treatments-index__arrow {
  opacity: 1;
}

.treatments-index__control:hover .treatments-index__arrow svg,
.treatments-index__control.is-active .treatments-index__arrow svg {
  transform: translateX(3px);
}

/* Inline-accordion furniture (chevron + per-item detail slot): desktop keeps
   the sticky two-column stage, so both stay out of the tree's paint there. */
.treatments-index__chevron {
  display: none;
}

.treatments-index__slot {
  display: none;
}

/* The controller maps the rail and description to the same scroll progress.
   Long copy travels more slowly; copy that fits in the viewport stays pinned.
   The default remains ordinary document flow without JavaScript. */
.treatments-stage {
  position: relative;
  min-width: 0;
}

.treatments-stage.is-scroll-following {
  will-change: transform;
}

.treatments-stage__panels {
  position: relative;
  min-width: 0;
}

/* Only the active panel is shown once the controller enhances the interface;
   keep the seam generic so a no-JS render never hides content. */
.treatments-interface.is-enhanced .treatment-panel[hidden] {
  display: none !important;
}

.treatment-panel {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  height: auto;
  min-height: 520px;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--rbw-radius-lg);
  /* Deep links (/treatments#sculptra) land below the sticky header. */
  scroll-margin-top: 128px;
  /* Featured-Treatments look from the Homepage: photo slice left, warm cream
     copy panel right — no lilac, no arch. Parent radius clips the photo's
     left corners and the copy panel's right corners. */
  background: var(--rbw-cream-2);
  box-shadow: var(--rbw-shadow-soft);
}

.treatment-panel__media {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--rbw-radius-lg) 0 0 var(--rbw-radius-lg);
  background: var(--rbw-cream-3);
}

.treatment-panel__media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 480px;
  object-fit: cover;
  object-position: center;
}

.treatment-panel__copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0;
  padding: clamp(32px, 3.4vw, 44px) clamp(28px, 3.6vw, 52px) clamp(32px, 3.4vw, 44px) clamp(28px, 3.4vw, 48px);
  border-radius: 0 var(--rbw-radius-lg) var(--rbw-radius-lg) 0;
}

.treatment-panel h2 {
  margin: 0;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  font-family: "Hatton-Medium", Georgia, serif;
  font-size: clamp(1.7rem, 2.4vw, 2.4rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -.01em;
  color: var(--rbw-plum);
}

.treatment-panel [data-treatment-description] {
  max-width: 62ch;
  margin: 20px 0 0;
  font-family: "HelveticaNowDisplay-Regular", Arial, sans-serif;
  font-size: clamp(1.06rem, 1.12vw, 1.16rem);
  line-height: 1.66;
  color: var(--rbw-muted);
}

/* Structured body for the expanded treatment copy: lead summary above, then
   subheadings, paragraphs and short bullet lists for scannable depth. */
.treatment-panel__details {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 22px;
  /* keeps a breathing gap above the CTA even when margin-top:auto collapses */
  margin-bottom: clamp(26px, 3vw, 36px);
}

.treatment-panel__subheading {
  margin: 4px 0 0;
  font-family: "HelveticaNowDisplay-Medium", Arial, sans-serif;
  font-size: .98rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .01em;
  color: var(--rbw-plum);
}

.treatment-panel__paragraph,
.treatment-panel__list {
  max-width: 62ch;
  margin: 0;
  font-family: "HelveticaNowDisplay-Regular", Arial, sans-serif;
  font-size: clamp(1.06rem, 1.12vw, 1.16rem);
  line-height: 1.66;
  color: var(--rbw-muted);
}

.treatment-panel__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  list-style: none;
}

.treatment-panel__list li {
  position: relative;
  padding-left: 18px;
}

.treatment-panel__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rbw-gold-2);
}

.treatment-panel__details strong {
  font-family: "HelveticaNowDisplay-Medium", Arial, sans-serif;
  font-weight: 500;
  color: var(--rbw-plum);
}

.treatment-panel__contact {
  align-self: flex-start;
  margin-top: auto;
}

/* ---------------------------------------------------------------- responsive */
@media screen and (max-width: 1180px) {
  .treatments-interface {
    gap: 34px;
  }

  .treatment-panel {
    grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
  }
}

@media screen and (max-width: 1024px) {
  .treatments-hero {
    padding-bottom: clamp(40px, 6vw, 60px);
  }

  .treatments-hero__panel {
    min-height: clamp(460px, 70vh, 640px);
    background-position: 60% 30%;
  }

  .treatments-hero h1 {
    font-size: clamp(2.4rem, 6vw, 3rem);
  }

  .treatments-interface {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .treatments-stage {
    position: static;
  }

  /* Compact layout swaps the sticky stage for an inline accordion: the tapped
     name expands its own detail panel; only one item is open at a time. */
  .treatments-interface.is-accordion .treatments-stage {
    display: none;
  }

  .treatments-index__item.is-open .treatments-index__control,
  .treatments-index__item.is-open .treatments-index__control:hover {
    transform: none;
  }

  .treatments-index__control .treatments-index__arrow {
    display: none;
  }

  .treatments-index__chevron {
    display: block;
    flex: none;
    width: 9px;
    height: 9px;
    margin-left: auto;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    opacity: .55;
    transform: rotate(45deg);
    transition: transform .35s ease, opacity .35s ease;
  }

  .treatments-index__item.is-open .treatments-index__chevron {
    opacity: 1;
    transform: rotate(-135deg);
  }

  .treatments-index__slot {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .5s ease;
  }

  .treatments-index__slot-inner {
    min-height: 0;
    overflow: hidden;
  }

  .treatments-index__item.is-open .treatments-index__slot {
    grid-template-rows: 1fr;
  }

  .treatments-index__slot .treatment-panel {
    min-height: 0;
    margin: 10px 0 4px;
    border: 1px solid var(--rbw-line);
    box-shadow: none;
  }

  .treatment-panel {
    grid-template-columns: 1fr;
  }

  .treatment-panel__media {
    border-radius: var(--rbw-radius-lg) var(--rbw-radius-lg) 0 0;
  }

  .treatment-panel__media img {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  .treatment-panel__copy {
    border-radius: 0;
    padding: clamp(28px, 4vw, 44px) clamp(22px, 5vw, 40px);
  }
}

@media screen and (max-width: 700px) {
  .treatments-hero__panel {
    min-height: 520px;
    background-position: center 22%;
    align-items: flex-end;
  }

  .treatments-hero__content {
    padding: 24px 26px 30px;
  }

  .treatments-hero__panel::before {
    background: linear-gradient(180deg, rgba(253, 249, 242, 0) 0%, rgba(253, 249, 242, .4) 40%, rgba(253, 249, 242, .94) 64%, rgba(253, 249, 242, .97) 100%);
  }

  .treatments-hero h1 {
    font-size: clamp(2.2rem, 11vw, 2.9rem);
  }

  .treatments-hero__actions {
    gap: 16px;
  }

  .treatments-catalog {
    padding: clamp(40px, 8vw, 56px) 0 clamp(64px, 12vw, 96px);
  }

  .treatments-index__control {
    padding: 15px 18px;
    font-size: 1.12rem;
  }

  .treatment-panel {
    min-height: 0;
  }

  .treatment-panel__media img {
    aspect-ratio: 4 / 3;
  }

  .treatment-panel__copy {
    padding: clamp(24px, 6vw, 32px) clamp(20px, 6vw, 30px) clamp(30px, 8vw, 42px);
  }

  .treatment-panel h2 {
    font-size: clamp(1.6rem, 6vw, 2rem);
  }

  .treatments-hero__cta,
  .treatment-panel__contact {
    font-size: .96rem;
    padding: 1em 1.6em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .treatments-hero__cta,
  .treatment-panel__contact,
  .treatments-index__control,
  .treatments-index__arrow svg,
  .treatments-index__chevron,
  .treatments-index__slot {
    transition: none;
  }

  .treatments-index__control:hover .treatments-index__arrow svg,
  .treatments-index__control.is-active .treatments-index__arrow svg {
    transform: none;
  }
}

/* ---------------------------------------------------------------- shell alignment (grid pass)
   The hero is a standalone visual panel - a rounded card - so below the shell
   width it takes real side air instead of the ~20px that pure centring leaves.

   THIS BLOCK MUST STAY AT THE END OF THE FILE. It has the same specificity as
   `.treatments-hero__panel { margin: 0 auto }` above, so source order decides;
   placed above that rule it silently lost, and the panel stayed full-bleed
   (L=0, W=1280 at 1280px) while the homepage hero was inset (L=64, W=1152).

   1439px handoff keeps the 1440px reference exact: at 1440 the panel is the
   1320 shell with 60px of automatic air each side, as designed. */
@media (max-width: 1439px) {
  .treatments-hero__panel {
    margin-inline: var(--rbw-gutter);
  }
}
