/* ==========================================================================
   SODEC — Society Development Center | style.css
   Design system: SODEC Red (brand/CTA) + Terraced-Hill Gold & Forest Green
   (functional accents for status/impact) on white / near-white neutrals.
   Typography: Poppins (display) + Inter (body) + Noto Sans Devanagari (np).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Brand red — top bar, nav, primary CTAs, active states */
  --red-700: #68171c;
  --red-600: #852329;
  --red-500: #a7373a;
  --red-050: #fbebe9;
  --hero-static-photo: url("assets/images/about-overview.jpg");

  /* Harvest gold — stats, "upcoming" tag, small highlights */
  --gold-600: #b8862f;
  --gold-500: #d3a04a;
  --gold-050: #faf1de;

  /* Terraced-forest green — "current" tag, success/confirm states */
  --forest-700: #26422b;
  --forest-600: #375c3d;
  --forest-050: #eaf1e9;

  /* Neutrals per brief */
  --white: #ffffff;
  --bg-soft: #f8f9fa;
  --ink: #222222;
  --ink-soft: #55575c;
  --line: #e6e3dd;

  /* Type */
  --font-display: "Poppins", "Noto Sans Devanagari", sans-serif;
  --font-body: "Inter", "Noto Sans Devanagari", sans-serif;

  /* Scale (major third-ish, rounded) */
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2rem;
  --step-4: 2.65rem;
  --step-5: 3.4rem;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 22px;
  --shadow-card: 0 1px 2px rgba(34, 34, 34, 0.06), 0 10px 24px -14px rgba(34, 34, 34, 0.18);
  --shadow-pop: 0 20px 45px -20px rgba(143, 17, 22, 0.35);
  --container: 1180px;
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0 0 0.5em;
  font-weight: 600;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, var(--step-5)); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, var(--step-3)); }
h3 { font-size: var(--step-1); }
p { margin: 0 0 1em; max-width: 68ch; color: var(--ink-soft); }
.np { font-family: "Noto Sans Devanagari", sans-serif; }

:focus-visible {
  outline: 3px solid var(--gold-500);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: clamp(48px, 6vw, 88px) 0;
}
.section--soft { background: var(--bg-soft); }
.section-head { max-width: 640px; margin-bottom: 2.5rem; }
.section-head p { margin-bottom: 0; }
.eyebrow-plain {
  display: block;
  color: var(--red-600);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step--1);
  margin-bottom: 0.4em;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* --------------------------------------------------------------------------
   3. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.85em 1.6em;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step--1);
  border: 2px solid transparent;
  transition: transform var(--transition), background var(--transition), color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--white); color: var(--red-600); box-shadow: var(--shadow-pop); }
.btn-primary:hover { background: var(--gold-500); color: var(--white); }
.btn-outline { border-color: rgba(255,255,255,0.7); color: var(--white); }
.btn-outline:hover { background: rgba(255,255,255,0.12); border-color: var(--white); }
.btn-solid { background: var(--red-600); color: var(--white); }
.btn-solid:hover { background: var(--red-700); }
.btn-ghost { background: transparent; color: var(--red-600); border-color: var(--red-050); }
.btn-ghost:hover { background: var(--red-050); }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; }

/* --------------------------------------------------------------------------
   4. Header / Nav
   -------------------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 100; overflow-anchor: none; }
.site-header {
  transition: transform 0.3s ease;
}
@media (min-width: 1024px) {
  .site-header.is-hidden {
    transform: translateY(-100%);
  }
}

/* Top identity bar: logo + bilingual name + tagline (SODEC Red) */
.topbar {
  background: linear-gradient(180deg, var(--red-600), var(--red-700));
  color: var(--white);
  transition: padding var(--transition);
}
.topbar__inner {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 18px 0;
}
.site-logo {
  width: 88px; height: 88px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.85);
  background: var(--white);
  flex-shrink: 0;
  transition: width var(--transition), height var(--transition);
}
.topbar__title { flex: 1; min-width: 0; }
.topbar__title .org-en {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.05rem, 0.85rem + 0.8vw, 1.5rem);
  display: block;
}
.topbar__title .org-np {
  font-weight: 600;
  font-size: clamp(0.95rem, 0.8rem + 0.5vw, 1.15rem);
  display: block;
  opacity: 0.96;
}
.topbar__tagline {
  font-style: italic;
  opacity: 0.85;
  font-size: var(--step--1);
  max-width: 22ch;
  text-align: right;
  margin-left: auto;
  display: none;
}
.topbar__tagline p { margin: 0; color: inherit; }

/* Nav bar: same red family, holds primary links + dropdowns */
.navbar { background: var(--red-500); border-top: 1px solid rgba(255,255,255,0.15); }
.navbar__inner { display: flex; align-items: center; justify-content: space-between; }
.nav-list { display: flex; align-items: center; }
.nav-list > li { position: relative; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 18px;
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--step--1);
  border-bottom: 3px solid transparent;
  transition: background var(--transition), border-color var(--transition);
}
.nav-link:hover, .nav-link:focus-visible, .nav-link.is-active {
  background: rgba(0,0,0,0.08);
  border-bottom-color: var(--gold-500);
}
.nav-link .caret { width: 9px; height: 9px; transition: transform var(--transition); }
.has-dropdown:hover .caret, .has-dropdown:focus-within .caret { transform: rotate(180deg); }

.dropdown {
  position: absolute;
  top: 100%; left: 0;
  min-width: 230px;
  background: var(--white);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.dropdown a {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: var(--step--1);
}
.dropdown a:hover { background: var(--bg-soft); color: var(--red-600); }

.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--white);
  padding: 10px;
  margin-right: 4px;
}
.nav-toggle svg { width: 26px; height: 26px; }

/* Sticky-shrink state (added by script.js on scroll) */
.site-header.is-condensed .topbar__inner { padding: 8px 0; }
.site-header.is-condensed .site-logo { width: 56px; height: 56px; }
.site-header.is-condensed .topbar__tagline { display: none; }
.site-header.is-condensed .nav-link { padding: 10px 18px; }

/* --------------------------------------------------------------------------
   5. Mobile nav
   -------------------------------------------------------------------------- */
@media (max-width: 880px) {
  .topbar__tagline { display: none; }
  .nav-toggle { display: inline-flex; }
  .navbar__inner { padding-top: 4px; padding-bottom: 4px; }
  .nav-list {
    position: fixed;
    inset: 0 0 0 auto;
    height: 100vh;
    height: 100dvh;
    width: min(78vw, 320px);
    background: var(--red-700);
    flex-direction: column;
    align-items: stretch;
    padding: 90px 12px 24px;
    transform: translateX(100%);
    transition: transform var(--transition);
    overflow-y: auto;
    /* BUG FIX: without an explicit z-index this panel had no stacking
       context, so .nav-backdrop (z-index: 90, added right after it in
       the HTML) rendered ABOVE it and silently ate every tap on the
       menu links. Giving the menu a higher z-index than the backdrop
       fixes tapping/navigating on mobile. */
    z-index: 95;
  }
  body.nav-open .nav-list { transform: translateX(0); }
  body.nav-open { overflow: hidden; }
  .nav-list > li { width: 100%; }
  .nav-link { border-bottom: 1px solid rgba(255,255,255,0.12); border-radius: 8px; }
  .nav-link.is-active, .nav-link:hover { border-bottom-color: rgba(255,255,255,0.12); }
  .dropdown {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; background: rgba(255,255,255,0.06); display: none;
    margin: 2px 0 8px;
  }
  .has-dropdown.is-open .dropdown { display: block; }
  .dropdown a { color: var(--white); }
  .dropdown a:hover { background: rgba(255,255,255,0.1); color: var(--gold-500); }
  .nav-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); opacity: 0; visibility: hidden; transition: opacity var(--transition); z-index: 90; }
  body.nav-open .nav-backdrop { opacity: 1; visibility: visible; }
}

/* --------------------------------------------------------------------------
   6. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  background: var(--red-700);
  color: var(--white);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(160deg,
    color-mix(in srgb, var(--red-700) 76%, transparent),
    color-mix(in srgb, var(--red-500) 68%, transparent) 70%);
}
.hero__inner {
  padding-top: clamp(56px, 9vw, 120px);
  padding-bottom: 140px;
  max-width: 640px;
}
.hero .eyebrow-plain { color: var(--gold-500); }
.hero h1 { color: var(--white); }
.hero p.lead {
  color: rgba(255,255,255,0.88);
  font-size: var(--step-1);
  max-width: 46ch;
}
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 1.8rem; }
.hero__terrain {
  position: absolute; left: 0; right: 0; bottom: -1px; line-height: 0;
}
.hero__terrain svg { width: 100%; height: auto; display: block; }
.hero__bg-photo {
  position: absolute; inset: 0; z-index: 0; opacity: 0.3;
  background-image: var(--hero-static-photo, none);
  background-size: cover; background-position: center;
}
.hero__inner { position: relative; z-index: 2; }
.hero__terrain { z-index: 3; }

/* Page hero (interior pages) — shorter variant.
   NOTE: this used to set "padding: 40px 0 72px; max-width:100%" which
   zeroed out the LEFT/RIGHT padding that .hero__inner normally inherits
   from .container, and removed the 1180px centered max-width — that's
   why interior-page titles (Contact Us, News & Updates, etc.) sat flush
   against the browser edge instead of lining up with the rest of the
   page. Fix: only override the vertical spacing, let .container keep
   handling the horizontal padding + centering. */
.page-hero { padding: 0; }
.page-hero .hero__inner { padding-top: 40px; padding-bottom: 72px; }
.page-hero h1 { margin-bottom: 0.3em; }
.breadcrumb { font-size: var(--step--1); opacity: 0.85; margin-bottom: 0.9em; }
.breadcrumb a:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   7. Two-column intro / vision blocks
   -------------------------------------------------------------------------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }
.split img, .split .img-placeholder { border-radius: var(--radius-lg); }

.text-block + .text-block { margin-top: 2.2rem; }
.text-block h3 { color: var(--red-600); margin-bottom: 0.5em; }
.obj-list li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 0.6em;
  color: var(--ink-soft);
}
.obj-list li::before {
  content: "";
  position: absolute; left: 0; top: 0.55em;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--gold-500);
}

.gallery-stack { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.gallery-stack figure:first-child { grid-column: 1 / -1; }
.gallery-stack figure { margin: 0; }
.gallery-stack .img-placeholder, .gallery-stack img { aspect-ratio: 16/10; object-fit: cover; width: 100%; }
.gallery-stack figure:first-child .img-placeholder,
.gallery-stack figure:first-child img { aspect-ratio: 16/9; }

/* --------------------------------------------------------------------------
   8. Stats counter
   -------------------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  text-align: center;
}
@media (max-width: 760px) { .stats { grid-template-columns: 1fr 1fr; } }
.stat b {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.5rem + 1.6vw, 3rem);
  color: var(--gold-600);
  font-weight: 700;
  line-height: 1;
}
.stat span { color: var(--ink-soft); font-size: var(--step--1); }

/* --------------------------------------------------------------------------
   9. Cards / grids
   -------------------------------------------------------------------------- */
.grid {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 980px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1040px) { .grid--4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .grid--4 { grid-template-columns: 1fr; } }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }
/* display:block added because card__media is now sometimes an <a> tag
   (linking into project-detail.html / news-detail.html) instead of a
   <div> — anchors are inline by default, which would break the
   aspect-ratio sizing below. */
.card__media { display: block; aspect-ratio: 4/3; overflow: hidden; }
.card__media img, .card__media .img-placeholder { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 20px 22px 22px; flex: 1; display: flex; flex-direction: column; }
.card__body h3 { margin-bottom: 0.35em; }
.card__body p { font-size: var(--step--1); }
.card__meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 0.8rem; color: var(--ink-soft); margin-bottom: 0.7em; }
.card__meta span { display: inline-flex; align-items: center; gap: 4px; }
.card__foot { margin-top: auto; padding-top: 10px; }

.tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
}
.tag--current { background: var(--forest-050); color: var(--forest-700); }
.tag--past { background: #eef0f1; color: #565d63; }
.tag--upcoming { background: var(--gold-050); color: var(--gold-600); }
.tag--category { background: var(--red-050); color: var(--red-600); }

.document-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.document-card { box-shadow: var(--shadow-card); }
.document-card:hover { box-shadow: 0 12px 28px -12px rgba(34, 34, 34, 0.28); }
.document-card__icon {
  display: grid; place-items: center; width: 52px; height: 52px; margin: 22px 22px 0;
  border-radius: 12px; background: var(--red-050); color: var(--red-600);
}
.document-card__icon svg { width: 30px; height: 30px; }
.document-card h3 { font-size: var(--step-1); line-height: 1.2; }
.document-card .card__meta { margin-bottom: 0.9em; }
.document-card .card__body p { line-height: 1.65; }
.document-card__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.document-card__link { flex: 1 1 145px; justify-content: center; }
.document-card__link svg { width: 18px; height: 18px; }

/* Board / staff cards */
.person-card { text-align: center; padding: 26px 18px; cursor: pointer; }
.person-card .avatar {
  width: 116px; height: 116px; border-radius: 50%; margin: 0 auto 16px;
  overflow: hidden; border: 3px solid var(--bg-soft);
}
.person-card .avatar img, .person-card .avatar .img-placeholder { width: 100%; height: 100%; object-fit: cover; }
.person-card h3 { margin-bottom: 0.2em; font-size: 1.05rem; }
.person-card .role { color: var(--red-600); font-size: var(--step--1); font-weight: 500; }
.person-card .bio-hint { font-size: 0.78rem; color: var(--ink-soft); margin-top: 10px; opacity: 0.75; }

/* --------------------------------------------------------------------------
   10. Featured highlights (home)
   -------------------------------------------------------------------------- */
.section-head-row {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 2.2rem; flex-wrap: wrap;
}
.section-head-row .section-head { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   11. Tabs (Projects page)
   -------------------------------------------------------------------------- */
.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); margin-bottom: 2.4rem; flex-wrap: wrap; }
.tab-btn {
  background: transparent; border: none; padding: 12px 6px; margin-right: 22px;
  font-family: var(--font-display); font-weight: 600; color: var(--ink-soft);
  border-bottom: 3px solid transparent; transition: color var(--transition), border-color var(--transition);
}
.tab-btn:hover { color: var(--red-600); }
.tab-btn.is-active { color: var(--red-600); border-color: var(--red-600); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: fadein 260ms ease; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.read-more-text { display: none; }
.read-more-text.is-open { display: block; margin-top: 8px; }
.read-more-btn { align-self: flex-start; background: none; border: none; padding: 0; color: var(--red-600); font-weight: 600; font-family: var(--font-display); font-size: var(--step--1); }
.read-more-btn:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   12. Timeline (past projects / news alt view)
   -------------------------------------------------------------------------- */
.timeline { position: relative; padding-left: 26px; border-left: 2px solid var(--line); }
.timeline .card { margin-bottom: 28px; position: relative; }
.timeline .card::before {
  content: ""; position: absolute; left: -32.5px; top: 24px;
  width: 12px; height: 12px; border-radius: 50%; background: var(--red-500); border: 3px solid var(--white); box-shadow: 0 0 0 2px var(--line);
}

/* --------------------------------------------------------------------------
   13. News page
   -------------------------------------------------------------------------- */
.featured-post {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 34px; align-items: center;
  background: var(--bg-soft); border-radius: var(--radius-lg); padding: 28px; margin-bottom: 3rem;
}
@media (max-width: 780px) { .featured-post { grid-template-columns: 1fr; } }
.featured-post .img-placeholder, .featured-post img { border-radius: var(--radius-md); aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.post-date { color: var(--ink-soft); font-size: 0.82rem; }

/* --------------------------------------------------------------------------
   14. Forms
   -------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-family: var(--font-display); font-weight: 500; font-size: var(--step--1); }
.field .req { color: var(--red-600); }
.field input, .field textarea {
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; font: inherit; color: var(--ink); background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:focus, .field textarea:focus {
  border-color: var(--red-500); box-shadow: 0 0 0 4px var(--red-050); outline: none;
}
.field.has-error input, .field.has-error textarea { border-color: var(--red-600); }
.field .error-msg { display: none; color: var(--red-600); font-size: 0.78rem; }
.field.has-error .error-msg { display: block; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.form-status {
  display: none; padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: var(--step--1);
}
.form-status.is-success { display: block; background: var(--forest-050); color: var(--forest-700); }
.form-status.is-error { display: block; background: var(--red-050); color: var(--red-700); }

/* --------------------------------------------------------------------------
   15. Contact page layout
   -------------------------------------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 30px; align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.info-card, .form-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(24px, 3vw, 36px); box-shadow: var(--shadow-card);
}
.info-list { display: flex; flex-direction: column; gap: 20px; margin-top: 1.4rem; }
.info-list .item { display: flex; gap: 14px; }
.info-list .icon {
  width: 40px; height: 40px; border-radius: 50%; background: var(--red-050); color: var(--red-600);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.info-list .icon svg { width: 19px; height: 19px; }
.info-list h4 { margin: 0 0 2px; font-size: var(--step--1); font-family: var(--font-display); }
.info-list p { margin: 0; font-size: var(--step--1); }
.placeholder-text { color: var(--gold-600); font-style: italic; }
.social-row { display: flex; gap: 10px; margin-top: 1.6rem; }
.social-row a {
  width: 40px; height: 40px; border-radius: 50%; background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center; color: var(--red-600);
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.social-row a:hover { background: var(--red-600); color: var(--white); transform: translateY(-2px); }
.social-row svg { width: 18px; height: 18px; }

/* --------------------------------------------------------------------------
   16. CTA band
   -------------------------------------------------------------------------- */
.cta-band {
  background: linear-gradient(120deg, var(--forest-700), var(--forest-600));
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: clamp(32px, 5vw, 56px);
  display: flex; align-items: center; justify-content: space-between; gap: 26px; flex-wrap: wrap;
}
.cta-band h2 { color: var(--white); margin-bottom: 0.25em; }
.cta-band p { color: rgba(255,255,255,0.85); margin-bottom: 0; }

/* --------------------------------------------------------------------------
   17. Modal (staff bio)
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20,16,14,0.55); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; visibility: hidden; transition: opacity var(--transition), visibility var(--transition);
}
.modal-backdrop.is-open { opacity: 1; visibility: visible; }
.modal {
  background: var(--white); border-radius: var(--radius-lg); max-width: 460px; width: 100%;
  padding: 30px; position: relative; transform: translateY(12px); transition: transform var(--transition);
  max-height: 85vh; overflow-y: auto;
}
.modal-backdrop.is-open .modal { transform: translateY(0); }
.modal-close {
  position: absolute; top: 16px; right: 16px; background: var(--bg-soft); border: none;
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.modal .avatar { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; margin-bottom: 14px; }
.modal .avatar img, .modal .avatar .img-placeholder { width: 100%; height: 100%; object-fit: cover; }
.modal .role { color: var(--red-600); font-weight: 500; margin-bottom: 10px; display: block; }

/* --------------------------------------------------------------------------
   18. Image placeholder helper (used until real photos are added)
   -------------------------------------------------------------------------- */
.img-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: repeating-linear-gradient(135deg, #f1ede6, #f1ede6 10px, #e9e4da 10px, #e9e4da 20px);
  color: #9a8f7d; text-align: center; padding: 14px; min-height: 90px;
}
.img-placeholder svg { width: 26px; height: 26px; opacity: 0.7; }
.img-placeholder small { font-size: 0.68rem; line-height: 1.35; max-width: 22ch; }

/* Data-loading placeholders keep fetched content from changing the layout. */
.skeleton {
  display: block;
  background: linear-gradient(100deg, var(--bg-soft) 30%, #e6e8ea 45%, var(--bg-soft) 60%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-title { height: 1.8rem; width: 72%; }
.skeleton-text { height: 0.9rem; width: 100%; margin: 0.7rem 0; }
.skeleton-text:last-child { width: 68%; }
.skeleton-image { width: 100%; aspect-ratio: 4/3; }
.skeleton-badge { height: 1.45rem; width: 82px; }
.skeleton-document-icon { width: 30px; height: 30px; border-radius: 4px; }
.skeleton-card .card__body { display: flex; flex-direction: column; align-items: flex-start; }
.skeleton-card .skeleton-title { margin: 0.2rem 0 0.9rem; }
.skeleton-featured { display: grid; grid-template-columns: 1.1fr 1fr; gap: 34px; align-items: center; background: var(--bg-soft); border-radius: var(--radius-lg); padding: 28px; margin-bottom: 3rem; }
.skeleton-featured .skeleton-image { aspect-ratio: 4/3; }
.skeleton-detail-title { width: min(72%, 620px); height: clamp(2.2rem, 4vw, 3rem); }
.skeleton-detail-photo { width: 100%; aspect-ratio: 16/9; }
.skeleton-detail-body { max-width: 760px; }
@media (max-width: 780px) {
  .skeleton-featured { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   19. Footer
   -------------------------------------------------------------------------- */
.site-footer { background: #1b1b1b; color: #cfcfcf; }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 34px;
  padding-top: 56px; padding-bottom: 34px;
}
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.footer-brand .site-logo { width: 46px; height: 46px; }
.footer-brand strong { display: block; color: var(--white); font-family: var(--font-display); }
.site-footer h4 { color: var(--white); font-family: var(--font-display); font-size: var(--step--1); margin-bottom: 14px; }
.site-footer a { color: #b8b8b8; transition: color var(--transition); }
.site-footer a:hover { color: var(--gold-500); }
.site-footer li { margin-bottom: 9px; font-size: 0.9rem; }
.site-footer p { color: #a9a9a9; font-size: 0.88rem; }
.footer-social { display: flex; gap: 10px; margin-top: 14px; }
.footer-social a { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center; }
.footer-social svg { width: 15px; height: 15px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 18px; padding-bottom: 18px; font-size: 0.8rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* --------------------------------------------------------------------------
   20. Utilities
   -------------------------------------------------------------------------- */
.mt-0 { margin-top: 0; }
.text-center { text-align: center; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Article/Project detail page hero — tightened up.
   NOTE: this used to duplicate the vertical padding already set on
   ".page-hero .hero__inner" (line ~344) by ALSO padding ".page-hero"
   itself with !important, stacking two sets of top/bottom padding and
   leaving a large empty gap above the article image below. Fixed by
   overriding the inner element (the single source of truth for this
   hero's spacing) instead of both. */
header, nav, .site-header {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

main section:has(h1[data-d-title]) .hero__inner,
.project-detail-hero .hero__inner {
  max-width: 960px;
}

main section:has(h1[data-d-title]) .hero__inner,
.project-detail-hero .hero__inner {
  padding-top: 2rem !important;
  padding-bottom: 2.75rem !important;
}
.page-hero:has(.hero__terrain) .hero__inner {
  padding-top: 2rem !important;
  padding-bottom: clamp(2.75rem, 1.5rem + 5vw, 6rem) !important;
}
@media (min-width: 1024px) {
  main section:has(h1[data-d-title]) .hero__inner,
  .project-detail-hero .hero__inner {
    padding-top: 1.25rem !important;
    padding-bottom: 2.75rem !important;
  }
}

h1[data-d-title] {
  font-size: clamp(1.95rem, 1.3rem + 2.2vw, 3rem);
  max-width: 850px;          /* Wide enough for long titles to sit on 1–2 lines */
  margin-bottom: 0;
  line-height: 1.25;         /* Keeps spacing between lines compact */
  text-wrap: balance;        /* Keeps line lengths even */
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  h1[data-d-title] {
    font-size: 1.75rem;
    max-width: 90%;
    margin-top: 0;
  }
}

/* Hide breadcrumb navigation site-wide */
.breadcrumb,
.breadcrumbs,
nav[aria-label="breadcrumb"],
.hero-breadcrumb {
  display: none !important;
}

/* FORCE TEAM GRID LAYOUT AND CENTERING */
.team-section {
  padding: 40px 20px !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
}

.category-title {
  font-size: 1.75rem !important;
  color: var(--red-700) !important;
  text-align: center !important;
  margin: 45px 0 25px 0 !important;
  font-weight: bold !important;
}

.team-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
  gap: 35px 20px !important;
  justify-items: center !important;
  width: 100% !important;
  margin-bottom: 40px !important;
}

.team-card {
  text-align: center !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  width: 100% !important;
}

.team-card img {
  width: 130px !important;
  height: 130px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  margin-bottom: 12px !important;
  border: 3px solid #ffffff !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
  background-color: #f0f0f0 !important; /* Visual placeholder box for missing photos */
}

.team-card h3 {
  font-size: 1.05rem !important;
  margin: 6px 0 2px 0 !important;
  color: #1a1a1a !important;
}

.team-card p {
  font-size: 0.88rem !important;
  color: var(--red-700) !important;
  margin: 0 !important;
}

/* ==========================================================================
   21. Admin panel (master.html / admin.js)
   Reuses existing tokens/classes (.btn, .field, .card, .tag, .modal*) as
   much as possible so the CMS visually matches the rest of the site;
   this section only adds what didn't already exist (login screen, table
   layout for content lists, and a couple of small admin-only helpers).
   ========================================================================== */

.admin-body { background: var(--bg-soft); min-height: 100vh; }

/* Simple top bar — lighter than the public site's, since dropdown nav
   doesn't make sense inside the CMS. */
.admin-topbar {
  background: linear-gradient(180deg, var(--red-600), var(--red-700));
  color: var(--white);
  padding: 14px 0;
  display: flex;
  align-items: center;
  gap: 14px;
}
.admin-topbar .site-logo { width: 42px; height: 42px; }
.admin-topbar strong { font-family: var(--font-display); font-size: 1.05rem; }
.admin-topbar .spacer { flex: 1; }
.admin-topbar .admin-email { opacity: 0.85; font-size: var(--step--1); margin-right: 14px; }

/* --- Login screen --- */
.admin-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, var(--red-700), var(--red-500) 70%);
}
.admin-login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 44px);
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-pop);
  text-align: center;
}
.admin-login-card .site-logo { width: 64px; height: 64px; margin: 0 auto 14px; }
.admin-login-card h1 { font-size: 1.4rem; margin-bottom: 0.25em; }
.admin-login-card p.sub { color: var(--ink-soft); font-size: var(--step--1); margin-bottom: 1.6rem; }
.admin-login-card form { text-align: left; }
.password-input-wrap { position: relative; }
.password-input-wrap input { padding-right: 72px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--red-700);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px;
}
.password-toggle:hover { text-decoration: underline; }

/* --- Dashboard shell --- */
.admin-main { max-width: 1080px; margin: 0 auto; padding: 32px 24px 80px; }
.admin-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 1.4rem; flex-wrap: wrap; }
.admin-section-head h2 { margin: 0; }

/* --- Content list (projects/news/messages) --- */
.admin-list { display: flex; flex-direction: column; gap: 12px; }
.admin-list-group-heading { margin: 12px 0 0; font-size: 0.95rem; color: var(--ink-soft); }
.admin-row {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.admin-row__thumb {
  width: 64px; height: 64px; border-radius: 10px; overflow: hidden; flex-shrink: 0; background: var(--bg-soft);
}
.admin-row__thumb img, .admin-row__thumb .img-placeholder { width: 100%; height: 100%; object-fit: cover; }
.admin-row__body { flex: 1; min-width: 0; }
.admin-row__body h4 { margin: 0 0 4px; font-family: var(--font-display); font-size: 0.98rem; }
.admin-row__meta { font-size: 0.8rem; color: var(--ink-soft); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.admin-row__actions { display: flex; gap: 8px; flex-shrink: 0; }
.admin-row__actions button {
  border: none; background: var(--bg-soft); color: var(--ink); padding: 7px 14px;
  border-radius: 999px; font-family: var(--font-display); font-size: 0.8rem; font-weight: 600;
  transition: background var(--transition), color var(--transition);
}
.admin-row__actions button:hover { background: var(--red-050); color: var(--red-600); }
.admin-row__actions button.danger:hover { background: var(--red-050); color: var(--red-700); }
.admin-row__actions button.move-btn { padding-left: 9px; padding-right: 9px; }
.admin-row__actions button:disabled { opacity: 0.35; cursor: not-allowed; }
.admin-row__actions button:disabled:hover { background: var(--bg-soft); color: var(--ink); }

.admin-empty { color: var(--ink-soft); text-align: center; padding: 40px 20px; }

/* --- Add/Edit form modal (reuses .modal-backdrop / .modal) --- */
.admin-modal .modal { max-width: 640px; text-align: left; }
.admin-modal .modal h3 { margin-bottom: 1.2rem; }
.admin-modal .field textarea { resize: vertical; min-height: 90px; }
.admin-form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 1.4rem; }
.admin-image-preview {
  width: 100%; aspect-ratio: 16/9; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--bg-soft); margin-bottom: 10px; display: flex; align-items: center; justify-content: center;
}
.admin-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.admin-image-preview span { color: var(--ink-soft); font-size: 0.8rem; }

/* --- Tabs reused from public site's .tabs/.tab-btn, small admin tweak --- */
.admin-tabs { margin-bottom: 1.6rem; }

/* --- Toast-style status banner (reuses .form-status) --- */
.admin-toast { position: fixed; bottom: 24px; right: 24px; z-index: 300; max-width: 340px; }

@media (max-width: 620px) {
  .admin-row { flex-wrap: wrap; }
  .admin-row__actions { width: 100%; justify-content: flex-end; }
}

/* ==========================================================================
   22. Video embeds (YouTube / Facebook) on project-detail.html / news-detail.html
   Responsive 16:9 wrapper so the iframe scales with the page instead of
   forcing a fixed pixel width that overflows on mobile.
   ========================================================================== */
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.content-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 1.5rem 0;
}
.content-gallery figure, .content-gallery img { margin: 0; width: 100%; }
.content-gallery img { aspect-ratio: 4 / 3; object-fit: contain; background: var(--bg-soft); border-radius: var(--radius-md); }
.content-video { margin: 1.5rem 0; }
.content-video .video-embed { max-width: 900px; }
.video-embed-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.video-embed-list .video-embed { min-width: 0; }
.content-video .video-fallback { display: block; padding: 1.2rem; background: var(--red-050); color: var(--red-700); border-radius: var(--radius-md); }
[data-d-body] figure { margin: 1.5rem 0; }
[data-d-body] figure img { max-height: 620px; width: 100%; object-fit: contain; background: var(--bg-soft); border-radius: var(--radius-md); }
[data-d-body] figcaption { color: var(--ink-soft); font-size: var(--step--1); margin-top: .4rem; }
.media-missing { min-height: 140px; }
.admin-content-editor { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 1rem; margin: 1rem 0; }
.message-detail { display: grid; grid-template-columns: 90px 1fr; gap: 10px 16px; margin: 1rem 0 1.4rem; }
.message-detail dt { font-weight: 600; color: var(--ink-soft); }
.message-detail dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-content-editor legend { font-family: var(--font-display); font-weight: 600; padding: 0 .4rem; }
.field-help { font-size: var(--step--1); }

/* Small live preview shown under the "Related video" field in master.html
   while typing a URL, so staff get instant feedback before saving. */
.admin-video-preview:not(:empty) { margin-top: 10px; }
.admin-video-preview .video-embed { max-width: 360px; }

/* --------------------------------------------------------------------------
   Content Block Editor (admin panel)
   Each block is a card: a small header (type badge + move/delete) and a
   type-specific body built by admin.js's BLOCK_BUILDERS.
   -------------------------------------------------------------------------- */
.content-block-row {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  margin: 12px 0;
  overflow: hidden;
}
.block-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}
.block-type-badge {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step--1);
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.block-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.block-actions button {
  width: 30px; height: 30px; padding: 0;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--white); cursor: pointer; font-size: 0.95rem; line-height: 1;
}
.block-actions button:hover { background: var(--bg-soft); }
.block-actions button.danger { color: var(--red-600); border-color: var(--red-050); }
.block-row-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.block-row-body input[type="text"],
.block-row-body textarea,
.block-row-body select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
}
.block-field-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.block-field-row label { display: flex; align-items: center; gap: 6px; font-size: var(--step--1); color: var(--ink-soft); }
.block-field-row select { width: auto; }
.block-checkbox-label { display: flex; align-items: center; gap: 8px; font-size: var(--step--1); }
.block-checkbox-label input { width: auto; }
.block-upload-status { margin: 0; font-size: var(--step--1); color: var(--ink-soft); min-height: 1em; }
.block-static-preview { padding: 8px 0; }
.admin-divider-preview { border: none; height: 3px; background: var(--red-600); border-radius: 2px; margin: 0; position: relative; opacity: 0.85; }

.block-add-toolbar { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.block-add-toolbar select.block-add-type { width: auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; }

/* Image block */
.block-image-preview {
  width: 100%; max-width: 320px; min-height: 100px;
  border: 1px dashed var(--line); border-radius: var(--radius-sm);
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: var(--bg-soft);
}
.block-image-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.block-image-empty { color: var(--ink-soft); font-size: var(--step--1); padding: 20px; text-align: center; }
.btn-sm { padding: 6px 12px; font-size: var(--step--1); }

/* Gallery block */
.block-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.block-gallery-cell {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-soft);
}
.block-gallery-cell img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.block-gallery-cell .cell-caption {
  width: 100%; border: none; border-top: 1px solid var(--line);
  padding: 6px 8px; font-size: 0.78rem; border-radius: 0;
}
.block-gallery-cell .cell-remove {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; padding: 0;
  border-radius: 50%; border: none; background: rgba(0,0,0,0.55); color: var(--white);
  cursor: pointer; line-height: 1; font-size: 0.9rem;
}
.block-gallery-cell .cell-remove:hover { background: var(--red-600); }

/* Rich text (Paragraph) editor */
.rte-toolbar {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  padding: 6px; border: 1px solid var(--line); border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--bg-soft);
}
.rte-toolbar button {
  width: 30px; height: 30px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; cursor: pointer; font-size: 0.85rem;
}
.rte-toolbar button:hover { background: var(--white); border-color: var(--line); }
.rte-toolbar button.is-active {
  background: var(--gold-500);
  border-color: var(--gold-500);
  color: var(--white);
}
.rte-toolbar button.is-active:hover { background: var(--gold-500); }
.rte-toolbar select {
  width: auto; padding: 5px 6px; font-size: 0.78rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white);
}
.rte-editor {
  min-height: 140px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font: inherit;
  line-height: 1.6;
}
.rte-editor:focus { outline: 2px solid var(--gold-500); outline-offset: -2px; }
.rte-editor p { margin: 0 0 0.8em; }
.rte-editor ul, .rte-editor ol { margin: 0 0 0.8em 1.3em; }

/* --------------------------------------------------------------------------
   Article / Detail Page Styles
   Professional content presentation for project-detail.html and news-detail.html
   -------------------------------------------------------------------------- */

/* Article layout container — narrower than normal for readability */
.article-section { padding-top: 0; padding-bottom: clamp(32px, 4vw, 56px); }
.article-container {
  max-width: 960px;
  margin: 0 auto;
}

/* On large screens, let photos, galleries, and video widen beyond the text
   column — the text stays a comfortable reading width while media gets
   more room to breathe, rather than being squeezed into the same narrow
   column as the paragraphs. Gated to a wide min-width so the breakout
   never exceeds the page's own container and never causes horizontal
   scroll on laptop-and-smaller screens. */
@media (min-width: 1280px) {
  .article-body .article-figure,
  .article-body .article-gallery,
  .article-videos {
    margin-left: -12%;
    margin-right: -12%;
    width: 124%;
    max-width: 124%;
  }
}

/* Hero image — professional NGO/news look: a modest, nearly-square corner
   radius rather than a heavily-rounded card, tighter surrounding
   whitespace, and a fixed-ish aspect ratio so the image reads as a
   photograph, not a decorative blob. */
.article-hero-image {
  margin: 1.5rem 0 2rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  max-height: 460px;
}
.article-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 16/9;
  display: block;
}

/* Meta bar — category tag, date, author */
.article-meta-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 1.6rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
}
.article-meta-date {
  font-size: var(--step--1);
  color: var(--ink-soft);
  font-weight: 500;
}
.article-meta-author {
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.article-meta-author { margin-left: auto; }
@media (max-width: 480px) { .article-meta-author { margin-left: 0; } }

/* Article body — the main readable content area */
.article-body {
  font-family: "Lora", "Georgia", serif;
  font-size: clamp(1rem, 0.9rem + 0.4vw, 1.125rem);
  line-height: 1.85;
  color: #2d2d2d;
}

/* Headings within article body */
.article-body .article-heading {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 2.2rem 0 0.8rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
  overflow-wrap: break-word;
}
.article-body .article-heading--h2 {
  font-size: clamp(1.5rem, 1.35rem + 0.6vw, 1.75rem);
  font-weight: 700;
  padding-top: 0.5rem;
  border-top: 3px solid var(--red-600);
  display: inline-block;
  padding-right: 0;
  border-top-width: 0;
  position: relative;
}
.article-body .article-heading--h1 {
  font-size: clamp(2.1rem, 1.95rem + 0.5vw, 2.25rem);
  font-weight: 800;
  line-height: 1.2;
  padding-top: 0.5rem;
  display: inline-block;
  position: relative;
}
.article-body .article-heading--h5 {
  font-size: clamp(2.5rem, 2.3rem + 0.7vw, 2.85rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--ink);
  letter-spacing: -0.015em;
}
.article-body .article-heading--h1::before {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  background: var(--red-600);
  margin-bottom: 0.6rem;
  border-radius: 2px;
}
.article-body .article-heading--h2::before {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  background: var(--red-600);
  margin-bottom: 0.6rem;
  border-radius: 2px;
}
.article-body .article-heading--h3 {
  font-size: clamp(1.25rem, 1.15rem + 0.4vw, 1.4rem);
  font-weight: 600;
  color: var(--forest-600);
}
.article-body .article-heading--h4 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Heading alignment (set per-block in the admin editor). H2 needs special
   handling because it's display:inline-block (so its accent bar hugs the
   text) — centering/right-aligning it means switching it to a full-width
   block and centering/shifting the bar along with it. H3/H4 are already
   block-level, so text-align alone is enough. */
.article-body .article-heading--center { text-align: center; }
.article-body .article-heading--right { text-align: right; }
.article-body .article-heading--h1.article-heading--center,
.article-body .article-heading--h1.article-heading--right,
.article-body .article-heading--h2.article-heading--center,
.article-body .article-heading--h2.article-heading--right {
  display: block;
}
.article-body .article-heading--h1.article-heading--center::before,
.article-body .article-heading--h2.article-heading--center::before {
  margin-left: auto;
  margin-right: auto;
}
.article-body .article-heading--h1.article-heading--right::before,
.article-body .article-heading--h2.article-heading--right::before {
  margin-left: auto;
  margin-right: 0;
}

/* Paragraphs within article body */
.article-body .article-paragraph {
  margin: 0 0 1.4em;
  max-width: none;
  color: #3a3a3a;
}
.article-body .article-paragraph:first-child {
  font-size: 1.08em;
  color: #2a2a2a;
}
/* A Paragraph block can itself contain rich-text markup (from the admin's
   formatting toolbar) — headings, lists, links — so give those the same
   treatment they get elsewhere in the article body. */
.article-body p,
.article-body .article-paragraph p,
.article-body .article-paragraph > div,
.article-body .article-paragraph ul,
.article-body .article-paragraph ol,
.article-body .article-paragraph li,
.article-body .article-quote p {
  max-width: none;
  width: 100%;
  hyphens: none;
  -webkit-hyphens: none;
  word-break: normal;
  overflow-wrap: normal;
  line-break: auto;
  text-wrap: pretty;
}
.article-body .article-paragraph p,
.article-body .article-paragraph > div {
  margin: 0 0 1.4em;
  text-align: justify;
  text-justify: inter-word;
}
.article-body .article-paragraph p:last-child { margin-bottom: 0; }
.article-body .article-paragraph h2,
.article-body .article-paragraph h3,
.article-body .article-paragraph h4 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 1.4rem 0 0.7rem;
  line-height: 1.3;
}
.article-body .article-paragraph ul,
.article-body .article-paragraph ol {
  margin: 0 0 1.2em 1.3em;
  padding: 0;
}
.article-body .article-paragraph li { margin-bottom: 0.4em; }
.article-body .article-paragraph a {
  color: var(--red-600);
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

/* Blockquotes */
.article-body .article-quote {
  margin: 2rem 0;
  padding: 1.2rem 1.8rem;
  border-left: 5px solid var(--gold-500);
  background: var(--gold-050);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  font-size: 1.05em;
  color: var(--ink);
  max-width: none;
}

/* Lists */
.article-body .article-list {
  margin: 0.8rem 0 1.6rem 0;
  padding-left: 0;
  list-style: none;
}
.article-body .article-list li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.55rem;
  color: #3a3a3a;
  line-height: 1.7;
}
.article-body .article-list:not(.article-list--ordered) li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red-600);
}
.article-body .article-list--ordered {
  counter-reset: ol-counter;
}
.article-body .article-list--ordered li {
  counter-increment: ol-counter;
}
.article-body .article-list--ordered li::before {
  content: counter(ol-counter) ".";
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 600;
  color: var(--red-600);
  font-family: var(--font-display);
  font-size: 0.9em;
}

/* Divider — a professional, understated rule with a small centered accent
   rather than a plain flat line. */
.article-body .article-divider {
  border: none;
  height: 3px;
  background: var(--line);
  margin: 2.75rem auto;
  max-width: 100%;
  position: relative;
  border-radius: 2px;
}
.article-body .article-divider::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -3px;
  transform: translateX(-50%);
  width: 56px;
  height: 9px;
  border-radius: 5px;
  background: var(--red-600);
}

/* Images and figures — subtle, nearly-square corners rather than a
   heavily rounded card, matching the hero image treatment. */
.article-body .article-figure,
.article-body .article-image {
  margin: 2rem 0;
}
.article-body .article-figure img,
.article-body .article-image img {
  width: 100%;
  border-radius: var(--radius-sm);
  display: block;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.article-body figcaption {
  margin-top: 0.5rem;
  font-size: var(--step--1);
  color: var(--ink-soft);
  text-align: center;
  font-style: italic;
  font-family: var(--font-body);
}

/* Gallery grid (legacy fallback for a single image / no-JS) */
.article-body .article-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin: 2rem 0;
}
.article-body .article-gallery figure,
.article-gallery-single {
  margin: 0;
}
.article-body .article-gallery img,
.article-gallery-single img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
}

/* --------------------------------------------------------------------------
   Gallery carousel/slider (public article page)
   -------------------------------------------------------------------------- */
.article-gallery-carousel {
  position: relative;
  margin: 2rem 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-soft);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.gallery-track {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  touch-action: pan-y;
}
.gallery-slide {
  flex: 0 0 100%;
  max-width: 100%;
}
.gallery-slide img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}
.gallery-slide-caption {
  margin: 0;
  padding: 0.7rem 1rem;
  font-size: var(--step--1);
  color: var(--ink-soft);
  font-style: italic;
  background: var(--white);
  text-align: center;
}
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.45);
  color: var(--white);
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition);
}
.gallery-arrow:hover { background: rgba(0,0,0,0.7); }
.gallery-arrow--prev { left: 12px; }
.gallery-arrow--next { right: 12px; }
.gallery-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  padding: 4px 8px;
}
.gallery-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.6);
  cursor: pointer;
  padding: 0;
}
.gallery-dot.is-active { background: var(--white); }
@media (max-width: 600px) {
  .gallery-arrow { width: 34px; height: 34px; font-size: 1.25rem; }
}

/* --------------------------------------------------------------------------
   Quote block — professional pull-quote styling with attribution
   -------------------------------------------------------------------------- */
.article-body .article-quote {
  margin: 2.25rem 0;
  padding: 1.4rem 1.8rem;
  border-left: 4px solid var(--gold-500);
  background: var(--gold-050);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  max-width: none;
}
.article-body .article-quote__text {
  margin: 0;
  font-style: italic;
  font-size: 1.08em;
  color: var(--ink);
  line-height: 1.7;
}
.article-body .article-quote__author {
  display: block;
  margin-top: 0.6rem;
  font-style: normal;
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--ink-soft);
}
.article-body .article-quote__author::before { content: "— "; }

/* --------------------------------------------------------------------------
   Spacer block
   -------------------------------------------------------------------------- */
.article-spacer { width: 100%; }
.article-spacer--small { height: 1rem; }
.article-spacer--medium { height: 2.5rem; }
.article-spacer--large { height: 5rem; }

/* Videos */
.article-body .article-video,
.article-videos {
  margin: 2rem 0;
}
.article-videos__heading {
  margin-bottom: 1rem;
  color: var(--ink);
}
.video-embed {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #000;
}
.video-embed iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-embed-list { display: flex; flex-direction: column; gap: 1.5rem; }
.video-fallback {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: var(--red-050);
  color: var(--red-600);
  border-radius: var(--radius-sm);
  font-weight: 500;
  text-decoration: none;
}
.video-fallback:hover { background: var(--red-600); color: var(--white); }

/* Missing media fallback */
.media-missing {
  display: block;
  width: 100%;
  min-height: 180px;
  background: var(--bg-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
}

/* Back link and bottom actions */
.article-back-link {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

/* --------------------------------------------------------------------------
   SEO admin fields (project/news forms) - improved labeling
   -------------------------------------------------------------------------- */
.admin-seo-section {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 12px;
}
.admin-seo-section legend,
.admin-seo-section .seo-label {
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  display: block;
}
.seo-char-count {
  font-size: 0.75rem;
  color: var(--ink-soft);
  float: right;
}
.seo-panel-group { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.seo-panel-group:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.seo-panel-group h4, .seo-panel-collapsible summary {
  margin: 0 0 10px; font-family: var(--font-display); font-size: var(--step--1); font-weight: 700;
  color: var(--ink); text-transform: uppercase; letter-spacing: 0.05em;
}
.seo-search-preview {
  background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(34, 34, 34, 0.05);
}
.seo-preview-title { color: #1a0dab; font-size: 1.05rem; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seo-preview-url { color: #188038; font-size: 0.78rem; margin: 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seo-preview-description { color: var(--ink-soft); font-size: 0.82rem; line-height: 1.5; }
.seo-checklist { display: grid; gap: 6px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.seo-check { display: flex; align-items: flex-start; gap: 8px; color: var(--ink-soft); font-size: 0.8rem; line-height: 1.4; }
.seo-check span { width: 1.1em; flex: 0 0 1.1em; font-weight: 700; color: var(--red-600); }
.seo-check[data-valid="true"] span { color: var(--forest-700); }
.seo-panel-collapsible { padding-bottom: 2px; }
.seo-panel-collapsible summary { cursor: pointer; list-style: none; }
.seo-panel-collapsible summary::-webkit-details-marker { display: none; }
.seo-panel-collapsible summary::after { content: "+"; float: right; font-size: 1rem; }
.seo-panel-collapsible[open] summary::after { content: "−"; }

/* --------------------------------------------------------------------------
   Admin message detail modal improvements
   -------------------------------------------------------------------------- */
.message-detail { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin-bottom: 1.2rem; }
.message-detail dt { font-weight: 600; color: var(--ink); white-space: nowrap; font-size: var(--step--1); }
.message-detail dd { margin: 0; color: var(--ink-soft); font-size: var(--step--1); word-break: break-word; }
.message-reply-form { margin-top: 1.2rem; border-top: 1px solid var(--line); padding-top: 1.2rem; }
.message-reply-form h4 { margin-bottom: 0.8rem; }

/* post-date used in news cards and detail pages */
.post-date { font-size: var(--step--1); color: var(--ink-soft); margin: 0; }