/* ============================================
   COASTWISE HEALTH — Global Styles
   ============================================ */

@import url('tokens.css');

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text-body);
  background-color: var(--color-white);
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

ul, ol {
  list-style: none;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-text-heading);
  line-height: 1.2;
  margin-bottom: var(--space-sm);
}

h1 {
  font-size: var(--text-5xl);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--text-3xl);
}

h3 {
  font-size: var(--text-xl);
}

h4 {
  font-size: var(--text-lg);
}

p {
  margin-bottom: var(--space-sm);
}

p:last-child {
  margin-bottom: 0;
}

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

.text-white {
  color: var(--color-white);
}

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

.container--narrow {
  max-width: var(--container-narrow);
}

.container--wide {
  max-width: var(--container-wide);
}

section {
  padding: var(--space-2xl) 0;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0.875rem 2rem;
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: var(--font-weight-bold);
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  letter-spacing: 0.02em;
}

.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-text-heading);
  border-color: var(--color-accent);
}

.btn--primary:hover {
  background-color: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: var(--color-text-heading);
}

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

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

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

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

.btn--sm {
  padding: 0.625rem 1.25rem;
  font-size: var(--text-sm);
}

.btn--lg {
  padding: 1rem 2.5rem;
  font-size: var(--text-md);
}

/* ---- Section Backgrounds ---- */
.section--white {
  background-color: var(--color-white);
}

.section--light {
  background-color: var(--color-off-white);
}

.section--cream {
  background-color: var(--color-warm-cream);
}

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

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

.section--slate {
  background-color: var(--color-slate-light);
}

.section--teal-wash {
  background-color: var(--color-teal-wash);
}

.section--dark {
  background-color: var(--color-primary-dark);
  color: var(--color-white);
}

.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--color-white);
}

.section--dark a {
  color: var(--color-accent);
}

/* Soft dark — gentler alternative to full dark teal */
.section--soft-dark {
  background-color: var(--color-sage);
  color: var(--color-white);
}

.section--soft-dark h2,
.section--soft-dark h3,
.section--soft-dark h4 {
  color: var(--color-white);
}

.section--soft-dark a {
  color: var(--color-accent);
}

.section--hero {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--color-white);
}

.section--hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--overlay-dark);
  z-index: 1;
}

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

.section--hero h1,
.section--hero h2,
.section--hero h3 {
  color: var(--color-white);
}

/* ---- Cards ---- */
.card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

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

.card--dark {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--color-white);
}

.card--dark h3,
.card--dark h4 {
  color: var(--color-white);
}

/* ---- Grid Utilities ---- */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ---- Flex Utilities ---- */
.flex {
  display: flex;
}

.flex--center {
  align-items: center;
  justify-content: center;
}

.flex--between {
  align-items: center;
  justify-content: space-between;
}

.flex--gap-sm {
  gap: var(--space-sm);
}

.flex--gap-md {
  gap: var(--space-md);
}

.flex--gap-lg {
  gap: var(--space-lg);
}

/* ---- Text Alignment ---- */
.text-center {
  text-align: center;
}

/* ---- Accreditation Bar ---- */
.accreditations {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
  padding: var(--space-lg) 0;
}

.accreditations img {
  height: 70px;
  width: auto;
  object-fit: contain;
}

/* ---- Section Intro (centered text above section content) ---- */
.section-intro {
  text-align: center;
  max-width: var(--container-narrow);
  margin: 0 auto var(--space-lg);
}

.section-intro p {
  font-size: var(--text-lg);
  color: var(--color-text-light);
}

.section--dark .section-intro p {
  color: rgba(255, 255, 255, 0.8);
}

/* ---- Eyebrow / Label ---- */
.eyebrow {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  margin-bottom: var(--space-xs);
}

/* Section divider — adds subtle top border to alternating sections */
section + section {
  border-top: 1px solid var(--color-light-gray);
}

section.section--dark + section,
section + section.section--dark,
.image-section + section,
section + .image-section,
.page-hero + section,
.anchor-bar + section,
.trust-bar + section,
section + .trust-bar,
.cta-banner + section,
section + .cta-banner,
.page-cta + footer,
section + footer {
  border-top: none;
}

/* ---- Divider ---- */
.divider {
  width: 60px;
  height: 3px;
  background-color: var(--color-accent);
  border: none;
  margin: var(--space-md) 0;
}

.divider--center {
  margin-left: auto;
  margin-right: auto;
}

/* ============================================
   HEADER — Two-row layout
   ============================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: transparent;
  transition: background var(--transition-base), box-shadow var(--transition-base);
}

.site-header.scrolled {
  background: var(--color-primary-dark);
  box-shadow: var(--shadow-md);
}

.site-header.scrolled .header-top {
  background: transparent;
}

/* Top utility bar — phone numbers only */
.header-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-md);
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: var(--space-xs) var(--space-md);
}

/* Inline divider under phone numbers — width of content, not full screen */
.header-top-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

/* Main bar — logo + nav + CTAs */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: var(--space-xs) var(--space-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.header-logo {
  margin-top: -45px;
  margin-bottom: -10px;
  flex-shrink: 0;
}

.header-logo img {
  height: 63px;
  width: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-left: auto;
  margin-right: var(--space-md);
}

/* Dropdown Nav */
.nav-item {
  position: relative;
}

.nav-item > a {
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--space-xs) 0;
  position: relative;
}

.nav-item > a:hover {
  color: var(--color-accent);
}

.nav-item > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--transition-base);
}

.nav-item > a:hover::after {
  width: 100%;
}

.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: var(--space-xs) 0;
  min-width: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(8px);
  transition: opacity var(--transition-base), transform var(--transition-base), visibility var(--transition-base);
  z-index: 100;
}

.nav-item:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown a {
  display: block;
  padding: 0.5rem 1.25rem;
  color: var(--color-text-body);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
  text-align: center;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.nav-dropdown a:hover {
  background: var(--color-off-white);
  color: var(--color-primary);
}

.nav-dropdown a::after {
  display: none;
}

.header-ctas {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-shrink: 0;
}

.header-phone {
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  letter-spacing: 0.03em;
}

.header-phone:hover {
  color: var(--color-accent);
}

.header-divider {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.25);
}

.header-ctas .btn--sm {
  padding: 0.4rem 1rem;
  font-size: var(--text-xs);
}

/* Mobile Nav Toggle */
/* Mobile Sticky CTA — hidden on desktop */
.mobile-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-white);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.12);
}

.mobile-cta .btn {
  width: 100%;
  border-radius: 25px;
  font-size: var(--text-md);
  padding: 0.875rem;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-white);
  margin: 5px 0;
  transition: all var(--transition-base);
}

/* ============================================
   GOOGLE REVIEWS
   ============================================ */
.google-reviews-header {
  text-align: center;
  margin-bottom: var(--space-lg);
  color: var(--color-text-light);
}

.google-reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.google-review-card {
  background: var(--color-off-white);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  position: relative;
}

.google-review-stars {
  color: #fbbc05;
  font-size: var(--text-lg);
  margin-bottom: var(--space-xs);
  letter-spacing: 2px;
}

.google-review-text {
  font-size: var(--text-sm);
  color: var(--color-text-body);
  line-height: 1.7;
  font-style: italic;
  margin-bottom: var(--space-sm);
}

.google-review-author {
  font-size: var(--text-xs);
  color: var(--color-text-light);
}

.google-review-author strong {
  display: block;
  color: var(--color-text-heading);
  margin-bottom: 2px;
}

/* Google Map container */
#google-map {
  width: 100%;
  height: 400px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 767px) {
  .google-reviews-grid {
    grid-template-columns: 1fr;
  }

  #google-map {
    height: 300px;
  }
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background-color: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.7);
  padding: var(--space-3xl) 0 var(--space-lg);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.footer-brand img {
  height: 94px;
  width: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto var(--space-md);
}

.footer-brand {
  text-align: center;
}

.footer-brand p {
  font-size: var(--text-sm);
  line-height: 1.8;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.footer-heading {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-white);
  margin-bottom: var(--space-md);
}

.footer-links li {
  margin-bottom: var(--space-xs);
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--text-sm);
  transition: color var(--transition-fast);
}

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

.footer-contact p,
.footer-contact a {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: var(--space-xs);
}

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

.footer-social {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-white);
  font-size: var(--text-md);
  transition: all var(--transition-fast);
}

.footer-social a:hover {
  background: var(--color-accent);
  color: var(--color-text-heading);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.footer-legal {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.5);
}

.footer-legal a {
  color: rgba(255, 255, 255, 0.5);
}

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 991px) {
  h1 {
    font-size: var(--text-4xl);
  }

  h2 {
    font-size: var(--text-2xl);
  }

  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 767px) {
  h1 {
    font-size: var(--text-3xl);
  }

  h2 {
    font-size: var(--text-xl);
  }

  section {
    padding: var(--space-xl) 0;
  }

  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }

  .header-logo {
    margin-top: 0;
    margin-bottom: 0;
  }

  .header-logo img {
    height: 40px;
  }

  /* Mobile: hide top bar, show hamburger */
  .header-top {
    display: none;
  }

  .header-ctas {
    display: flex;
    gap: var(--space-xs);
  }

  .header-ctas .btn {
    padding: 0.4rem 0.75rem;
    font-size: var(--text-xs);
  }

  .header-inner {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  }

  .nav-toggle {
    display: block;
  }

  .header-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 360px;
    height: 100vh;
    background: var(--color-primary-dark);
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-3xl) var(--space-lg);
    gap: 0;
    transition: right var(--transition-slow);
    box-shadow: var(--shadow-lg);
  }

  .header-nav.open {
    right: 0;
  }

  .header-nav > .nav-item > a {
    font-size: var(--text-base);
    padding: var(--space-sm) 0;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    display: block;
  }

  .nav-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: transparent;
    padding: 0;
    min-width: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .nav-item.expanded .nav-dropdown {
    max-height: 500px;
  }

  .nav-dropdown a {
    color: rgba(255, 255, 255, 0.7);
    padding: 0.75rem 0;
    font-size: var(--text-sm);
    border-bottom: none;
    text-align: center;
  }

  .nav-dropdown a:hover {
    background: transparent;
    color: var(--color-accent);
  }

  .mobile-cta {
    display: block;
  }

  .footer-social a {
    width: 44px;
    height: 44px;
  }

  .page-cta .btn {
    display: block;
    width: 100%;
    margin: var(--space-xs) auto;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}
