/* =====================================================================
   src/styles/theme.css
   SINGLE SOURCE OF TRUTH for the Signature Dental dark-green theme.

   - Always dark. No prefers-color-scheme media query anywhere.
   - `html:root` has higher specificity than a plain `:root`, so even if
     an old stylesheet still has a :root block, THIS one wins.
   - Import it in main.jsx / index.js, FIRST, and delete the old :root /
     @media (prefers-color-scheme: dark) blocks from services.css and
     style.css (see the notes).
   ===================================================================== */

html:root {
  color-scheme: dark;

  --ink: #eef8f2;
  --ink-2: #c1d4cd;
  --paper: #0e1b19;
  --surface: #152622;
  --mist: #182e29;
  --mint: #23463b;
  --mint-2: #315d4d;
  --teal: #70c9bb;
  --teal-2: #a4ded0;
  --lime: #d8ee77;
  --peach: #d98962;
  --sun: #d9b84f;
  --line: #2c4941;
  --white: #ffffff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --shadow-small: 0 14px 40px rgba(0, 0, 0, 0.2);

  /* NEW helper tokens.
     --teal-2 is a LIGHT mint in this theme, so anything sitting on a
     --teal-2 surface needs DARK text (not #fff). */
  --on-accent: #0e1b19;
  --on-accent-soft: #173734;
  --accent-deep: #07514e; /* dark teal for small text/links on mint */
  --warm-on-mint: #a33d00; /* orange eyebrow text on mint, AA contrast */
}

/* Paint the page dark before React loads (no white flash / white overscroll
   on mobile) */
html {
  background: #0e1b19;
}

/* Missing keyframes: .loader uses `animation: pulse` but it was never defined */
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.8;
  }
}

/* =====================================================================
   OVERRIDES
   Everything below is prefixed with `html body` so it wins no matter in
   which order the page stylesheets load (lazy routes etc.).
   ===================================================================== */

/* ---------- 1. Headings: fixed px values were beating the responsive clamps ---------- */
/* Before: `.section-head h2 {font-size:58px}` etc. stayed 58-68px on phones. */
html body .section-head h2,
html body .svc-home .svc-h2 {
  font-size: clamp(2.1rem, 4.6vw, 3.625rem);
}
html body .doctor-copy h2,
html body .reviews-top h2,
html body .tech-copy h2,
html body .about-story-copy h2 {
  font-size: clamp(2.1rem, 4.8vw, 3.75rem);
}
html body .sd-hero__title {
  font-size: clamp(2.3rem, 5.4vw, 4.25rem);
}
/* Phones: 35px (same value you had in responsive.css, now lives here so it
   is not overridden by the clamp() rules above) */
@media (max-width: 574.99px) {
  html body .section-head h2,
  html body .svc-home .svc-h2,
  html body .doctor-copy h2,
  html body .reviews-top h2,
  html body .tech-copy h2,
  html body .about-story-copy h2,
  html body .sd-hero__title {
    font-size: 35px;
    line-height: 1.06;
  }
}

/* ---------- 2. Text on mint (--teal-2) surfaces: white -> dark ---------- */
html body .btn,
html body .svc-btn,
html body .btn:hover,
html body .svc-btn:hover {
  color: var(--on-accent);
}
html body .btn-outline,
html body .svc-btn--ghost,
html body .btn-outline:hover,
html body .svc-btn--ghost:hover {
  color: var(--ink);
}
html body .mobile-bar a:last-child {
  color: var(--on-accent);
}
html body .review-aside {
  color: var(--on-accent);
}
html body .bd-avatar {
  color: var(--on-accent);
}
html body .sd-jump a:hover {
  color: var(--on-accent);
}

/* Emergency card */
html body .em-card {
  color: var(--on-accent);
}
html body .em-card__phone {
  color: var(--on-accent);
}
html body .em-card__phone:hover {
  color: var(--accent-deep);
}
html body .em-card .em-card__text,
html body .em-card .em-card__addr {
  color: var(--on-accent-soft);
}
html body .em-card__addr svg {
  color: var(--accent-deep);
}
html body .em-card__live {
  color: var(--accent-deep);
}
html body .em-card__live i {
  background: var(--accent-deep);
}
html body .em-card__dir,
html body .em-card__dir:hover {
  background: var(--paper);
  color: var(--teal-2);
}
@keyframes em-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(7, 81, 78, 0.55);
  }
  100% {
    box-shadow: 0 0 0 14px rgba(7, 81, 78, 0);
  }
}

/* Emergency tabs */
html body .em-tab.is-active {
  color: var(--on-accent);
}
html body .em-tab.is-active .em-tab__icon {
  background: var(--paper);
  color: var(--teal-2);
}
html body .em-panel__h--dont {
  color: #f08a6b;
}
html body .em-panel__h--dont svg {
  color: #ffb59a;
}

/* Contact: working hours card */
html body .ct-hours li {
  border-bottom-color: rgba(14, 27, 25, 0.14);
}
html body .ct-hours li.is-today {
  background: rgba(255, 255, 255, 0.35);
}
html body .ct-hours__day,
html body .ct-hours__time {
  color: var(--on-accent);
}
html body .ct-hours__time small {
  color: var(--on-accent-soft);
}
html body .ct-hours__day em {
  background: var(--paper);
  color: var(--teal-2);
}
html body .ct-hours li.is-closed .ct-hours__time {
  color: #a73a22;
}
html body .ct-hours .ct-hours__note {
  color: var(--on-accent-soft);
}
html body .ct-hours__note a {
  color: var(--accent-deep);
  text-decoration: underline;
}
html body .ct-hours::after {
  border-color: rgba(14, 27, 25, 0.08);
}

/* Blog sidebar CTA */
html body .bd-cta h3 {
  color: var(--on-accent);
}
html body .bd-cta .svc-eyebrow {
  color: var(--warm-on-mint);
}
html body .bd-cta__btn,
html body .bd-cta__btn:hover {
  background: var(--paper);
  color: var(--teal-2);
}
html body .bd-cta__link {
  color: var(--on-accent);
}
html body .bd-cta__link:hover {
  color: var(--accent-deep);
}
html body .bd-cta__rel {
  color: var(--on-accent);
  background: rgba(255, 255, 255, 0.35);
}
html body .bd-cta__rel:hover {
  background: rgba(255, 255, 255, 0.5);
  color: var(--on-accent);
}
html body .bd-cta__rel small {
  color: var(--accent-deep);
}

/* Orange eyebrows on mint: #e95d00 / #f16302 / #fc8b40 were ~2:1 contrast */
html body .feature-copy .eyebrow,
html body .ba-info .svc-eyebrow,
html body .ba-contact strong,
html body .bd-closing strong {
  color: var(--warm-on-mint);
}

/* ---------- 3. Booking form + modal ---------- */
/* Hard-coded #152622 -> token; the close button had NO colour (black on dark) */
html body .ba-modal__box {
  background: var(--surface);
  box-shadow:
    0 0 0 1px var(--line),
    0 24px 70px rgba(0, 0, 0, 0.5);
}
html body .ba-modal__close {
  color: var(--ink);
}
/* select arrow was dark teal (%230e6d67) on a dark input */
html body .ba-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2370c9bb' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 9 7 7 7-7'/%3E%3C/svg%3E");
}
html body .ba-error {
  color: #ff8a80;
}

/* ---------- 4. Blog tick icon: dark-teal tick on dark-mint circle ---------- */
html body .bd-section li::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a4ded0' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E");
}

/* ---------- 5. Keyboard focus visible on dark ---------- */
html body a:focus-visible,
html body button:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}
