/* ==========================================================================
   MOM's Speech & Hearing Clinic — Shared Stylesheet
   Tailwind is loaded before this file on every page.
   This file covers only: design tokens, base reset/typography, and the
   genuinely-custom interactive behaviors that utility classes cannot provide.
   ========================================================================== */

:root {
  /* Brand colors */
  --color-primary: #1B4B8F;
  --color-secondary: #FFFFFF;
  --color-accent: #C41E3A;
  --color-neutral-dark: #14213D;
  --color-neutral-light: #F5F7FA;

  /* Semantic aliases */
  --color-bg: var(--color-neutral-light);
  --color-text: var(--color-neutral-dark);
  --color-border: #E2E8F0;

  /* Fonts */
  --font-heading: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', Arial, sans-serif;
  --font-weight-regular: 400;
  --font-weight-bold: 700;

  /* Type scale (desktop) */
  --h1-size: 56px;
  --h1-size-mobile: 34px;
  --h1-line: 1.1;
  --h2-size: 40px;
  --h2-size-mobile: 28px;
  --h2-line: 1.15;
  --h3-size: 26px;
  --h3-size-mobile: 20px;
  --h3-line: 1.2;
  --body-size: 17px;
  --body-size-mobile: 16px;
  --body-line: 1.65;
  --small-size: 14px;
  --small-size-mobile: 13px;
  --small-line: 1.6;

  /* Spacing scale */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 64px;
  --space-7: 96px;
  --space-8: 128px;
  --section-padding-desktop: 96px;
  --section-padding-mobile: 48px;
  --container-max: 1200px;

  /* Radii & shadows */
  --card-radius: 16px;
  --card-shadow: 0 4px 16px rgba(20, 33, 61, 0.08);
  --card-padding: 32px;
  --card-border: 1px solid #E2E8F0;
  --header-shadow: 0 2px 12px rgba(20, 33, 61, 0.12);
}

/* ==========================================================================
   Reset & base typography
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: var(--font-weight-regular);
  font-size: var(--body-size-mobile);
  line-height: var(--body-line);
  color: var(--color-text);
  background-color: var(--color-bg);
}

@media (min-width: 640px) {
  body {
    font-size: var(--body-size);
  }
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-regular);
  margin: 0;
  color: var(--color-neutral-dark);
}

h1 {
  font-size: var(--h1-size-mobile);
  line-height: var(--h1-line);
}

h2 {
  font-size: var(--h2-size-mobile);
  line-height: var(--h2-line);
}

h3 {
  font-size: var(--h3-size-mobile);
  line-height: var(--h3-line);
}

@media (min-width: 768px) {
  h1 { font-size: var(--h1-size); }
  h2 { font-size: var(--h2-size); }
  h3 { font-size: var(--h3-size); }
}

small {
  font-size: var(--small-size-mobile);
  line-height: var(--small-line);
}

@media (min-width: 640px) {
  small {
    font-size: var(--small-size);
  }
}

p {
  margin: 0;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--space-2);
  padding-right: var(--space-2);
}

/* ==========================================================================
   Sticky / scroll-aware header
   ========================================================================== */

.site-header {
  background-color: var(--color-secondary);
  transition: box-shadow 200ms ease, padding 200ms ease;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  padding-bottom: 24px;
  transition: padding 200ms ease;
}

.site-header.is-scrolled {
  box-shadow: var(--header-shadow);
}

.site-header.is-scrolled .header-inner {
  padding-top: 12px;
  padding-bottom: 12px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.site-logo img {
  height: 48px;
  width: auto;
  object-fit: contain;
  border-radius: 8px;
}

/* ==========================================================================
   Nav toggle (hamburger -> X) & mobile nav
   ========================================================================== */

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  padding: 0;
  z-index: 60;
}

.nav-toggle-bar {
  display: block;
  width: 26px;
  height: 2px;
  background-color: var(--color-primary);
  border-radius: 2px;
  transition: transform 250ms ease, opacity 250ms ease;
}

.nav-toggle.is-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  font-family: var(--font-body);
  font-weight: var(--font-weight-bold);
  color: var(--color-neutral-dark);
  padding: 8px 4px;
  position: relative;
  transition: color 200ms ease;
}

.nav-link:hover {
  color: var(--color-primary);
}

.nav-link.is-active {
  color: var(--color-primary);
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: -2px;
  height: 2px;
  background-color: var(--color-accent);
  border-radius: 2px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

@media (max-width: 767px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background-color: var(--color-secondary);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 300ms ease, opacity 250ms ease;
    box-shadow: 0 8px 16px rgba(20, 33, 61, 0.1);
  }

  .site-nav.is-open {
    max-height: 480px;
    opacity: 1;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-2);
  }

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

  .nav-link {
    display: block;
    padding: 14px 8px;
  }

  .site-nav .btn {
    margin: var(--space-2);
  }
}

/* ==========================================================================
   FAQ accordion
   ========================================================================== */

.faq-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  background: transparent;
  border: none;
  text-align: left;
  padding: var(--space-3) 0;
  font-family: var(--font-body);
  font-weight: var(--font-weight-bold);
  font-size: 18px;
  color: var(--color-neutral-dark);
}

.faq-icon {
  position: relative;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.faq-icon::before,
.faq-icon::after {
  content: "";
  position: absolute;
  background-color: var(--color-primary);
  transition: transform 250ms ease;
}

.faq-icon::before {
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  transform: translateY(-50%);
}

.faq-icon::after {
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
}

.faq-item.is-open .faq-icon::after {
  transform: translateX(-50%) scaleY(0);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 300ms ease;
}

.faq-item.is-open .faq-answer {
  max-height: 400px;
}

.faq-answer p {
  padding-bottom: var(--space-3);
  color: #4A5568;
}

/* ==========================================================================
   Scroll reveal
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms ease, transform 600ms ease;
}

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

@media (prefers-reduced-motion: reduce) {
  .reveal {
    transition: none;
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   Buttons (behavioral base only — sizing/color mostly via utility classes)
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 9999px;
  font-family: var(--font-body);
  font-weight: var(--font-weight-bold);
  text-decoration: none;
}

/* ==========================================================================
   Contact form base
   ========================================================================== */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.contact-form input,
.contact-form textarea {
  font-family: var(--font-body);
  font-size: var(--body-size-mobile);
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background-color: #FFFFFF;
  color: var(--color-neutral-dark);
  width: 100%;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}