/* ==========================================================================
   What the Doctor Said — rebuilt stylesheet
   Brand colors: primary blue #0066CD, accent blue #00a6ed
   Font: Nunito
   ========================================================================== */

:root {
  --blue-primary: #0066CD;
  --blue-accent: #00a6ed;
  --white: #ffffff;
  --text-dark: #000000;
  --gray: #808080;
  --light-gray: #a0a0a0;
  --header-height: 88px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  color: var(--text-dark);
  background: var(--white);
  line-height: 1.5;
}

a {
  color: var(--blue-accent);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

ul {
  padding-left: 1.2em;
  margin: 0.25em 0;
}

li {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-dark);
  line-height: 1;
  margin-bottom: 0.2em;
}

li::marker {
  color: var(--text-dark);
}

/* -------------------- Header / Hero -------------------- */

.site-header {
  background: var(--blue-primary);
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
}

.logo-link {
  margin-right: 1rem;
}

.logo {
  width: clamp(300px, 36vw, 500px);
}

.nav-top a {
  color: var(--white);
  font-size: 1rem;
  line-height: 1;
  margin-left: 1.25rem;
  padding-bottom: 4px;
}

.nav-top a:first-child {
  margin-left: 0;
}

.nav-top a.active {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  font-weight: 700;
}

/* Height is now independent of width (a fixed clamp, not tied to an
   aspect-ratio) so the stage can use the full header width without
   the whole section ballooning in height. Matches #content's max-width
   and padding exactly, so the tagline/icons line up with the content
   icons below. */
.hero-stage {
  position: relative;
  height: clamp(400px, 36vw, 460px);
  padding: 0 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

.tagline {
  position: absolute;
  left: 2.6%;
  top: 10.7%;
  width: 46%;
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--blue-accent);
  margin: 0;
}

.hero-icon,
.hero-bubble-wrap {
  position: absolute;
  opacity: 0;
  animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Coordinates from the drag-and-drop positioning tool ---- */

.hero-icon--hospital {
  left: 2.6%;
  top: 41%;
  width: 19%;
  animation-delay: 0.2s;
}

.hero-icon--doctor {
  left: 44.2%;
  top: 50%;
  width: 13%;
  animation-delay: 1.1s;
}

.hero-icon--patient {
  left: 75%;
  top: 37%;
  width: 16%;
  animation-delay: 2s;
}

@media (min-width: 641px) and (max-width: 1024px) {
  .hero-icon--doctor {
    width: 10%;
  }
  .hero-icon--patient {
    width: 12%;
  }
}

.hero-bubble--hospital {
  left: 12.5%;
  top: 78%;
  width: 17.5%;
  height: 21%;
  animation-delay: 0.5s;
}

.hero-bubble--doctor {
  left: 48%;
  top: 29%;
  width: 18%;
  height: 18%;
  animation-delay: 1.4s;
}

.hero-bubble--patient {
  left: 77.5%;
  top: 12%;
  width: 15%;
  height: 22.1%;
  animation-delay: 2.3s;
}

/* Speech bubbles: a single unified SVG shape (rounded body + integrated
   tail, one continuous outline — not a box with a separate triangle
   glued on). The svg fills its wrapper exactly; the tail points drawn
   into the path extend outside the 0..w / 0..h viewBox area and render
   fine since overflow is visible. */
.hero-bubble-wrap svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.hero-bubble-wrap path {
  fill: var(--blue-accent);
}

.hero-bubble-text {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  padding: 0 16%;
  color: var(--white);
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.3;
  text-align: left;
}

.hero-bubble-text a {
  color: var(--white);
  text-decoration: underline;
}

.header-wave {
  display: block;
  width: 100%;
  height: 70px;
  margin-top: 0;
}

/* Contact form category picker */
.category-picker {
  border: none;
  padding: 0;
  margin: 0 0 0.15rem;
  display: flex;
  flex-wrap: wrap;
}

.category-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  margin-right: 1rem;
  cursor: pointer;
  flex: 1 1 0;
}

.category-icon {
  width: 42px;
  height: 42px;
  background: transparent;
  border: 2px solid var(--blue-primary);
  color: var(--blue-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

.category-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.category-option input:checked + .category-icon {
  background: var(--white);
  color: var(--blue-primary);
}

.category-option input:focus-visible + .category-icon {
  outline: 3px solid var(--blue-primary);
  outline-offset: 2px;
}

.contact-disclaimer {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  opacity: 0.9;
  max-width: 660px;
  margin: 0.5em 0 0 150px;
}

.form-success-message,
.form-error-message {
  font-size: 1.1rem;
  font-weight: 700;
  max-width: 660px;
  margin: 1rem 0 0 150px;
  padding: 0.9rem 1.1rem;
  border-radius: 6px;
}

.form-success-message {
  background: var(--white);
  color: var(--blue-primary);
}

.form-error-message {
  background: var(--white);
  color: #b00020;
}

/* -------------------- Content -------------------- */

#content {
  padding: 0 1.5rem 0.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

.info-row {
  display: flex;
  align-items: flex-start;
  padding: 0.4rem 0;
}

.info-row .info-icon {
  margin-right: 1.25rem;
}

.info-row:nth-of-type(2),
.info-row:nth-of-type(3) {
  padding-top: 1.5rem;
}

.info-row:first-of-type {
  padding-top: 0;
}

.info-icon {
  width: 130px;
  flex-shrink: 0;
}

.info-text h2 {
  color: var(--blue-primary);
  font-weight: 800;
  font-size: 2.1rem;
  line-height: 1.1;
  margin-top: 0;
  margin-bottom: 0;
}

.info-text p {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-dark);
  line-height: 1;
  margin: 0.5em 0;
}

.content-wave {
  display: block;
  width: 100%;
  height: 50px;
  margin-bottom: -1px;
}

/* -------------------- Contact -------------------- */

#contact {
  background: var(--blue-accent);
  color: var(--white);
  padding: 0.5rem 0 1.5rem;
  text-align: left;
}

.contact-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.contact-heading-row {
  position: relative;
}

.contact-envelope {
  position: absolute;
  left: 27px;
  top: 0;
  width: 76px;
  height: 58px;
  color: var(--blue-primary);
}

#contact h2 {
  color: var(--blue-primary);
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1;
  margin: 0;
  margin-left: 150px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  text-align: left;
  margin-top: 0;
  margin-left: 150px;
  max-width: 500px;
}

.contact-form label {
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.3em;
  margin-top: 1em;
}

.contact-form input,
.contact-form textarea {
  border: 2px solid var(--blue-primary);
  background: transparent;
  color: var(--white);
  font-family: inherit;
  font-size: 1rem;
  padding: 0.5em;
  border-radius: 4px;
}

.message-label,
.contact-form textarea {
  width: 660px;
  max-width: 90vw;
}

.contact-form textarea {
  height: 70px;
  resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.75);
}

.contact-form button {
  margin-top: 1.5rem;
  align-self: flex-start;
  background: var(--blue-primary);
  color: var(--white);
  font-family: inherit;
  border: 1px solid var(--gray);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  padding: 0.4em 1.5em;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
}

.contact-form button:hover {
  background: var(--white);
  color: var(--blue-primary);
}

/* -------------------- Footer -------------------- */

.site-footer {
  background: var(--blue-primary);
  color: var(--white);
  padding-top: 2rem;
}

.nav-bottom {
  display: flex;
  justify-content: center;
  padding: 0 1rem 2rem;
  flex-wrap: wrap;
}

.nav-bottom a {
  color: var(--white);
  font-size: 1.1rem;
  margin: 0 1rem;
  line-height: 1;
}

.nav-bottom a.active {
  text-decoration: underline;
  font-weight: 700;
}

.footer-credit {
  text-align: center;
  font-size: 0.75rem;
  opacity: 0.75;
  padding: 0 1.5rem 1.5rem;
  margin: 0;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.footer-brand {
  display: flex;
  align-items: center;
}

.footer-brand img {
  margin-right: 0.75rem;
}

#logoCross {
  width: 50px;
}

/* -------------------- Responsive -------------------- */

@media (max-width: 640px) {
  .hero-stage {
    height: auto;
    aspect-ratio: auto;
    padding: 2rem 1.5rem 1.5rem;
    display: block;
  }
  .tagline {
    position: static;
    width: 100%;
    max-width: 100%;
    margin: 0 0 1.5rem;
    text-align: center;
  }

  /* A fixed-height "stage" just for the rotating icon + bubble pairs,
     so the three pairs can crossfade in the same spot rather than
     stacking on top of each other down the page. */
  .hero-carousel-stage {
    position: relative;
    height: 290px;
    margin: 0 auto;
    max-width: 240px;
  }

  .hero-icon,
  .hero-bubble-wrap {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    pointer-events: none;
    animation-name: heroSlideCycle;
    animation-duration: 15s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
  }

  .hero-icon {
    width: auto !important;
    height: 140px !important;
  }

  .hero-bubble-wrap {
    width: 220px !important;
  }

  /* Hospital bubble's tail points UP, so it belongs BELOW its icon. */
  .hero-icon--hospital {
    top: 20px;
  }
  .hero-bubble--hospital {
    top: 195px;
    width: 170px !important;
    height: 85px !important;
  }

  /* Doctor and patient bubbles' tails point DOWN, so they belong
     ABOVE their icon (matching the desktop layout). */
  .hero-bubble--doctor {
    top: 8px;
    left: 65%;
    width: 150px !important;
    height: 65px !important;
  }
  .hero-icon--doctor {
    top: 100px;
    height: 165px !important;
  }

  .hero-bubble--patient {
    top: 8px;
    left: 65%;
    width: 170px !important;
    height: 85px !important;
  }
  .hero-icon--patient {
    top: 120px;
    height: 170px !important;
  }

  .header-wave {
    height: 30px;
  }

  .content-wave {
    height: 30px;
  }

  .hero-bubble-text {
    padding: 0 8% 0 14%;
    font-size: 0.75rem;
    line-height: 1.2;
  }

  /* Stagger the three pairs so exactly one is visible at a time,
     cycling hospital -> doctor -> patient -> repeat. */
  .hero-icon--hospital,
  .hero-bubble--hospital {
    animation-delay: 0s;
  }
  .hero-icon--doctor,
  .hero-bubble--doctor {
    animation-delay: 5s;
  }
  .hero-icon--patient,
  .hero-bubble--patient {
    animation-delay: 10s;
  }

  /* Contact section: the 150px left indent (used on desktop to align
     text past the envelope icon) leaves almost no room on a phone
     screen, which is why it looked squashed into a cramped second
     column. On mobile, the envelope sits in normal flow above the
     centered heading, and everything below goes full-width. */
  .contact-heading-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .contact-envelope {
    position: static;
    width: 50px;
    height: 38px;
    margin-bottom: 0.5rem;
  }
  #contact h2 {
    margin-left: 0;
  }
  .contact-form {
    margin-left: 0;
    max-width: 100%;
  }
  .contact-disclaimer,
  .form-success-message,
  .form-error-message {
    margin-left: 0;
    max-width: 100%;
  }
}

@keyframes heroSlideCycle {
  0%   { opacity: 0; pointer-events: none; }
  4%   { opacity: 1; pointer-events: auto; }
  29%  { opacity: 1; pointer-events: auto; }
  33%  { opacity: 0; pointer-events: none; }
  100% { opacity: 0; pointer-events: none; }
}

@media (max-width: 700px) {
  .header-bar {
    justify-content: center;
    text-align: center;
    padding: 1rem 0.75rem;
  }
  .nav-top {
    width: 100%;
    text-align: center;
  }
  .nav-top a {
    font-size: 0.8rem;
    margin-left: 0.7rem;
    margin-right: 0.7rem;
    white-space: nowrap;
  }
  .info-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .info-row .info-icon {
    margin-right: 0;
    margin-bottom: 0.75rem;
  }
  .info-text {
    width: 100%;
    text-align: center;
  }
  .info-text h2 {
    text-align: center;
  }
  .info-text ul {
    display: inline-block;
    text-align: left;
    margin-left: auto;
    margin-right: auto;
  }
  .info-icon {
    width: 130px;
  }
  .info-row:first-of-type {
    padding-top: 1.25rem;
  }
  .contact-disclaimer {
    line-height: 1;
  }
  .contact-form button {
    align-self: center;
    width: 33%;
    min-width: 100px;
  }
  .message-label,
  .contact-form textarea {
    width: 100%;
    max-width: 100%;
  }
  .site-footer {
    padding-top: 1rem;
  }
  .nav-bottom {
    max-width: 1000px;
    margin: 0 auto;
    flex-direction: column;
    align-items: center;
    padding: 0 1.5rem 1rem;
  }
  .nav-bottom a {
    font-size: 1rem;
    margin: 0.3rem 0;
  }
  .footer-bottom {
    padding: 1rem;
  }
  .text-block .stat-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
  }
  .stat {
    min-width: 0;
    margin-right: 0;
    margin-bottom: 0;
  }
  .stat-num {
    font-size: 0.95rem;
  }
  .stat-label {
    font-size: 0.8rem;
  }
  .category-option {
    font-size: 0.8rem;
    margin-right: 0.5rem;
  }
  .category-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    margin-bottom: 0.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-icon,
  .hero-bubble-wrap {
    animation: none;
    opacity: 1;
  }
}

/* -------------------- How It Works page -------------------- */

.page-howitworks .site-header {
  background: var(--white);
  overflow: visible;
}

.page-howitworks .header-bar {
  background: var(--blue-primary);
}

.page-header {
  padding-bottom: 0.5rem;
}

.page-title-row {
  position: relative;
  max-width: 1000px;
  margin: 1.25rem auto 0;
  padding: 0 1.5rem;
}

.page-title-icon {
  position: absolute;
  left: -70px;
  top: 50%;
  transform: translateY(-50%);
  width: 76px;
  height: auto;
  display: block;
}

.page-title-row h1 {
  color: var(--blue-primary);
  font-size: clamp(2.2rem, 3.8vw, 2.8rem);
  font-weight: 800;
  margin: 0;
}

#howitworks-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem 1rem;
}

.text-block {
  padding: 0.25rem 0;
}

.why-block {
  padding-top: 1.25rem;
}

.text-block h2 {
  color: var(--blue-primary);
  font-weight: 800;
  font-size: 2.1rem;
  line-height: 1.1;
  margin: 0;
}

.text-block h3 {
  color: var(--blue-primary);
  font-weight: 800;
  font-size: 1.3rem;
  line-height: 1.1;
  margin: 1.8em 0 0.2em;
}

.text-block h3:first-child {
  margin-top: 0;
}

.text-block p {
  font-size: 1rem;
  line-height: 1;
  margin: 0 0 0.5em;
}

.text-block ul {
  margin: 0 0 0.15em;
}

.text-block li {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1;
}

.citations-block .citation {
  color: #555555;
  font-size: 0.9rem;
  line-height: 1;
  margin: 0 0 1em;
}

.citations-block h3 {
  margin-top: 2.5em;
}

.citations-block .citation a {
  color: var(--blue-accent);
}

.origins-row {
  display: flex;
  align-items: flex-start;
  margin-top: 0.5em;
}

.origins-photo {
  width: 140px;
  margin-right: 1.5rem;
  height: 140px;
  object-fit: cover;
  object-position: center 15%;
  border-radius: 50%;
  flex-shrink: 0;
}

.origins-row p {
  margin: 0 0 0.5em;
}

.origins-row p:last-child {
  margin-bottom: 0;
}

.flow-diagram {
  display: block;
  width: 100%;
  max-width: 700px;
  height: auto;
  margin: 1rem 0;
}

.citations-block .footnote {
  font-size: 8pt;
  color: var(--gray);
  line-height: 1.2;
  margin: 2.5em 0 0;
  padding-top: 1em;
  border-top: 1px solid #eee;
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  margin: 0.3em 0 1.2em;
}

.stat {
  display: flex;
  flex-direction: column;
  min-width: 140px;
  margin-right: 1.5rem;
  margin-bottom: 0.5rem;
}

.stat-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--blue-accent);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.9rem;
  line-height: 1;
  color: var(--gray);
  font-weight: 600;
  max-width: 180px;
}

.citation-note {
  font-size: 0.85rem;
  color: var(--gray);
  line-height: 1.4;
  margin: 0 0 1em;
}

.testimonial {
  margin: 1.8em 0 0.5em;
  padding-left: 1.2rem;
  border-left: 4px solid var(--blue-accent);
}

.testimonial p {
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1;
  color: var(--text-dark);
  margin: 0 0 0.4em;
}

.testimonial cite {
  display: block;
  font-style: normal;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--blue-primary);
}

@media (max-width: 600px) {
  .origins-row {
    display: block;
  }
  .origins-photo {
    float: left;
    width: 110px;
    height: 110px;
    margin: 0 1rem 0.75rem 0;
    shape-outside: circle(50%);
    shape-margin: 0.75rem;
  }
  .origins-row p {
    margin: 0;
  }
}

@media (max-width: 1024px) {
  .page-title-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
  }
  .page-title-icon {
    position: static;
    transform: none;
    width: 42px;
    flex-shrink: 0;
    margin: 0.15rem 0.75rem 0 0;
  }
}

/* Contact section on this page matches the homepage's blue styling
   (this was also true on the original site) — no override needed. */

/* -------------------- Awards page -------------------- */

.awards-block {
  padding-top: 0.5em;
}

.award-row {
  display: flex;
  align-items: flex-start;
  padding: 1.25rem 0;
  border-bottom: 1px solid #eee;
}

.award-row:last-of-type {
  border-bottom: none;
}

.award-image {
  width: 130px;
  flex-shrink: 0;
  margin-right: 1.5rem;
}

.grant-image {
  width: 130px;
  height: auto;
}

img[src*="AMPF"],
img[src*="Myer"] {
  width: 175px;
}

.award-text h3 {
  color: var(--blue-primary);
  font-weight: 800;
  font-size: 1.3rem;
  line-height: 1.1;
  margin: 0 0 0.3em;
}

.award-text p {
  font-size: 1rem;
  line-height: 1;
  margin: 0.5em 0;
}

.grant-quote {
  font-style: italic;
  color: #555;
}

@media (max-width: 600px) {
  .award-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 0 0.75rem;
  }
  .award-image {
    margin-right: 0;
    margin-bottom: 0.5rem;
  }
  .awards-block {
    padding-top: 0;
  }
  .award-row:first-of-type {
    padding-top: 0.25rem;
  }
}
