/* Page categories: business (navy/gold/white), clinical (sage/green/gold),
   and patient (white/green). The homepage, shared header and footer retain
   their established treatments. This is the final page-content colour layer. */
body[data-page-theme] {
  --theme-navy: #142b4a;
  --theme-green: #123d32;
  --theme-gold: #b69a5f;
  --theme-surface: #fff;
  --theme-ink: var(--theme-green);
  --theme-line: var(--theme-green);
  --theme-text: var(--theme-ink);
  background: var(--theme-surface);
}
body[data-page-theme="business"] {
  --theme-ink: var(--theme-navy);
  --theme-line: var(--theme-gold);
}
body[data-page-theme="clinical"] {
  --theme-surface: #eaf2eb;
  --theme-line: var(--theme-gold);
}

/* Override the legacy per-panel reading colours without changing typography,
   layout, photographs, form behaviour or the common welcome section. */
html body[data-page-theme] main {
  background: var(--theme-surface);
  color: var(--theme-text);
}
html body[data-page-theme] main * {
  --reading-ink: var(--theme-text);
  border-color: var(--theme-line) !important;
}
html body[data-page-theme] main :is(
  h1, h2, h3, h4, p, li, dt, dd, address, small, label, figcaption,
  a, span, strong, em, summary, legend, blockquote, svg, button
) {
  color: var(--theme-text) !important;
}
html body[data-page-theme] main :is(section, article, aside, header, details) {
  background: var(--theme-surface) !important;
}
html body[data-page-theme] main :is(
  .guide-card, .guide-related, .guide-references, .services-notice,
  .about-person, .about-role-note, .care-item, .premium-panel,
  .visit-arrival, .visit-practical, .first-visit-overview, .steps article,
  .faq-intro, .faq-intro > .text-link, .faq-list summary,
  .arrival-note, .journey-panel, .journey-aside, .booking-status,
  .choice, .wl-form-card, .service-status, .concern-card,
  .newsletter-document, .news-feature, .journal-strip
) {
  background: var(--theme-surface) !important;
  border-color: var(--theme-line) !important;
}
html body[data-page-theme] main :is(
  .guide-hero, .about-hero, .guide-card, .guide-related, .guide-references,
  .services-notice, .about-person, .about-role-note, .care-item,
  .premium-panel, .visit-arrival, .visit-practical, .first-visit-overview,
  .steps article, .faq-intro, .faq-list details, .arrival-note,
  .journey-panel, .choice, .wl-form-card, .policy-hero
) {
  border-width: 2px;
  border-style: solid;
}
html body[data-page-theme] main .premium-panel {
  --panel-background: var(--theme-surface);
  --panel-heading: var(--theme-text);
  --panel-body: var(--theme-text);
  --panel-link: var(--theme-text);
  --panel-gold: var(--theme-text);
  --panel-line: var(--theme-line);
}
html body[data-page-theme] main .care-item {
  --tile-background: var(--theme-surface);
  --tile-heading: var(--theme-text);
  --tile-body: var(--theme-text);
  --tile-link: var(--theme-text);
  --tile-gold: var(--theme-text);
  --tile-line: var(--theme-line);
}
html body[data-page-theme] main :is(.guide-card, .about-person, .care-item, .premium-panel) {
  box-shadow: none;
}
html body[data-page-theme] main :is(a, button, summary, input, select, textarea):focus-visible {
  outline: 3px solid var(--theme-line);
  outline-offset: 4px;
}
html body[data-page-theme] main :is(input:not([type="checkbox"], [type="radio"]), select, textarea) {
  background: #fff;
  color: var(--theme-ink) !important;
  border-color: var(--theme-line) !important;
}
html body[data-page-theme] main :is(input, textarea)::placeholder {
  color: var(--theme-ink);
}
html body[data-page-theme] main :is(input[type="checkbox"], input[type="radio"]) {
  accent-color: var(--theme-ink);
}
html body[data-page-theme] main .button {
  --theme-text: #fff;
  background: var(--theme-ink) !important;
  border: 2px solid var(--theme-line);
  color: var(--theme-text) !important;
}
html body[data-page-theme] main .button:hover {
  filter: brightness(1.12);
}

/* Business pages have navy introductions and featured offer panels,
   with white reading surfaces and clear gold borders. */
html body[data-page-theme="business"] main :is(
  .guide-hero, .about-hero, .fees-intro-layout, .page-intro,
  .journal-hero, .wl-intro, .fees-information, .journal-offer,
  .newsletter-document, .fee-card.palette-emerald, .fee-card.palette-navy
) {
  --theme-surface: var(--theme-navy);
  --theme-text: #fff;
  background: var(--theme-navy) !important;
  border: 2px solid var(--theme-gold);
}
html body[data-page-theme="business"] main :is(.fees-intro-layout, .wl-intro) {
  padding: clamp(24px, 3vw, 38px);
  border-radius: 10px;
}
html body[data-page-theme="business"] main .fees-intro-layout {
  margin-bottom: 28px;
}
html body[data-page-theme="business"] main .wl-wrap {
  gap: clamp(24px, 4vw, 52px);
}
html body[data-page-theme="business"] main .button {
  --theme-text: var(--theme-navy);
  background: #dec283 !important;
}
html body[data-page-theme="business"] main :is(.service-status, .about-person-initials) {
  --theme-text: var(--theme-navy);
  background: #fff !important;
}
html body[data-page-theme="business"] main .wl-kicker > span {
  background: #dec283;
}
html body[data-page-theme="business"] main .wl-form-card {
  border-top-width: 4px;
}

/* Clinical pages keep the pale green foundation, dark green reading text
   and stronger gold rules used on Dr Fizah's biography. */
html body[data-page-theme="clinical"] main :is(
  .guide-hero, .about-hero, .guide-card, .about-person, .care-item,
  .services-notice, .about-role-note
) {
  border-width: 3px;
}
html body[data-page-theme="clinical"] main :is(
  .services-section, .services-process article, .about-team-section,
  .about-section, .about-biography, .team-biography, .team-bio-row,
  .team-bio-copy, .team-slogan
) {
  border-color: var(--theme-gold) !important;
}
html body[data-page-theme="clinical"] main :is(.services-process article, .about-biography) {
  border-top-width: 3px;
}
html body[data-page-theme="clinical"] main .about-person-initials {
  background: #eaf2eb;
  border: 3px solid var(--theme-gold);
}
html body[data-page-theme="clinical"] main :is(.service-feature-photo, .services-photographs figure) {
  border: 3px solid var(--theme-gold);
}
html body[data-page-theme="clinical"] main .team-bio-arrow {
  --theme-text: #fff;
  background: var(--theme-gold);
}
html body[data-page-theme="clinical"] main .team-bio-arrow::before {
  background: var(--theme-green);
}

/* Patient information stays white throughout, including formerly navy or
   green panels, with dark green copy, outlines and accessible controls. */
html body[data-page-theme="patient"] main :is(.button, .faq-intro > .text-link) {
  --theme-text: var(--theme-green);
  background: #fff !important;
  border: 2px solid var(--theme-green);
}
html body[data-page-theme="patient"] main .button:hover {
  --theme-text: #fff;
  background: var(--theme-green) !important;
  filter: none;
}
html body[data-page-theme="patient"] main .faq-list details[open] > summary {
  background: #fff !important;
  border-bottom: 2px solid var(--theme-green);
}
html body[data-page-theme="patient"] main :is(.clinic-hours, .contact-arrival, .contact-social) {
  border-color: var(--theme-green) !important;
}
html body[data-page-theme="patient"] main .choice:has(input:checked) {
  box-shadow: inset 0 0 0 2px var(--theme-green);
}
html body[data-page-theme="patient"] main .journey-progress li[aria-current="step"] > span {
  --theme-text: #fff;
  background: var(--theme-green);
}

/* Feedback must remain distinguishable and legible within themed forms. */
html body[data-page-theme] main :is(.wl-error, .error-message) {
  --theme-text: #7c2920;
  --reading-ink: #7c2920;
  background: #fff4f2 !important;
  border-color: #7c2920 !important;
}
