/* ============================================================
   Sierra Hospice — Global Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Lora:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
  --green:      #2a6049;
  --green-dark: #1a3d2e;
  --green-mid:  #3d8a66;
  --green-pale: #f2f9f5;
  --gold:       #c47d2e;
  --text:       #1a2820;
  --text-soft:  #4a6158;
  --white:      #ffffff;
  --border:     rgba(42, 96, 73, 0.14);
  --shadow:     0 1px 4px rgba(26,61,46,.06), 0 6px 24px rgba(26,61,46,.09);
  --radius:     10px;
  --max-w:      1440px;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: var(--a11y-font-size, 16px); }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--white);
}

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

a { color: var(--green-mid); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
a:hover { color: var(--green); }

h1, h2, h3, h4 {
  font-family: 'Lora', Georgia, serif;
  line-height: 1.25;
  margin-top: 0;
  color: var(--text);
}
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.35rem, 2.8vw, 2rem); }
h3 { font-size: clamp(1.05rem, 1.8vw, 1.3rem); }
p  { margin-top: 0; }

/* ── Layout ── */
.container {
  width: min(100% - 2.5rem, var(--max-w));
  margin-inline: auto;
}

/* ── Top bar ── */
.topbar {
  background: var(--green-dark);
  color: rgba(255,255,255,.8);
  font-size: .84rem;
  text-align: center;
  padding: .42rem 1rem;
}
.topbar a { color: rgba(255,255,255,.9); font-weight: 600; text-decoration: none; }
.topbar a:hover { color: #fff; }

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .35rem;
  padding: .85rem 0;
}

.logo { display: inline-flex; flex-shrink: 0; }
.logo img { width: min(190px, 48vw); }

/* ── Nav ── */
.site-nav {
  display: flex;
  align-items: center;
  gap: 0;
}
.site-nav a {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  padding: .3rem .55rem;
  border-radius: 6px;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.site-nav a:hover,
.site-nav a.active {
  background: var(--green-pale);
  color: var(--green);
}
.site-nav .btn-donate {
  margin-left: .5rem;
  background: var(--green);
  color: #fff !important;
  border-radius: 999px;
  padding: .32rem 1rem;
  font-size: .9rem;
}
.site-nav .btn-donate:hover { background: var(--green-dark); }

/* ── Hamburger ── */
.menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: .45rem .5rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  padding: .65rem 1.4rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-primary   { background: var(--green);  color: #fff; border-color: var(--green); }
.btn-primary:hover   { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.btn-outline   { background: transparent; color: var(--green); border-color: var(--green); }
.btn-outline:hover   { background: var(--green); color: #fff; }
.btn-white     { background: #fff; color: var(--green); border-color: #fff; }
.btn-white:hover     { background: var(--green-pale); border-color: var(--green-pale); }
.btn-ghost     { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.btn-ghost:hover     { background: rgba(255,255,255,.12); border-color: #fff; }

/* ── Hero (home) ── */
.hero {
  background: var(--green-dark);
  color: #fff;
  padding: clamp(4rem, 9vw, 7rem) 0 clamp(3.5rem, 7vw, 6rem);
}
.hero h1      { color: #fff; font-size: clamp(2.1rem, 5.2vw, 3.5rem); margin-bottom: .7rem; }
.hero .lead   { color: rgba(255,255,255,.8); max-width: 56ch; font-size: 1.1rem; margin-bottom: 0; }
.hero .btns   { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.eyebrow {
  display: inline-block;
  font-size: .77rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
  margin-bottom: .65rem;
}

/* ── Page banner (inner pages) ── */
.page-banner {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 100%);
  color: #fff;
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
}
.page-banner .eyebrow { color: rgba(255,255,255,.55); }
.page-banner h1 { color: #fff; margin-bottom: .4rem; font-size: clamp(1.65rem, 4vw, 2.6rem); }
.page-banner p  { color: rgba(255,255,255,.78); max-width: 55ch; margin: 0; font-size: 1.05rem; }
.page-banner .btns { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.4rem; }

/* ── Sections ── */
.section { padding: clamp(2.5rem, 5.5vw, 5rem) 0; }
.section-alt { background: var(--green-pale); }

.section-head { margin-bottom: 2rem; }
.section-head p { color: var(--text-soft); max-width: 58ch; margin-top: .4rem; }

/* ── Cards ── */
.card-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.card-grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card-grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
.card h2, .card h3 { margin-bottom: .5rem; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }

/* Stat cards */
.stat-card { text-align: center; }
.stat-card strong {
  display: block;
  font-family: 'Lora', Georgia, serif;
  font-size: 2.3rem;
  font-weight: 700;
  color: var(--green);
  line-height: 1;
  margin-bottom: .35rem;
}
.stat-card span { font-size: .9rem; color: var(--text-soft); }

/* Icon cards */
.icon-card { text-align: center; }
.icon-card .icon {
  width: 88px;
  height: 88px;
  border-radius: 16px;
  background: var(--green-pale);
  border: 2px solid rgba(42,96,73,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  overflow: hidden;
}
.icon-card .icon img { width: 56px; height: 56px; object-fit: contain; margin: auto; }
.icon-card h3 { font-size: 1.05rem; margin-bottom: .35rem; }
.icon-card p  { font-size: .95rem; color: var(--text-soft); margin-bottom: .5rem; }

/* ── CTA band ── */
.cta-band {
  background: var(--green);
  color: #fff;
  padding: clamp(2.5rem, 6vw, 4rem) 0;
  text-align: center;
}
.cta-band h2 { color: #fff; margin-bottom: .5rem; }
.cta-band p  { color: rgba(255,255,255,.78); max-width: 50ch; margin: 0 auto 1.5rem; }
.cta-band .btns { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }

/* ── Lists ── */
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { margin-bottom: .45rem; }

.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li {
  position: relative;
  padding: .28rem 0 .28rem 1.55rem;
}
.check-list li::before {
  content: '';
  position: absolute;
  left: 0; top: .8rem;
  width: .48rem; height: .48rem;
  border-radius: 50%;
  background: var(--green-mid);
}

.two-cols { columns: 2; column-gap: 1.5rem; }
.two-cols li { break-inside: avoid; }

/* ── Notice ── */
.notice {
  border-left: 4px solid var(--gold);
  background: #fdf6ed;
  border-radius: 0 8px 8px 0;
  padding: .8rem 1rem;
  margin-top: 1rem;
  font-size: .93rem;
}

/* ── Article pages ── */
.article-body { max-width: 72ch; }
.article-body h2 { margin-top: 2rem; }
.article-body h2:first-child { margin-top: 0; }

/* ── Form ── */
.form-grid {
  display: grid;
  gap: .85rem;
  grid-template-columns: 1fr 1fr;
}
.form-field { display: flex; flex-direction: column; gap: .3rem; }
.form-field.full { grid-column: 1 / -1; }

label { font-weight: 600; font-size: .9rem; color: var(--text-soft); }

input, textarea {
  font: inherit;
  font-size: 1rem;
  padding: .6rem .8rem;
  border: 1px solid rgba(42,96,73,.25);
  border-radius: 8px;
  width: 100%;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--green-mid);
  box-shadow: 0 0 0 3px rgba(61,138,102,.15);
}
textarea { min-height: 140px; resize: vertical; }
.form-status { font-weight: 600; color: var(--green); min-height: 1.4em; }

/* ── Footer ── */
.site-footer {
  background: var(--green-dark);
  color: rgba(255,255,255,.72);
  margin-top: 4rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2.5rem;
  padding: 3rem 0 2.5rem;
}
.footer-brand img {
  width: min(190px, 80%);
  filter: brightness(0) invert(1) opacity(.85);
  margin-bottom: .9rem;
}
.footer-brand p   { font-size: .88rem; margin-bottom: .35rem; }
.footer-brand .ein { font-size: .8rem; opacity: .55; }

.site-footer h4 {
  color: #fff;
  font-family: inherit;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  margin-bottom: .85rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .5rem; font-size: .88rem; }
.site-footer a  { color: rgba(255,255,255,.62); text-decoration: none; }
.site-footer a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  text-align: center;
  font-size: .83rem;
  color: rgba(255,255,255,.38);
  padding: 1rem 0 1.1rem;
}

/* ── Reveal animation ── */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s ease, transform .5s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* ── Accessibility widget ── */
:root { --a11y-font-size: 16px; }

.a11y-widget {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .5rem;
}

.a11y-trigger {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.35);
  background: var(--green);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(26,61,46,.38);
  transition: background .18s, transform .15s;
  order: 2;
}
.a11y-trigger:hover { background: var(--green-dark); transform: scale(1.07); }
.a11y-trigger:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.a11y-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem 1.1rem;
  min-width: 220px;
  order: 1;
}

.a11y-panel-title {
  font-family: 'Lora', Georgia, serif;
  font-weight: 600;
  font-size: .95rem;
  color: var(--green-dark);
  margin: 0 0 .85rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}

.a11y-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .35rem 0;
}
.a11y-row-label {
  font-size: .82rem;
  color: var(--text-soft);
  cursor: default;
}

/* Font size button group */
.a11y-btn-group {
  display: flex;
  gap: .25rem;
}
.a11y-btn {
  padding: .2rem .55rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: .82rem;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.a11y-btn:hover { border-color: var(--green); color: var(--green); }
.a11y-btn.active { background: var(--green); border-color: var(--green); color: #fff; }
.a11y-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

/* Toggle switch */
.a11y-toggle {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 11px;
  border: none;
  background: #d0d5dd;
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
}
.a11y-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform .2s;
}
.a11y-toggle.on { background: var(--green); }
.a11y-toggle.on::after { transform: translateX(16px); }
.a11y-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ── Accessibility modifier classes ── */

/* High contrast */
.a11y-contrast {
  --green:      #005c38;
  --green-dark: #003d26;
  --text:       #000000;
  --text-soft:  #1a1a1a;
  --white:      #ffffff;
  --border:     rgba(0,0,0,.45);
}
.a11y-contrast body { background: #fff; }
.a11y-contrast .topbar { background: #003d26; }
.a11y-contrast .site-header { border-bottom: 2px solid #000; }
.a11y-contrast .page-banner { background: #003d26; }
.a11y-contrast .cta-band { background: #003d26; }
.a11y-contrast .card { border: 2px solid #000; }

/* Focus rings */
.a11y-focus *:focus { outline: 3px solid var(--gold) !important; outline-offset: 3px !important; }

/* Dyslexia-friendly font (system fallback — loads OpenDyslexic if available) */
.a11y-dyslexia body,
.a11y-dyslexia input,
.a11y-dyslexia textarea,
.a11y-dyslexia select {
  font-family: 'OpenDyslexic', 'Comic Sans MS', 'Trebuchet MS', Arial, sans-serif !important;
  letter-spacing: .04em;
  word-spacing: .12em;
  line-height: 1.85;
}
.a11y-dyslexia h1,
.a11y-dyslexia h2,
.a11y-dyslexia h3,
.a11y-dyslexia h4 {
  font-family: 'OpenDyslexic', 'Comic Sans MS', 'Trebuchet MS', Arial, sans-serif !important;
}

/* Reduce motion */
.a11y-reduce-motion *,
.a11y-reduce-motion *::before,
.a11y-reduce-motion *::after {
  animation-duration: .001ms !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important;
}
.a11y-reduce-motion .reveal {
  opacity: 1 !important;
  transform: none !important;
}

/* ── Responsive ── */
@media (max-width: 920px) {
  .menu-btn { display: flex; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: #fff;
    border-top: 1px solid var(--border);
    border-bottom: 2px solid var(--green-pale);
    padding: .75rem 1.25rem 1.25rem;
    flex-direction: column;
    align-items: flex-start;
    gap: .05rem;
    box-shadow: 0 10px 28px rgba(26,61,46,.12);
    z-index: 200;
  }
  .site-nav.open { display: flex; }
  .site-nav a { width: 100%; padding: .55rem .6rem; }
  .site-nav .btn-donate { margin-left: 0; margin-top: .5rem; }

  .footer-inner { grid-template-columns: 1fr; gap: 1.75rem; }
}

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .two-cols  { columns: 1; }
  .card-grid.cols-2 { grid-template-columns: 1fr; }
}
