/* IBHS Clinical — main stylesheet. Based on the approved IBHS static mockup. */
:root {
  --ink: #1a2c30;
  --muted: #3d5459;
  --line: #d3e2e5;
  --teal: #156068;
  --teal-dark: #0e4a51;
  --teal-soft: #e8f4f5;
  --teal-mid: #c5dfe2;
  --bg: #f6fafb;
  --surface: #ffffff;
  --notice: #f4f1e8;
  --notice-ink: #3f3a2a;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 40, 45, 0.04), 0 8px 24px rgba(15, 40, 45, 0.06);
  --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 18px;
}
img { max-width: 100%; height: auto; }
a { color: var(--teal); }
a:hover { color: var(--teal-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}
.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  background: var(--teal-dark);
  color: #fff;
  padding: 0.55rem 0.9rem;
  z-index: 100;
  border-radius: 0 0 6px 6px;
}
.skip:focus { top: 0; color: #fff; }

.wp-site-blocks { padding: 0; min-height: 100vh; display: flex; flex-direction: column; }
.wp-site-blocks > main { flex: 1 0 auto; }
.wp-site-blocks > * { margin-block-start: 0; margin-block-end: 0; }
.wrap {
  width: min(var(--max), calc(100% - 2.5rem));
  margin-inline: auto;
  max-width: none;
}

/* ---- Baseline spacing inside pages (explicit, so core layout resets do not collapse it) ---- */
.wp-site-blocks main :is(p, ul, ol, dl, address, figure) { margin-block: 0 1rem; }
.wp-site-blocks main :is(h1, h2, h3, h4) { line-height: 1.22; margin-block: 0 0.6rem; font-weight: 700; }
.wp-site-blocks main h2 { font-size: 1.5rem; }
.wp-site-blocks main h3 { font-size: 1.2rem; }
.wp-site-blocks main address { font-style: normal; }

/* ---- Header ---- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: flex-start; gap: 1.25rem; padding: 0.9rem 0; }
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: inherit; min-width: 0; }
.brand:hover { color: inherit; }
.brand img { width: 48px; height: 48px; border-radius: 50%; flex: 0 0 48px; }
.brand-text { min-width: 0; }
.brand-name { display: block; font-weight: 700; font-size: 1.15rem; letter-spacing: 0.01em; line-height: 1.15; }
.brand-legal { display: block; color: var(--muted); font-size: 0.8rem; line-height: 1.3; margin-top: 0.15rem; }
.header-right { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; justify-content: flex-end; }
.header-phones { display: flex; flex-direction: column; align-items: flex-end; gap: 0.1rem; font-size: 0.95rem; font-weight: 600; margin-left: auto; }
.header-phones a { color: var(--ink); text-decoration: none; white-space: nowrap; }
.header-phones a:hover { color: var(--teal); }

/* Buttons (also core Button block) */
.btn,
.wp-block-button__link,
.wp-block-button .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--teal);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  border: 0;
  border-radius: 8px;
  padding: 0.65rem 1.15rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.2;
  white-space: nowrap;
}
.btn:hover, .wp-block-button__link:hover { background: var(--teal-dark); color: #fff; }
.wp-block-button.is-style-outline .wp-block-button__link,
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background) {
  background: transparent;
  color: var(--teal-dark);
  box-shadow: inset 0 0 0 2px var(--teal);
  border: 0;
  padding: 0.65rem 1.15rem;
}
.wp-block-button.is-style-outline .wp-block-button__link:hover { background: var(--teal-soft); color: var(--teal-dark); }
.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-block: 0; }
.wp-block-buttons.after-text { margin-top: 1.25rem; }
.wp-block-buttons .wp-block-button { margin: 0; }

/* Navigation */
.nav-bar { background: var(--surface); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.nav-links ul { display: flex; gap: 0.25rem 1.35rem; list-style: none; margin: 0; padding: 0.65rem 0; flex-wrap: wrap; }
.nav-links a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--teal); border-bottom-color: var(--teal); }
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid #8fa7ab;
  border-radius: 8px;
  padding: 0.4rem 0.65rem;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

/* ---- Heroes ---- */
.hero, .page-hero {
  background: linear-gradient(180deg, #f3f8f9 0%, var(--bg) 100%);
  padding: 3.5rem 0 3rem;
  border-bottom: 1px solid var(--line);
}
.page-hero { padding: 2.75rem 0 2.4rem; }
.hero-grid, .page-hero-grid, .split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2.5rem;
  align-items: center;
}
.hero-grid:has(.hero-side) { align-items: start; }
.hero-grid:has(.hero-side) > div:first-child { padding-top: 0.35rem; }
.hero-grid > *, .page-hero-grid > *, .split > *, .contact-grid > * { min-width: 0; }
.split.reverse { direction: rtl; }
.split.reverse > * { direction: ltr; }
.wp-site-blocks .eyebrow {
  color: var(--teal);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.82rem;
  margin: 0 0 0.85rem;
}
.hero h1, .page-hero h1 {
  font-size: clamp(1.85rem, 3.2vw, 2.7rem);
  line-height: 1.18;
  font-weight: 700;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}
.page-hero h1 { font-size: clamp(1.7rem, 2.8vw, 2.35rem); }
.wp-site-blocks .lede { font-size: 1.15rem; color: var(--muted); max-width: 40rem; margin: 0 0 1.75rem; }
.hero-actions { margin-top: 0; }
.hero-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.5rem 1.5rem 1.35rem;
  box-shadow: var(--shadow);
}
.wp-site-blocks .hero-panel h2 { margin: 0 0 0.6rem; font-size: 1.05rem; }
.wp-site-blocks .hero-panel p { margin: 0 0 1rem; color: var(--muted); font-size: 1rem; }
.wp-site-blocks .hero-panel p.phone-lg { margin: 0 0 0.15rem; }
.hero-panel .phone-lg a { font-size: 1.35rem; font-weight: 700; color: var(--teal-dark); text-decoration: none; display: block; }
.wp-site-blocks .hours-brief { margin: 0.75rem 0 0; padding-top: 0.75rem; border-top: 1px solid var(--line); font-size: 0.95rem; color: var(--muted); }
.hero-side { display: grid; gap: 1rem; }

/* ---- Photos ---- */
.wp-site-blocks main figure.photo, figure.photo { margin: 0; }
.photo img {
  width: 100%;
  display: block;
  border-radius: 16px;
  object-fit: cover;
  background: var(--teal-soft);
  box-shadow: var(--shadow);
}
.hero-photo img, .page-hero .photo img { aspect-ratio: 4 / 3; max-height: 28rem; }
.split .photo img { aspect-ratio: 4 / 3; max-height: 24rem; }

/* ---- Sections ---- */
:where(main section.wp-block-group) { padding: 3.5rem 0; }
.band-white { background: var(--surface); border-block: 1px solid var(--line); }
.wp-site-blocks .section-title { font-size: 1.85rem; margin: 0 0 0.5rem; letter-spacing: -0.02em; }
.wp-site-blocks .section-intro { color: var(--muted); margin: 0 0 2rem; max-width: 44rem; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem 1.4rem;
  overflow: hidden;
}
.card.with-photo { padding: 0 0 1.3rem; }
.card.with-photo .card-body { padding: 1.15rem 1.25rem 0.15rem; }
.card.with-photo .photo img { border-radius: 12px 12px 0 0; aspect-ratio: 4 / 3; box-shadow: none; }
.wp-site-blocks .card h3 { margin: 0 0 0.45rem; font-size: 1.2rem; }
.wp-site-blocks .card p, .wp-site-blocks .card address { margin: 0 0 0.7rem; color: var(--muted); line-height: 1.5; }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem 1.5rem; margin: 0; }
.facts div { margin: 0; }
.facts dt { font-weight: 700; font-size: 0.92rem; margin: 0 0 0.15rem; }
.facts dd { margin: 0; color: var(--muted); }
.wp-site-blocks .hours-box {
  margin-top: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
}
.wp-site-blocks .hours-box h3 { margin: 0 0 0.35rem; font-size: 1.15rem; }
.wp-site-blocks .hours-box p:last-child { margin-bottom: 0; }
.wp-site-blocks .loc-list { color: var(--muted); }

/* ---- FAQ (core Details block) ---- */
.faq-list { display: grid; gap: 0.75rem; }
details.faq {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
}
details.faq summary { cursor: pointer; font-weight: 700; padding: 1rem 1.2rem; list-style: none; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; float: right; color: var(--teal); font-weight: 600; }
details.faq[open] summary::after { content: "–"; }
.wp-site-blocks details.faq > :not(summary) { padding-inline: 1.2rem; }
.wp-site-blocks details.faq > :last-child { padding-bottom: 1.15rem; margin-bottom: 0; }
.wp-site-blocks details.faq > summary + * { margin-top: 0; }

/* ---- Contact ---- */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 2.5rem; align-items: start; }

/* Contact form: Gravity Forms, minimal skin. */
.notice, .ibhs-notice {
  background: var(--notice);
  color: var(--notice-ink);
  border-left: 4px solid #8a7a3a;
  padding: 0.85rem 1rem;
  border-radius: 0 8px 8px 0;
  margin: 0 0 1.25rem;
  font-weight: 600;
}
.gform_wrapper { margin: 0; }
.gform_wrapper .gform_fields { display: grid; gap: 0.9rem; list-style: none; margin: 0; padding: 0; }
.gform_wrapper .gfield { margin: 0; padding: 0; }
.gform_wrapper .gfield_label, .gform_wrapper legend.gfield_label {
  display: block; font-weight: 600; font-size: 0.95rem; margin: 0 0 0.3rem; padding: 0;
}
.gform_wrapper .gfield_required { color: #8a2c1f; margin-left: 0.2rem; }
.gform_wrapper input[type="text"], .gform_wrapper input[type="email"], .gform_wrapper input[type="tel"],
.gform_wrapper input[type="url"], .gform_wrapper input[type="number"], .gform_wrapper select, .gform_wrapper textarea,
.form-col input[type="text"], .form-col input[type="email"], .form-col input[type="tel"], .form-col textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: #fff;
  border: 1px solid #6f878c; border-radius: 8px; padding: 0.65rem 0.75rem; width: 100%;
}
.gform_wrapper textarea { min-height: 8rem; resize: vertical; }
.gform_wrapper .gform_footer { margin: 1rem 0 0; padding: 0; }

/* Submit button: IBHS teal. Gravity Forms loads its own theme CSS (blue by default, with high-specificity rules),
   so this sets GF's CSS variables AND restates the colors with !important on the button only. Contrast:
   white on #156068 is 7.2:1, white on hover #0e4a51 is 9.9:1. */
.gform_wrapper, .gform-theme, .gform-theme--foundation, .gform-theme--framework, .gform-theme--orbital {
  --gf-ctrl-btn-bg-color-primary: #156068;
  --gf-ctrl-btn-bg-color-hover-primary: #0e4a51;
  --gf-ctrl-btn-bg-color-focus-primary: #156068;
  --gf-ctrl-btn-bg-color-active-primary: #0b3a40;
  --gf-ctrl-btn-color-primary: #ffffff;
  --gf-ctrl-btn-color-hover-primary: #ffffff;
  --gf-ctrl-btn-color-focus-primary: #ffffff;
  --gf-ctrl-btn-color-active-primary: #ffffff;
  --gf-ctrl-btn-border-color-primary: #156068;
  --gf-ctrl-btn-border-color-hover-primary: #0e4a51;
  --gf-ctrl-btn-border-color-focus-primary: #156068;
  --gf-ctrl-btn-border-color-active-primary: #0b3a40;
  --gf-ctrl-btn-radius: 8px;
  --gf-ctrl-btn-font-weight: 600;
  --gf-ctrl-btn-size-md: 2.75rem;
}
body .gform_wrapper .gform_footer .gform_button,
body .gform_wrapper .gform_footer input[type="submit"],
body .gform_wrapper .gform_page_footer .gform_button,
body .gform_wrapper .gform_page_footer input[type="submit"],
body .gform_wrapper button.gform_button,
body .gform_wrapper input.gform_button,
body .gform_wrapper input[type="submit"] {
  background-color: #156068 !important;
  background-image: none !important;
  color: #ffffff !important;
  border: 2px solid #156068 !important;
  border-radius: 8px !important;
  padding: 0.7rem 1.4rem !important;
  min-width: 10rem;
  min-height: 2.75rem;
  font-family: inherit !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
body .gform_wrapper .gform_footer .gform_button:hover,
body .gform_wrapper .gform_footer input[type="submit"]:hover,
body .gform_wrapper .gform_page_footer .gform_button:hover,
body .gform_wrapper button.gform_button:hover,
body .gform_wrapper input.gform_button:hover,
body .gform_wrapper input[type="submit"]:hover {
  background-color: #0e4a51 !important;
  border-color: #0e4a51 !important;
  color: #ffffff !important;
}
body .gform_wrapper .gform_footer .gform_button:focus-visible,
body .gform_wrapper .gform_footer input[type="submit"]:focus-visible,
body .gform_wrapper .gform_page_footer .gform_button:focus-visible,
body .gform_wrapper button.gform_button:focus-visible,
body .gform_wrapper input.gform_button:focus-visible,
body .gform_wrapper input[type="submit"]:focus-visible,
body .gform_wrapper .gform_footer .gform_button:focus,
body .gform_wrapper input[type="submit"]:focus {
  background-color: #0e4a51 !important;
  border-color: #0e4a51 !important;
  color: #ffffff !important;
  outline: 3px solid #0e4a51 !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 2px #ffffff !important;
}
body .gform_wrapper .gform_footer .gform_button:active,
body .gform_wrapper input[type="submit"]:active,
body .gform_wrapper button.gform_button:active {
  background-color: #0b3a40 !important;
  border-color: #0b3a40 !important;
}
body .gform_wrapper .gform_button:disabled,
body .gform_wrapper input[type="submit"]:disabled,
body .gform_wrapper .gform_button[aria-disabled="true"] {
  background-color: #5f8b90 !important;
  border-color: #5f8b90 !important;
  color: #ffffff !important;
  cursor: not-allowed;
}
@media (forced-colors: active) {
  body .gform_wrapper input[type="submit"], body .gform_wrapper button.gform_button { border: 2px solid ButtonText !important; }
}
.gform_wrapper .gfield_description, .gform_wrapper .ibhs-form-note { font-size: 0.9rem; color: var(--muted); }
.gform_wrapper .validation_message, .gform_wrapper .gform_validation_errors { color: #8a2c1f; font-weight: 600; font-size: 0.92rem; }
.gform_confirmation_message { background: var(--teal-soft); border: 1px solid var(--teal-mid); border-radius: 8px; padding: 1rem 1.1rem; font-weight: 600; }
.gform_wrapper .gform_validation_container, .gform_wrapper .gfield--type-honeypot { position: absolute !important; left: -9999px; }

/* ---- Default pages (privacy, terms, SMS forms, notice) ---- */
.prose { padding: 2.75rem 0 3.5rem; }
.prose > * { max-width: 50rem; }
.prose .wp-block-post-title { font-size: clamp(1.7rem, 2.8vw, 2.35rem); line-height: 1.18; margin: 0 0 1.25rem; letter-spacing: -0.02em; }
.prose .wp-block-post-content h2 { font-size: 1.5rem; margin: 2rem 0 0.6rem; }
.prose .wp-block-post-content h3 { font-size: 1.2rem; margin: 1.5rem 0 0.5rem; }
.prose .wp-block-post-content :is(p, ul, ol) { margin-block: 0 1rem; }
.prose .wp-block-post-content :is(ul, ol) { padding-left: 1.4rem; }
.prose .wp-block-post-title a { color: inherit; text-decoration: none; }
.prose .gform_wrapper input[type="checkbox"], .prose .gform_wrapper input[type="radio"] { width: auto; }

/* ---- Footer ---- */
.crisis { background: var(--teal-soft); border-top: 1px solid var(--line); padding: 1.1rem 0; font-size: 0.98rem; }
.crisis p { margin: 0.15rem 0; }
.site-footer { background: #12383d; color: #e7f2f3; padding: 2.5rem 0 1.5rem; font-size: 0.95rem; }
.site-footer a { color: #d7eef0; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 2rem; padding-bottom: 1.75rem; border-bottom: 1px solid rgba(255,255,255,0.15); }
.site-footer h2 { font-size: 1rem; margin: 0 0 0.7rem; color: #fff; }
.site-footer p { margin: 0 0 0.5rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0.35rem 0; }
.legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; padding-top: 1.15rem; color: #c5d9dc; font-size: 0.88rem; }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .hero-grid, .page-hero-grid, .split, .split.reverse, .contact-grid, .footer-grid, .cards, .facts {
    grid-template-columns: 1fr;
  }
  .split.reverse { direction: ltr; }
  .split > .photo { order: 2; }
  .split > :not(.photo) { order: 1; }
  .hero, .page-hero { padding: 2.35rem 0 2.1rem; }
  :where(main section.wp-block-group) { padding: 2.6rem 0; }
  .header-phones { align-items: flex-start; }
}

@media (max-width: 700px) {
  .wrap { width: min(var(--max), calc(100% - 1.5rem)); }
  .brand-legal { display: none; }
  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand actions" "phones phones";
    gap: 0.55rem 0.85rem;
    align-items: center;
  }
  .brand { grid-area: brand; min-width: 0; }
  .brand-name { font-size: 1.05rem; white-space: nowrap; }
  .brand img { width: 42px; height: 42px; flex-basis: 42px; }
  .header-right { grid-area: actions; margin-left: 0; gap: 0.5rem; }
  .header-right .btn, .menu-toggle { padding: 0.5rem 0.75rem; font-size: 0.95rem; }
  .header-phones {
    grid-area: phones; margin-left: 0; width: 100%; flex-direction: row; flex-wrap: wrap;
    gap: 0.15rem 1rem; align-items: center; justify-content: flex-start;
  }
  /* Menu button only when JavaScript is available; otherwise the links just show. */
  .has-js .menu-toggle { display: inline-flex; margin: 0; }
  .has-js .nav-bar { border-bottom: 0; }
  .has-js .nav-links { display: none; width: 100%; }
  .has-js.nav-open .nav-bar { border-bottom: 1px solid var(--line); }
  .has-js.nav-open .nav-links { display: block; }
  .has-js.nav-open .nav-links ul { flex-direction: column; gap: 0; padding: 0.4rem 0 0.8rem; }
  .has-js.nav-open .nav-links a { display: block; padding: 0.45rem 0; border-bottom: 0; }
  body .gform_wrapper .gform_footer .gform_button, body .gform_wrapper .gform_footer input[type="submit"] { width: 100%; }
  .wp-block-buttons .wp-block-button, .wp-block-buttons .wp-block-button__link { white-space: normal; }
}
