@import url('/hope-tokens.css');
/* Portal adapters. Shared values live in hope-tokens.css. Clinical status colors stay semantic. */
.portal-theme {
  --portal-ink: #142f42;
  --portal-blue: #256b8c;
  --portal-teal: #087f7a;
  --portal-warm: #ad4e23;
  background: var(--hope-light);
  color: var(--portal-ink);
}
.portal-theme .portal-header {
  background: var(--hope-prism);
  border-color: #ffffffb3;
  box-shadow: var(--hope-shadow);
  -webkit-backdrop-filter: blur(var(--hope-blur));
  backdrop-filter: blur(var(--hope-blur));
}
.portal-theme .portal-header .portal-brand { color: var(--hope-ink); }
.portal-brand svg { color: var(--hope-teal); }
.portal-header button[aria-label],
.portal-header a[href*="login"],
.portal-header .portal-nav a,
.portal-header .portal-nav > span { color: #30495f; }
.portal-header .portal-nav a[data-active],
.portal-header .portal-nav a:hover { color: var(--hope-blue); border-bottom-color: var(--hope-lavender); }
.portal-header [data-nav-emphasis] {
  background: #ffffffa6;
  color: #285980;
}
.portal-header a[href*="signup"],
.portal-header a[href="/life/home"] { background: var(--hope-action); color: #fff; }
.portal-header button[aria-label]:hover { background: #ffffffa6; color: var(--hope-ink); }

.portal-theme .portal-hero {
  position: relative;
  isolation: isolate;
  background: radial-gradient(ellipse at 85% 15%,#e3d7fb8c,transparent 55%), radial-gradient(ellipse at 14% 95%,#aeead761,transparent 48%),linear-gradient(120deg,#edf9fb,#f6f8ff 50%,#fff2ed);
  border-bottom: 1px solid #c7dfe8;
}
.portal-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at 80% 18%,#61c9b936,transparent 48%),
    radial-gradient(ellipse at 16% 88%,#79aee638,transparent 53%);
  opacity: .7;
}
.portal-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: repeating-radial-gradient(ellipse at 100% 0%,transparent 0 91px,#256b8c09 92px 93px,transparent 94px 160px);
}
.portal-hero--rehab { background: linear-gradient(120deg,#edf7f5,#d9eee4 65%,#eef5d8) !important; }
.portal-hero--beauty { background: linear-gradient(120deg,#fcf3ee,#f9e3e9 65%,#eee5f5) !important; }
.portal-hero h1 { color: #142f42; }
.portal-hero p,
.portal-stats a > span:last-child,
.portal-topic-card span span { color: #52677a; }
.portal-hero h1 span { color: #216d8a; }
.portal-hero--rehab h1 span { color: #047857; }
.portal-hero--beauty h1 span { color: #a72562; }
.portal-theme .portal-action {
  background: var(--hope-action);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px #285daa25;
}
.portal-search-tabs button[aria-pressed="true"] {
  background: var(--hope-action);
  border-color: transparent;
  box-shadow: 0 3px 10px #142f4217;
}
.portal-stats a { border-color: #c6dce6; box-shadow: 0 3px 15px #1a536507; }
.portal-stats a:nth-child(2) { background: #e7f4ee; border-color: #c6dfd5; }
.portal-stats a:nth-child(2) > span:first-child { color: #167050; }
.portal-stats a:nth-child(3) { background: #fff3e7; border-color: #eddac8; }
.portal-stats a:nth-child(3) > span:first-child { color: #9d4a20; }
.portal-stats a:nth-child(4) { background: #eeeef9; border-color: #d8d7e9; }
.portal-stats a:nth-child(4) > span:first-child { color: #625194; }
.portal-near { padding-top: 34px; }
.portal-section-heading { border-bottom: 1px solid #d6e3e8; }
.portal-section-heading h2 > span { background: #dceef5; }
.portal-health-section { background: linear-gradient(130deg,#f1f9f7b8,#f5f9fca3) !important; }
.portal-topic-card:nth-child(3n+1) { background: var(--hope-glass-shine),#d9edf7a3; border-color: #ffffffd9; }
.portal-topic-card:nth-child(3n+2) { background: var(--hope-glass-shine),#e1f3e5a3; border-color: #ffffffd9; }
.portal-topic-card:nth-child(3n) { background: var(--hope-glass-shine),#fae9dca3; border-color: #ffffffd9; }
.portal-theme .portal-consult {
  background: radial-gradient(ellipse at 100% 0%,#137d80 0%,transparent 65%),linear-gradient(120deg,#142f42,#1e5667);
  box-shadow: 0 16px 40px -24px #142f4290;
}
.portal-consult button { color: #91421f; background: #fff2e5; }
.portal-theme .portal-business { background: linear-gradient(115deg,#193c50,#256b8c); }
.portal-page { position: relative; isolation: isolate; }
.portal-page::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 330px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at 92% 0%,#a8dcd63d,transparent 65%);
}
.portal-page > h1 { color: #193f55; }
.portal-page > h1::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: .85em;
  border-radius: 4px;
  margin-right: 12px;
  background: linear-gradient(#287896,#28a799);
}
.portal-editorial-card { border-color: #d9e6eb; box-shadow: 0 3px 12px #173e4f04; }
.portal-editorial-card:nth-child(4n+2) > span:first-child { background: #e5f3eb; }
.portal-editorial-card:nth-child(4n+2) > span:first-child svg { color: #247356; }
.portal-editorial-card:nth-child(4n+3) > span:first-child { background: #fff0e4; }
.portal-editorial-card:nth-child(4n+3) > span:first-child svg { color: #a95227; }
.portal-editorial-card:nth-child(4n+4) > span:first-child { background: #efedf8; }
.portal-editorial-card:nth-child(4n+4) > span:first-child svg { color: #6d5695; }
.portal-card { border-color: #d4e2e9; }
.portal-theme .portal-footer { background: #e6eff3; border-color: #c7dbe4; }
.portal-footer > div > div:last-child { background: #f5f9fb; color: #4d6678; }
.portal-theme :where(a,button) { transition: background-color .2s ease,color .2s ease,border-color .2s ease,box-shadow .2s ease,transform .2s ease; }
.portal-theme :where(a,button,input,select):focus-visible { outline: 3px solid #d78b51; outline-offset: 3px; }
@media (hover:hover) and (pointer:fine) {
  .portal-card:hover,.portal-editorial-card:hover,.portal-topic-card:hover,.portal-stats a:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px -14px #20556b50;
    border-color: #83b7c8;
  }
  .portal-action:hover { transform: translateY(-1px); box-shadow: 0 7px 18px #ad4e2330; }
}
.portal-theme button:active { transform: translateY(1px); }
@keyframes portal-breathe { from { opacity: .55; } to { opacity: 1; } }
@media (max-width:767px) {
  .portal-hero::after { opacity: .45; }
  .portal-hero::before { animation-duration: 22s; }
  .portal-near { padding-top: 26px; }
  /* Mobile keeps translucent paint; only the blur budget changes in tokens. */
}
@media (prefers-reduced-motion:reduce) {
  .portal-hero::before { animation: none; }
  .portal-theme :where(a,button) { transition: none; }
  .portal-theme :where(a,button):hover,.portal-theme button:active { transform: none; }
}
/* Public, server-rendered articles use the same palette without loading the app. */
html.portal-static body { background: #f2f7fa; }
html.portal-static body > header { background: var(--hope-prism); border-color: var(--hope-line); -webkit-backdrop-filter: blur(var(--hope-blur)); backdrop-filter: blur(var(--hope-blur)); }
html.portal-static body > header .logo { color: var(--hope-ink); }
html.portal-static body > header .hnav { color: var(--hope-muted); }
html.portal-static body > header .hnav .cta { background: var(--hope-action); color: #fff; }
html.portal-static body > header .hnav a:hover { background: #e1eef8; color: var(--hope-ink); }
html.portal-static body article { border-color: #d5e4eb; box-shadow: 0 8px 30px #15374a06; }
html.portal-static body .summary { background: #e7f3f7; }

/* Consistent chrome and cards, including the first item in every metric row. */
.portal-theme .portal-header::after { content:""; position:absolute; inset:auto 0 -1px; height:2px; background:var(--hope-spectrum); pointer-events:none; }
.portal-theme .portal-card, .portal-editorial-card { border-radius:var(--hope-radius); box-shadow:var(--hope-shadow); }
.portal-theme .portal-stats > a { padding:18px; min-width:0; background:#ffffffa6; border:1px solid #ffffffcf; border-radius:16px; box-shadow:var(--hope-shadow); }
.portal-theme .portal-stats > a:nth-child(2) { background:#e5f7edb3; }
.portal-theme .portal-stats > a:nth-child(3) { background:#fff3e2b3; }
.portal-theme .portal-stats > a:nth-child(4) { background:#eee7fcb3; }
.portal-theme .portal-stats > a > span:first-child { font-variant-numeric:tabular-nums; font-size:25px; }
.portal-theme .portal-header [data-nav-emphasis] { min-height:44px; }
.portal-theme .portal-hero--cancer { padding-block:clamp(36px,5vw,72px); }
.portal-theme .portal-hero--cancer h1 { max-width:850px; font-size:clamp(28px,3.4vw,46px); line-height:1.35; letter-spacing:-.045em; }
.portal-theme .portal-hero--cancer > div > p:not(.hope-eyebrow) { max-width:720px; margin-block:16px 26px; }
.portal-theme .portal-hero .hope-eyebrow { color:var(--hope-teal); }
.portal-theme .portal-search-tabs { margin-bottom:12px; }
.portal-theme .portal-header a[href*="signup"],.portal-theme .portal-header a[href="/life/home"] { color:white; }
.portal-theme .portal-footer { background:linear-gradient(120deg,#eaf6f3,#edf0fa); }
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) {
  .portal-theme .portal-header,html.portal-static body > header { background:var(--hope-prism-fallback); }
}
@media(prefers-reduced-transparency:reduce) {
  .portal-theme .portal-header,html.portal-static body > header { background:#edf6f7; backdrop-filter:none; -webkit-backdrop-filter:none; }
}
@media(max-width:767px) { .portal-theme .portal-hero--cancer h1 { font-size:clamp(26px,6.9vw,34px); } }

/*
 * Glass surface policy
 * --------------------
 * Every neutral/pastel rounded surface in the public portal participates in the
 * same material system, even when it was authored with a Tailwind utility rather
 * than a component class. Media, maps, semantic status colours and primary action
 * buttons are intentionally excluded so their meaning and contrast stay intact.
 */
.portal-theme .portal-header, html.portal-static body > header {
  background:var(--hope-glass-shine),var(--hope-prism);
  border-color:var(--hope-glass-edge); box-shadow:var(--hope-glass-shadow);
  -webkit-backdrop-filter:blur(var(--hope-blur)) saturate(var(--hope-saturation));
  backdrop-filter:blur(var(--hope-blur)) saturate(var(--hope-saturation));
}
.portal-theme :is(
  .portal-card,
  .portal-editorial-card,
  .portal-topic-card,
  .portal-stats > a,
  .portal-glass-surface
) {
  background:var(--hope-glass-shine),var(--hope-glass);
  border-color:var(--hope-glass-edge); box-shadow:var(--hope-glass-shadow);
  -webkit-backdrop-filter:blur(var(--hope-panel-blur)) saturate(var(--hope-saturation));
  backdrop-filter:blur(var(--hope-panel-blur)) saturate(var(--hope-saturation));
}

/* Utility-authored cards, search fields, filters, tabs, chips and sheet panels. */
.portal-theme [class~="bg-white"][class*="rounded"],
.portal-theme [class~="bg-white/95"][class*="rounded"],
.portal-theme [class~="bg-white/97"][class*="rounded"],
.portal-theme [class~="bg-[#F8FAFC]"][class*="rounded"],
.portal-theme [class~="bg-[#FBFCFE]"][class*="rounded"],
.portal-theme [class~="bg-[#F1F5F9]"][class*="rounded"],
.portal-theme [class~="bg-[#E7F3FA]"][class*="rounded"],
.portal-theme [class~="bg-[#EAF5F9]"][class*="rounded"],
.portal-theme [class~="bg-[#ECFDF5]"][class*="rounded"],
.portal-theme [class~="bg-[#FFF7ED]"][class*="rounded"] {
  background:var(--hope-glass-shine),var(--hope-glass) !important;
  border-color:var(--hope-glass-edge) !important;
  box-shadow:var(--hope-glass-shadow);
  -webkit-backdrop-filter:blur(var(--hope-panel-blur)) saturate(var(--hope-saturation));
  backdrop-filter:blur(var(--hope-panel-blur)) saturate(var(--hope-saturation));
}

/* Large section bands should also reveal the ambient Hope UI colour field. */
.portal-theme :is(section[class~="bg-white"],.portal-health-section) {
  background:linear-gradient(135deg,#ffffff8f,#f3fbfaa3) !important;
  border-color:#ffffffc7 !important;
  -webkit-backdrop-filter:blur(var(--hope-panel-blur)) saturate(var(--hope-saturation));
  backdrop-filter:blur(var(--hope-panel-blur)) saturate(var(--hope-saturation));
}

/* Form controls without a utility background still need a readable glass fill. */
.portal-theme :is(input,select,textarea)[class*="rounded"]:not([class~="bg-transparent"]) {
  background:linear-gradient(145deg,#ffffffe8,#ffffff73) !important;
  border-color:#ffffffe0 !important;
  box-shadow:inset 0 1px 0 #fff,0 4px 16px -12px #345c8a42;
  -webkit-backdrop-filter:blur(var(--hope-panel-blur)) saturate(var(--hope-saturation));
  backdrop-filter:blur(var(--hope-panel-blur)) saturate(var(--hope-saturation));
}
.portal-theme .portal-stats > a:nth-child(2) { background:var(--hope-glass-shine),#cef0df99; }
.portal-theme .portal-stats > a:nth-child(3) { background:var(--hope-glass-shine),#ffedcf99; }
.portal-theme .portal-stats > a:nth-child(4) { background:var(--hope-glass-shine),#e5d7fa99; }

/* Topic identity remains visible as a tint beneath the common glass material. */
.portal-theme .portal-topic-card:nth-child(3n+1) { background:var(--hope-glass-shine),#d9edf7a3 !important; }
.portal-theme .portal-topic-card:nth-child(3n+2) { background:var(--hope-glass-shine),#e1f3e5a3 !important; }
.portal-theme .portal-topic-card:nth-child(3n) { background:var(--hope-glass-shine),#fae9dca3 !important; }
.portal-theme .portal-topic-card > span:first-child {
  background:linear-gradient(145deg,#fffffff2,#ffffff80) !important;
  border-color:#ffffffed !important;
  box-shadow:inset 0 1px 0 #fff,0 5px 14px -10px #345c8a66;
}

/* Cards retain a crisp lower edge over photographs and dense mobile grids. */
.portal-theme .portal-card { isolation:isolate; }
.portal-theme .portal-card > :not(a) { position:relative; z-index:1; }

/* Server-rendered article surfaces follow the same material policy. */
html.portal-static body article,
html.portal-static body .summary {
  background:var(--hope-glass-shine),var(--hope-glass);
  border-color:var(--hope-glass-edge);
  box-shadow:var(--hope-glass-shadow);
  -webkit-backdrop-filter:blur(var(--hope-panel-blur)) saturate(var(--hope-saturation));
  backdrop-filter:blur(var(--hope-panel-blur)) saturate(var(--hope-saturation));
}

@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) {
  .portal-theme :is(.portal-card,.portal-editorial-card,.portal-topic-card,.portal-stats > a,.portal-glass-surface),
  .portal-theme [class*="rounded"][class~="bg-white"],
  .portal-theme [class*="rounded"][class~="bg-[#F8FAFC]"],
  html.portal-static body :is(article,.summary) {
    background:var(--hope-solid) !important;
  }
}
@media(prefers-reduced-transparency:reduce) {
  .portal-theme .portal-header,
  .portal-theme :is(.portal-card,.portal-editorial-card,.portal-topic-card,.portal-stats > a,.portal-glass-surface),
  .portal-theme [class~="bg-white"][class*="rounded"],
  .portal-theme [class~="bg-white/95"][class*="rounded"],
  .portal-theme [class~="bg-white/97"][class*="rounded"],
  .portal-theme [class~="bg-[#F8FAFC]"][class*="rounded"],
  .portal-theme [class~="bg-[#FBFCFE]"][class*="rounded"],
  .portal-theme [class~="bg-[#F1F5F9]"][class*="rounded"],
  .portal-theme [class~="bg-[#E7F3FA]"][class*="rounded"],
  .portal-theme [class~="bg-[#EAF5F9]"][class*="rounded"],
  .portal-theme :is(input,select,textarea)[class*="rounded"]:not([class~="bg-transparent"]),
  html.portal-static body :is(header,article,.summary) {
    background:var(--hope-solid) !important;
    -webkit-backdrop-filter:none !important;
    backdrop-filter:none !important;
  }
}
