/* D'Key Civic – polish layer (v6.6)
   Purpose: reduce nav clutter, stabilise header controls, improve dark mode consistency,
   improve keyboard accessibility (skip-link), and keep changes "beard-safe".
*/

/* --- Theme variable overrides (works with existing inline CSS variables) --- */
:root{
  --bg-top: #fcf7ee;
  --header-bg: rgba(247, 242, 233, 0.95);
  --header-border: rgba(0, 0, 0, 0.05);
  --footer-bg: rgba(248,242,232,0.9);
  --focus-ring: rgba(194,155,64,0.55);
}

body.dark{
  --bg: #0f0f10;
  --bg-top: #1b1b1c;
  --text: #f2f2f2;
  --muted: rgba(242,242,242,0.72);
  --card-bg: rgba(22,22,24,0.98);
  --border-soft: rgba(255,255,255,0.10);
  --shadow-soft: 0 10px 30px rgba(0,0,0,0.45);
  --header-bg: rgba(18,18,20,0.92);
  --header-border: rgba(255,255,255,0.08);
  --footer-bg: rgba(18,18,20,0.92);
}

html[data-theme="dark"]{
  --bg: #0f0f10;
  --bg-top: #1b1b1c;
  --text: #f2f2f2;
  --muted: rgba(242,242,242,0.72);
  --card-bg: rgba(22,22,24,0.98);
  --border-soft: rgba(255,255,255,0.10);
  --shadow-soft: 0 10px 30px rgba(0,0,0,0.45);
  --header-bg: rgba(18,18,20,0.92);
  --header-border: rgba(255,255,255,0.08);
  --footer-bg: rgba(18,18,20,0.92);
}

body{
  background: radial-gradient(circle at top left, var(--bg-top), var(--bg)) !important;
  color: var(--text) !important;
}

/* -------------------------------------------------
   Ask Nello (Civic Help Desk) – floating widget
   Source-only, no API, no storage.
------------------------------------------------- */
.asknello-btn{
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: linear-gradient(135deg, var(--accent), #a87f2c);
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: 0 10px 26px rgba(0,0,0,0.22);
  cursor: pointer;
}
.asknello-btn:focus{
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}
.asknello-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 0 0 4px rgba(255,255,255,0.15);
}

.asknello-modal{
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
}
.asknello-modal.open{ display: block; }

.asknello-overlay{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
}

.asknello-panel{
  position: absolute;
  right: 16px;
  bottom: 72px;
  width: min(520px, calc(100vw - 32px));
  max-height: min(72vh, 640px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  background: var(--card-bg);
  color: var(--text);
  box-shadow: 0 18px 48px rgba(0,0,0,0.30);
  overflow: hidden;
}

.asknello-head{
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(135deg, rgba(194,155,64,0.12), rgba(229,201,130,0.10));
}
.asknello-title{
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.asknello-title strong{ font-size: 0.98rem; }
.asknello-title span{ font-size: 0.82rem; color: var(--muted); }

.asknello-close{
  border: 1px solid var(--border-soft);
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
}
.asknello-close:hover{ transform: translateY(-1px); }

.asknello-body{ padding: 12px 14px; overflow: auto; }

.asknello-row{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}
.asknello-input{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: rgba(255,255,255,0.75);
  color: var(--text);
}
body.dark .asknello-input{ background: rgba(255,255,255,0.06); }

.asknello-send{
  padding: 10px 12px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--accent), #a87f2c);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.asknello-chips{ margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.asknello-chip{
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: transparent;
  color: var(--text);
  padding: 6px 10px;
  font-size: 0.85rem;
  cursor: pointer;
}
.asknello-chip:hover{ border-color: rgba(194,155,64,0.6); }

.asknello-note{
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--muted);
}
.asknello-note a{ text-decoration: underline; text-underline-offset: 3px; }

.asknello-results{ margin-top: 12px; display: grid; gap: 10px; }
.asknello-card{
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: rgba(255,255,255,0.72);
}
body.dark .asknello-card{ background: rgba(255,255,255,0.05); }
.asknello-card h4{ margin: 0 0 6px; font-size: 0.95rem; }
.asknello-card p{ margin: 0 0 8px; color: var(--muted); }
.asknello-card a{ text-decoration: underline; text-underline-offset: 3px; }


/* Ask Nello feedback */
.asknello-feedback{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Ask Nello TTS */
.asknello-tts{ margin-top: 10px; }
.asknello-tts-row{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.asknello-tts-btn{
  appearance:none; border:1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.25);
  color: inherit; padding: 6px 10px; border-radius: 10px;
  font-size: 13px; cursor:pointer;
}
.asknello-tts-btn:hover{ background: rgba(0,0,0,0.35); }
.asknello-tts-btn:disabled{ opacity:0.6; cursor:not-allowed; }
.asknello-tts-status{ font-size: 12px; opacity:0.85; }

/* Ask Nello – Voice settings (optional) */
.asknello-voice{
  margin-top: 10px;
  border: 1px dashed var(--border-soft);
  border-radius: 14px;
  padding: 8px 10px;
  background: rgba(0,0,0,0.14);
}
.asknello-voice summary{
  cursor: pointer;
  font-weight: 800;
}
.asknello-voice-grid{
  margin-top: 8px;
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 8px 10px;
  font-size: 13px;
}
.asknello-voice-inline{
  display:flex;
  align-items:center;
  gap:10px;
}
.asknello-voice-select{
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: var(--card-bg);
  color: var(--text);
}
.asknello-voice-rate,
.asknello-voice-pitch{
  width: 100%;
}
.asknello-voice-actions{
  grid-column: 1 / -1;
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.asknello-voice-badge{
  display:inline-flex;
  align-items:center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(194,155,64,0.45);
  background: rgba(194,155,64,0.12);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.asknello-voice-badge.is-active{
  background: rgba(194,155,64,0.18);
  box-shadow: 0 0 0 1px rgba(194,155,64,0.12) inset;
}
.asknello-voice-use-piper,
.asknello-voice-use-device,
.asknello-voice-test{
  appearance:none;
  border:1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.25);
  color: inherit;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 13px;
  cursor:pointer;
}
.asknello-voice-use-piper:hover:not(:disabled),
.asknello-voice-use-device:hover:not(:disabled),
.asknello-voice-test:hover{ background: rgba(0,0,0,0.35); }
.asknello-voice-use-piper:disabled,
.asknello-voice-use-device:disabled{ opacity:0.58; cursor:not-allowed; }
.asknello-voice-hint{ font-size:12px; opacity:0.88; }
.asknello-voice-note,
.asknello-voice-mobile-note{
  grid-column: 1 / -1;
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(194,155,64,0.30);
  background: rgba(194,155,64,0.08);
}
.asknello-voice-note-pill{
  display:inline-flex;
  align-items:center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(194,155,64,0.16);
  border: 1px solid rgba(194,155,64,0.30);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.02em;
}
.asknello-voice-note-text{
  font-size: 12px;
  opacity: 0.94;
}
.asknello-voice-note-dismiss{
  appearance:none;
  border:1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.20);
  color: inherit;
  padding: 5px 9px;
  border-radius: 10px;
  font-size: 12px;
  cursor:pointer;
  margin-left:auto;
}
.asknello-voice-note-dismiss:hover{ background: rgba(0,0,0,0.30); }
.asknello-voice-tip{
  grid-column: 1 / -1;
  font-size: 12px;
  opacity: 0.84;
}
.asknello-fb-row{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.asknello-fb-label{
  font-size: 0.82rem;
  color: var(--muted);
  margin-right: 2px;
}
.asknello-fb-btn{
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: transparent;
  color: var(--text);
  padding: 6px 10px;
  font-size: 0.82rem;
  cursor: pointer;
}
.asknello-fb-btn:hover{
  border-color: rgba(194,155,64,0.6);
}
.asknello-fb-reasons{
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.asknello-fb-status{
  font-size: 0.82rem;
  color: var(--muted);
}


@media (max-width: 520px){
  .asknello-panel{ right: 10px; bottom: 68px; width: calc(100vw - 20px); }
  .asknello-btn{ right: 10px; bottom: 10px; }
}

header{
  background: var(--header-bg) !important;
  border-bottom: 1px solid var(--header-border) !important;
}

footer{
  background: var(--footer-bg) !important;
  border-top: 1px solid var(--header-border) !important;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible{
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 10px;
}

/* --- Skip to content --- */
.skip-link{
  position: absolute;
  left: -999px;
  top: 0.75rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  color: var(--text);
  z-index: 1000;
}
.skip-link:focus{
  left: 1rem;
}

/* --- Header layout: prevent toggle overlap/drift --- */
.nav{
  display: grid !important;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "brand actions"
    "links links";
  align-items: center;
  gap: 0.65rem 1rem;
}

.brand{ grid-area: brand; min-width: 0; }
.nav-actions{
  grid-area: actions;
  margin-left: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.nav-links{
  grid-area: links;
  align-items: center;
  gap: 0.75rem !important;
}

.nav-links a,
.nav-more > summary{
  position: relative;
  padding: 0.35rem 0.15rem;
  line-height: 1.1;
}

/* Make “More” behave like a nav link (underline accent) */
.nav-more > summary{
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.nav-more > summary::-webkit-details-marker{ display: none; }

.nav-more > summary::after{
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  border-radius: 999px;
  transition: width 0.18s ease-out;
}
.nav-more:hover > summary::after,
.nav-more[open] > summary::after{
  width: 100%;
}

/* --- “More” panel --- */
.nav-more{
  position: relative;
}

.nav-more-panel{
  position: absolute;
  right: 0;
  top: calc(100% + 0.6rem);
  /* Keep the panel inside the viewport (prevents the left-most column from being pushed off-screen) */
  width: min(760px, calc(100vw - 1.25rem));
  max-width: calc(100vw - 1.25rem);
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 0.95rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  z-index: 90;
}

.nav-col-title{
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin: 0 0 0.35rem 0;
}

.nav-col a{
  display: block;
  padding: 0.35rem 0.45rem;
  border-radius: 10px;
}
.nav-col a:hover{
  background: rgba(194,155,64,0.10);
}

@media (max-width: 980px){
  .nav-more-panel{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* On small screens, keep dropdown panel inside the flow so it doesn't render off-screen */
@media (max-width: 900px){
  .nav{
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand actions"
      "links links";
  }

  .nav-more-panel{
    position: static;
    min-width: 0;
    margin-top: 0.6rem;
  }

  .nav-links{
    gap: 0.55rem !important;
  }
}

/* --- Images: slightly smoother render on modern browsers --- */
img{
  image-rendering: auto;
}


/* --- Dark mode hardcoded-colour rescue (many pages have fixed light backgrounds) --- */
body.dark p,
body.dark li,
body.dark label,
body.dark small{
  color: rgba(242,242,242,0.84) !important;
}

body.dark h1,
body.dark h2,
body.dark h3{
  color: var(--accent-soft) !important;
}

body.dark .section,
body.dark .intro-box,
body.dark .intro,
body.dark .help-box,
body.dark .volunteer-box,
body.dark .cta-box,
body.dark .event-box,
body.dark .location-box,
body.dark .metric-box,
body.dark .partner-box,
body.dark .skill-box,
body.dark .space-box,
body.dark .story-box,
body.dark .workshop-box,
body.dark .form-card,
body.dark .card,
body.dark .team-card,
body.dark .partner-card,
body.dark .story-card,
body.dark .impact-card,
body.dark .resource-card{
  background: rgba(22,22,24,0.98) !important;
  border-color: rgba(255,255,255,0.10) !important;
}

body.dark input,
body.dark textarea,
body.dark select{
  background: rgba(18,18,20,0.85) !important;
  color: var(--text) !important;
  border-color: rgba(255,255,255,0.12) !important;
}

body.dark a:hover{
  background: rgba(194,155,64,0.10);
}

/* --- Gallery captions (fix: dark mode text blending on light caption bg) --- */
.gallery-caption{
  background: rgba(0,0,0,0.02) !important;
  color: var(--muted) !important;
  border-top: 1px solid var(--border-soft);
}

body.dark .gallery-caption{
  background: rgba(255,255,255,0.05) !important;
  color: rgba(242,242,242,0.86) !important;
}

/* --- Pills/labels that were hard-coded for light mode --- */
body.dark .event-pill{
  background: rgba(255,255,255,0.08) !important;
  border-color: rgba(255,255,255,0.14) !important;
  color: rgba(242,242,242,0.92) !important;
}


/* -------------------------------------------------
   CIVIC PULSE (public-safe “smart system” widget)
------------------------------------------------- */
.civic-pulse{
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(0,0,0,0.12);
  box-shadow: 0 14px 38px rgba(0,0,0,0.12);
  cursor: pointer;
  user-select: none;
}
body.dark .civic-pulse{
  background: rgba(18,18,20,0.90);
  border-color: rgba(255,255,255,0.14);
  box-shadow: 0 14px 38px rgba(0,0,0,0.48);
}
.civic-pulse .dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(194,155,64,0.22);
}
body.dark .civic-pulse .dot{
  box-shadow: 0 0 0 4px rgba(194,155,64,0.18);
}
.civic-pulse .meta{
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.civic-pulse .meta strong{ font-size: 13px; }
.civic-pulse .meta span{ font-size: 12px; opacity: 0.75; }

.civic-pulse-modal{
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,0.55);
}
.civic-pulse-modal.open{ display: flex; }

.civic-pulse-card{
  width: min(560px, 100%);
  border-radius: 18px;
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  box-shadow: 0 24px 70px rgba(0,0,0,0.22);
  overflow: hidden;
}
body.dark .civic-pulse-card{
  background: rgba(18,18,20,0.92);
  border-color: rgba(255,255,255,0.12);
}
.civic-pulse-card header{
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-soft);
}
body.dark .civic-pulse-card header{
  border-bottom-color: rgba(255,255,255,0.12);
}
.civic-pulse-card header .title{
  display: flex;
  align-items: center;
  gap: 10px;
}
.civic-pulse-card header .close{
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 12px;
}
.civic-pulse-card header .close:hover{
  background: rgba(194,155,64,0.10);
}
.civic-pulse-card .body{ padding: 14px 16px; }
.civic-pulse-card .body p{ margin: 0 0 10px; }

.civic-pulse-links{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.civic-pulse-links a{
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.12);
  font-weight: 700;
  font-size: 13px;
}
body.dark .civic-pulse-links a{
  border-color: rgba(255,255,255,0.14);
}


/* --- Theme & Typography Fix (v3.5) --- */
:root{
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

html{ -webkit-text-size-adjust: 100%; }
body{
  font-family: var(--font-sans) !important;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:where(button,input,select,textarea){
  font-family: inherit !important;
  color: inherit;
}
:where(input,select,textarea){
  background: rgba(255,255,255,0.70);
  border: 1px solid var(--border-soft);
}
body.dark :where(input,select,textarea),
html[data-theme="dark"] :where(input,select,textarea){
  background: rgba(20,20,22,0.78);
  border-color: rgba(255,255,255,0.12);
}

::placeholder{ color: var(--muted); opacity: 0.85; }

/* Make browser-native controls follow theme */
body{ color-scheme: light; }
body.dark{ color-scheme: dark; }
html[data-theme="dark"]{ color-scheme: dark; }

code,pre,kbd,samp{ font-family: var(--font-mono) !important; }

/* Slightly stronger muted text in dark mode */
body.dark .muted, body.dark small,
html[data-theme="dark"] .muted, html[data-theme="dark"] small{
  color: rgba(242,242,242,0.78) !important;
}

/* -------------------------------------------------
   DARK MODE READABILITY PATCH (v3.6)
   Fixes pages that hard-code nav/text colours for light mode.
------------------------------------------------- */
body.dark header,
html[data-theme="dark"] header{
  color: var(--text) !important;
}

/* Force nav link text to remain readable in dark mode (overrides page-inline color:#181818) */
body.dark .nav-links,
html[data-theme="dark"] .nav-links{
  color: var(--text) !important;
}

body.dark .nav-links a,
html[data-theme="dark"] .nav-links a,
body.dark .nav-more > summary,
html[data-theme="dark"] .nav-more > summary,
body.dark .nav-more-panel a,
html[data-theme="dark"] .nav-more-panel a{
  color: var(--text) !important;
}

/* Keep active link accent */
body.dark .nav-links a.active,
html[data-theme="dark"] .nav-links a.active{
  color: var(--accent) !important;
}

/* Mega-menu headings were looking washed out on some pages */
body.dark .nav-col-title,
html[data-theme="dark"] .nav-col-title{
  color: rgba(242,242,242,0.92) !important;
}

/* Footer text often hard-coded for light mode */
body.dark footer,
html[data-theme="dark"] footer{
  color: rgba(242,242,242,0.78) !important;
}

/* About page highlight/callout box (and any future .highlight usage) */
body.dark .highlight,
html[data-theme="dark"] .highlight{
  background: rgba(22,22,24,0.98) !important;
  border-left-color: var(--accent) !important;
}
body.dark .highlight *,
html[data-theme="dark"] .highlight *{
  color: rgba(242,242,242,0.90) !important;
}

/* -------------------------------------------------
   READABILITY + SPACING BOOST (v3.8)
   Tailored to the Civic theme system:
   - Dark mode is activated by: body.dark AND html[data-theme="dark"] (set by site.js)
   - This patch increases legibility without breaking layout.
------------------------------------------------- */
:root{
  --reading-font: clamp(16px, 0.45vw + 15px, 18px);
  --reading-line: 1.70;
  --reading-max: 74ch;
  --reading-gap: 1.05em;
}

/* Apply to main content area (most pages use <main id="main">) */
main, #main{
  font-size: var(--reading-font);
  line-height: var(--reading-line);
}

main p, #main p{
  margin: 0 0 var(--reading-gap);
}

/* Keep paragraphs/lists readable on wide screens */
main p, main li,
#main p, #main li{
  max-width: var(--reading-max);
}

/* Slightly tighter heading leading for better scan */
main h1, main h2, main h3,
#main h1, #main h2, #main h3{
  line-height: 1.18;
}

/* Dark mode: strengthen small/meta text (often too dim) */
body.dark .meta,
body.dark .tiny,
body.dark .note,
html[data-theme="dark"] .meta,
html[data-theme="dark"] .tiny,
html[data-theme="dark"] .note{
  color: rgba(242,242,242,0.78) !important;
}

/* Dark mode: ensure long-form links are readable */
body.dark main a,
body.dark #main a,
html[data-theme="dark"] main a,
html[data-theme="dark"] #main a{
  color: rgba(242,242,242,0.90);
  text-decoration-color: rgba(194,155,64,0.75);
}

/* Mobile: prevent excessive scaling (keeps buttons/nav stable) */
@media (max-width: 420px){
  :root{ --reading-font: 16px; }
}
/* =========================================================
   v6.7 HOTFIX: visibility + "always readable" dark mode
   - raises base readability slightly on desktop
   - strengthens dark-mode contrast for any leftover hard-coded light sections
   ========================================================= */

/* Base readability (helps the “zoomed out / too small” feel) */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { font-size: 16.5px; line-height: 1.65; }
@media (min-width: 1100px) { body { font-size: 17px; } }

/* Universal container breathing room (safe: only when pages use these common wrappers) */
:where(.container,.wrap,.content,.page,.main,.section,.section-inner,.card,.panel,.box){
  max-width: 1120px;
}

/* Dark mode: last-resort readability enforcement */
body.dark, html[data-theme="dark"]{
  background: #121212 !important;
  color: #f0f0f0 !important;
}

/* Catch any sections/cards that still have light backgrounds or dark text baked in */
body.dark :where(main,section,article,aside,header,footer,.section,.card,.panel,.box,.tile,.intro,.intro-box,.help-box,.cta-box,.event-box,.location-box,.metric-box,.partner-box,.skill-box,.space-box,.story-box,.workshop-box,.form-card,.team-card,.resource-card,.impact-card){
  background-color: var(--card-bg) !important;
  color: var(--text) !important;
  border-color: var(--border-soft) !important;
}

/* Ensure text inside those blocks inherits the corrected colour */
body.dark :where(p,li,dt,dd,label,small,span,div,em,strong,blockquote,legend){
  color: inherit !important;
}

/* Links and focus states */
body.dark a{ color: var(--accent-soft) !important; }
body.dark a:hover{ color: #fff !important; }
body.dark :where(button,[role="button"],.btn,.button){
  color: var(--text) !important;
}

/* Form fields */
body.dark :where(input,select,textarea){
  background: rgba(255,255,255,0.06) !important;
  color: var(--text) !important;
  border-color: var(--border-soft) !important;
}
