/* ============================================================
   SOSL New Hampshire — shared stylesheet
   Calm, warm, accessible. One file for the whole site.
   ============================================================ */

/* Fonts are loaded via <link> in each page's <head> (faster than @import). */

:root {
  /* color */
  --bg:          #faf7f2;   /* warm paper */
  --surface:     #ffffff;
  --surface-alt: #f3eee6;   /* soft sand */
  --ink:         #2c3a43;   /* deep slate */
  --ink-soft:    #5a6b74;   /* muted slate */
  --primary:     #356383;   /* calm dawn blue */
  --primary-dk:  #284c64;
  --primary-soft:#e6eef3;
  --accent:      #c98a52;   /* warm amber, used sparingly */
  --accent-soft: #f6ebde;
  --line:        #e7ddcf;   /* gentle border */
  --shadow:      0 1px 2px rgba(44, 58, 67, 0.04),
                 0 8px 24px rgba(44, 58, 67, 0.06);

  /* type */
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --body:    'Mulish', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* layout */
  --maxw: 1080px;
  --maxw-narrow: 720px;
  --radius: 14px;
  --radius-sm: 10px;
  --ribbon-h: 38px;        /* crisis ribbon height */
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dk); text-decoration: underline; }

/* ---------- typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.18;
  color: var(--ink);
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
h3 { font-size: 1.3rem; font-weight: 600; }
h4 { font-size: 1.08rem; font-weight: 600; font-family: var(--body); color: var(--primary-dk); }
p  { margin: 0 0 1.1em; }
.lead { font-size: 1.2rem; color: var(--ink-soft); }
.eyebrow {
  font-family: var(--body);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.8em;
}

/* ---------- layout helpers ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }
.narrow { max-width: var(--maxw-narrow); }
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section-alt { background: var(--surface-alt); }
.center { text-align: center; }
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--primary); color: #fff; padding: 0.7rem 1.2rem;
  border-radius: 0 0 var(--radius-sm) 0; z-index: 200;
}
.skip-link:focus { left: 0; }

/* ---------- header ---------- */
.site-header {
  position: fixed; left: 0; right: 0; top: var(--ribbon-h); z-index: 100;
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 76px;
}
.brand { display: inline-flex; align-items: flex-end; gap: 0.85rem; }
.brand:hover { text-decoration: none; }
.brand-icon { height: 46px; width: auto; }
.brand-lockup { display: flex; flex-direction: column; line-height: 1.12; transform: translateY(2px); }
.brand-name {
  font-family: Georgia, 'Times New Roman', serif; font-style: italic;
  font-size: 1.12rem; color: var(--primary);
}
.brand-state {
  font-family: Georgia, 'Times New Roman', serif; text-transform: uppercase;
  letter-spacing: 0.14em; font-size: 0.66rem; font-weight: 500; color: var(--primary);
}

.nav { display: flex; align-items: center; gap: 0.35rem; }
.nav a {
  color: var(--ink); font-weight: 600; font-size: 0.98rem;
  padding: 0.5rem 0.85rem; border-radius: 999px; transition: background .18s, color .18s;
}
.nav a:hover { background: var(--primary-soft); color: var(--primary-dk); text-decoration: none; }
.nav a.active { color: var(--primary-dk); background: var(--primary-soft); }

.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  padding: 0.5rem; border-radius: 8px; color: var(--ink);
}
.nav-toggle svg { display: block; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--body); font-weight: 700; font-size: 1rem;
  padding: 0.8rem 1.5rem; border-radius: 999px;
  border: 1.5px solid transparent; cursor: pointer; transition: all .18s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dk); color: #fff; text-decoration: none; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--primary-dk); border-color: var(--primary); }
.btn-ghost:hover { background: var(--primary-soft); text-decoration: none; }

/* ---------- hero ---------- */
.hero { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 5vw, 3.5rem); }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center;
}
.hero h1 { margin-bottom: 0.3em; }
.hero .lead { margin-bottom: 1.6em; }
.hero-media img {
  border-radius: var(--radius); box-shadow: var(--shadow);
  width: 100%; object-fit: cover; aspect-ratio: 4 / 3;
}
.hero-strong { font-weight: 700; color: var(--ink); display: block; margin-bottom: 0.6em; font-size: 1.15rem; }

/* ---------- feature cards ---------- */
.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem;
}
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.7rem 1.6rem; box-shadow: var(--shadow);
}
.card h3 { margin-top: 0.2rem; color: var(--primary-dk); }
.card p:last-child { margin-bottom: 0; }
.card-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--primary-soft); color: var(--primary-dk);
  display: grid; place-items: center; margin-bottom: 1rem;
}
.card-icon svg { width: 24px; height: 24px; }

/* ---------- generic content ---------- */
.prose h2 { margin-top: 2.2rem; }
.prose h3 { margin-top: 1.8rem; color: var(--primary-dk); }
.prose ul { padding-left: 1.2rem; margin: 0 0 1.2rem; }
.prose li { margin-bottom: 0.4rem; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

.feature-image {
  border-radius: var(--radius); box-shadow: var(--shadow);
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover; margin: 0 0 2rem;
}

/* value/two-column list blocks (About) */
.stack-blocks { display: grid; gap: 0; }
.stack-block {
  padding: 1.8rem 0; border-top: 1px solid var(--line);
}
.stack-block:first-child { border-top: 0; }
.stack-block h3 { margin-bottom: 0.35rem; }
.stack-block p:last-child { margin-bottom: 0; }

/* ---------- support group cards ---------- */
.group-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.group-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.7rem; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.group-card h3 { color: var(--primary-dk); margin-bottom: 0.2rem; }
.group-card .place { color: var(--accent); font-weight: 700; font-size: 0.9rem; margin-bottom: 0.9rem; }
.group-card p { font-size: 1rem; }
.group-card .btn { margin-top: auto; align-self: flex-start; }

/* expectations panel */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow);
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

/* ---------- resources ---------- */
.res-group {
  margin-bottom: 2.5rem;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem;
}
.res-group > h3 {
  grid-column: 1 / -1; justify-self: start;
  color: var(--primary-dk);
  border-bottom: 3px solid var(--accent-soft); padding-bottom: 0.2rem; margin-bottom: 0.3rem;
}
.res-item {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm); padding: 1.3rem 1.4rem; box-shadow: var(--shadow);
}
.res-item.crisis { border-left-color: var(--accent); background: var(--accent-soft); }
.res-item h4 { font-family: var(--display); font-size: 1.18rem; font-weight: 600; color: var(--ink); margin-bottom: 0.4rem; }
.res-item p { margin-bottom: 0.5rem; font-size: 1rem; }
.res-meta { font-size: 0.95rem; }
.res-meta strong { color: var(--primary-dk); }
.phone-badge {
  display: inline-block; font-family: var(--display); font-weight: 600;
  font-size: 1.4rem; color: var(--accent); letter-spacing: 0.02em;
}

/* book lists */
.book-cat { margin-bottom: 0; }
.book-cat h4 { color: var(--primary-dk); margin-bottom: 0.5rem; }
.book-list { list-style: none; padding: 0; margin: 0; }
.book-list li { padding: 0.35rem 0; border-bottom: 1px dashed var(--line); font-size: 0.98rem; }
.book-list li:last-child { border-bottom: 0; }
.book-list .title { font-style: italic; color: var(--ink); }

/* ---------- contact form ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.2rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 700; font-size: 0.95rem; color: var(--ink); }
.field input, .field textarea, .field select {
  font-family: var(--body); font-size: 1rem; color: var(--ink);
  padding: 0.75rem 0.9rem; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.field textarea { resize: vertical; min-height: 140px; }
.form-note { font-size: 0.9rem; color: var(--ink-soft); margin-top: 0.5rem; }

/* ---------- closing CTA ---------- */
.cta {
  background: var(--primary); color: #fff; text-align: center;
  padding: clamp(3rem, 6vw, 4.5rem) 0;
}
.cta h2, .cta p { color: #fff; }
.cta h2 { margin-bottom: 0.4em; }
.cta p { color: rgba(255,255,255,0.9); max-width: 620px; margin-left: auto; margin-right: auto; margin-bottom: 1.6em; }
.cta .btn-primary { background: #fff; color: var(--primary-dk); }
.cta .btn-primary:hover { background: var(--accent-soft); color: var(--primary-dk); }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: #cdd6db; padding: 2.5rem 0 2rem; }
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 1.5rem;
  align-items: center; justify-content: space-between;
}
.footer-brand { display: inline-flex; align-items: flex-end; gap: 0.78rem; }
.footer-brand .brand-icon { height: 40px; filter: brightness(0) invert(1); opacity: 0.92; }
.footer-brand .brand-name { color: #fff; font-size: 1.05rem; }
.footer-brand .brand-state { color: rgba(255,255,255,0.6); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; }
.footer-nav a { color: #cdd6db; font-weight: 600; font-size: 0.95rem; }
.footer-nav a:hover { color: #fff; }
.footer-bottom {
  margin-top: 1.8rem; padding-top: 1.4rem; border-top: 1px solid rgba(255,255,255,0.12);
  display: flex; flex-wrap: wrap; gap: 0.8rem 1.5rem; align-items: center; justify-content: space-between;
  font-size: 0.88rem; color: #9aa7ad;
}
.footer-bottom a { color: #cdd6db; }
.social-link { display: inline-flex; align-items: center; gap: 0.45rem; }
.social-link svg { width: 18px; height: 18px; }

/* ---------- page intro band ---------- */
.page-intro { padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(1.5rem, 4vw, 2.5rem); }
.page-intro .eyebrow { color: var(--accent); }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(14px); animation: rise .7s ease forwards; }
  .reveal-1 { animation-delay: .05s; }
  .reveal-2 { animation-delay: .15s; }
  .reveal-3 { animation-delay: .25s; }
  @keyframes rise { to { opacity: 1; transform: none; } }
}

/* ============================================================
   MODERNIZATION LAYER (2026)
   Full-bleed media heroes/bands, transparent→solid header,
   refined cards. Calm, immersive, professional.
   ============================================================ */

/* ---------- transparent header that solidifies on scroll ---------- */
/* Opt-in per page via .transparent-header on .site-header (pages with a
   full-bleed hero behind it). Pages without it keep the solid sticky bar. */
.site-header.transparent-header {
  position: fixed; left: 0; right: 0; top: var(--ribbon-h);
  background: transparent;
  backdrop-filter: none;
  border-bottom-color: transparent;
  transition: background .3s ease, border-color .3s ease, backdrop-filter .3s ease;
}
.transparent-header .brand-icon { filter: brightness(0) invert(1); transition: filter .3s ease; }
.transparent-header .brand-name,
.transparent-header .brand-state { color: #fff; transition: color .3s ease; }
.transparent-header .nav-toggle { color: #fff; }
@media (min-width: 861px) {
  .transparent-header .nav a { color: #fff; }
  .transparent-header .nav a:hover,
  .transparent-header .nav a.active { background: rgba(255,255,255,0.16); color: #fff; }
}
/* once scrolled (and on mobile when the menu is open) it becomes the solid bar */
.site-header.transparent-header.scrolled {
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.transparent-header.scrolled .brand-icon { filter: none; }
.transparent-header.scrolled .brand-name { color: var(--primary); }
.transparent-header.scrolled .brand-state { color: var(--primary); }
.transparent-header.scrolled .nav-toggle { color: var(--ink); }
@media (min-width: 861px) {
  .transparent-header.scrolled .nav a { color: var(--ink); }
  .transparent-header.scrolled .nav a:hover,
  .transparent-header.scrolled .nav a.active { background: var(--primary-soft); color: var(--primary-dk); }
}

/* ---------- reusable full-bleed media section ---------- */
.media-section { position: relative; isolation: isolate; color: #fff; overflow: hidden; }
.media-section .media-bg {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover; object-position: center;
  filter: saturate(0.96) contrast(1.02);
}
.media-section::after { content: ""; position: absolute; inset: 0; z-index: -1; }
/* legible-but-airy scrim for heroes */
.media-section.scrim-hero::after {
  background:
    linear-gradient(180deg, rgba(30,42,50,0.22) 0%, rgba(30,42,50,0.55) 68%, rgba(30,42,50,0.80) 100%),
    linear-gradient(100deg, rgba(30,42,50,0.55) 0%, rgba(30,42,50,0.05) 58%);
}
/* softer scrim for mid-page "breath" bands */
.media-section.scrim-soft::after {
  background: linear-gradient(180deg, rgba(30,42,50,0.42) 0%, rgba(30,42,50,0.62) 100%);
}
/* deep, brand-tinted scrim for the closing CTA */
.media-section.scrim-deep::after {
  background: linear-gradient(180deg, rgba(40,76,100,0.80) 0%, rgba(30,42,50,0.88) 100%);
}
.media-section .eyebrow { color: #ecc49a; }
.media-section h1, .media-section h2, .media-section h3 { color: #fff; }
.media-section .lead { color: rgba(255,255,255,0.92); }

/* ---------- full-bleed hero ---------- */
.hero-full { min-height: min(88vh, 780px); display: flex; align-items: center; }
.hero-full .wrap { width: 100%; }
.hero-full .hero-content {
  max-width: 640px;
  padding-top: clamp(8.5rem, 16vh, 10.5rem);   /* clears ribbon + fixed header */
  padding-bottom: clamp(3rem, 8vh, 5rem);
}
.hero-full h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin-bottom: 0.25em; }
.hero-full .hero-strong { color: #fff; font-size: clamp(1.15rem, 2.4vw, 1.5rem); }
.hero-full .lead { font-size: clamp(1.1rem, 2.2vw, 1.3rem); margin-bottom: 1.7em; max-width: 33em; }
.hero-full .btn-row { display: flex; flex-wrap: wrap; gap: 0.8rem; }
@media (prefers-reduced-motion: no-preference) {
  .hero-full .media-bg { animation: kenburns 24s ease-in-out infinite alternate; }
  @keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.07); } }
}

/* compact hero for interior pages */
.hero-full.hero-compact { min-height: min(62vh, 560px); }
.hero-full.hero-compact .hero-content { padding-top: clamp(8rem, 15vh, 9.5rem); padding-bottom: clamp(2.5rem, 6vh, 4rem); }
.hero-full.hero-compact h1 { font-size: clamp(2.2rem, 5.2vw, 3.3rem); }

/* white CTA for use over photography */
.btn-light { background: #fff; color: var(--primary-dk); }
.btn-light:hover { background: var(--accent-soft); color: var(--primary-dk); text-decoration: none; transform: translateY(-1px); }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,0.65); }
.btn-outline-light:hover { background: rgba(255,255,255,0.14); color: #fff; text-decoration: none; }

/* ---------- mid-page "breath" band ---------- */
.band { padding: clamp(4rem, 12vh, 7rem) 0; text-align: center; }
.band .wrap { max-width: var(--maxw-narrow); }
.band h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.25; }
.band .band-quote {
  font-family: var(--display); font-weight: 400; font-style: italic;
  font-size: clamp(1.4rem, 3.4vw, 2.1rem); line-height: 1.4; color: #fff; margin: 0;
}
.band .band-attrib { display: block; margin-top: 1.2rem; font-family: var(--body); font-style: normal;
  font-weight: 600; font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; color: #ecc49a; }

/* ---------- closing CTA over photography ---------- */
.cta-media { padding: clamp(4rem, 10vh, 6.5rem) 0; text-align: center; }
.cta-media .wrap { max-width: 680px; }
.cta-media h2 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); margin-bottom: 0.4em; }
.cta-media p { color: rgba(255,255,255,0.92); margin: 0 auto 1.7em; max-width: 36em; }

/* ---------- section heading helper (centered intro) ---------- */
.section-head { max-width: var(--maxw-narrow); margin: 0 auto 2.8rem; text-align: center; }
.section-head .lead { margin-bottom: 0; }

/* ---------- refined feature cards (lighter, calmer) ---------- */
.cards.cards-soft { gap: 1.5rem; }
.cards-soft .card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 2rem 1.8rem;
  box-shadow: 0 1px 2px rgba(44,58,67,0.03), 0 14px 34px rgba(44,58,67,0.07);
  transition: transform .25s ease, box-shadow .25s ease;
}
.cards-soft .card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(44,58,67,0.05), 0 22px 48px rgba(44,58,67,0.10); }
.cards-soft .card-icon {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary-dk);
  box-shadow: inset 0 0 0 6px rgba(53,99,131,0.06);
}
.cards-soft .card-icon svg { width: 26px; height: 26px; }
.cards-soft .card h3 { font-family: var(--display); font-weight: 500; font-size: 1.35rem; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .two-col, .form-grid { grid-template-columns: 1fr; }

  .hero-full { min-height: 86vh; }
  .hero-full .hero-content { padding-top: clamp(6rem, 18vh, 8rem); }

  .nav {
    position: fixed; inset: calc(var(--ribbon-h) + 76px) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 0.5rem 1rem 1.2rem;
    box-shadow: var(--shadow);
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: all .2s;
  }
  .nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav a { padding: 0.85rem 0.6rem; border-radius: 10px; }
  .nav-toggle { display: inline-flex; }
  /* mobile menu links stay dark even under a transparent header */
  .transparent-header .nav a { color: var(--ink); }
  .transparent-header .nav a:hover, .transparent-header .nav a.active { background: var(--primary-soft); color: var(--primary-dk); }
}

/* ---------- crisis ribbon (sitewide, fixed top) ---------- */
.crisis-ribbon {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300;
  height: var(--ribbon-h);
  display: flex; align-items: center; justify-content: center;
  gap: 0.4rem; padding: 0 1rem;
  background: var(--primary-dk); color: #fff;
  font-family: var(--body); font-size: 0.85rem; line-height: 1.2; text-align: center;
}
.crisis-ribbon a { color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.crisis-ribbon a:hover { color: var(--accent-soft); }
@media (max-width: 480px) {
  .crisis-ribbon .ribbon-extra { display: none; }
  .crisis-ribbon { font-size: 0.8rem; }
  /* keep the brand lockup from crowding the menu button on small phones */
  .brand { gap: 0.65rem; }
  .brand-icon { height: 40px; }
  .brand-name { font-size: 0.98rem; }
  .brand-state { font-size: 0.6rem; letter-spacing: 0.12em; }
}

/* ---------- focus-visible rings (keyboard users) ---------- */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 3px;
}
.media-section a:focus-visible,
.crisis-ribbon a:focus-visible,
.cta-media a:focus-visible { outline-color: #fff; }
.btn:focus-visible { outline-offset: 3px; }

/* ---------- top padding for pages with no hero (404, privacy) ---------- */
.page-pad { padding-top: calc(var(--ribbon-h) + 76px + clamp(1.5rem, 4vw, 3rem)); }

/* skip link must sit above the ribbon */
.skip-link { z-index: 400; }
