/*
Theme Name: AVPR Super Speciality Dental Hospital v2
Theme URI: https://madfolks.agency/
Author: Madfolks
Author URI: https://madfolks.agency/
Description: Custom responsive WordPress theme for AVPR Super Speciality Dental Hospital in Jagtial, Telangana, led by Dr. A Shailendar Reddy. Built with patient-first healthcare aesthetics, responsive design system, and custom appointment & self-diagnose tool integrations.
Version: 2.0.0
Text Domain: avpr-dental
*/

/* ==========================================================================
   Design System Tokens (Stitch MCP DNA)
   ========================================================================== */
:root {
  --color-primary: #0A4D68;
  --color-primary-hover: #088395;
  --color-accent: #05BFDB;
  --color-accent-light: #E0F7FA;
  --color-bg-light: #F4F9F9;
  --color-surface: #FFFFFF;
  --color-text-dark: #1E293B;
  --color-text-muted: #64748B;
  --color-border: #E2E8F0;
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-error: #EF4444;

  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(10, 77, 104, 0.05);
  --shadow-md: 0 8px 24px rgba(10, 77, 104, 0.08);
  --shadow-lg: 0 16px 36px rgba(10, 77, 104, 0.12);

  --max-width: 1200px;
  --header-height: 80px;
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  color: var(--color-text-dark);
  background-color: var(--color-bg-light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-primary);
  line-height: 1.25;
  font-weight: 700;
  margin-bottom: 0.75em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.6rem); }

p {
  margin-bottom: 1.25em;
  color: var(--color-text-dark);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-accent);
}

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

/* Inline SVG icons: deliberately NOT emoji (📍🕒📞 etc). Color emoji
   glyphs are baked bitmaps that ignore the CSS `color` property entirely
   — no stylesheet can recolor them. These SVGs use stroke="currentColor"
   instead, so they automatically match whatever text color applies in
   context (white in the dark header/footer, dark blue elsewhere) with
   zero extra color rules needed. */
.icon-text {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  color: inherit;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

.section-alt {
  background-color: var(--color-surface);
}

.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.25s ease;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  color: var(--color-surface);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: var(--color-accent-light);
  color: var(--color-primary);
}

.btn-secondary:hover {
  background-color: var(--color-accent);
  color: var(--color-surface);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-outline:hover {
  background-color: var(--color-primary);
  color: var(--color-surface);
}

/* Top Bar */
.top-bar {
  background-color: var(--color-primary);
  color: var(--color-surface);
  padding: 10px 0;
  font-size: 0.875rem;
}

.top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.top-bar-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

/* Main Header */
.site-header {
  background-color: var(--color-surface);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--header-height);
  position: relative;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-logo-text {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--color-primary);
}

.site-logo-text span {
  color: var(--color-accent);
}

.main-navigation ul {
  display: flex;
  list-style: none;
  gap: 24px;
}

.main-navigation a:not(.btn) {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text-dark);
  padding: 8px 0;
  position: relative;
}

.main-navigation a:not(.btn):hover,
.main-navigation .current-menu-item a:not(.btn) {
  color: var(--color-primary);
}

/* Hamburger toggle button: hidden on desktop, shown only <992px below. */
.mobile-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* When open, animate the 3 lines into an X. */
.mobile-nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.mobile-nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}
.mobile-nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* This <li> holds the "Book an Appointment" link duplicated inside the
   mobile dropdown menu — necessary because the standalone header button
   (.header-cta) is hidden on mobile to avoid crowding the logo + hamburger
   into a too-narrow row. Hidden on desktop, where .header-cta is used
   instead. */
.mobile-nav-cta {
  display: none;
}

/* Cards & Grids */
.hero-grid {
  grid-template-columns: 1.2fr 0.8fr;
}
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

.card {
  background: var(--color-surface);
  padding: 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* Footer */
.site-footer {
  background-color: var(--color-primary);
  color: var(--color-surface);
  padding: 60px 0 30px;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h4 {
  color: var(--color-accent);
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.footer-col p, .footer-col li {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 10px;
}

/* :not(.btn) is deliberate: without it, this rule's higher specificity
   (class + element) silently overrides .btn-primary/.btn-secondary's own
   text color whenever a button is placed inside the footer — which is
   exactly what caused the unreadable "Book Appointment" button here.
   Buttons must always control their own foreground color regardless of
   which section of the page they're placed in. */
.footer-col a:not(.btn) {
  color: rgba(255, 255, 255, 0.85);
}

.footer-col a:not(.btn):hover {
  color: var(--color-accent);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 24px;
  text-align: center;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.75);
}

/* The global "p { color: ... }" rule above targets these <p> tags
   directly, which beats inheriting color from the parent .footer-bottom
   div — without this, the copyright/credits text renders in dark navy
   on the dark navy footer background and becomes unreadable. */
.footer-bottom p {
  color: rgba(255, 255, 255, 0.75);
}

.footer-bottom a:not(.btn) {
  color: var(--color-accent);
  text-decoration: underline;
}

/* ==========================================================================
   Hero Doctor Cutout
   A real transparent-background cutout, not a photo in a white card — sits
   directly on the hero gradient with a soft ground-contact shadow (via
   drop-shadow, which follows the subject's silhouette, unlike box-shadow
   which would just draw a rectangle behind it) and a floating glass-style
   name badge instead of a solid white label block.
   ========================================================================== */
.doctor-cutout-wrap {
  position: relative;
  max-width: 420px;
  margin: 0 auto;
  animation: doctor-float 5s ease-in-out infinite;
}

.doctor-cutout-img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 18px 28px rgba(10, 77, 104, 0.28));
}

.doctor-name-badge {
  position: absolute;
  left: 50%;
  bottom: 6%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  padding: 10px 22px;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(10, 77, 104, 0.12);
}

.doctor-name-badge strong {
  display: block;
  color: var(--color-primary);
  font-size: 1rem;
}

.doctor-name-badge span {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 500;
}

@keyframes doctor-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

/* ==========================================================================
   Hero entrance animation (plays once on page load — hero is above the
   fold, so this isn't scroll-triggered like .reveal below).
   ========================================================================== */
@keyframes hero-fade-up {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes hero-fade-scale {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

.hero-anim-text {
  animation: hero-fade-up 0.8s ease both;
}

.hero-anim-image {
  animation: hero-fade-scale 0.9s 0.15s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ==========================================================================
   Site-wide scroll-reveal system. Elements only start hidden/offset once
   the "js-reveal-ready" class has been added to <html> — and that class
   is added by an inline script in the <head> (see header.php), separate
   from and before the IntersectionObserver logic in footer.php.

   This matters: if this were unconditional (".reveal { opacity:0 }" with
   no gating class), any failure in the JS — blocked script, caching
   issue serving stale/broken JS, a conflict with another plugin's script
   erroring out first — would leave every section using .reveal PERMANENTLY
   invisible, with no fallback. That's a fail-*unsafe* default: broken JS
   silently deletes real content instead of just skipping an animation.
   Gating behind a class that only JS can add makes the failure mode
   "content shows immediately, no animation" instead of "content vanishes."
   ========================================================================== */
.js-reveal-ready .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.js-reveal-ready .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Respect users who've asked their OS/browser to minimize motion. */
@media (prefers-reduced-motion: reduce) {
  .doctor-cutout-wrap,
  .hero-anim-text,
  .hero-anim-image {
    animation: none !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ==========================================================================
   Mobile / Tablet Breakpoint (<=992px)
   ========================================================================== */
@media (max-width: 992px) {
  /* Address/hours/phone bar: desktop-only. On mobile it just eats vertical
     space above the fold for information that's already reachable via the
     Call Now button and Contact page — hidden here, untouched on desktop. */
  .top-bar {
    display: none;
  }

  /* NOTE: previously this rule said ".hero" — a class that doesn't exist
     anywhere in the theme (the actual homepage grid is ".hero-grid", set
     inline in front-page.php). That mismatch meant the hero's 2-column
     layout never collapsed on any phone or tablet, squeezing the doctor
     photo and text into two very narrow columns. Fixed below. */
  .hero-grid, .grid-3, .grid-4, .footer-grid {
    grid-template-columns: 1fr;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .doctor-cutout-wrap {
    max-width: 300px;
  }

  /* --- Mobile navigation ---
     Previously: .main-navigation was just display:none with no way to
     open it again — meaning nobody on a phone or tablet could reach any
     nav link at all. Replaced with an actual toggleable dropdown panel. */
  .mobile-nav-toggle {
    display: flex;
  }

  .header-cta {
    display: none; /* replaced by .mobile-nav-cta inside the dropdown below */
  }

  .main-navigation {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    box-shadow: var(--shadow-md);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    z-index: 999;
  }

  .main-navigation.is-open {
    max-height: 600px;
  }

  .main-navigation ul {
    flex-direction: column;
    gap: 0;
    padding: 8px 24px 20px;
  }

  .main-navigation li {
    border-bottom: 1px solid var(--color-border);
  }

  .main-navigation a:not(.btn) {
    display: block;
    padding: 14px 4px;
  }

  .mobile-nav-cta {
    display: block;
    border-bottom: none;
    padding-top: 4px;
  }
}

/* ==========================================================================
   Small Phone Breakpoint (<=768px)
   Section padding is set inline (e.g. style="padding: 60px 0") on every
   page's intro banner across all 18 templates, which a normal stylesheet
   rule — media query or not — can never override, since inline styles
   always win over external CSS regardless of specificity. The !important
   below is a deliberate, singular exception to override that inline
   value specifically for small screens, not a general practice used
   elsewhere in this stylesheet.
   ========================================================================== */
@media (max-width: 768px) {
  .section,
  .hero-section {
    padding: 48px 0 !important;
  }

  .top-bar-info {
    font-size: 0.8rem;
  }

  .site-logo-text {
    font-size: 1.2rem;
  }
}
