/* ============================================================
   HEALTHY HAPPY COMMUNITY — Base Styles
   Reset · Typography · Layout · Utilities
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: inherit; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--color-primary);
}

h1 { font-size: clamp(2rem, 5vw, var(--text-5xl)); }
h2 { font-size: clamp(1.6rem, 4vw, var(--text-4xl)); }
h3 { font-size: clamp(1.3rem, 3vw, var(--text-3xl)); }
h4 { font-size: clamp(1.1rem, 2vw, var(--text-xl)); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p { line-height: var(--leading-relaxed); margin-bottom: var(--sp-4); }
p:last-child { margin-bottom: 0; }

strong, b { font-weight: var(--weight-bold); }
em, i     { font-style: italic; }
small     { font-size: var(--text-sm); }

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

.font-serif  { font-family: var(--font-serif); }
.font-sans   { font-family: var(--font-sans); }

.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

/* ── Section Header ────────────────────────────────────────── */
.section-eyebrow {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--sp-3);
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: var(--weight-bold);
  color: var(--forest);
  line-height: var(--leading-tight);
  margin-bottom: var(--sp-4);
}

.section-title span { color: var(--gold); }

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
  max-width: 600px;
  margin: 0 auto var(--sp-12);
}

/* ── Layout / Container ────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

@media (max-width: 768px) {
  .container { padding: 0 var(--sp-4); }
}

section { padding: var(--sp-20) 0; }

.section-light  { background: var(--cream); }
.section-dark   { background: var(--forest); color: var(--white); }
.section-dark h1, .section-dark h2, .section-dark h3 { color: var(--white); }
.section-white  { background: var(--white); }
.section-cream  { background: var(--cream-dark); }

/* ── Grid ──────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-8); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-8); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-6); }

@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ── Flex Utilities ────────────────────────────────────────── */
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col     { display: flex; flex-direction: column; }
.flex-wrap    { flex-wrap: wrap; }
.gap-2        { gap: var(--sp-2); }
.gap-4        { gap: var(--sp-4); }
.gap-6        { gap: var(--sp-6); }
.gap-8        { gap: var(--sp-8); }

/* ── Spacing Utilities ─────────────────────────────────────── */
.mt-auto { margin-top: auto; }
.mb-0    { margin-bottom: 0; }
.pt-0    { padding-top: 0; }

/* ── Display Utilities ─────────────────────────────────────── */
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
}
@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}

/* ── Flash Messages ────────────────────────────────────────── */
.flash-messages { padding: var(--sp-4) 0 0; }

.flash {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  border: 1px solid transparent;
}

.flash-success { background: #D4EDDA; color: #155724; border-color: #C3E6CB; }
.flash-error   { background: #F8D7DA; color: #721C24; border-color: #F5C6CB; }
.flash-warning { background: #FFF3CD; color: #856404; border-color: #FFEEBA; }
.flash-info    { background: #D1ECF1; color: #0C5460; border-color: #BEE5EB; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--cream-dark); }
::-webkit-scrollbar-thumb { background: var(--forest-light); border-radius: var(--radius-full); }

/* ── Selection ─────────────────────────────────────────────── */
::selection { background: var(--gold-pale); color: var(--forest-deep); }

/* ── Focus ─────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
