/* ═══════════════════════════════════════
   SocialPrescribing.co — Shared Styles
   Used across all pages (homepage + inner)
   ═══════════════════════════════════════ */

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

:root {
  --amber-deep: #8B6914;
  --amber: #C4961A;
  --gold-light: #E8D5A3;
  --sage: #5C7A52;
  --sage-light: #8BA67A;
  --warm-cream: #F5EFE0;
  --warm-white: #FDFBF6;
  --ink: #2C2416;
  --ink-light: #5A4D3A;
  --ink-dark: #1A170F;

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 3px rgba(44,36,22,0.04), 0 4px 12px rgba(44,36,22,0.06);
  --shadow-md: 0 2px 8px rgba(44,36,22,0.06), 0 12px 32px rgba(44,36,22,0.08);
  --shadow-lg: 0 4px 12px rgba(44,36,22,0.08), 0 20px 48px rgba(44,36,22,0.12);

  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

body {
  background: var(--warm-white);
  color: var(--ink);
  font-family: 'Source Sans 3', sans-serif;
  overflow-x: hidden;
}

/* Grain texture overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.2;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.4'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  z-index: 9999;
  pointer-events: none;
}

/* ─── NAV ─── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.5rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(253, 251, 246, 0.85);
}

nav .nav-left {
  font-family: 'Lora', serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink);
  text-transform: uppercase;
  text-decoration: none;
}

nav .nav-left span { font-weight: 400; opacity: 0.5; }

nav .nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

nav .nav-links a {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-light);
  text-decoration: none;
  transition: color 0.3s;
}

nav .nav-links a:hover { color: var(--sage); }
nav .nav-links a.active { color: var(--ink); font-weight: 600; }

/* ─── MOBILE NAV (hamburger) ─── */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 101;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  transition: all 0.3s var(--ease);
}

.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(253, 251, 246, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 99;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.nav-overlay.open { display: flex; }

.nav-overlay a {
  font-family: 'Lora', serif;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.3s;
}

.nav-overlay a:hover { color: var(--sage); }
.nav-overlay a.active { color: var(--amber); }

/* ─── PAGE HEADER (inner pages) ─── */
.page-header {
  padding: clamp(8rem, 14vh, 10rem) 4rem clamp(3rem, 6vh, 5rem);
  max-width: 1200px;
  margin: 0 auto;
}

.page-header .page-overline {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 1rem;
}

.page-header h1 {
  font-family: 'Lora', serif;
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 1rem;
  max-width: 700px;
}

.page-header .page-desc {
  font-size: 1.1rem;
  color: var(--ink-light);
  line-height: 1.7;
  max-width: 600px;
}

/* ─── SECTION SHARED ─── */
.section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 4rem;
}

.section-overline {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 1rem;
}

.section-heading {
  font-family: 'Lora', serif;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 1.25rem;
  max-width: 500px;
}

.section-desc {
  font-size: 1rem;
  color: var(--ink-light);
  line-height: 1.7;
  max-width: 520px;
  margin-bottom: 1.5rem;
}

.section-cta {
  font-family: 'Barlow', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  background: white;
  border: 1px solid rgba(44,36,22,0.12);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.4rem;
  transition: all 0.3s var(--ease);
  display: inline-block;
}

.section-cta:hover {
  background: var(--ink);
  color: var(--warm-white);
  border-color: var(--ink);
}

/* ─── SECTION CARD ─── */
.section-card {
  background: rgba(253, 251, 246, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(44, 36, 22, 0.08);
  border-radius: var(--radius-lg);
  padding: 3rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease), background 0.4s var(--ease);
  position: relative;
}

.section-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  background: rgba(253, 251, 246, 0.85);
}

/* ─── GRADIENT DIVIDERS ─── */
.section-divider {
  height: 1px;
  max-width: 1200px;
  margin: 0 auto;
  background: linear-gradient(90deg, transparent, rgba(44, 36, 22, 0.08), transparent);
}

/* ─── FILTER PILLS (research + prescribe pages) ─── */
.filter-bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 4rem 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.filter-pill {
  font-family: 'Barlow', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.5rem 1.2rem;
  border-radius: 100px;
  border: 1px solid rgba(44,36,22,0.12);
  background: transparent;
  color: var(--ink-light);
  cursor: pointer;
  transition: all 0.3s var(--ease);
}

.filter-pill:hover {
  border-color: var(--amber);
  color: var(--ink);
}

.filter-pill.active {
  background: var(--ink);
  color: var(--warm-white);
  border-color: var(--ink);
}

/* Pillar-specific active colors */
.filter-pill.active[data-pillar="movement"] { background: #9E7C1A; border-color: #9E7C1A; }
.filter-pill.active[data-pillar="nature"] { background: #3A5A30; border-color: #3A5A30; }
.filter-pill.active[data-pillar="art"] { background: #78508C; border-color: #78508C; }
.filter-pill.active[data-pillar="service"] { background: #B56450; border-color: #B56450; }
.filter-pill.active[data-pillar="belonging"] { background: #3C7878; border-color: #3C7878; }

/* ─── SEARCH BAR ─── */
.search-bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 4rem 2rem;
}

.search-input {
  width: 100%;
  max-width: 500px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid rgba(44,36,22,0.12);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--ink);
  outline: none;
  transition: border-color 0.3s var(--ease);
}

.search-input::placeholder { color: var(--ink-light); opacity: 0.5; }
.search-input:focus { border-color: var(--amber); }

/* ─── STUDY CARD (research page) ─── */
.study-card {
  padding: 2rem 0;
  border-bottom: 1px solid rgba(44,36,22,0.06);
}

.study-card:last-child { border-bottom: none; }

.study-title {
  font-family: 'Lora', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.study-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s;
}

.study-title a:hover { color: var(--sage); }

.study-meta {
  font-size: 0.8rem;
  color: var(--ink-light);
  opacity: 0.6;
  margin-bottom: 0.75rem;
}

.study-summary {
  font-size: 0.95rem;
  color: var(--ink-light);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.study-stats {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.6;
  background: rgba(196, 150, 26, 0.06);
  border-left: 3px solid var(--amber);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  margin-top: 0.25rem;
}

.study-tag {
  display: inline-block;
  font-family: 'Barlow', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 100px;
  margin-top: 0.5rem;
}

.study-tag[data-pillar="movement"] { background: rgba(196,150,26,0.1); color: #9E7C1A; }
.study-tag[data-pillar="nature"] { background: rgba(58,90,48,0.1); color: #3A5A30; }
.study-tag[data-pillar="art"] { background: rgba(120,80,140,0.1); color: #78508C; }
.study-tag[data-pillar="service"] { background: rgba(181,100,80,0.1); color: #B56450; }
.study-tag[data-pillar="belonging"] { background: rgba(60,120,120,0.1); color: #3C7878; }
.study-tag[data-pillar="general_sp"] { background: rgba(52,99,192,0.12); color: #2E5BAA; }

/* ─── PROGRAM CARD (prescribe page) ─── */
.program-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.program-card {
  background: white;
  border: 1px solid rgba(44,36,22,0.08);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  transition: all 0.3s var(--ease);
}

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

.program-name {
  font-family: 'Lora', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.program-desc {
  font-size: 0.9rem;
  color: var(--ink-light);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.program-link {
  font-family: 'Barlow', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sage);
  text-decoration: none;
  transition: color 0.3s;
  cursor: pointer;
}

.program-link:hover { color: var(--ink); }

/* ─── FOOTER ─── */
footer {
  background: linear-gradient(5deg, var(--warm-white) 0%, rgba(245, 239, 224, 0.4) 50%, var(--warm-white) 100%);
  padding: 4rem 4rem 2rem;
  margin-top: clamp(4rem, 8vh, 6rem);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
}

.footer-brand {
  font-family: 'Lora', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.footer-brand span { font-weight: 400; opacity: 0.4; }

.footer-tagline {
  font-size: 0.85rem;
  color: var(--ink-light);
  opacity: 0.6;
}

.footer-heading {
  font-family: 'Barlow', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 1rem;
}

.footer-col a {
  display: block;
  font-size: 0.85rem;
  color: var(--ink-light);
  text-decoration: none;
  margin-bottom: 0.6rem;
  transition: color 0.3s;
}

.footer-col a:hover { color: var(--ink); }

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 1.5rem;
}

.footer-bottom p {
  font-size: 0.75rem;
  color: var(--ink-light);
  opacity: 0.3;
}

/* ─── SECTION REVEALS ─── */
.reveal-section .reveal-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal-section.revealed .reveal-up {
  opacity: 1;
  transform: translateY(0);
}

.reveal-section.revealed .reveal-up:nth-child(2) { transition-delay: 0.1s; }
.reveal-section.revealed .reveal-up:nth-child(3) { transition-delay: 0.2s; }
.reveal-section.revealed .reveal-up:nth-child(4) { transition-delay: 0.3s; }
.reveal-section.revealed .reveal-up:nth-child(5) { transition-delay: 0.4s; }

/* ─── ANIMATIONS ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  nav { padding: 1rem 1.5rem; }
  nav .nav-links { display: none; }
  .nav-hamburger { display: flex; flex-direction: column; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; gap: 5px; }
  .nav-hamburger span { margin: 0; }
  nav .nav-left { min-height: 44px; display: flex; align-items: center; }

  .page-header { padding: 7rem 1.5rem 2rem; }
  .page-header h1 { font-size: 2rem; }
  .page-header .page-overline { font-size: 0.75rem; }

  .section-inner { padding: 0 1.5rem; }
  .section-card { padding: 2rem 1.5rem; border-radius: var(--radius-md); }
  .section-overline { font-size: 0.75rem; }

  .filter-bar { padding: 0 1.5rem 1.5rem; }
  .filter-pill { padding: 0.75rem 1.2rem; font-size: 0.85rem; }
  .search-bar { padding: 0 1.5rem 1.5rem; }
  .search-input { max-width: 100%; }

  .study-tag { font-size: 0.8rem; padding: 0.3rem 0.75rem; }

  .program-grid { padding: 0 1.5rem; grid-template-columns: 1fr; }
  .program-link { font-size: 0.85rem; min-height: 44px; display: inline-flex; align-items: center; }

  footer { padding: 3rem 1.5rem 1.5rem; }
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  /* Footer social-icon anchors: 24px icon inside a 44x44 tap target */
  .footer-col a:has(img) { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; margin-right: 0; }
  .footer-heading { font-size: 0.8rem; }
  .footer-tagline { font-size: 0.9rem; }
  .footer-col a { min-height: 44px; display: flex; align-items: center; }
}
