/* ===========================================================================
   Joseph H. Beaven, MD, Internal Medicine. Site styles
   Plain CSS, no framework. Calm medical palette, accessible, responsive.
   =========================================================================== */

:root {
  --teal-900: #0f3d3e;
  --teal-700: #14746f;
  --teal-600: #1a8f88;
  --teal-500: #2aa79e;
  --teal-050: #e8f5f3;
  --ink: #1c2b2d;
  --slate: #51676a;
  --line: #dce6e6;
  --bg: #ffffff;
  --bg-soft: #f5faf9;
  --amber: #e0a23b;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 61, 62, 0.06), 0 2px 8px rgba(15, 61, 62, 0.05);
  --shadow-md: 0 6px 24px rgba(15, 61, 62, 0.10);
  --maxw: 1120px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  line-height: 1.65;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* guard against any element widening the page on mobile */
}

/* Accessible hidden field (spam honeypot) — invisible without expanding layout */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

iframe { max-width: 100%; }

h1, h2, h3 { line-height: 1.2; color: var(--teal-900); margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; color: var(--slate); }
a { color: var(--teal-700); }

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section--soft { background: var(--bg-soft); }
.section__head { max-width: 640px; margin-bottom: 2.5rem; }
.section__head--center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-600);
  margin-bottom: 0.75rem;
}

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-block;
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--teal-600); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--teal-700); box-shadow: var(--shadow-md); }
.btn--ghost { background: transparent; color: var(--teal-700); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--teal-500); background: var(--teal-050); }
.btn--block { display: block; width: 100%; text-align: center; }

/* ---- Header / nav ------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--teal-900);
  font-weight: 700;
  font-size: 1.15rem;
}
.brand__mark {
  width: 38px; height: 38px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--teal-500), var(--teal-700));
  display: grid; place-items: center;
  color: #fff; font-weight: 800;
}
.brand small { display: block; font-size: 0.72rem; font-weight: 500; color: var(--slate); letter-spacing: 0.04em; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0; padding: 0;
}
.nav__links a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav__links a:hover { background: var(--teal-050); color: var(--teal-700); }
.nav__links a.is-active { color: var(--teal-700); background: var(--teal-050); }
.nav__cta { margin-left: 0.5rem; }

.nav__toggle {
  display: none;
  position: relative;
  width: 44px; height: 40px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.nav__toggle:hover { background: var(--teal-050); }
.nav__toggle span {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 20px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: background 0.2s ease;
}
.nav__toggle span::before,
.nav__toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease;
}
.nav__toggle span::before { top: -7px; }
.nav__toggle span::after { top: 7px; }
/* animate to an X when the menu is open */
.nav__toggle[aria-expanded="true"] span { background: transparent; }
.nav__toggle[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span::after { transform: translateY(-7px) rotate(-45deg); }

/* ---- Hero -------------------------------------------------------------- */
.hero {
  background: linear-gradient(180deg, var(--teal-050), var(--bg) 70%);
  padding: clamp(3rem, 8vw, 6rem) 0;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero p.lead { font-size: 1.15rem; color: var(--slate); max-width: 48ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.hero__meta { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 1.5rem; }
.hero__meta div { font-size: 0.92rem; color: var(--slate); }
.hero__meta strong { display: block; color: var(--teal-900); font-size: 1.4rem; }

.hero__card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 1.75rem;
}
.hero__card h3 { color: var(--teal-900); }
.hours-list { list-style: none; margin: 0; padding: 0; }
.hours-list li {
  display: flex; justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.95rem;
}
.hours-list li:last-child { border-bottom: none; }
.hours-list span:first-child { color: var(--ink); font-weight: 500; }
.hours-list span:last-child { color: var(--slate); }

/* ---- Cards / grids ----------------------------------------------------- */
.grid { display: grid; gap: 1.5rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card__icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--teal-050);
  color: var(--teal-700);
  display: grid; place-items: center;
  margin-bottom: 1rem;
  font-size: 1.4rem;
}
.card h3 { margin-bottom: 0.4rem; }
.card p { margin-bottom: 0; font-size: 0.96rem; }

/* ---- About ------------------------------------------------------------- */
.about__grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}
.portrait {
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--teal-500), var(--teal-900));
  aspect-ratio: 4 / 5;
  display: grid; place-items: center;
  color: #fff;
  box-shadow: var(--shadow-md);
}
.portrait span { font-size: 4rem; font-weight: 800; opacity: 0.85; }
.creds { list-style: none; margin: 1.5rem 0 0; padding: 0; }
.creds li { padding: 0.55rem 0 0.55rem 1.75rem; position: relative; color: var(--ink); border-bottom: 1px solid var(--line); }
.creds li::before { content: "✓"; position: absolute; left: 0; color: var(--teal-600); font-weight: 800; }
.creds li:last-child { border-bottom: none; }

/* ---- Steps ------------------------------------------------------------- */
.steps { counter-reset: step; }
.step { position: relative; padding-left: 3.25rem; }
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 2.25rem; height: 2.25rem;
  background: var(--teal-600); color: #fff;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700;
}

/* ---- CTA banner -------------------------------------------------------- */
.cta {
  background: linear-gradient(135deg, var(--teal-700), var(--teal-900));
  color: #fff;
  border-radius: var(--radius);
  padding: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
}
.cta h2 { color: #fff; }
.cta p { color: rgba(255,255,255,0.85); max-width: 52ch; margin-inline: auto; }
.cta .btn--primary { background: #fff; color: var(--teal-800, var(--teal-900)); }
.cta .btn--primary:hover { background: var(--teal-050); }

/* ---- Contact ----------------------------------------------------------- */
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 3rem);
  align-items: start;
}
.info-list { list-style: none; margin: 0; padding: 0; }
.info-list li { display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.info-list li:last-child { border-bottom: none; }
.info-list .ico {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--teal-050); color: var(--teal-700);
  display: grid; place-items: center; font-size: 1.2rem;
}
.info-list strong { display: block; color: var(--teal-900); }
.info-list a { color: var(--slate); text-decoration: none; }
.info-list a:hover { color: var(--teal-700); }

.form { display: grid; gap: 1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow-sm); }
.field { display: grid; gap: 0.35rem; }
.field label { font-weight: 600; font-size: 0.9rem; color: var(--ink); }
.field input, .field textarea, .field select {
  font: inherit;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-soft);
  color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px var(--teal-050);
  background: #fff;
}
.field--row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form__note { font-size: 0.82rem; color: var(--slate); margin: 0; }
.form__status { font-size: 0.92rem; font-weight: 600; color: var(--teal-700); min-height: 1.2em; }

.map-embed {
  width: 100%; height: 260px;
  border: 0;
  border-radius: var(--radius);
  margin-top: 1.5rem;
  filter: saturate(0.9);
}

/* ---- Notice banner (placeholder reminder) ------------------------------ */
.notice {
  background: #fff7e8;
  border-bottom: 1px solid #f0dcae;
  color: #7a591b;
  font-size: 0.85rem;
  text-align: center;
  padding: 0.5rem 1rem;
}
.notice strong { color: #5e4310; }

/* ---- Footer ------------------------------------------------------------ */
.site-footer {
  background: var(--teal-900);
  color: rgba(255,255,255,0.78);
  padding: 3rem 0 1.5rem;
  margin-top: 0;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.site-footer h4 { color: #fff; font-size: 0.95rem; margin: 0 0 0.9rem; letter-spacing: 0.03em; }
.site-footer a { color: rgba(255,255,255,0.78); text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer__links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.footer__brand .brand { color: #fff; }
.footer__brand .brand small { color: rgba(255,255,255,0.6); }
.footer__brand p { color: rgba(255,255,255,0.7); max-width: 34ch; font-size: 0.9rem; }
.footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 1.25rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
  font-size: 0.83rem;
}

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 900px) {
  .hero__grid, .about__grid, .contact__grid { grid-template-columns: 1fr; }
  .grid--3 { grid-template-columns: 1fr 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav__toggle { display: inline-flex; }
  .nav__links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    padding: 0.5rem 1rem 1rem;
    gap: 0.15rem;
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links li { width: 100%; }
  .nav__links a {
    display: block;
    padding: 0.8rem 0.85rem;
    border-radius: 10px;
    font-size: 1.02rem;
  }
  .nav__cta { margin: 0.4rem 0 0; }
  .nav__cta .btn { width: 100%; text-align: center; padding-block: 0.85rem; }
}

@media (max-width: 560px) {
  .grid--3, .grid--2, .field--row { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
