/* ==========================================================================
   Maruti Public Charitable Trust — public site stylesheet
   Implements spec §10: stamp-paper palette, ledger grid, guilloche hairline
   dividers, mono metadata. No build step, no framework.

   Design constraints held throughout (§10.3):
     · no gradients, no shadows beyond a 1px --paper-edge border
     · one accent (--serial) used once per page
     · motion limited to a 150ms reveal, disabled under reduced-motion
   ========================================================================== */

:root {
  --ink:        #131A22;  /* registry ink — body text, headings */
  --ink-soft:   #46505C;  /* secondary text */
  --stamp:      #0D6E78;  /* stamp-paper teal — primary, links, CTA */
  --stamp-deep: #084A52;  /* hover, footer ground */
  --guilloche:  #7FC6C4;  /* aqua hairlines, dividers */
  --serial:     #C0392B;  /* endorsement red — once per page, max */
  --paper:      #FBF9F4;  /* document stock — page background */
  --paper-edge: #ECE6DA;  /* card ground, table stripes */
  --card:       #FFFFFF;

  /* Anek Devanagari carries Latin as well as Devanagari, so one family gives
     both scripts typographic parity (§10.2) and avoids loading two. */
  --font-display: "Anek Devanagari", system-ui, sans-serif;
  --font-body: "Tiro Devanagari Hindi", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* Type scale from §10.2: 14 / 16 / 18 / 22 / 28 / 38 / 52 */
  --t-xs:   0.8125rem;  /* 13 */
  --t-sm:   0.875rem;   /* 14 */
  --t-base: 1rem;       /* 16 */
  --t-md:   1.125rem;   /* 18 */
  --t-lg:   1.375rem;   /* 22 */
  --t-xl:   1.75rem;    /* 28 */
  --t-2xl:  2.375rem;   /* 38 */
  --t-3xl:  3.25rem;    /* 52 */

  --measure: 68ch;      /* body measure cap, §10.2 */
  --gutter: clamp(1rem, 4vw, 2rem);
  --rule: 1px solid var(--paper-edge);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-base);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

/* --- Headings ------------------------------------------------------------ */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.4em;
  text-wrap: balance;
}
h1 { font-size: clamp(var(--t-2xl), 5vw, var(--t-3xl)); }
h2 { font-size: clamp(var(--t-lg), 3vw, var(--t-xl)); margin-top: 0; }
h3 { font-size: var(--t-md); }

p { margin: 0 0 1rem; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

a { color: var(--stamp); text-underline-offset: 0.15em; }
a:hover { color: var(--stamp-deep); }

/* Visible keyboard focus, --stamp at 2px offset (§10.4) */
:focus-visible { outline: 2px solid var(--stamp); outline-offset: 2px; border-radius: 2px; }

.mono {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

/* Screen-reader-only, and the skip link that becomes visible on focus */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 0.5rem; top: -3.5rem; z-index: 10;
  background: var(--card); color: var(--stamp-deep);
  padding: 0.6rem 1rem; border: 1px solid var(--stamp); border-radius: 4px;
  font-family: var(--font-display); font-size: var(--t-sm);
  transition: top 120ms ease;
}
.skip-link:focus { top: 0.5rem; }

/* --------------------------------------------------------------------------
   Guilloche hairline — the recurring section divider (§10.3). A repeating
   2px-tall SVG wave; used at section boundaries and nowhere else.
   -------------------------------------------------------------------------- */
.guilloche {
  border: 0;
  height: 2px;
  margin: clamp(2rem, 5vw, 3.25rem) 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='2' viewBox='0 0 24 2'%3E%3Cpath d='M0 1 Q 6 -1 12 1 T 24 1' fill='none' stroke='%237FC6C4' stroke-width='1'/%3E%3C/svg%3E") repeat-x;
}

/* --------------------------------------------------------------------------
   Frame
   -------------------------------------------------------------------------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter); }

.site-header {
  border-bottom: var(--rule);
  background: var(--paper);
}
.header-top {
  display: flex; align-items: baseline; gap: 1rem;
  padding: 0.9rem 0 0.55rem;
}
.brand {
  display: flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--t-md); line-height: 1.2;
  color: var(--ink); text-decoration: none;
  margin-right: auto;
}
/* The mark is INLINE svg, so currentColor genuinely resolves against the page:
   stamp teal in the header, pale ink on the footer ground. An <img>-loaded SVG
   is an isolated document and would ignore this entirely. */
.brand-mark { color: var(--stamp); flex-shrink: 0; }
.brand:hover { color: var(--stamp-deep); }

.lang-switch { font-family: var(--font-mono); font-size: var(--t-xs); margin: 0; white-space: nowrap; }
.lang-switch a { text-decoration: none; color: var(--stamp); }
.lang-switch [aria-current="true"] { color: var(--ink); font-weight: 600; text-decoration: underline; }

/* Nav: ONE row that scrolls sideways rather than stacking. Nine items wrapped
   into three rows pushed the page content ~370px down on a narrow viewport. */
.site-nav {
  display: flex; gap: 1.15rem;
  padding-bottom: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;              /* the scroll is incidental, not a control */
  -webkit-overflow-scrolling: touch;
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  font-family: var(--font-display);
  font-size: var(--t-sm);
  color: var(--stamp-deep);
  text-decoration: none;
  white-space: nowrap;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--guilloche); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--stamp); }

main { padding: clamp(1.75rem, 4vw, 2.75rem) 0 clamp(2.5rem, 6vw, 4rem); }

/* --------------------------------------------------------------------------
   Ledger grid — narrow mono rail beside a wide content column (§10.3)
   -------------------------------------------------------------------------- */
.ledger { display: grid; grid-template-columns: 11.5rem 1fr; gap: clamp(1.25rem, 3vw, 2.5rem); }
.ledger-rail {
  font-family: var(--font-mono); font-size: var(--t-xs);
  color: var(--stamp-deep); line-height: 1.5;
  border-left: 2px solid var(--guilloche);
  padding-left: 0.85rem;
}
.ledger-rail p { margin-bottom: 0.7rem; max-width: none; }
.ledger-rail p:last-child { margin-bottom: 0; }
@media (max-width: 760px) {
  .ledger { grid-template-columns: 1fr; gap: 1rem; }
  .ledger-rail { border-left: 0; border-top: 2px solid var(--guilloche); padding: 0.6rem 0 0; }
}

/* Hero ------------------------------------------------------------------- */
.hero-lede {
  font-size: clamp(var(--t-md), 2.2vw, var(--t-lg));
  color: var(--ink-soft);
  max-width: 46ch;
}
/* Illustrative-content notice.

   Deliberately conspicuous. The point is that nobody reads an invented impact
   figure as a record of what the trust has done and decides to donate, or to
   apply for help, on that basis — so a discreet grey strip would defeat it.
   Endorsement red is used here rather than the usual once-per-page rule: this
   outranks whatever else wanted it. */
.demo-notice {
  background: #FBEAE7;
  border-bottom: 2px solid var(--serial);
  color: #6E241C;
  font-size: var(--t-sm);
  line-height: 1.5;
  padding: .6rem 0;
}
.demo-notice strong {
  font-family: var(--font-display);
  margin-right: .4rem;
}
@media (prefers-color-scheme: dark) {
  .demo-notice { background: #3A1714; color: #F3C9C2; }
}

/* Header right-hand cluster: the giving CTA above the language switch. */
.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .4rem;
}

/* The one filled button in the header. Deliberately the only stamp-teal fill
   above the fold, so it is the thing the eye lands on — a trust asking for
   support should not make people hunt for how. */
.header-cta {
  display: inline-block;
  background: var(--stamp);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: var(--t-sm);
  font-weight: 600;
  line-height: 1;
  padding: .5rem .95rem;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s ease;
}
.header-cta:hover,
.header-cta:focus-visible {
  background: var(--stamp-deep);
  color: #FFFFFF;
  text-decoration: none;
}

/* On narrow screens the header already carries the logo, name and language
   links; stack the cluster horizontally so the CTA keeps its prominence
   without pushing the nav down another line. */
@media (max-width: 34rem) {
  .header-right { flex-direction: row; align-items: center; gap: .7rem; }
  .header-cta { padding: .4rem .75rem; }
}

/* Hero copy the trust writes for itself (admin-editable).

   The tagline sits between the name and the address, so it is set smaller than
   the lede but in the display face — a claim about the trust, not a caption.
   The intro is body text at the normal measure. Both are optional; neither
   leaves a gap when absent because they are guarded in the Blade. */
.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(var(--t-base), 1.8vw, var(--t-md));
  font-weight: 500;
  color: var(--stamp-deep);
  letter-spacing: .005em;
  margin: .35rem 0 0;
  max-width: 52ch;
}
.hero-intro {
  font-size: var(--t-base);
  color: var(--ink);
  max-width: var(--measure);
  margin-top: 1rem;
}
.hero-cta { margin: 1.35rem 0 0; }

/* Contact line in the footer. Aqua rather than the footer's body colour so a
   phone number is findable at a glance on a page someone is scanning. */
.footer-contact a {
  color: var(--guilloche);
  text-underline-offset: 2px;
}
.footer-contact a:hover { color: #FFFFFF; }

/* The registration line, set like an endorsement stamp: the one --serial use. */
.reg-line {
  font-family: var(--font-mono); font-size: var(--t-xs);
  color: var(--stamp-deep);
  border-left: 3px solid var(--serial);
  padding: 0.15rem 0 0.15rem 0.85rem;
  margin: 1.35rem 0 0;
  max-width: none;
}

/* --------------------------------------------------------------------------
   Cards — 1px border only, no shadows (§10.3)
   -------------------------------------------------------------------------- */
.card-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr));
}
.card {
  background: var(--card);
  border: var(--rule);
  border-radius: 6px;
  padding: 1.1rem 1.2rem;
  display: flex; flex-direction: column; gap: 0.4rem;
}
.card h3 { margin: 0; font-size: var(--t-md); }
.card h3 a { text-decoration: none; color: var(--stamp-deep); }
.card h3 a:hover { text-decoration: underline; }
.card p { font-size: var(--t-sm); margin: 0; color: var(--ink-soft); max-width: none; }
.card .mono { display: block; color: var(--stamp); padding-top: 0.25rem; margin-top: auto; }
/* Interactive cards shift their border; still no shadow. */
.card:hover:has(h3 a) { border-color: var(--guilloche); }

/* Impact tiles: the figure is the point, so set it in mono and large. */
.stat-value {
  font-family: var(--font-mono); font-weight: 600;
  font-size: clamp(var(--t-xl), 3.5vw, var(--t-2xl));
  color: var(--stamp-deep); line-height: 1.05;
  font-variant-numeric: tabular-nums;
  display: block;
}
.stat-unit { font-family: var(--font-mono); font-size: var(--t-sm); color: var(--ink-soft); }
.stat-label { font-family: var(--font-display); font-size: var(--t-sm); color: var(--ink); }

/* Ruled rows — notices, trustee terms, ledger listings --------------------- */
.ruled { border-top: var(--rule); }
.ruled-row {
  display: grid; grid-template-columns: 1fr auto; gap: 0.5rem 1.5rem;
  padding: 0.8rem 0; border-bottom: var(--rule);
  align-items: baseline;
}
.ruled-row > :last-child { text-align: right; color: var(--stamp-deep); }
.ruled-row small { color: var(--ink-soft); font-size: var(--t-sm); }
@media (max-width: 560px) {
  .ruled-row { grid-template-columns: 1fr; }
  .ruled-row > :last-child { text-align: left; }
}

/* The transparency ledger reads as a public record, not a marketing page. */
.ledger-table .ruled-row { padding: 0.6rem 0; }
.ledger-table .ruled-row > :first-child { color: var(--stamp-deep); }

blockquote {
  margin: 0 0 1.5rem;
  padding-left: 1rem;
  border-left: 3px solid var(--guilloche);
}
blockquote footer { color: var(--ink-soft); }

figure { margin: 0; }
figure picture { display: block; }
figure img { width: 100%; height: auto; border-radius: 6px; border: var(--rule); display: block; }
figcaption { margin-top: 0.4rem; color: var(--ink-soft); }

/* --------------------------------------------------------------------------
   Forms — real labels, never placeholders as labels (§10.4)
   -------------------------------------------------------------------------- */
.form-grid { display: grid; gap: 1.15rem; max-width: 34rem; }
.form-grid > div { min-width: 0; }
.form-grid label {
  display: block; font-family: var(--font-display);
  font-size: var(--t-sm); margin-bottom: 0.3rem; color: var(--ink);
}
.form-grid input[type="text"], .form-grid input[type="email"],
.form-grid input[type="tel"], .form-grid input[type="number"],
.form-grid input[type="file"], .form-grid select, .form-grid textarea {
  width: 100%; padding: 0.6rem 0.7rem;
  font: inherit; font-size: var(--t-base); color: var(--ink);
  background: var(--card); border: 1px solid #D8D2C6; border-radius: 4px;
}
.form-grid textarea { resize: vertical; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus {
  outline: 2px solid var(--stamp); outline-offset: 1px; border-color: var(--stamp);
}
.form-grid input[type="checkbox"] { margin-right: 0.4rem; accent-color: var(--stamp); }
.form-grid label:has(input[type="checkbox"]) {
  display: flex; gap: 0.15rem; align-items: flex-start;
  font-family: var(--font-body); font-size: var(--t-base); line-height: 1.5;
}
.field-error { color: var(--serial); font-size: var(--t-sm); margin: 0.3rem 0 0; }

.consent-box {
  border: var(--rule); border-left: 3px solid var(--stamp);
  border-radius: 6px; padding: 1rem 1.15rem; background: var(--card);
}

.notice-ok {
  border: 1px solid var(--guilloche); border-left: 3px solid var(--stamp);
  background: var(--card); border-radius: 6px;
  padding: 1rem 1.25rem; margin-bottom: 1.75rem;
}

.btn {
  display: inline-block; font-family: var(--font-display); font-size: var(--t-base);
  color: #fff; background: var(--stamp); border: 1px solid var(--stamp);
  border-radius: 4px; padding: 0.6rem 1.35rem; cursor: pointer;
  text-decoration: none; line-height: 1.4;
}
.btn:hover { background: var(--stamp-deep); border-color: var(--stamp-deep); color: #fff; }
.btn-secondary { background: transparent; color: var(--stamp); }
.btn-secondary:hover { background: var(--stamp); color: #fff; }

/* Honeypot — out of view, still in the DOM for bots */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Filter bar (programmes, media) ------------------------------------------ */
.filter-bar {
  display: grid; gap: 0.85rem; align-items: end; margin: 1.5rem 0 0;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 13rem));
  max-width: none;
}
.type-filter { font-family: var(--font-mono); font-size: var(--t-xs); margin: 1rem 0 0; }
.type-filter a { text-decoration: none; }
.type-filter [aria-current="true"] { color: var(--ink); font-weight: 600; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--stamp-deep); color: #E4EFEE;
  padding: clamp(2rem, 5vw, 3rem) 0; margin-top: clamp(2rem, 5vw, 3rem);
}
.site-footer a { color: #C6E4E1; }
.site-footer a:hover { color: #fff; }
.site-footer .mono { color: #A3CFCB; }
.site-footer p { max-width: none; }
.footer-brand {
  display: flex; align-items: center; gap: 0.7rem;
  margin-bottom: 0.55rem;
}
/* Guilloche aqua rather than the body ink: the mark should sit quietly on the
   footer, not compete with the registration line for attention. */
.footer-mark { color: var(--guilloche); flex-shrink: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.35rem 0.7rem; align-items: baseline; }

/* --------------------------------------------------------------------------
   Motion — 150ms reveal on section headings only (§10.3)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: rise 150ms ease-out both; }
  @keyframes rise { from { opacity: 0; transform: translateY(4px); } }
}

/* --------------------------------------------------------------------------
   Print — /transparency is the page a CSR reviewer prints
   -------------------------------------------------------------------------- */
@media print {
  .site-header, .site-footer, .btn, .filter-bar, .skip-link { display: none; }
  body { background: #fff; font-size: 11pt; }
  .guilloche { background: none; border-top: 1px solid #999; height: 0; margin: 1rem 0; }
  .ledger { grid-template-columns: 1fr; }
  a { color: var(--ink); text-decoration: none; }
  .ruled-row { padding: 0.25rem 0; }
}
