/* Editorial refinements for the existing treatment-page contract.
   Load after treatments.css. The homepage is intentionally outside this sheet. */

.t-hero:is(.ritual, .maternity, .body) h1 {
  text-wrap: balance;
  overflow-wrap: break-word;
  letter-spacing: -.03em;
}

.t-hero:is(.ritual, .maternity, .body) .hero-excerpt {
  text-wrap: pretty;
}

/* Ritual: a large photograph and a grounded, overlapping reading surface.
   The copy remains legible without placing a wash over the photograph. */
.t-hero.ritual {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: stretch;
  min-height: 0;
  margin: 26px var(--space) 88px;
  overflow: visible;
  border-radius: 0;
  background: transparent;
}

.t-hero.ritual::after {
  content: none;
}

.t-hero.ritual .hero-media {
  position: relative;
  inset: auto;
  z-index: 0;
  grid-column: 6 / -1;
  grid-row: 1;
  width: 100%;
  min-height: 500px;
  max-height: 600px;
  aspect-ratio: 1.25;
  border-radius: var(--radius);
}

.t-hero.ritual .hero-media img {
  object-position: var(--photo-position, 62% center);
}

.t-hero.ritual .hero-copy {
  grid-column: 1 / 8;
  grid-row: 1;
  align-self: center;
  justify-self: start;
  width: 100%;
  max-width: 770px;
  margin-top: 48px;
  margin-bottom: 0;
  padding: clamp(32px, 4vw, 64px) clamp(32px, 4.3vw, 70px) 30px 0;
  border-radius: 0 var(--radius) 0 0;
  background: var(--paper);
}

.t-hero.ritual .hero-copy h1 {
  font-size: clamp(52px, 5.2vw, 84px);
  max-width: 10.5em;
  line-height: 1.04;
}

.t-hero.ritual .hero-excerpt {
  max-width: 37ch;
}

.t-hero.ritual .hero-actions {
  gap: 14px 26px;
}

/* Maternity: the photograph leads; the text gets a quieter, narrower measure. */
.t-hero.maternity {
  grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  gap: clamp(46px, 8vw, 128px);
  padding: 28px var(--space) 105px;
  min-height: 0;
  align-items: center;
}

.t-hero.maternity .hero-media {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 720px;
  border-radius: var(--radius);
}

.t-hero.maternity .hero-media img {
  object-position: var(--photo-position, center 42%);
}

.t-hero.maternity .hero-copy {
  grid-column: 2;
  grid-row: 1;
  padding-block: 60px 20px;
  max-width: 580px;
}

.t-hero.maternity .hero-copy h1 {
  font-size: clamp(48px, 4.5vw, 74px);
  line-height: 1.08;
}

.t-hero.maternity .hero-excerpt {
  max-width: 35ch;
  margin-top: 30px;
  line-height: 1.8;
}

.t-hero.maternity .hero-actions {
  align-items: flex-start;
  flex-direction: column;
  gap: 12px;
  margin-top: 32px;
}

/* Body: an asymmetric diptych with the image set below the title's first line. */
.t-hero.body {
  grid-template-columns: minmax(0, 1.22fr) minmax(0, .78fr);
  gap: clamp(48px, 8vw, 128px);
  align-items: start;
  min-height: 0;
  padding: 35px var(--space) 100px;
}

.t-hero.body .hero-copy {
  padding-top: 0;
  min-width: 0;
}

.t-hero.body .hero-copy h1 {
  font-size: clamp(62px, 6.4vw, 96px);
  line-height: 1.02;
  max-width: 9em;
}

.t-hero.body .hero-copy .kicker {
  margin-bottom: 34px;
}

.t-hero.body .hero-excerpt {
  margin-top: 40px;
  max-width: 36ch;
}

.t-hero.body .hero-media {
  width: 100%;
  margin-top: 90px;
  aspect-ratio: 3 / 4;
  max-height: 660px;
  border-radius: var(--radius);
}

.t-hero.body .hero-media img {
  object-position: var(--photo-position, center);
}

/* The aesthetic area is an edited service index, rather than a wall of cards.
   Group headings hold their place while the relevant treatments are scanned. */
.t-hero.ritual + .area-story {
  padding-top: 28px;
  padding-bottom: clamp(65px, 7vw, 112px);
}

.t-hero.ritual ~ .area-catalog .catalog-controls {
  padding-bottom: 20px;
}

.t-hero.ritual ~ .area-catalog .catalog-group {
  display: grid;
  grid-template-columns: minmax(180px, .75fr) minmax(0, 2fr);
  gap: clamp(36px, 6vw, 90px);
  align-items: start;
  padding-block: 36px 65px;
}

.t-hero.ritual ~ .area-catalog .catalog-group > h2 {
  position: sticky;
  top: 112px;
  margin-bottom: 0;
  font-size: clamp(30px, 2.8vw, 43px);
  line-height: 1.16;
  text-wrap: balance;
}

.t-hero.ritual ~ .area-catalog .catalog-grid {
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--line);
}

.t-hero.ritual ~ .area-catalog .catalog-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 32px;
  min-height: 0;
  padding: 27px 0 30px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  transform: none;
  transition: color 180ms ease;
}

.t-hero.ritual ~ .area-catalog .catalog-card > .kicker {
  display: none;
}

.t-hero.ritual ~ .area-catalog .catalog-card h3 {
  grid-column: 1;
  margin: 0;
  font-size: clamp(28px, 2.3vw, 35px);
  line-height: 1.2;
  text-wrap: balance;
}

.t-hero.ritual ~ .area-catalog .catalog-card p {
  grid-column: 1;
  max-width: 60ch;
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.75;
}

.t-hero.ritual ~ .area-catalog .catalog-card .card-more {
  grid-column: 2;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  align-self: center;
  max-width: 12ch;
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  text-align: right;
}

.t-hero.ritual ~ .area-catalog .card-more > span {
  display: inline-block;
  font-size: 22px;
  line-height: 1;
  transition: transform 220ms var(--ease);
}

.t-hero.ritual ~ .area-catalog .catalog-card:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 7px;
  border-radius: 4px;
}

@media (hover: hover) and (pointer: fine) {
  .t-hero.ritual ~ .area-catalog .catalog-card:hover {
    background: transparent;
    transform: none;
  }

  .t-hero.ritual ~ .area-catalog .catalog-card:hover .card-more > span {
    transform: translate(3px, -3px);
  }

  .t-hero.ritual ~ .area-catalog .catalog-card:hover h3 {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 6px;
  }
}

@media (min-width: 781px) and (max-width: 1150px) {
  .t-hero.ritual .hero-media {
    grid-column: 5 / -1;
    min-height: 500px;
    max-height: 560px;
  }

  .t-hero.ritual .hero-copy {
    grid-column: 1 / 9;
    padding-right: 38px;
    max-width: 650px;
  }

  .t-hero.ritual .hero-copy h1 {
    font-size: clamp(48px, 6vw, 68px);
  }

  .t-hero.maternity {
    gap: 42px;
  }

  .t-hero.maternity .hero-copy {
    padding-top: 28px;
  }

  .t-hero.maternity .hero-copy h1 {
    font-size: clamp(44px, 5vw, 58px);
  }

  .t-hero.body {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    gap: 42px;
  }

  .t-hero.body .hero-copy h1 {
    font-size: clamp(54px, 6.1vw, 72px);
  }

  .t-hero.body .hero-media {
    margin-top: 76px;
  }

  .t-hero.ritual ~ .area-catalog .catalog-group {
    grid-template-columns: minmax(150px, .65fr) minmax(0, 2fr);
    gap: 38px;
  }
}

@media (max-width: 780px) {
  .t-hero.ritual {
    grid-template-columns: 1fr;
    min-height: 0;
    margin: 10px 24px 62px;
  }

  .t-hero.ritual .hero-media {
    grid-column: 1;
    grid-row: 1;
    min-height: 0;
    width: calc(100% - 24px);
    margin-left: 24px;
    aspect-ratio: 5 / 4;
    max-height: 430px;
  }

  .t-hero.ritual .hero-copy {
    grid-column: 1;
    grid-row: 2;
    width: calc(100% - 24px);
    max-width: none;
    margin: -38px 0 0;
    padding: 31px 20px 0 0;
    border-radius: 0 12px 0 0;
  }

  .t-hero.ritual .hero-copy h1 {
    max-width: 11em;
    font-size: clamp(44px, 11vw, 65px);
    line-height: 1.06;
  }

  .t-hero.ritual .hero-excerpt {
    max-width: 37ch;
    margin-top: 22px;
  }

  .t-hero.ritual .hero-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .t-hero.maternity {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 20px 24px 66px;
  }

  .t-hero.maternity .hero-copy {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    max-width: none;
    padding: 0;
  }

  .t-hero.maternity .hero-copy h1 {
    max-width: 12em;
    font-size: clamp(43px, 10.7vw, 66px);
  }

  .t-hero.maternity .hero-excerpt {
    max-width: 38ch;
    margin-top: 22px;
  }

  .t-hero.maternity .hero-actions {
    margin-top: 25px;
  }

  .t-hero.maternity .hero-media {
    grid-column: 1;
    grid-row: 2;
    width: 88%;
    margin-left: auto;
    aspect-ratio: 4 / 5;
    max-height: 560px;
    border-radius: var(--radius);
  }

  .t-hero.body {
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 26px 24px 65px;
  }

  .t-hero.body .hero-copy h1 {
    font-size: clamp(47px, 12vw, 70px);
    max-width: 10em;
    line-height: 1.04;
  }

  .t-hero.body .hero-copy .kicker {
    margin-bottom: 22px;
  }

  .t-hero.body .hero-excerpt {
    margin-top: 25px;
    max-width: 38ch;
  }

  .t-hero.body .hero-media {
    width: 100%;
    margin: 0;
    aspect-ratio: 5 / 4;
    max-height: 460px;
  }

  .t-hero.body .hero-media img {
    object-position: var(--photo-position, center 42%);
  }

  .t-hero.ritual + .area-story {
    padding-top: 0;
    padding-bottom: 55px;
  }

  .t-hero.ritual ~ .area-catalog .catalog-group {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-block: 26px 38px;
  }

  .t-hero.ritual ~ .area-catalog .catalog-group > h2 {
    position: static;
    max-width: 16ch;
    font-size: 34px;
  }

  .t-hero.ritual ~ .area-catalog .catalog-card {
    gap: 0 18px;
    padding-block: 22px 25px;
  }

  .t-hero.ritual ~ .area-catalog .catalog-card h3 {
    font-size: 28px;
  }

  .t-hero.ritual ~ .area-catalog .catalog-card p {
    grid-column: 1 / -1;
    margin-top: 12px;
    max-width: 50ch;
  }

  .t-hero.ritual ~ .area-catalog .catalog-card .card-more {
    grid-column: 2;
    grid-row: 1;
    max-width: 9ch;
    font-size: 10px;
  }
}

@media (max-width: 390px) {
  .t-hero.ritual .hero-copy {
    width: 100%;
    padding-right: 10px;
  }

  .t-hero:is(.ritual, .maternity, .body) .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .t-hero:is(.ritual, .maternity, .body) .hero-actions .t-button {
    white-space: normal;
    text-align: center;
  }

  .t-hero:is(.ritual, .maternity, .body) .hero-actions .text-link {
    align-self: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .t-hero.ritual ~ .area-catalog .card-more > span {
    transition: none;
    transform: none !important;
  }
}
