/* ============================================================
   HapiFound — Style D : Editorial / Journalistic
   ============================================================ */

:root {
  --paper:     #FBFAF7;
  --ink:       #111111;
  --ink-soft:  #383838;
  --ink-mute:  #6F6F6F;
  --rule:      #DAD6CC;
  --accent:    #B5121B;     /* single bold editorial red */
  --accent-soft: #FCE9EB;

  --display: "Playfair Display", "Times New Roman", Georgia, serif;
  --body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 32px; }

/* Editorial display type */
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.04;
  letter-spacing: -0.015em;
}
h1 { font-size: clamp(34px, 8.5vw, 116px); }
h2 { font-size: clamp(40px, 5.5vw, 64px); }
h3 { font-size: clamp(24px, 2.6vw, 32px); line-height: 1.15; }

p { font-size: 18px; color: var(--ink-soft); line-height: 1.7; }
p + p { margin-top: 1.1em; }

/* Editorial standfirst (newspaper-style sub-deck) */
.standfirst {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.4;
  color: var(--ink-soft);
  max-width: 760px;
}

/* Section labels — small caps caps-and-rule */
.kicker {
  font-family: var(--body);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 16px;
}
.kicker::before {
  content: "";
  display: block;
  width: 32px;
  height: 1px;
  background: var(--accent);
}

/* Byline-style meta */
.meta {
  font-family: var(--body);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}

/* Buttons / CTAs --------------------------------------------------------- */

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--body);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 18px 28px;
  background: var(--accent);
  color: white;
  border: 1.5px solid var(--accent);
  transition: background 0.18s;
}
.cta:hover { background: #8E0E14; border-color: #8E0E14; }
.cta--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.cta--ghost:hover { background: var(--ink); color: var(--paper); }

a.read-more {
  font-family: var(--body);
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
}
a.read-more:hover { color: #8E0E14; }

/* Header ----------------------------------------------------------------- */

.masthead {
  border-bottom: 3px double var(--ink);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 50;
}
.masthead .row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 32px;
  font-family: var(--body);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  border-bottom: 1px solid var(--rule);
  max-width: 1240px;
  margin: 0 auto;
}
.masthead .wordmark-row {
  text-align: center;
  padding: 22px 32px 18px;
}
.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 48px;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.wordmark em { color: var(--accent); font-style: italic; }
.masthead .nav-row {
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 14px 32px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}
.masthead .nav-row a:hover { color: var(--accent); }
@media (max-width: 720px) {
  .masthead .nav-row { gap: 18px; flex-wrap: wrap; font-size: 11px; }
  .wordmark { font-size: 32px; }
}

/* Lede / Hero ------------------------------------------------------------ */

.lede {
  padding: 80px 0 60px;
}
.lede .kicker { margin-bottom: 32px; }
.lede h1 { margin-bottom: 32px; max-width: 1020px; }
.lede .standfirst { margin-bottom: 48px; }
.lede .ctas { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 64px; }
.lede .photo {
  width: 100%;
  aspect-ratio: 16/7;
  background: var(--rule);
  background-size: cover;
  background-position: center;
}
.lede .credit {
  font-family: var(--body);
  font-size: 11px;
  color: var(--ink-mute);
  font-style: italic;
  margin-top: 10px;
}

/* Pull quote band */
.pullquote {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 90px 0;
  text-align: center;
}
.pullquote blockquote {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1.25;
  color: var(--ink);
  max-width: 960px;
  margin: 0 auto;
}
.pullquote .drop {
  display: inline-block;
  font-family: var(--display);
  font-size: 100px;
  line-height: 0.6;
  color: var(--accent);
  vertical-align: -22px;
  margin-right: 8px;
}
.pullquote cite {
  display: block;
  font-family: var(--body);
  font-style: normal;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 28px;
  font-weight: 600;
}

/* Feature / Mission ------------------------------------------------------ */

.feature {
  padding: 110px 0;
}
.feature .grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 80px;
}
@media (max-width: 920px) { .feature .grid { grid-template-columns: 1fr; gap: 36px; } }
.feature h2 { margin-bottom: 24px; }
.feature h2 em { color: var(--accent); font-style: italic; }
.feature .kicker { margin-bottom: 22px; }
.feature .body p:first-of-type::first-letter {
  font-family: var(--display);
  font-size: 5.5em;
  float: left;
  line-height: 0.9;
  padding-right: 12px;
  padding-top: 6px;
  color: var(--accent);
  font-weight: 700;
}

/* Programs --------------------------------------------------------------- */

.programs {
  padding: 110px 0;
  border-top: 1px solid var(--rule);
}
.programs .header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 64px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 28px;
}
.programs .header-row .kicker { margin-bottom: 14px; }
.programs .header-row h2 { max-width: 700px; }
.programs .header-row .meta { text-align: right; }
@media (max-width: 720px) {
  .programs .header-row { flex-direction: column; align-items: flex-start; gap: 14px; }
}
.programs .grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
}
@media (max-width: 920px) { .programs .grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .programs .grid { grid-template-columns: 1fr; } }
.program {
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 36px 28px 36px 0;
}
.program:last-child { border-right: none; }
@media (max-width: 920px) {
  .program:nth-child(2n) { border-right: none; }
}
.program .num {
  font-family: var(--display);
  font-size: 56px;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 16px;
  font-weight: 700;
}
.program h3 { margin-bottom: 14px; }
.program p { font-size: 16px; margin-bottom: 20px; }

/* Stories — story-card grid like a homepage feature row ------------------ */

.stories {
  padding: 110px 0;
  background: #F2EFE6;
}
.stories .header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 48px;
}
.stories .kicker { margin-bottom: 14px; }
.stories .grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 60px;
  align-items: start;
}
@media (max-width: 920px) { .stories .grid { grid-template-columns: 1fr; } }
.story-lead .img {
  aspect-ratio: 4/3;
  background-size: cover;
  background-position: center;
  margin-bottom: 24px;
}
.story-lead .kicker { margin-bottom: 12px; }
.story-lead h3 { font-size: clamp(28px, 3.5vw, 44px); margin-bottom: 16px; }
.story-lead p { margin-bottom: 12px; }
.story-side article {
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}
.story-side article:last-child { border-bottom: none; }
.story-side .row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 20px;
  align-items: start;
}
.story-side .img {
  aspect-ratio: 1/1;
  background-size: cover;
  background-position: center;
}
.story-side .kicker { margin-bottom: 6px; }
.story-side h3 { font-size: 22px; margin-bottom: 8px; }
.story-side p { font-size: 15px; }

/* Get involved ---------------------------------------------------------- */

.involve {
  padding: 110px 0;
  border-top: 1px solid var(--rule);
}
.involve .header-row { margin-bottom: 56px; }
.involve .kicker { margin-bottom: 16px; }
.involve .grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
@media (max-width: 720px) { .involve .grid { grid-template-columns: 1fr; } }
.involve .cell {
  padding: 48px 28px 48px 0;
  border-right: 1px solid var(--rule);
}
.involve .cell:last-child { border-right: none; }
.involve .cell h3 { margin-bottom: 14px; }
.involve .cell p { font-size: 15px; margin-bottom: 28px; min-height: 80px; }

/* Footer ----------------------------------------------------------------- */

.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding: 90px 0 36px;
}
.site-footer .grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 60px;
  margin-bottom: 70px;
}
@media (max-width: 720px) { .site-footer .grid { grid-template-columns: 1fr 1fr; } }
.site-footer .wordmark { color: var(--paper); display: block; margin-bottom: 14px; font-size: 32px; }
.site-footer .wordmark em { color: var(--accent); }
.site-footer h4 {
  font-family: var(--body);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 18px;
}
.site-footer p, .site-footer a, .site-footer li {
  color: rgba(251, 250, 247, 0.7);
  font-size: 14px;
  line-height: 1.85;
}
.site-footer ul { list-style: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer .fineprint {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 28px;
  font-size: 12px;
  color: rgba(251,250,247,0.45);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
}

/* === Polish: editorial accent moments === */
.lede .photo { box-shadow: 0 24px 60px rgba(0,0,0,0.06); }
.story-lead h3 a { color: var(--accent); }
.feature .body strong { color: var(--accent); font-weight: 600; }

/* Bottom rule under standfirst — newspaper kicker rhythm */
.lede .standfirst { padding-bottom: 24px; border-bottom: 1px solid var(--rule); }

/* === QA fix: mobile horizontal-overflow guard === */
html, body { overflow-x: hidden; max-width: 100%; }
h1, h2, h3 { overflow-wrap: break-word; word-break: normal; }
