/* Project V.I.E.W - site stylesheet
   Design system: see "Project VIEW - Website Plan - 13 Sep 2026", section 7.
   Colours are chosen to meet WCAG 2.2 AA contrast on every background they appear on.
   Brand gold (#D4A373) is decorative only: it never carries text or meaning. */

:root {
  --text: #2C3E50;        /* charcoal, 11:1 on white */
  --text-muted: #4A5A6A;  /* 7.4:1 on white */
  --teal: #0D7377;        /* primary, 5.6:1 on white; white on teal 5.6:1 */
  --teal-dark: #0B5F62;   /* focus ring and hover, 7.4:1 on white */
  --gold: #D4A373;        /* decorative only */
  --gold-deep: #7A5217;   /* gold that may carry text, 6.9:1 on white */
  --tint: #E6F2F2;        /* alternate section background */
  --warm: #FBF3E8;        /* resource blocks */
  --navy: #0D1B24;        /* footer, matches the dark logo */
  --white: #FFFFFF;
  --border: #B8C4CC;      /* decorative separators only */
  --border-strong: #5A6B7A; /* 4.7:1 on white, for meaningful borders */
  --error: #B00020;
  --max: 76rem;
  --measure: 70ch;
  --radius: 6px;
}

* { box-sizing: border-box; }

html {
  font-size: 106.25%;           /* 17px */
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (min-width: 48rem) { html { font-size: 112.5%; } }  /* 18px */
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Noto Sans Sinhala", "Noto Sans Tamil", "Iskoola Pota", "Nirmala UI", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
  overflow-wrap: break-word;  /* long words and web addresses wrap instead of widening the page (WCAG 1.4.10) */
}

/* Sinhala and Tamil text needs a little more line height and sensible fonts. */
[lang="si"], [lang="ta"] {
  line-height: 1.8;
  overflow-wrap: anywhere;  /* long Sinhala and Tamil words wrap inside their box at 400% zoom (WCAG 1.4.10) */
  font-family: "Noto Sans Sinhala", "Noto Sans Tamil", "Nirmala UI", "Iskoola Pota", "Latha", "Segoe UI", system-ui, sans-serif;
}

p, li, dd, dt, summary, figcaption, address { max-width: var(--measure); }
p { margin: 0 0 1rem; }
address { font-style: normal; }
strong { font-weight: 700; }
abbr[title] { text-decoration: underline dotted; text-underline-offset: 0.15em; }

/* Headings: one H1, H2 per section, H3 per resource, H4 for download lists. */
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.75rem; font-weight: 700; overflow-wrap: break-word; }
h1 { font-size: 2.25rem; color: var(--teal-dark); }
h1 .h1-sub { display: block; font-size: 1.25rem; font-weight: 600; color: var(--text); margin-top: 0.5rem; line-height: 1.4; }
h2 { font-size: 1.75rem; color: var(--teal-dark); padding-bottom: 0.5rem; position: relative; }
h2::after { /* decorative gold rule */
  content: ""; display: block; width: 4rem; height: 4px; background: var(--gold); margin-top: 0.6rem; border-radius: 2px;
}
h3 { font-size: 1.35rem; color: var(--text); margin-top: 2rem; }
h4 { font-size: 1.125rem; margin-top: 1.25rem; }

/* Links: underlined, teal, with a strong visible focus. */
a { color: var(--teal); text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
a:hover { color: var(--teal-dark); text-decoration-thickness: 0.15em; }
a:focus-visible, button:focus-visible, summary:focus-visible, audio:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--teal-dark);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Skip link: first focusable element, visible on focus. */
.skip-link {
  position: absolute; left: 1rem; top: -100px;
  background: var(--navy); color: var(--white);
  padding: 0.75rem 1.25rem; border-radius: var(--radius); z-index: 100;
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 1rem; outline: 3px solid var(--gold); outline-offset: 2px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1rem; }
@media (min-width: 48rem) { .wrap { padding: 0 2rem; } }

/* Header and navigation */
.site-header { border-bottom: 1px solid var(--border); background: var(--white); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; padding-top: 1rem; padding-bottom: 1rem; }
.logo-link { display: inline-block; line-height: 0; border-radius: 4px; }
.logo-link img { height: 6.5rem; width: auto; display: block; }
@media (max-width: 40rem) { .logo-link img { height: 5rem; } }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; }
.site-nav a {
  display: inline-block; padding: 0.6rem 0.85rem; min-height: 44px;
  font-weight: 600; text-decoration: none; color: var(--teal-dark);
  border: 2px solid transparent; border-radius: var(--radius);
}
.site-nav a:hover { text-decoration: underline; background: var(--tint); }

/* Main sections */
main { display: block; }
main:focus { outline: none; }
.section { padding: 3rem 0; }
.section + .section { border-top: 1px solid var(--border); }
.section.tint { background: var(--tint); }
.section .wrap > :last-child { margin-bottom: 0; }
.hero { padding-top: 2.5rem; }
.lead { font-size: 1.2rem; }
.tagline { font-size: 1.25rem; font-weight: 600; color: var(--teal-dark); }

.back-to-top { display: inline-block; margin-top: 2rem; font-size: 0.95rem; }

/* Button-style links (navigation, not form buttons) */
.button-row { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.5rem 0; }
.button {
  display: inline-block; min-height: 44px;
  padding: 0.75rem 1.5rem; border-radius: var(--radius);
  background: var(--teal); color: var(--white);
  border: 2px solid var(--teal); font-weight: 700; font-size: 1.125rem;
  text-decoration: none; line-height: 1.3;
}
.button:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: var(--white); }
.button.secondary { background: var(--white); color: var(--teal-dark); border-color: var(--teal-dark); }
.button.secondary:hover { background: var(--tint); }
@media (min-width: 40rem) { .button-row .button { flex: 1 1 18rem; text-align: center; } }

.funder { font-weight: 600; color: var(--text); }

/* Language welcome blocks */
.welcome-block { background: var(--white); border: 1px solid var(--border-strong); border-left: 6px solid var(--teal); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1rem 0; max-width: var(--measure); }
.welcome-block p { margin-bottom: 0.75rem; }

/* Disclosure (details/summary) styled as a control */
details { margin: 0.75rem 0 1rem; max-width: var(--measure); }
summary {
  cursor: pointer; display: inline-block; min-height: 44px;
  padding: 0.6rem 1rem 0.6rem 2.4rem; position: relative;
  border: 2px solid var(--teal-dark); border-radius: var(--radius);
  background: var(--white); color: var(--teal-dark); font-weight: 700;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::before { /* chevron drawn in CSS, decorative */
  content: ""; position: absolute; left: 1rem; top: 50%;
  width: 0.55em; height: 0.55em; border-right: 3px solid currentColor; border-bottom: 3px solid currentColor;
  transform: translateY(-70%) rotate(-45deg);
}
details[open] > summary::before { transform: translateY(-70%) rotate(45deg); }
summary:hover { background: var(--tint); }
details > .details-body { padding: 1rem 0 0.25rem 0.25rem; }
details > .details-body > :last-child { margin-bottom: 0; }

/* Resource and lesson blocks */
.resource {
  background: var(--warm); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 1.25rem 1.5rem; margin: 1.5rem 0;
}
.resource > h3, .resource > h4 { margin-top: 0; }
.section.tint .resource { background: var(--white); }
.meta { color: var(--text-muted); font-size: 0.95rem; }

/* Download lists */
.downloads { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.downloads li { margin: 0; border-top: 1px solid var(--border); max-width: none; }
.downloads li:first-child { border-top: 0; }
.downloads a {
  display: flex; align-items: center; gap: 0.75rem;
  min-height: 44px; padding: 0.55rem 0.25rem; max-width: var(--measure);
}
.downloads a:hover { background: rgba(13, 115, 119, 0.08); }
.downloads svg { flex: 0 0 auto; width: 1.4rem; height: 1.4rem; }
.downloads a > span { min-width: 0; }  /* lets long link text wrap instead of pushing past the box */

/* Audio */
audio { display: block; width: 100%; max-width: 40rem; margin: 0.75rem 0 1rem; }

/* Transcript text */
.transcript p { margin-bottom: 0.9rem; }
.transcript blockquote { margin: 0 0 0.9rem 0; padding: 0.35rem 0 0.35rem 1rem; border-left: 4px solid var(--gold); font-style: italic; max-width: var(--measure); }
.transcript blockquote p { margin: 0 0 0.5rem; }
.transcript blockquote p:last-child { margin-bottom: 0; }

/* Myths list */
.myths { max-width: var(--measure); margin: 1rem 0; padding: 0; }
.myths dt { font-weight: 700; margin-top: 1.25rem; color: var(--teal-dark); }
.myths dd { margin: 0.25rem 0 0; }

/* Facts list */
.facts { padding-left: 1.25rem; }
.facts li { margin-bottom: 0.5rem; }

/* Footer */
.site-footer { background: var(--navy); color: var(--white); padding: 2.5rem 0 2rem; margin-top: 0; }
.site-footer a { color: var(--white); }
.site-footer a:hover { color: var(--gold); }
.site-footer a:focus-visible { outline-color: var(--gold); }
.site-footer .footer-logo img { height: 5rem; width: auto; display: block; margin-bottom: 1.25rem; }
.site-footer p { max-width: var(--measure); }
.site-footer .funder { color: var(--white); }
.footer-links { list-style: none; padding: 0; margin: 1rem 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.footer-links a { display: inline-block; padding: 0.4rem 0; min-height: 24px; }
.site-footer .small { font-size: 0.9rem; color: #D5DDE3; }

/* Supporting pages */
.page-body { padding: 2.5rem 0 3rem; }
.page-body ul { max-width: var(--measure); }

/* Screen-reader-only text */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Windows High Contrast / forced colours: keep real borders and visible controls */
@media (forced-colors: active) {
  .button, summary, .site-nav a { border: 2px solid ButtonText; forced-color-adjust: none; background: ButtonFace; color: ButtonText; }
  .button:hover, summary:hover { background: Highlight; color: HighlightText; }
  h2::after { background: CanvasText; }
  .transcript blockquote { border-left-color: CanvasText; }
  .welcome-block, .resource { border-color: CanvasText; }
  .skip-link:focus { outline-color: Highlight; }
}

@media print {
  .skip-link, .site-nav, .back-to-top, audio { display: none; }
  a { color: inherit; }
  details { break-inside: avoid; }
  details > summary { border: 0; padding: 0; }
  .section { padding: 1rem 0; }
}

/* staging only - remove before launch */
.staging-banner{background:#7a2f00;color:#fff;padding:.75rem 1rem;margin:0;text-align:center;font-weight:700}
