/* ============================================================
   Hillsborough Periodontics & Dental Implants — redesign
   Tokens, base, and component styles. See design/design-plan.md
   ============================================================ */

:root {
  --ink: #1C1F23;
  --bg: #F6F6F7;
  --surface: #FFFFFF;
  --green: #517425;
  --green-light: #74A13C;
  --green-dark: #3D581C;
  --gray: #82868D;
  --gray-light: #AAACB1;
  --line: #DCDDE0;
  --muted: #636569;
  /* soft, low-saturation section washes (tints of the green/gray accents),
     used on alternating full-width sections so the page doesn't read as
     flat white throughout (see .section--wash-green/-gray) */
  --wash-green: #EDF3E5;
  --wash-gray: #EFEFEF;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --container: 1180px;
  --radius: 10px;
  --gap-section: 6rem;
}

@media (max-width: 700px) {
  :root { --gap-section: 3.25rem; }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--green-dark);
  line-height: 1.15;
  margin: 0 0 0.5em;
  font-weight: 600;
}

h1 { font-size: 2.1rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }

@media (min-width: 780px) {
  h1 { font-size: 3.25rem; }
  h2 { font-size: 2.1rem; }
  h3 { font-size: 1.375rem; }
}

p { margin: 0 0 1em; max-width: 68ch; }
a { color: var(--green); }
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--gray);
  outline-offset: 2px;
}
img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section { padding: var(--gap-section) 0; }
.section--surface { background: var(--surface); }
.section--wash-green { background: var(--wash-green); }
.section--wash-gray { background: var(--wash-gray); }
.section--green { background: var(--green); color: #EAF0EA; }
.section--green h2, .section--green h3 { color: #FFFFFF; }
.section--green p { color: #D8E4DB; }

.eyebrow {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.0625rem;
  color: var(--green-light);
  margin-bottom: 0.35em;
}

/* signature underline mark: one hand-drawn-feeling stroke, used once per
   section heading — replaces the old Divi green-bar image */
.mark {
  display: block;
  width: 86px;
  height: 12px;
  margin: 0.6em 0 1.1em;
}
.mark path { fill: none; stroke: var(--gray); stroke-width: 3; stroke-linecap: round; }
.section--green .mark path { stroke: var(--gray-light); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85em 1.6em;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
}
.btn--primary { background: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-dark); }
.btn--ghost { background: transparent; color: var(--green); border-color: var(--green); }
.btn--ghost:hover { background: var(--green); color: #fff; }
.section--green .btn--ghost { color: #fff; border-color: var(--gray-light); }
.section--green .btn--ghost:hover { background: var(--gray-light); color: var(--green-dark); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem 1.5rem;
  max-width: var(--container);
  margin: 0 auto;
}
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 44px; width: auto; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  background: none;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }

.primary-nav {
  display: none;
}
.primary-nav.is-open {
  display: block;
  position: fixed;
  inset: 0;
  background: var(--surface);
  padding: 1.5rem;
  overflow-y: auto;
  z-index: 60;
}
.primary-nav__close {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}
.primary-nav ul { list-style: none; margin: 0; padding: 0; }
.primary-nav > ul { display: flex; flex-direction: column; gap: 0.25rem; }
.primary-nav a {
  display: block;
  padding: 0.75rem 0.25rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.has-submenu > button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 0.25rem;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.has-submenu .submenu {
  display: none;
  padding-left: 1rem;
}
.has-submenu.is-open .submenu { display: block; }
.has-submenu.is-open > button svg { transform: rotate(180deg); }
.submenu a { font-weight: 500; font-size: 0.95rem; color: var(--muted); }
.nav-call {
  margin-top: 1rem;
  display: block;
}
/* .primary-nav a has higher specificity than .btn--primary (class+element
   vs. single class), which was overriding the call button's color, padding,
   and adding an unwanted border — fix by targeting it more specifically. */
.primary-nav .nav-call {
  color: #fff;
  padding: 0.85em 1.6em;
  border-bottom: none;
  text-align: center;
}

@media (min-width: 960px) {
  .nav-toggle { display: none; }
  .primary-nav {
    display: block;
    position: static;
    background: none;
    padding: 0;
    inset: auto;
    overflow: visible;
  }
  .primary-nav__close { display: none; }
  .primary-nav > ul { flex-direction: row; align-items: center; gap: 1.75rem; }
  .primary-nav a, .has-submenu > button {
    border-bottom: none;
    padding: 0.5rem 0;
    font-size: 0.975rem;
  }
  .has-submenu { position: relative; }
  .has-submenu .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.5rem;
    box-shadow: 0 12px 24px rgba(28,31,35,0.08);
  }
  .has-submenu .submenu a { border-bottom: none; padding: 0.55rem 0.75rem; border-radius: 6px; }
  .has-submenu .submenu a:hover { background: var(--bg); }
  .nav-call { margin-top: 0; }
  /* the nav block (links row + call button) is taller than the logo, so
     the header bar's height is already set by the nav, not the logo —
     the logo can grow up to that same height with zero effect on the
     bar's height, the nav, or anything below the header */
  .brand img { height: 80px; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 3rem 0 var(--gap-section);
  background: linear-gradient(180deg, var(--wash-gray) 0%, var(--bg) 65%);
}
.hero__content {
  max-width: 640px;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.hero__reassure {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--green);
}

.warning-signs-block { margin-top: 3rem; }
.warning-signs__label {
  margin: 0 0 0.75rem;
  max-width: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--green-dark);
}
.warning-signs {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 640px) { .warning-signs { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px) {
  /* at this width the warning signs move beside the hero text instead of
     below it (see .hero .container), so they go back to a single column */
  .hero .container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    align-items: start;
  }
  .warning-signs-block { margin-top: 0.35rem; }
  .warning-signs {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
  .warning-signs li { padding: 1.1rem 1.25rem; font-size: 0.95rem; }
}
.warning-signs li {
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---------- Doctor / about ---------- */
.doctor {
  display: grid;
  gap: 2.5rem;
}
@media (min-width: 860px) {
  .doctor { grid-template-columns: 0.85fr 1.15fr; align-items: start; }
}
.doctor__photo img { border-radius: var(--radius); border: 1px solid var(--line); }
.credential-list {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
}
.credential-list li {
  padding-left: 1.4rem;
  position: relative;
  color: var(--muted);
  font-size: 0.975rem;
}
.credential-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.55em;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gray);
}

/* ---------- Team ---------- */
.team-grid {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 2rem;
}
.team-card img {
  border-radius: var(--radius);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--line);
  margin-bottom: 0.85rem;
}
.team-card h3 { margin-bottom: 0.15em; }
.team-card p { color: var(--muted); margin: 0; }

/* ---------- Office photos: carousel ---------- */
.office-carousel { margin-top: 2rem; }
.office-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  border-radius: var(--radius);
}
.office-track::-webkit-scrollbar { display: none; }
.office-track:focus-visible { outline: 3px solid var(--gray); outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) { .office-track { scroll-behavior: auto; } }
.office-slide { flex: 0 0 100%; scroll-snap-align: start; margin: 0; }
.office-slide img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.office-slide figcaption {
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}
.office-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.office-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--green-dark);
  cursor: pointer;
}
.office-arrow:hover { background: var(--bg); border-color: var(--green); }
.office-arrow svg { width: 20px; height: 20px; }
.office-counter {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--muted);
  min-width: 4.5ch;
  text-align: center;
}

/* ---------- Services ---------- */
.services-layout {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}
@media (min-width: 860px) {
  .services-layout { grid-template-columns: 280px 1fr; gap: 2.5rem; align-items: start; }
}
.service-tabs {
  display: flex;
  overflow-x: auto;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.service-tabs button { scroll-snap-align: start; }
/* on mobile the five categories don't fit in view; fade the right edge so
   it reads as a scrollable strip rather than "only two categories" */
@media (max-width: 859px) {
  .service-tabs {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent 100%);
    mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent 100%);
  }
}
.service-tabs button {
  flex: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.6em 1.1em;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
}
.service-tabs button[aria-selected="true"] {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
@media (min-width: 860px) {
  .service-tabs {
    flex-direction: column;
    overflow: visible;
    position: sticky;
    top: 96px;
  }
  .service-tabs button { text-align: left; border-radius: var(--radius); }
}

.service-panel { display: none; }
.service-panel.is-active { display: block; }

/* so a deep link from the nav's Services submenu doesn't land partly
   hidden under the sticky header */
.service-panel, .service-topic {
  scroll-margin-top: 90px;
}
@media (min-width: 960px) {
  .service-panel, .service-topic { scroll-margin-top: 140px; }
}

.service-topic + .service-topic { border-top: 1px solid var(--line); }
.service-topic summary {
  cursor: pointer;
  list-style: none;
  padding: 1.1rem 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--green-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.service-topic summary::-webkit-details-marker { display: none; }
.service-topic summary::after {
  content: "+";
  font-family: var(--font-body);
  font-size: 1.4rem;
  color: var(--gray);
  flex: none;
}
.service-topic[open] summary::after { content: "–"; }
.service-topic__body { padding: 0 0 1.4rem; color: var(--muted); }
.service-topic__body p:last-child { margin-bottom: 0; }
.service-topic__video {
  position: relative;
  padding-top: 56.25%;
  margin: 1rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}
.service-topic__video iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
/* the video is a linked thumbnail rather than a live iframe embed, since an
   embedded YouTube player errors out when this page is opened as a local
   file (no build step/server) instead of served over http(s) */
.video-thumb {
  position: absolute; inset: 0; display: block;
}
.video-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-thumb::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(28, 31, 35, 0.15);
  transition: background 0.15s ease;
}
.video-thumb:hover::after,
.video-thumb:focus-visible::after { background: rgba(28, 31, 35, 0.32); }
.video-thumb__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
}
.video-thumb__play svg { width: 22px; height: 22px; color: var(--green); margin-left: 3px; }
.video-thumb:hover .video-thumb__play { background: var(--gray); }
.video-thumb:hover .video-thumb__play svg { color: #fff; }
.service-topic__diagram {
  float: right;
  width: 220px;
  max-width: 42%;
  margin: 0.15rem 0 1rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.service-topic__diagram img { display: block; width: 100%; height: auto; }
.service-topic__diagram figcaption {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  padding: 0.4rem 0.5rem;
  border-top: 1px solid var(--line);
}
@media (max-width: 700px) {
  .service-topic__diagram {
    float: none;
    width: 200px;
    max-width: 70%;
    margin: 0 auto 1rem;
  }
}
.advantage-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin: 1rem 0;
}
.advantage-grid div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--bg);
}
.advantage-grid h4 { margin-bottom: 0.3em; font-size: 1rem; }

/* ---------- Testimonials carousel ---------- */
.testimonial-carousel {
  margin-top: 2.5rem;
}
.testimonial-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  border-radius: var(--radius);
}
.testimonial-track::-webkit-scrollbar { display: none; }
.testimonial-track:focus-visible {
  outline: 3px solid var(--gray);
  outline-offset: 4px;
}
@media (prefers-reduced-motion: reduce) {
  .testimonial-track { scroll-behavior: auto; }
}
.testimonial-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  display: flex;
  justify-content: center;
}
.testimonial-card {
  width: 100%;
  max-width: 640px;
  position: relative;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius);
  padding: 2.75rem 1.5rem 1.5rem;
}
/* the signature quote mark the design plan calls for: the one deliberately
   centered element among an otherwise left-aligned layout */
.testimonial-card::before {
  content: "\201C";
  position: absolute;
  top: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 3rem;
  line-height: 1;
  color: var(--gray-light);
}

.testimonial-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 1.75rem;
}
.testimonial-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.35);
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.testimonial-arrow:hover { background: rgba(255,255,255,0.12); }
.testimonial-arrow svg { width: 20px; height: 20px; }
.testimonial-dots { display: flex; align-items: center; gap: 0.55rem; }
.testimonial-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  cursor: pointer;
}
.testimonial-dot.is-active { background: var(--gray-light); }
.testimonial-card p { color: #EAF0EA; font-size: 0.975rem; }
.testimonial-card cite {
  display: block;
  margin-top: 1rem;
  font-style: normal;
  font-weight: 700;
  color: var(--gray-light);
}

/* ---------- Forms ---------- */
.forms-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 2rem;
}
.forms-grid a {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
}
.form-icon { width: 26px; height: 26px; color: var(--green); margin-bottom: 0.75rem; flex: none; }
.forms-grid a small { display: block; font-weight: 400; color: var(--muted); margin-top: 0.35em; }
.forms-grid a:hover { border-color: var(--green); }
.forms-grid a:hover .form-icon { color: var(--gray); }
.forms-options { display: grid; gap: 1rem; margin-top: 2rem; align-items: stretch; }
.forms-option, .forms-referral {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.forms-option h3, .forms-referral h3 { margin: 0.25rem 0 0.4rem; }
.forms-option p, .forms-referral p { color: var(--muted); font-size: 0.975rem; }
.forms-option .forms-grid, .forms-referral .forms-grid { margin-top: 1.1rem; }
.forms-option__label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
}
.forms-or { display: flex; align-items: center; justify-content: center; }
.forms-or span {
  font-family: var(--font-display, inherit);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--gray);
  padding: 0 0.5rem;
}
.forms-referral { margin-top: 2.5rem; border-style: dashed; }
@media (min-width: 860px) {
  .forms-options { grid-template-columns: 1fr auto 2fr; }
  .forms-or { flex-direction: column; }
  .forms-or::before, .forms-or::after { content: ""; flex: 1; width: 1px; background: var(--line); }
  .forms-or span { padding: 0.6rem 0; }
  .forms-referral { max-width: 420px; }
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  gap: 2.5rem;
  margin-top: 2rem;
}
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
/* the map is a fixed-proportion box; center the info column's content
   within the row's height (set by the map) instead of letting it sit
   pinned to the top with dead space below it */
.contact-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hours-table { width: 100%; border-collapse: collapse; margin: 1.25rem 0 0; }
.hours-table td { padding: 0.65rem 0; border-bottom: 1px solid var(--line); font-size: 0.975rem; }
.hours-table td:last-child { text-align: right; color: var(--muted); }
.map-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 4 / 3;
  align-self: center;
}
.map-frame iframe { width: 100%; height: 100%; border: 0; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--green-dark);
  color: #C7D3C9;
  padding: 2.5rem 0;
  font-size: 0.9rem;
}
.site-footer a { color: #fff; }
.site-footer__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}
