/* ==========================================================================
   Doctor Portfolio — custom styles that complement Tailwind utilities
   ========================================================================== */

:root {
  --navy: #0B2545;
  --teal: #0E7C86;
  --sky: #DCEFF5;
  --paper: #F5F7F8;
  --muted: #5B6B7F;
}

/* Guard against horizontal scroll ("clip" keeps the sticky header working) */
html, body { overflow-x: clip; }
::selection { background: var(--teal); color: #fff; }

/* Offset anchored sections below the sticky header (64px mobile / 76px desktop) */
section[id] { scroll-margin-top: 4rem; }
@media (min-width: 1024px) { section[id] { scroll-margin-top: 4.75rem; } }

/* Header gains a soft shadow once the page is scrolled */
.site-header.is-scrolled { background: rgba(255,255,255,.96); box-shadow: 0 8px 24px -12px rgba(11,37,69,.18); }

/* Lock page scroll while the mobile drawer is open */
body.drawer-open { overflow: hidden; }

/* ---------- Sidebar / mobile drawer ---------- */
.sidebar { box-shadow: 1px 0 0 rgba(255,255,255,.04); }
.sidebar.is-open { transform: translateX(0); box-shadow: 24px 0 60px -20px rgba(0,0,0,.45); }
#overlay.is-visible { opacity: 1; pointer-events: auto; }

.sidebar-scroll { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.sidebar-scroll::-webkit-scrollbar { width: 6px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 6px; }

/* ---------- Hero ---------- */
.hero-grid {
  background-image:
    linear-gradient(rgba(11,37,69,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11,37,69,.045) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 10%, transparent 70%);
          mask-image: radial-gradient(ellipse at 70% 30%, #000 10%, transparent 70%);
}

/* Arch-shaped portrait frame */
.portrait-frame {
  aspect-ratio: 4 / 5;
  border-radius: 999px 999px 28px 28px;
  outline: 1px solid rgba(14,124,134,.18);
  outline-offset: 10px;
}

/* ---------- Colour tones for icons ----------
   Each tone = a strong colour (--tone) + a soft tint (--tone-bg). */
.tone-teal    { --tone: #0E7C86; --tone-bg: #E3F3F4; }
.tone-blue    { --tone: #1D6FB8; --tone-bg: #E4EFFA; }
.tone-rose    { --tone: #D2455C; --tone-bg: #FCE8EB; }
.tone-amber   { --tone: #B9770E; --tone-bg: #FBF0DC; }
.tone-violet  { --tone: #6A58CC; --tone-bg: #EEEBFB; }
.tone-emerald { --tone: #138A5E; --tone-bg: #E1F4EB; }

.icon-tile[class*="tone-"] { background: var(--tone-bg); color: var(--tone); }
.card:hover .icon-tile[class*="tone-"] { background: var(--tone); color: #fff; }
.service-icon[class*="tone-"] { background: var(--tone); }

/* Handwritten signature under the About text */
.signature { font-family: 'Great Vibes', cursive; line-height: 1; }

/* ---------- Treatment image cards ---------- */
.service-card {
  display: flex; flex-direction: column;
  overflow: hidden; border-radius: 1.25rem;
  background: #fff; border: 1px solid rgba(11,37,69,.06);
  box-shadow: 0 1px 2px rgba(11,37,69,.04), 0 8px 24px -8px rgba(11,37,69,.10);
  transition: transform .3s ease, box-shadow .3s ease;
}
.service-card:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(11,37,69,.05), 0 18px 40px -12px rgba(11,37,69,.18); }
.service-img { aspect-ratio: 16 / 10; overflow: hidden; background: var(--sky); }
.service-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.service-card:hover .service-img img { transform: scale(1.05); }
.service-icon {
  position: absolute; top: -1.75rem; left: 1.75rem;
  display: grid; place-items: center; width: 3.5rem; height: 3.5rem;
  border-radius: 1rem; border: 4px solid #fff;
  background: var(--teal); color: #fff; font-size: 1.1rem;
  transition: background-color .3s ease;
}
.service-card:hover .service-icon { background: var(--navy); }

/* ---------- Subtle pattern for dark sections ---------- */
.awards-pattern {
  background-image: radial-gradient(rgba(169,214,229,.10) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 85%);
          mask-image: linear-gradient(to bottom, #000, transparent 85%);
}

/* ---------- Treatments: card link ---------- */
.learn-more {
  display: inline-flex; align-items: center; gap: .5rem;
  min-height: 44px;
  font-size: .875rem; font-weight: 600; color: var(--teal);
}
.learn-more i { font-size: .75rem; transition: transform .25s ease; }
.learn-more:hover i, .group:hover .learn-more i { transform: translateX(4px); }

/* ---------- FAQ accordion (native <details>) ---------- */
.faq-item {
  border-radius: 1rem; background: #fff;
  border: 1px solid rgba(11,37,69,.08);
  transition: border-color .3s ease, box-shadow .3s ease;
}
.faq-item:hover { border-color: rgba(14,124,134,.3); }
.faq-item[open] { border-color: rgba(14,124,134,.35); box-shadow: 0 1px 2px rgba(11,37,69,.04), 0 8px 24px -8px rgba(11,37,69,.10); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 56px; padding: 1rem 1.25rem 1rem 1.5rem;
  font-weight: 600; font-size: .975rem; color: var(--navy);
  cursor: pointer; list-style: none; border-radius: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; flex-shrink: 0;
  display: grid; place-items: center; width: 2rem; height: 2rem;
  border-radius: 999px; background: #E7F4F5; color: var(--teal);
  font-size: 1.15rem; font-weight: 500; line-height: 1;
  transition: transform .3s ease, background-color .3s ease, color .3s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); background: var(--teal); color: #fff; }
.faq-item summary:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(14,124,134,.3); }
.faq-body { padding: 0 1.5rem 1.35rem; font-size: .925rem; line-height: 1.75; color: #5B6B7F; }
@media (max-width: 639px) {
  .faq-item summary { padding: .9rem 1rem .9rem 1.15rem; font-size: .94rem; }
  .faq-body { padding: 0 1.15rem 1.15rem; }
}

/* ---------- About page: vertical timeline ---------- */
.timeline > li { position: relative; padding: 0 0 1.75rem 2rem; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before {                 /* connecting line */
  content: ''; position: absolute; left: calc(.5rem - 1px); top: 1.1rem; bottom: -.35rem;
  width: 2px; background: rgba(14,124,134,.18);
}
.timeline > li:last-child::before { display: none; }
.timeline > li::after {                  /* dot */
  content: ''; position: absolute; left: 0; top: .3rem;
  width: 1rem; height: 1rem; border-radius: 999px;
  border: 3px solid var(--teal); background: #fff;
}
.timeline > li:first-child::after { background: var(--teal); box-shadow: 0 0 0 4px rgba(14,124,134,.15); }
.timeline-date  { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); }
.timeline-title { margin-top: .25rem; font-size: 1.02rem; font-weight: 600; line-height: 1.4; color: var(--navy); }
.timeline-place { margin-top: .15rem; font-size: .875rem; color: var(--muted); }

/* ---------- Treatments page ---------- */
.service-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.service-meta li {
  display: inline-flex; align-items: center; gap: .4rem;
  border-radius: 999px; background: var(--paper); padding: .3rem .75rem;
  font-size: .75rem; font-weight: 600; color: rgba(11,37,69,.75);
}
.service-meta i { color: var(--teal); font-size: .7rem; }

.step-card {
  position: relative; overflow: hidden;
  border-radius: 1.25rem; border: 1px solid rgba(11,37,69,.06); background: #fff; padding: 1.75rem;
  box-shadow: 0 1px 2px rgba(11,37,69,.04), 0 8px 24px -8px rgba(11,37,69,.10);
}
.step-num {
  position: absolute; right: 1.25rem; top: .75rem;
  font-family: 'Fraunces', Georgia, serif; font-size: 3rem; line-height: 1; color: rgba(14,124,134,.12);
}

/* ---------- FAQ page ---------- */
.faq-topics { scrollbar-width: none; }
.faq-topics::-webkit-scrollbar { display: none; }
.faq-topic {
  display: flex; align-items: center; gap: .6rem; white-space: nowrap;
  min-height: 44px; padding: 0 1rem; border-radius: 999px;
  border: 1px solid rgba(11,37,69,.1); background: #fff;
  font-size: .875rem; font-weight: 600; color: var(--navy);
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}
.faq-topic i { color: var(--teal); width: 1rem; text-align: center; }
.faq-topic:hover { border-color: var(--teal); color: var(--teal); }
@media (min-width: 1024px) {
  .faq-topic { border-radius: .75rem; border-color: transparent; }
  .faq-topic:hover { background: #E7F4F5; border-color: transparent; }
}
.faq-group-title {
  display: flex; align-items: center; gap: .9rem;
  font-family: 'Fraunces', Georgia, serif; font-size: 1.5rem; font-weight: 500; color: var(--navy);
}
#appointments, #tests, #reports, #emergencies { scroll-margin-top: 5.5rem; }
@media (min-width: 1024px) { #appointments, #tests, #reports, #emergencies { scroll-margin-top: 7rem; } }

/* ---------- Form validation ---------- */
.field-error { display: none; margin-top: .375rem; font-size: .75rem; color: #B42318; }
.field.is-invalid { border-color: #F04438; background: #fff; }
.field.is-invalid + .field-error { display: block; }

/* ---------- Mobile bottom navigation ---------- */
.bottom-nav { padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -8px 24px -12px rgba(11,37,69,.18); }
.bnav-link {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 56px; border-radius: 12px;
  font-size: 10.5px; font-weight: 600; color: var(--muted);
  transition: color .2s ease;
}
.bnav-link i { font-size: 17px; }
.bnav-link::before {                      /* small active indicator */
  content: ''; position: absolute; top: -6px; width: 22px; height: 3px; border-radius: 0 0 4px 4px;
  background: var(--teal); transform: scaleX(0); transition: transform .25s ease;
}
.bnav-link.is-active { color: var(--teal); }
.bnav-link.is-active::before { transform: scaleX(1); }
.bnav-cta {
  display: grid; place-items: center;
  width: 56px; height: 56px; margin-top: -26px;
  border-radius: 999px; border: 4px solid #fff;
  background: var(--teal); color: #fff; font-size: 20px;
  box-shadow: 0 10px 24px -8px rgba(14,124,134,.6);
  transition: background-color .2s ease, transform .2s ease;
}
.bnav-cta:active { transform: scale(.95); }
.bnav-cta:hover { background: #0A646C; }

/* ---------- Floating buttons ---------- */
#backToTop.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.wa-btn::before {                     /* subtle one-time attention ring */
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(37,211,102,.5);
  animation: wa-pulse 2.4s ease-out 1.5s 3;
}
@keyframes wa-pulse { to { box-shadow: 0 0 0 16px rgba(37,211,102,0); } }

/* ---------- Scroll reveal ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s ease, transform .7s ease;
  transition-delay: var(--d, 0ms);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
