/*
Theme Name: Vitality Chiropractic
Theme URI: https://vitalitychiro.com
Author: Evergreen Agency
Description: A premium WordPress block theme for Vitality Chiropractic in San Jose, CA. Built for local SEO and new patient conversion.
Version: 1.0.0
Requires at least: 6.3
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: vitality-chiropractic
*/

/* =============================================
   BASE RESETS & LAYOUT
   ============================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

.wp-site-blocks > footer {
  margin-block-start: 0;
}

/* Remove gap between header and hero */
.wp-site-blocks > header + * {
  margin-block-start: 0 !important;
}

.site-header {
  margin-bottom: 0 !important;
}

/* =============================================
   TYPOGRAPHY
   ============================================= */

.wp-block-heading {
  letter-spacing: -0.02em;
}

h1.wp-block-heading { font-size: clamp(2.25rem, 4vw, 3.25rem); }
h2.wp-block-heading { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h3.wp-block-heading { font-size: clamp(1.35rem, 2vw, 1.75rem); }
h4.wp-block-heading { font-size: 1.25rem; font-family: var(--wp--preset--font-family--body); font-weight: 600; }

p { line-height: 1.7; }

.eyebrow {
  font-family: var(--wp--preset--font-family--body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--wp--preset--color--accent);
}

/* =============================================
   NAVIGATION
   ============================================= */

.wp-block-navigation a {
  text-decoration: none;
  color: var(--wp--preset--color--light);
  transition: color 0.2s ease;
}

.wp-block-navigation a:hover {
  color: var(--wp--preset--color--accent);
}

.site-header .wp-block-navigation a {
  color: var(--wp--preset--color--light);
}

.wp-block-navigation__submenu-container {
  background: var(--wp--preset--color--primary);
  border-top: 2px solid var(--wp--preset--color--accent);
  min-width: 200px;
}

.wp-block-navigation__submenu-container a {
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
}

.wp-block-navigation-item__content {
  padding: 0.25rem 0;
}

.wp-block-site-title a {
  text-decoration: none;
  color: var(--wp--preset--color--light) !important;
  font-family: var(--wp--preset--font-family--display);
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

/* =============================================
   BUTTONS
   ============================================= */

.wp-block-buttons .wp-block-button__link {
  padding: 0.85rem 2rem;
  border-radius: 4px;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.wp-block-buttons .wp-block-button__link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26, 60, 46, 0.25);
}

.is-style-outline .wp-block-button__link {
  background: transparent !important;
  border: 2px solid var(--wp--preset--color--light) !important;
  color: var(--wp--preset--color--light) !important;
}

.is-style-outline .wp-block-button__link:hover {
  background: var(--wp--preset--color--light) !important;
  color: var(--wp--preset--color--primary) !important;
}

.btn-dark .wp-block-button__link {
  background: var(--wp--preset--color--primary) !important;
  color: var(--wp--preset--color--light) !important;
}

.btn-dark .wp-block-button__link:hover {
  background: var(--wp--preset--color--secondary) !important;
}

/* =============================================
   CARD LAYOUTS (equal height)
   ============================================= */

.equal-cards > .wp-block-column {
  display: flex;
  flex-direction: column;
  flex-grow: 0;
}

.equal-cards > .wp-block-column > .wp-block-group {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.equal-cards .cta-bottom {
  margin-top: auto;
  justify-content: center;
}

/* Service Cards */
.service-card {
  background: var(--wp--preset--color--light);
  border: 1px solid var(--wp--preset--color--muted);
  border-radius: 8px;
  padding: 2rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(26, 60, 46, 0.12);
  border-color: var(--wp--preset--color--accent);
}

.service-icon {
  width: 52px;
  height: 52px;
  background: var(--wp--preset--color--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

/* Condition Cards (local SEO pages) */
.condition-card {
  background: var(--wp--preset--color--cream);
  border-left: 3px solid var(--wp--preset--color--accent);
  border-radius: 0 6px 6px 0;
  padding: 1.5rem;
  transition: background 0.2s ease;
}

.condition-card:hover {
  background: var(--wp--preset--color--muted);
}

/* =============================================
   HERO SECTION
   ============================================= */

.hero-section {
  background: linear-gradient(135deg, rgba(26,60,46,0.97) 0%, rgba(45,92,68,0.93) 50%, rgba(26,60,46,0.97) 100%),
              url('https://assets.cdn.filesafe.space/gDvepw2oB1OngJrVX6kD/media/e9068476-dd7f-410b-9630-eb7292371306.jpeg') center/cover no-repeat !important;
  background-color: #1a3c2e !important;
  position: relative;
  overflow: hidden;
  color: #ffffff;
}

/* Ensure hero text is always visible even before animations */
.hero-section .fade-up {
  animation-fill-mode: both;
}

.hero-section * {
  position: relative;
  z-index: 1;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(122, 182, 72, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: 5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(122, 182, 72, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* =============================================
   SECTION DIVIDERS & ACCENTS
   ============================================= */

.green-band {
  background: var(--wp--preset--color--primary);
}

.accent-band {
  background: var(--wp--preset--color--accent);
}

.cream-band {
  background: var(--wp--preset--color--cream);
}

.white-band {
  background: var(--wp--preset--color--light);
}

.stat-number {
  font-family: var(--wp--preset--font-family--display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  color: var(--wp--preset--color--accent);
  line-height: 1;
  display: block;
}

/* =============================================
   TESTIMONIAL STYLING
   ============================================= */

.testimonial-card {
  background: var(--wp--preset--color--light);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(26, 60, 46, 0.08);
  position: relative;
}

.testimonial-card::before {
  content: '"';
  font-family: var(--wp--preset--font-family--display);
  font-size: 5rem;
  color: var(--wp--preset--color--accent);
  opacity: 0.3;
  position: absolute;
  top: -0.5rem;
  left: 1.5rem;
  line-height: 1;
}

/* =============================================
   INNER PAGE HERO
   ============================================= */

.page-hero {
  background: linear-gradient(135deg, #1a3c2e 0%, #2d5c44 100%);
  padding: 5rem 0 4rem;
}

.breadcrumb {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--wp--preset--color--accent);
}

/* =============================================
   SIDEBAR / STICKY BOOKING BOX
   ============================================= */

.booking-box {
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--light);
  border-radius: 8px;
  padding: 2rem;
  position: sticky;
  top: 100px;
}

.booking-box h3 {
  color: var(--wp--preset--color--light);
  margin-bottom: 1rem;
}

/* =============================================
   LOCATION / MAP SECTION
   ============================================= */

.location-info-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 0;
  border-bottom: 1px solid var(--wp--preset--color--muted);
}

.hours-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.hours-table tr td {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--wp--preset--color--muted);
}

.hours-table tr td:first-child {
  font-weight: 600;
  width: 45%;
}

/* =============================================
   SCROLL ANIMATIONS
   ============================================= */

.animate-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-on-scroll-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.animate-on-scroll-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.animate-on-scroll-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.animate-on-scroll-right.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger delay helpers */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }

/* Entrance animations on load */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeUp 0.7s ease both;
}

.fade-up.delay-1 { animation-delay: 0.15s; }
.fade-up.delay-2 { animation-delay: 0.3s; }
.fade-up.delay-3 { animation-delay: 0.45s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Safety net — if animation never runs (e.g. prefers-reduced-motion already handled below),
   ensure content is never permanently invisible */
@media (min-width: 0px) {
  .hero-section .fade-up {
    animation: fadeUp 0.7s ease both;
  }
}

/* Green accent pulse on hero CTA */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(122, 182, 72, 0.4); }
  50%       { box-shadow: 0 0 0 10px rgba(122, 182, 72, 0); }
}

.pulse-cta .wp-block-button__link {
  animation: pulseGlow 2.5s ease-in-out infinite;
}

/* Floating decorative element */
@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%       { transform: translateY(-14px) rotate(3deg); }
}

.float-slow {
  animation: floatSlow 6s ease-in-out infinite;
}

/* =============================================
   CUSTOM DROPDOWN NAVIGATION
   ============================================= */

.vitality-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.vitality-nav ul li {
  position: relative;
}

.vitality-nav ul li a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--wp--preset--font-family--body);
  white-space: nowrap;
  transition: color 0.2s ease;
  cursor: pointer;
}

.vitality-nav ul li a:hover {
  color: var(--wp--preset--color--accent);
}

/* Dropdown */
.vitality-nav .dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #1a3c2e;
  border-top: 2px solid var(--wp--preset--color--accent);
  border-radius: 0 0 6px 6px;
  min-width: 210px;
  flex-direction: column;
  gap: 0 !important;
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
  z-index: 9999;
}

.vitality-nav .has-dropdown:hover .dropdown {
  display: flex;
}

/* Bridge gap so mouse can reach dropdown */
.vitality-nav .has-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 8px;
}

.vitality-nav .dropdown li {
  width: 100%;
}

.vitality-nav .dropdown li a {
  display: block;
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.75);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background 0.15s ease, color 0.15s ease;
}

.vitality-nav .dropdown li a:hover {
  background: rgba(122,182,72,0.12);
  color: #fff;
}

.vitality-nav .dropdown li:last-child a {
  border-bottom: none;
}

/* =============================================
   CONDITIONS SECTION CENTERING
   ============================================= */

.conditions-section > .wp-block-group {
  margin-left: auto;
  margin-right: auto;
}

.conditions-section .wp-block-columns {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

/* Footer list reset */
.footer-links {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.footer-links li {
  padding: 0.25rem 0;
}

/* =============================================
   ACCESSIBILITY
   ============================================= */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 900px) {
  .hero-section::before,
  .hero-section::after { display: none; }
  .booking-box { position: static; }

  /* Homepage hero padding */
  .hero-section { padding-left: 1.25rem !important; padding-right: 1.25rem !important; }

  /* Blog grid single column */
  .vc-blog-grid { grid-template-columns: 1fr !important; }

  /* Single post layout */
  .vc-article-body .inner { grid-template-columns: 1fr !important; }
  .vc-article-sidebar { position: static !important; }
}

@media (max-width: 600px) {
  /* Ensure full width, no horizontal scroll */
  body { overflow-x: hidden; }
  .wp-site-blocks { overflow-x: hidden; }

  /* Hero font sizes */
  .hero-section h1,
  .hero-section .wp-block-heading { font-size: clamp(1.6rem, 6vw, 2.2rem) !important; }

  /* Inline block elements that might overflow */
  img, video, iframe { max-width: 100%; }

  /* Homepage sections padding */
  .wp-block-group[style*="padding"] { padding-left: 1rem !important; padding-right: 1rem !important; }

  /* Columns stack */
  .wp-block-columns { flex-direction: column !important; }
  .wp-block-column { flex-basis: 100% !important; min-width: 100% !important; }

  /* Stats/numbers */
  .stat-number { font-size: clamp(2rem, 8vw, 3rem); }
}
