/* ============================================
   COMMUNITY V2 — community-v2.html
   The Almanac aesthetic: chapter-numbered editorial
   yearbook of community service.

   Five chapters, each opened by a Roman numeral marker.
   Card grids replaced with a numbered ledger pattern.
   Reuses inner-pages.css for hero + section-cta.

   Color discipline (per CLAUDE.md):
   - var(--warm) maroon — chapter Roman numerals (soul/ceremonial register)
   - var(--warm-green) — section labels and small accents only
   - var(--accent) Hampton Blue — buttons, links, focus
   ============================================ */

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

/* ============================================
   STICKY CHAPTER RAIL
   Fixed-position chapter index that follows the reader.
   Replaces the in-flow TOC. Hidden on screens < 1100px wide so
   it doesn't obscure content. Active chapter is set by JS via
   IntersectionObserver (see inline script in community-v2.html).
   ============================================ */
.alm-rail {
  position: fixed;
  top: 50%;
  left: 28px;
  transform: translate(-12px, -50%);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms var(--ease-soft),
              transform 400ms var(--ease-calm);
}

.alm-rail.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(0, -50%);
}

.alm-rail-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  row-gap: 2px;
}

.alm-rail-list a {
  display: grid;
  grid-template-columns: 26px auto;
  align-items: baseline;
  gap: 14px;
  padding: 6px 12px 6px 12px;
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-light);
  border-left: 1px solid var(--hairline);
  transition: color 320ms var(--ease-soft),
              border-color 320ms var(--ease-soft),
              padding-left var(--t-fast) var(--ease-soft);
}

.alm-rail-list a:hover {
  color: var(--ink);
  border-left-color: var(--ink);
  padding-left: 16px;
}

.alm-rail-num {
  font-family: var(--font-heading);
  font-weight: 300;
  letter-spacing: 0.06em;
  color: var(--warm);
  opacity: 0.55;
  text-align: right;
  font-variant-numeric: tabular-nums;
  transition: color 320ms var(--ease-soft), opacity 320ms var(--ease-soft);
}

.alm-rail-name {
  font-weight: 500;
  letter-spacing: 0.18em;
}

/* Active chapter — maroon left rail, full-opacity numeral, ink-colored name */
.alm-rail-list .is-active a {
  color: var(--ink);
  border-left-color: var(--warm);
  padding-left: 18px;
}

.alm-rail-list .is-active .alm-rail-num {
  opacity: 1;
  color: var(--warm);
}

.alm-rail-list .is-active .alm-rail-name {
  font-weight: 600;
}

/* Inverted rail — applied via JS while the dark CTA section is in view
   so the rail stays legible against the gradient background.
   Inactive items: muted white. Active item: full white. The maroon
   accent on numerals lifts to a soft warm-cream against dark surfaces. */
.alm-rail.is-on-dark .alm-rail-list a {
  color: rgba(255, 255, 255, 0.55);
  border-left-color: rgba(255, 255, 255, 0.18);
}

.alm-rail.is-on-dark .alm-rail-list a:hover {
  color: var(--white);
  border-left-color: rgba(255, 255, 255, 0.5);
}

.alm-rail.is-on-dark .alm-rail-num {
  color: rgba(255, 220, 200, 0.7);
  opacity: 0.85;
}

.alm-rail.is-on-dark .alm-rail-list .is-active a {
  color: var(--white);
  border-left-color: var(--white);
}

.alm-rail.is-on-dark .alm-rail-list .is-active .alm-rail-num {
  color: var(--white);
  opacity: 1;
}

/* Hide on screens too narrow to host the rail without obscuring content.
   The JS also no-ops below this width for parity. */
@media (max-width: 1099px) {
  .alm-rail { display: none; }
}

/* ============================================
   CHAPTER STRUCTURE — shared
   Each chapter opens with: Roman numeral marker, section label,
   chapter title, optional description.
   Alternating bg (white / off-white) creates rhythm.
   ============================================ */
.alm-chapter {
  padding: 128px 0;
  background: var(--white);
  border-bottom: 1px solid var(--hairline);
  position: relative;
  overflow: hidden;
}

.alm-chapter:nth-of-type(even) {
  background: var(--off-white);
}

.alm-chapter::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 700px 500px at 80% 18%, rgba(58, 125, 92, 0.035), transparent 60%),
    radial-gradient(ellipse 600px 400px at 18% 82%, rgba(123, 35, 50, 0.03), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.alm-chapter::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  opacity: 0.04;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 0;
}

.alm-chapter .alm-container { position: relative; z-index: 1; }

.alm-chapter-head {
  text-align: center;
  margin: 0 auto 56px;
  max-width: 760px;
}

.alm-chapter-num {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(4rem, 8vw, 6.5rem);
  font-weight: 200;
  line-height: 0.85;
  letter-spacing: -0.02em;
  color: var(--warm);
  margin: 0 0 24px;
  user-select: none;
}

.alm-chapter-head .section-label {
  display: inline-block;
  margin: 0 0 18px;
  color: var(--warm-green);
}

.alm-chapter-title {
  font-family: var(--font-heading);
  font-size: clamp(1.85rem, 3.6vw, 2.6rem);
  font-weight: 300;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}

.alm-chapter-title strong { font-weight: 700; }

.ch-br { display: none; }
@media (min-width: 720px) {
  .ch-br { display: inline; }
}

.alm-chapter-desc {
  font-family: var(--font-body);
  font-size: 1.08rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-body);
  text-align: center;
  margin: 28px auto 64px;
  max-width: 640px;
}

/* ============================================
   I. BELIEF — pull-quote chapter
   Cormorant italic earns its keep here, the brand's
   reserved soul typeface for contemplative moments.
   ============================================ */
.alm-belief .alm-quote {
  margin: 24px auto 0;
  max-width: 760px;
  text-align: center;
  padding: 56px 32px 0;
  border-top: 1px solid var(--hairline-strong);
  position: relative;
}

.alm-belief .alm-quote::before {
  content: '\201C';
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 5rem;
  line-height: 0.6;
  color: rgba(123, 35, 50, 0.18);
  background: var(--white);
  padding: 0 24px;
  pointer-events: none;
}

.alm-belief:nth-of-type(even) .alm-quote::before {
  background: var(--off-white);
}

.alm-quote-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.45rem, 2.5vw, 2.05rem);
  line-height: 1.45;
  color: var(--ink);
  margin: 0 0 32px;
  letter-spacing: -0.005em;
}

.alm-quote-text strong {
  font-weight: 400;
  font-style: italic;
  color: var(--warm);
}

.alm-quote-cite {
  display: block;
  font-family: var(--font-heading);
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--warm);
}

/* ============================================
   II. INITIATIVES — organizations + acts of kindness
   Photoless editorial ledger: a large hairline numeral indexes each
   organization, a warm-green tag names who they serve. Acts of Kindness
   follows as a two-column list closing on a maroon Cormorant coda.
   (Replaced the photo-spread layout — we have no real org photography.)
   ============================================ */
.alm-subhead {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--warm-green);
  text-align: center;
  margin: 0 0 36px;
}

.alm-orgs {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--hairline-strong);
}

.alm-org {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 40px;
  padding: 48px 8px;
  border-bottom: 1px solid var(--hairline-strong);
  align-items: start;
}

.alm-org-num {
  font-family: var(--font-heading);
  font-size: clamp(2.6rem, 4.5vw, 4rem);
  font-weight: 200;
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: rgba(31, 32, 36, 0.16);
  user-select: none;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.alm-org-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-heading);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--warm-green);
  margin: 0 0 14px;
}

.alm-org-tag::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 1px;
  background: var(--warm-green);
  margin-right: 10px;
}

.alm-org-body h3 {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 2.2vw, 1.95rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 16px;
  line-height: 1.2;
}

.alm-org-body p {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-body);
  margin: 0;
  max-width: 62ch;
}

.alm-orgs-note {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 1.3rem;
  color: var(--text-light);
  text-align: center;
  margin: 36px 0 0;
}

/* Acts of Kindness — second block inside chapter II */
.alm-acts-block {
  margin-top: 88px;
  padding-top: 72px;
  border-top: 1px solid var(--hairline-strong);
  text-align: center;
}

.alm-acts {
  list-style: none;
  padding: 0;
  margin: 0 auto 48px;
  max-width: 760px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 40px;
  text-align: left;
}

.alm-acts li {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.5;
  color: var(--text-body);
  padding: 16px 0 16px 28px;
  border-bottom: 1px solid var(--hairline);
  position: relative;
}

.alm-acts li::before {
  content: '';
  position: absolute;
  left: 0;
  /* Align the dot to the first text line (was a fixed 24px that drifted on
     wrapped two-line items). */
  top: calc(16px + 0.72em);
  transform: translateY(-50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warm-green);
  opacity: 0.85;
}

/* When the last act is a lone item on its own row (5 items in 2 cols),
   let it span the full width instead of leaving an empty cell. */
.alm-acts li:nth-child(5):last-child { grid-column: 1 / -1; }

.alm-acts-close {
  font-family: var(--font-body);
  font-size: 1.08rem;
  font-weight: 300;
  line-height: 1.75;
  color: var(--text-body);
  max-width: 680px;
  margin: 0 auto 28px;
}

.alm-acts-coda {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: 300;
  line-height: 1.4;
  color: var(--ink);
  max-width: 680px;
  margin: 0 auto;
}

.alm-acts-coda strong {
  font-weight: 400;
  color: var(--warm);
}

/* III. IMPACT + IV. EVENTS + SCENES — placeholder treatments.
   No real data yet; these keep the chapter shells honest until filled. */
.alm-impact-soon,
.alm-placeholder-note {
  font-family: var(--font-body);
  font-size: 1.12rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-body);
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.alm-impact-soon strong { color: var(--ink); font-weight: 600; }

.alm-placeholder-note {
  font-style: italic;
  color: var(--text-light);
  margin-bottom: 40px;
}

.alm-placeholder-note a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Empty scenes mosaic — soft gradient tiles stand in for future photos */
.alm-scenes-empty .scene { opacity: 0.5; }

/* ============================================
   III. IMPACT — stats strip
   Reuses the homepage stat-value/-num/-suffix/-label treatment.
   ============================================ */
.alm-impact .alm-chapter-head { margin-bottom: 64px; }

.alm-stats-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--hairline-strong);
  border-bottom: 1px solid var(--hairline-strong);
}

.alm-stat {
  text-align: center;
  padding: 48px 24px;
  border-right: 1px solid var(--hairline-strong);
}

.alm-stat:last-child { border-right: 0; }

.alm-stat .stat-value {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 200;
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin: 0 0 16px;
  display: flex;
  align-items: baseline;
  justify-content: center;
}

.alm-stat .stat-num {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

.alm-stat .stat-suffix {
  font-size: 0.6em;
  font-weight: 300;
  color: var(--warm);
  margin-left: 4px;
}

.alm-stat .stat-label {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-light);
  margin: 0;
}

/* ============================================
   SCENES — photo essay (unnumbered interlude between III and IV)
   Asymmetric mosaic. 4-column grid with auto rows; some scenes
   span 2 rows (tall) or 2 cols (wide) for varied rhythm. Hover
   scales the inner photo.
   ============================================ */
.alm-scenes-section { padding: 96px 0 112px; }
.alm-scenes-section .alm-chapter-head { margin-bottom: 56px; }

.alm-chapter-num-quiet {
  font-size: clamp(2rem, 4vw, 3rem) !important;
  color: var(--text-light) !important;
  letter-spacing: 0;
  margin-bottom: 12px !important;
}

.alm-scenes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 220px;
  grid-auto-flow: dense;
  gap: 14px;
}

.scene {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, #d5d5d5, #ebebeb);
}

.scene::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: var(--img-inset);
  pointer-events: none;
  border-radius: inherit;
}

.scene img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 700ms var(--ease-calm);
}

.scene:hover img { transform: scale(1.06); }

.scene-tall { grid-row: span 2; }
.scene-wide { grid-column: span 2; }

/* ============================================
   IV. EVENTS LOG (photo + status + body)
   Three columns: photo thumbnail, status indicator, body.
   Status (Upcoming / Completed) acts as a date-stamp equivalent.
   Upcoming gets a green pulsing dot to read at a glance.
   ============================================ */
.alm-events .alm-chapter-head { margin-bottom: 56px; }

.alm-log {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--hairline-strong);
}

.alm-log-item {
  display: grid;
  grid-template-columns: 240px 140px minmax(0, 1fr);
  gap: 36px;
  padding: 32px 8px;
  border-bottom: 1px solid var(--hairline-strong);
  align-items: center;
}

.alm-log-photo {
  margin: 0;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, #d5d5d5, #ebebeb);
  position: relative;
}

.alm-log-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: var(--img-inset);
  pointer-events: none;
  border-radius: inherit;
}

.alm-log-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--t-slow) var(--ease-calm);
}

.alm-log-item:hover .alm-log-photo img { transform: scale(1.05); }

.alm-log-status {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-light);
  position: relative;
  align-self: center;
}

.alm-log-status-upcoming {
  color: var(--warm-green);
  padding-left: 18px;
}

.alm-log-status-upcoming::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  margin-top: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warm-green);
  box-shadow: 0 0 0 4px rgba(58, 125, 92, 0.18);
}

.alm-log-body h3 {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 1.6vw, 1.4rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 10px;
  line-height: 1.3;
}

.alm-log-body p {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.65;
  color: var(--text-body);
  margin: 0;
  max-width: 60ch;
}

/* ============================================
   V. PRINCIPLES (Get Involved)
   Small Roman numerals (i, ii, iii) — different scale from
   the chapter-level numerals. Reads as a sub-pattern.
   ============================================ */
.alm-principles {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 800px;
}

.alm-principle {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 32px;
  padding: 36px 0;
  border-bottom: 1px solid var(--hairline);
  align-items: start;
}

.alm-principle:last-child { border-bottom: 0; }

.alm-principle-num {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 2.2vw, 1.95rem);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--warm);
  text-align: right;
  font-variant: small-caps;
  line-height: 1.1;
  padding-top: 4px;
}

.alm-principle-body h4 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0 0 10px;
  line-height: 1.3;
}

.alm-principle-body p {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.65;
  color: var(--text-body);
  margin: 0;
  max-width: 60ch;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .alm-toc { padding: 72px 0 80px; }
  .alm-toc-list a { grid-template-columns: 56px 1fr auto; gap: 18px; padding: 20px 0; }
  .alm-toc-num { font-size: 0.95rem; }
  .alm-toc-list a:hover { padding-left: 8px; }

  .alm-chapter { padding: 88px 0 96px; }
  .alm-chapter-num { font-size: clamp(3rem, 10vw, 5rem); margin-bottom: 18px; }
  .alm-chapter-head { margin-bottom: 40px; }
  .alm-chapter-desc { margin: 24px auto 48px; }

  .alm-belief .alm-quote { padding: 48px 16px 0; }
  .alm-belief .alm-quote::before { font-size: 4rem; }

  /* Initiatives — tighten the org ledger (acts list stays 2-col on tablet,
     collapses at ≤600 below). */
  .alm-org {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 20px;
    padding: 36px 4px;
  }
  .alm-org-num { font-size: clamp(2rem, 8vw, 3rem); text-align: left; }
  .alm-acts-block { margin-top: 64px; padding-top: 56px; }

  /* Scenes — collapse to 2-col grid on tablet */
  .alm-scenes-section { padding: 72px 0 88px; }
  .alm-scenes-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 180px;
    gap: 10px;
  }
  .scene-wide { grid-column: span 2; }
  .scene-tall { grid-row: span 2; }

  /* Impact stats — 2x2 */
  .alm-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .alm-stat { border-right: 0; padding: 32px 16px; }
  .alm-stat:nth-child(odd) { border-right: 1px solid var(--hairline-strong); }
  .alm-stat:nth-child(-n+2) { border-bottom: 1px solid var(--hairline-strong); }

  /* Events log — stack to vertical layout */
  .alm-log-item {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 28px 4px;
  }
  .alm-log-photo {
    max-width: 320px;
    aspect-ratio: 3 / 2;
  }
  .alm-log-status { padding-top: 0; align-self: start; }

  /* Principles */
  .alm-principle {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 18px;
    padding: 30px 0;
  }
  .alm-principle-num { font-size: 1.5rem; text-align: left; }
}

@media (max-width: 600px) {
  .alm-acts { grid-template-columns: 1fr; max-width: 520px; }
}

@media (max-width: 520px) {
  .alm-container { padding: 0 24px; }
  .alm-toc-list a { grid-template-columns: 48px 1fr auto; gap: 14px; }
  .alm-toc-num { font-size: 0.9rem; }

  /* Scenes — single column on phones; tall/wide modifiers neutralized */
  .alm-scenes-grid { grid-template-columns: 1fr; grid-auto-rows: 240px; }
  .scene-wide,
  .scene-tall { grid-column: auto; grid-row: auto; }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .alm-toc-list a,
  .alm-toc-arrow,
  .alm-spread-photo img,
  .alm-log-photo img,
  .scene img { transition: none; }
}
