/* Rebu condition library: shared visual system, original page copy preserved. */
.condition-page.condition-page {
  --condition-ink: #312f57;
  --condition-muted: #686374;
  --condition-paper: #fbfaf7;
  --condition-lavender: #eeebf4;
  --condition-rule: #ded9e4;
  --condition-font: "Rebu Home Geist", Arial, sans-serif;
  padding: 0 0 64px;
  color: var(--condition-ink);
  background: var(--condition-paper);
  font: 400 16px/1.75 var(--condition-font);
  -webkit-font-smoothing: antialiased;
}

.home-secondary-shell .home-route-content > .condition-page.condition-page { padding-top: 0; }
.condition-page *, .condition-page *::before, .condition-page *::after { box-sizing: border-box; }
.condition-page :where(h1, h2, h3) { overflow-wrap: break-word; }
.condition-page :where(a, button) { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.condition-page :where(a, button):focus-visible { outline: 3px solid #8264b9; outline-offset: 5px; }
.condition-page ::selection { color: var(--condition-ink); background: #d8cfeb; }

.condition-page > section:first-of-type,
.condition-page > section:nth-of-type(2),
.condition-page > .condition-related,
.condition-page > section:last-of-type {
  width: min(1200px, calc(100% - 112px));
  max-width: none;
  margin-inline: auto;
}

/* An open, human introduction replaces the old framed gradient hero. */
.condition-page > section:first-of-type {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr);
  grid-template-rows: auto auto 1fr auto auto;
  column-gap: clamp(32px, 5vw, 72px);
  align-items: start;
  overflow: visible;
  margin-block: 0 68px;
  padding: 64px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.condition-page > section:first-of-type > :not(:last-child) { grid-column: 1; min-width: 0; }

.condition-page > section:first-of-type > div:first-child {
  display: block;
  align-self: start;
  width: auto;
  margin: 0 0 22px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--condition-muted);
  background: none;
  box-shadow: none;
  font: 500 12px/1.65 var(--condition-font);
  letter-spacing: .015em;
  text-transform: none;
}

.condition-page--detail > section:first-of-type > div:first-child a {
  color: var(--condition-ink);
  text-decoration: underline;
  text-decoration-color: #b8b0c5;
  text-underline-offset: 4px;
}

.condition-page > section:first-of-type > h1 {
  max-width: none;
  margin: 0 0 24px;
  color: var(--condition-ink);
  font: 430 clamp(38px, 4.8vw, 64px)/1.08 var(--condition-font);
  letter-spacing: -.04em;
  text-wrap: balance;
}

.condition-page > section:first-of-type > p {
  max-width: 58ch;
  margin: 0;
  color: var(--condition-muted);
  font: 400 17px/1.8 var(--condition-font);
  text-wrap: pretty;
}

/* A clear prelaunch next step stays beside the introduction, before browsing. */
.condition-page > section:first-of-type > .condition-early-care {
  grid-column: 1;
  grid-row: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  min-width: 0;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--condition-rule);
}
.condition-early-care > div { flex: 1 1 220px; min-width: 0; }
.condition-early-care strong {
  display: block;
  color: var(--condition-ink);
  font: 500 16px/1.4 var(--condition-font);
  letter-spacing: -.015em;
}
.condition-early-care p {
  margin: 5px 0 0;
  color: var(--condition-muted);
  font: 400 13px/1.6 var(--condition-font);
}
.condition-page .condition-connect-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  gap: 16px;
  min-height: 48px;
  max-width: 100%;
  padding: 12px 20px;
  border: 1px solid var(--condition-ink);
  border-radius: 999px;
  color: #fff;
  background: var(--condition-ink);
  font: 500 14px/1.4 var(--condition-font);
  text-decoration: none;
  transition: background-color .18s, border-color .18s;
}
.condition-page .condition-connect-link:hover { background: #49436c; border-color: #49436c; }
.condition-page .condition-connect-link svg { width: 17px; height: 17px; flex: 0 0 17px; }

.condition-page > section:first-of-type::after {
  content: "";
  position: static;
  z-index: auto;
  grid-column: 2;
  grid-row: 1 / 5;
  align-self: stretch;
  width: 100%;
  height: auto;
  min-height: 410px;
  border: 0;
  border-radius: 22px;
  background: #e1d8ca url('/assets/home-redesign/process-conversation-v2-1280.webp') center center / cover no-repeat;
  pointer-events: none;
}

.condition-page--category > section:first-of-type::after {
  background-image: url('/assets/home-redesign/conditions-life-v1-960.webp');
  background-position: 50% 40%;
}

.condition-page > section:first-of-type > div:last-child {
  grid-column: 1 / -1;
  grid-row: 5;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  margin: 40px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--condition-rule);
}

.condition-page > section:first-of-type > div:last-child > div,
.condition-page > section:first-of-type > div:last-child > div:first-child {
  align-items: flex-start;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

.condition-page > section:first-of-type > div:last-child svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 3px 10px 0 0;
  color: #8a809b;
  stroke-width: 1.5;
}

.condition-page > section:first-of-type > div:last-child span {
  color: var(--condition-ink);
  font: 450 14px/1.65 var(--condition-font);
}

/* Keep every clinical section readable, with a predictable heading/body rhythm. */
.condition-page > section:nth-of-type(2) {
  display: block;
  padding: 0;
  counter-reset: none;
}

.condition-page > section:nth-of-type(2) > .grid,
.condition-page > section:nth-of-type(2) > .grid:nth-of-type(3),
.condition-page > section:nth-of-type(2) > .grid:nth-of-type(4),
.condition-page--category > section:nth-of-type(2) > .grid:nth-of-type(5) {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  align-items: start;
  gap: clamp(32px, 6vw, 84px);
  min-width: 0;
  margin: 0 !important;
  padding: 42px 0;
  border: 0;
  border-top: 1px solid var(--condition-rule);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  counter-increment: none;
}

.condition-page > section:nth-of-type(2) > .grid > div { min-width: 0; }
.condition-page > section:nth-of-type(2) > .grid > div:first-child,
.condition-page > section:nth-of-type(2) > .grid:nth-of-type(3) > div:first-child,
.condition-page > section:nth-of-type(2) > .grid:nth-of-type(4) > div:first-child {
  margin: 0;
  padding: 0;
  border: 0;
}

.condition-page > section:nth-of-type(2) > .grid h2 {
  position: static;
  margin: 0;
  color: var(--condition-ink);
  font: 430 clamp(27px, 2.7vw, 35px)/1.18 var(--condition-font);
  letter-spacing: -.03em;
  text-wrap: balance;
}

.condition-page > section:nth-of-type(2) > .grid h2::before { content: none; display: none; }
.condition-page > section:nth-of-type(2) > .grid p {
  max-width: 65ch;
  margin: 0;
  color: var(--condition-muted);
  font: 400 17px/1.85 var(--condition-font);
}
.condition-page > section:nth-of-type(2) > .grid p + p { margin-top: 1em; }

/* Related reading now follows the care invitation, not the final clinical row. */
.condition-page--detail > section:nth-of-type(2) > .grid:last-child::before {
  content: none;
  display: none;
}

/* Category navigation and related topics share the same quiet editorial cards. */
.condition-page--category > section:nth-of-type(2) > div:first-child,
.condition-page--detail > .condition-related {
  margin-block: 0 !important;
  padding: 56px 0;
  border: 0;
  border-top: 1px solid var(--condition-rule);
  border-radius: 0;
  background: transparent;
}

.condition-page--category > section:nth-of-type(2) > div:first-child::before,
.condition-page--detail > .condition-related::before { content: none; display: none; }

.condition-page--category > section:nth-of-type(2) > div:first-child > h2,
.condition-page--detail > .condition-related > h2 {
  max-width: 700px;
  margin: 0 0 18px;
  color: var(--condition-ink);
  font: 430 clamp(32px, 3.3vw, 43px)/1.13 var(--condition-font);
  letter-spacing: -.035em;
}

.condition-page--category > section:nth-of-type(2) > div:first-child > p,
.condition-page--detail > .condition-related > p {
  max-width: 65ch;
  margin: 0 0 32px;
  color: var(--condition-muted);
  font: 400 16px/1.75 var(--condition-font);
}

.condition-page--category > section:nth-of-type(2) > div:first-child > .grid,
.condition-page--detail > .condition-related .grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
}

.condition-page--category > section:nth-of-type(2) > div:first-child > .grid > :is(div, .condition-index-link),
.condition-page--category > section:nth-of-type(2) > div:first-child > .grid > :is(div, .condition-index-link):nth-child(n + 4),
.condition-page--detail > .condition-related .grid > a,
.condition-page--detail > .condition-related .grid > a:nth-child(n + 4) {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  min-height: 100%;
  padding: 28px;
  border: 1px solid var(--condition-rule);
  border-radius: 18px;
  color: var(--condition-ink);
  background: transparent;
  box-shadow: none;
  text-decoration: none;
  transition: background-color .18s, border-color .18s;
}

.condition-page--category > section:nth-of-type(2) > div:first-child > .grid > :is(div, .condition-index-link):nth-last-child(-n + 2),
.condition-page--detail > .condition-related .grid > a:nth-last-child(-n + 2) { grid-column: span 3; }

.condition-page--category > section:nth-of-type(2) > div:first-child h3,
.condition-page--detail > .condition-related h3 {
  margin: 0 0 13px;
  color: var(--condition-ink);
  font: 450 23px/1.25 var(--condition-font);
  letter-spacing: -.025em;
}

.condition-page--category > section:nth-of-type(2) > div:first-child .grid p,
.condition-page--detail > .condition-related a p {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  margin: 0 0 20px;
  color: var(--condition-muted);
  font: 400 14px/1.8 var(--condition-font);
}

.condition-page--category > section:nth-of-type(2) > div:first-child > .grid > .condition-index-link > span,
.condition-page--detail > .condition-related a > div:last-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  min-height: 44px;
  margin-top: auto;
  padding: 8px 0 0;
  color: var(--condition-ink);
  font: 500 13px/1.5 var(--condition-font);
}

.condition-page--category > section:nth-of-type(2) > div:first-child > .grid > .condition-index-link:hover,
.condition-page--detail > .condition-related a:hover {
  border-color: #b8b0c5;
  background: #f0edf5;
  box-shadow: none;
  transform: none;
}

.condition-page--category > section:nth-of-type(2) > div:first-child > .grid > .condition-index-link:hover h3,
.condition-page--category > section:nth-of-type(2) > div:first-child > .grid > .condition-index-link:focus-visible h3,
.condition-page--detail > .condition-related a:hover h3 { color: var(--condition-ink); }

/* A continuous lavender band invites the next step without a framed sales panel. */
.condition-page > section:nth-of-type(3) {
  width: 100%;
  max-width: none;
  margin: 40px 0 0;
  padding: 72px max(56px, calc((100% - 1200px) / 2));
  border: 0;
  border-radius: 0;
  background: var(--condition-lavender);
  box-shadow: none;
}

.condition-page > section:nth-of-type(3)::before { content: none; display: none; }
.condition-page > section:nth-of-type(3) > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px 80px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  text-align: left;
}

.condition-page > section:nth-of-type(3) h2 {
  grid-column: 1;
  grid-row: 1 / 3;
  max-width: 460px;
  margin: 0;
  color: var(--condition-ink);
  font: 430 clamp(36px, 4vw, 54px)/1.1 var(--condition-font);
  letter-spacing: -.04em;
}

.condition-page > section:nth-of-type(3) p {
  grid-column: 2;
  margin: 0;
  color: var(--condition-muted);
  font: 400 16px/1.8 var(--condition-font);
}

.condition-page > section:nth-of-type(3) button {
  grid-column: 2;
  justify-self: start;
  width: auto;
  max-width: 100%;
  height: auto;
  min-height: 54px;
  margin: 0;
  padding: 15px 24px !important;
  border: 1px solid var(--condition-ink);
  border-radius: 999px;
  color: #fff;
  background: var(--condition-ink);
  box-shadow: none;
  font: 500 14px/1.4 var(--condition-font);
  transition: background .18s, border-color .18s;
}

.condition-page > section:nth-of-type(3) button > span { gap: 24px; }
.condition-page > section:nth-of-type(3) button:hover {
  border-color: #49436c;
  background: #49436c;
  box-shadow: none;
  transform: none;
}
.condition-page > section:nth-of-type(3) button::after { content: none; display: none; }
.condition-page > section:nth-of-type(3) button svg { width: 18px; height: 18px; }

/* Sources are fully retained and comfortably readable. */
.condition-page > section:last-of-type {
  margin-block: 48px 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.condition-page > section:last-of-type > div {
  max-width: 100%;
  color: var(--condition-muted);
  font: 400 13px/1.85 var(--condition-font);
}
.condition-page > section:last-of-type h2 {
  margin: 0 0 16px;
  color: var(--condition-ink);
  font: 500 14px/1.5 var(--condition-font);
  letter-spacing: 0;
}
.condition-page > section:last-of-type p { max-width: 105ch; }

@media (max-width: 1190px) {
  .condition-page > section:first-of-type,
  .condition-page > section:nth-of-type(2),
  .condition-page > .condition-related,
  .condition-page > section:last-of-type { width: calc(100% - 80px); }
  .condition-page > section:nth-of-type(3) { padding-inline: 40px; }
  .condition-page > section:first-of-type { column-gap: 36px; }
  .condition-page > section:first-of-type > h1 { font-size: clamp(38px, 4.9vw, 56px); }
  .condition-page--category > section:nth-of-type(2) > div:first-child > .grid > :is(div, .condition-index-link),
  .condition-page--detail > .condition-related .grid > a { padding: 24px; }
}

@media (max-width: 900px) {
  .condition-page > section:first-of-type {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto auto auto;
    margin-bottom: 48px;
    padding-top: 42px;
  }
  .condition-page > section:first-of-type > h1 { max-width: 740px; font-size: clamp(38px, 6.5vw, 58px); }
  .condition-page > section:first-of-type > p { max-width: 72ch; }
  .condition-page > section:first-of-type::after {
    grid-column: 1;
    grid-row: 5;
    min-height: 0;
    aspect-ratio: 16 / 9;
    margin-top: 28px;
    background-position: 50% 28%;
    background-image: url('/assets/home-redesign/process-conversation-v2-768.webp');
  }
  .condition-page--category > section:first-of-type::after { background-image: url('/assets/home-redesign/conditions-life-v1-960.webp'); background-position: 50% 32%; }
  .condition-page > section:first-of-type > div:last-child { grid-row: 6; margin-top: 26px; gap: 20px; }
  .condition-page > section:first-of-type > div:last-child span { font-size: 13px; }
  .condition-page > section:nth-of-type(2) > .grid,
  .condition-page > section:nth-of-type(2) > .grid:nth-of-type(3),
  .condition-page > section:nth-of-type(2) > .grid:nth-of-type(4),
  .condition-page--category > section:nth-of-type(2) > .grid:nth-of-type(5) { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 32px; }
  .condition-page--category > section:nth-of-type(2) > div:first-child > .grid,
  .condition-page--detail > .condition-related .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .condition-page--category > section:nth-of-type(2) > div:first-child > .grid > :is(div, .condition-index-link),
  .condition-page--category > section:nth-of-type(2) > div:first-child > .grid > :is(div, .condition-index-link):nth-child(n + 4),
  .condition-page--category > section:nth-of-type(2) > div:first-child > .grid > :is(div, .condition-index-link):nth-last-child(-n + 2),
  .condition-page--detail > .condition-related .grid > a,
  .condition-page--detail > .condition-related .grid > a:nth-child(n + 4),
  .condition-page--detail > .condition-related .grid > a:nth-last-child(-n + 2) { grid-column: auto; }
  .condition-page--category > section:nth-of-type(2) > div:first-child > .grid > .condition-index-link:last-child,
  .condition-page--detail > .condition-related .grid > a:last-child { grid-column: 1 / -1; }
  .condition-page > section:nth-of-type(3) > div { column-gap: 40px; }
}

@media (max-width: 600px) {
  .condition-page.condition-page { padding-bottom: 42px; }
  .condition-page > section:first-of-type,
  .condition-page > section:nth-of-type(2),
  .condition-page > .condition-related,
  .condition-page > section:last-of-type { width: calc(100% - 44px); }
  .condition-page > section:first-of-type { padding: 34px 0 0; margin-bottom: 38px; }
  .condition-page > section:first-of-type > div:first-child { margin-bottom: 19px; font-size: 11px; }
  .condition-page--detail > section:first-of-type > div:first-child a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    max-width: 100%;
    padding-block: 6px;
    vertical-align: middle;
    overflow-wrap: anywhere;
  }
  .condition-page > section:first-of-type > h1 { font-size: clamp(34px, 8.8vw, 46px); margin-bottom: 20px; }
  .condition-page > section:first-of-type > p { font-size: 15px; line-height: 1.8; }
  .condition-page > section:first-of-type::after { aspect-ratio: 4 / 3; border-radius: 18px; }
  .condition-page--category > section:first-of-type::after { background-image: url('/assets/home-redesign/conditions-life-v1-640.webp'); }
  .condition-page > section:first-of-type > div:last-child { grid-template-columns: 1fr; gap: 12px; padding-top: 20px; }
  .condition-page > section:first-of-type > div:last-child > div,
  .condition-page > section:first-of-type > div:last-child > div:first-child { padding: 0; border: 0; }
  .condition-page > section:first-of-type > div:last-child span { font-size: 13px; }
  .condition-page > section:nth-of-type(2) > .grid,
  .condition-page > section:nth-of-type(2) > .grid:nth-of-type(3),
  .condition-page > section:nth-of-type(2) > .grid:nth-of-type(4),
  .condition-page--category > section:nth-of-type(2) > .grid:nth-of-type(5) { grid-template-columns: minmax(0, 1fr); gap: 17px; padding: 30px 0; }
  .condition-page > section:nth-of-type(2) > .grid h2 { font-size: 28px; }
  .condition-page > section:nth-of-type(2) > .grid p { font-size: 15px; line-height: 1.85; }
  .condition-page--category > section:nth-of-type(2) > div:first-child,
  .condition-page--detail > .condition-related { padding: 36px 0; }
  .condition-page--category > section:nth-of-type(2) > div:first-child > h2,
  .condition-page--detail > .condition-related > h2 { font-size: 32px; }
  .condition-page--category > section:nth-of-type(2) > div:first-child > p,
  .condition-page--detail > .condition-related > p { font-size: 15px; margin-bottom: 25px; }
  .condition-page--category > section:nth-of-type(2) > div:first-child > .grid,
  .condition-page--detail > .condition-related .grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .condition-page--category > section:nth-of-type(2) > div:first-child > .grid > :is(div, .condition-index-link),
  .condition-page--detail > .condition-related .grid > a { padding: 24px; border-radius: 16px; }
  .condition-page--category > section:nth-of-type(2) > div:first-child h3,
  .condition-page--detail > .condition-related h3 { font-size: 23px; }
  .condition-page > section:nth-of-type(3) { padding: 46px 22px; margin-top: 24px; }
  .condition-page > section:nth-of-type(3) > div { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .condition-page > section:nth-of-type(3) h2,
  .condition-page > section:nth-of-type(3) p,
  .condition-page > section:nth-of-type(3) button { grid-column: 1; grid-row: auto; }
  .condition-page > section:nth-of-type(3) h2 { max-width: 400px; font-size: 39px; }
  .condition-page > section:nth-of-type(3) p { font-size: 15px; }
  .condition-page > section:nth-of-type(3) button { width: auto; max-width: 100%; }
  .condition-page > section:last-of-type { margin-top: 36px; }
  .condition-page > section:last-of-type > div { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .condition-page *, .condition-page *::before, .condition-page *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
