/* PWA additions on top of the approved mockup CSS (tokens.css + site.css, both unchanged).
   Rules here only style PWA-only elements (marked data-pwa in the markup) or fit real photos into the mockup's image
   slots. Nothing here changes the size or position of a mockup block: overlays are position: fixed, and in-flow
   additions stay hidden (display: none) until the visitor uses them. Colours and spacing come from tokens.css. */

/* Real photos in mockup image slots. The slot size comes from site.css (.ph is full width, .r-* sets the ratio);
   the photo is cropped to it. */
img.ph { padding: 0; object-fit: cover; }
/* The mockup's hero placeholder grows from a 24 px flex basis (its padding); the padding-free photo gets the same basis. */
@media (min-width: 900px) { .hero-grid > img.ph { flex-basis: 24px; } }

/* Offline banner and update toast (fixed overlays) */
.pwa-banner { position: fixed; inset-inline: 0; z-index: 100; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--dir-space-12); padding: var(--dir-space-8) var(--dir-space-16); font-size: 0.9375rem; font-weight: 600; }
.pwa-banner-offline { inset-block-start: 0; background: var(--dir-indigo-900); color: var(--dir-text-on-brand); }
.pwa-banner-update { inset-block-end: 80px; background: var(--dir-bg-highlight); color: var(--dir-status-warning); border-radius: var(--dir-radius-md) var(--dir-radius-md) 0 0; box-shadow: var(--dir-shadow-up); }

/* Install card (fixed overlay above the mobile Donate bar) */
.pwa-install-card { position: fixed; inset-block-end: 80px; inset-inline: var(--dir-space-16); z-index: 90; display: flex; flex-wrap: wrap; align-items: center; gap: var(--dir-space-12); padding: var(--dir-space-20); background: var(--dir-bg-page); border: 1px solid var(--dir-border-default); border-radius: var(--dir-radius-lg); box-shadow: var(--dir-shadow); }
.pwa-install-card strong { flex: 1; min-inline-size: 0; }
.pwa-close { display: grid; place-items: center; min-block-size: 44px; min-inline-size: 44px; padding: 0; border: 0; background: none; color: var(--dir-text-secondary); font: inherit; cursor: pointer; }

@media (min-width: 600px) {
  .pwa-install-card { inset-block-end: var(--dir-space-16); inset-inline: auto var(--dir-space-24); max-inline-size: 480px; }
}
@media (min-width: 900px) {
  .pwa-banner-update { inset-block-end: 0; inset-inline: auto var(--dir-space-24); max-inline-size: 480px; }
}

/* Contact and volunteer forms: honeypot off-screen, messages hidden until used */
/* Turnstile: no box of its own (no grid gap in the form) until Cloudflare shows a challenge */
.turnstile, .turnstile div { display: contents; }
.hp { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.field-msg { margin: 0; font-size: 0.875rem; color: var(--dir-status-error); }
.field-error { border-color: var(--dir-status-error) !important; }
.form-status { margin: 0; padding: var(--dir-space-12) var(--dir-space-16); border-radius: var(--dir-radius-md); font-weight: 600; background: var(--dir-bg-highlight); color: var(--dir-status-warning); }
.form-status.notice--success { background: var(--dir-bg-subtle); color: var(--dir-status-success); }
.form-status.notice--error { color: var(--dir-status-error); }

/* Outbox (contact page, shown only when messages are queued) */
.outbox { margin-block-start: var(--dir-space-32); max-inline-size: 560px; }
.outbox-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--dir-space-8); }
.outbox-item { display: flex; flex-wrap: wrap; gap: var(--dir-space-8); align-items: flex-start; padding: var(--dir-space-16); background: var(--dir-bg-page); border-radius: var(--dir-radius-md); }
.outbox-meta, .outbox-note { font-size: 0.875rem; color: var(--dir-text-secondary); }
.outbox-topic { font-weight: 600; }
.outbox-actions { display: flex; gap: var(--dir-space-8); margin-inline-start: auto; }

/* Save for offline (Reports): a text button inside the report's meta line, so the row keeps its height */
.report-save-btn, .report-remove-btn { margin-inline-start: var(--dir-space-8); padding: 0; border: 0; background: none; font: inherit; color: var(--dir-text-link); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.report-save-btn:disabled { color: var(--dir-status-success); text-decoration: none; cursor: default; }
.storage-summary { margin-block-start: var(--dir-space-8); font-size: 0.875rem; color: var(--dir-text-secondary); }

/* Network-only actions are dimmed while offline */
body.pwa-offline [data-network-only] { opacity: 0.4; pointer-events: none; }

/* ---- Our logo page (about/logo). Built from mockup blocks: .split, .cards/.card, .caption, .chip, .ticks, .goal-list,
   .rtable, .reports/.report, .actions. Only what the mockup has no equivalent for is styled here: the framed image with
   its caption below the frame (CaptionedFigure), the numbered timeline and the definition list. ---- */

/* CaptionedFigure: the image sits in a .card frame; the caption (.caption) and the Chosen chip sit below it, outside the
   frame. Frame padding is at least 5% of the figure width: the logo artwork fills its own box edge to edge and the bindi
   is 4.9% of the logo's width, so the padding always keeps one bindi diameter of clear space. */
.fig { display: grid; gap: var(--dir-space-8); margin: 0; }
.fig .caption { margin: 0; overflow-wrap: break-word; text-wrap: pretty; }
.fig-frame { display: grid; place-items: center; padding: max(var(--dir-space-24), 5%); }
.fig-frame.is-chosen { border-color: var(--dir-indigo-700); box-shadow: inset 0 0 0 1px var(--dir-indigo-700); }
.fig-frame.on-night { background: var(--dir-indigo-900); border-color: var(--dir-indigo-900); }
.fig-frame.on-brand { background: var(--dir-bg-brand); border-color: var(--dir-bg-brand); }
/* Static marker, not a control: no 44 px tap height */
.chip.chip-chosen { min-block-size: 0; margin-inline-end: var(--dir-space-4); padding-inline: var(--dir-space-8); background: var(--dir-indigo-700); border-color: var(--dir-indigo-700); color: var(--dir-text-on-brand); font-size: 0.8125rem; line-height: 1.5; }
/* An image shown at its natural size (the 2004 original, 200 px): the frame shrinks to it. The frame clips (card
   overflow), so its minimum width is set explicitly or the shrink-to-fit figure would collapse it. */
.fig-fit { inline-size: min-content; max-inline-size: 100%; }
.fig-fit .fig-frame, .fig-fit.fig-frame { min-inline-size: min-content; padding: var(--dir-space-24); }
.fig-fit img { max-inline-size: none; }
/* In a card grid, frames and captions line up across a row (frame row, caption row) */
.figs > li { display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: var(--dir-space-8); }
.figs .fig { grid-row: span 2; grid-template-rows: subgrid; }
/* Story page: the supporting photos below the story text, in the mockup's gallery grid (.fig image + .caption) */
.story-figs { margin-block: var(--dir-space-32) 0; align-items: start; }

/* Timeline: numbered steps; the figures use the full width on small screens */
.timeline { list-style: none; margin: var(--dir-space-32) 0 0; padding: 0; display: grid; gap: var(--dir-space-48); }
.step { display: grid; grid-template-columns: var(--dir-space-48) minmax(0, 1fr); gap: var(--dir-space-12) var(--dir-space-16); align-items: center; }
.step > h3 { margin: 0; }
.step-no { display: grid; place-items: center; inline-size: var(--dir-space-48); block-size: var(--dir-space-48); border-radius: var(--dir-radius-pill); background: var(--dir-indigo-700); color: var(--dir-text-on-brand); font-size: 1.25rem; font-weight: 700; }
.step-body { grid-column: 1 / -1; }
.step-body > .cards, .step-body > .fig { margin-block: var(--dir-space-20) 0; }
.step-body > .fig:not(.fig-fit) { max-inline-size: 760px; }
.step-body > :last-child { margin-block-end: 0; }

.facts { display: grid; gap: var(--dir-space-8) var(--dir-space-24); margin: var(--dir-space-24) 0 0; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0 0 var(--dir-space-12); max-inline-size: 68ch; }

.ticks-dont .i { color: var(--dir-status-error); }
/* Subsections under one h2 (Sizes, Guidelines): the mockup's subsection heading spacing (.fy h3) */
.subsecs > h3, .subsecs > .split { margin-block-start: var(--dir-space-24); }
/* Download rows (mockup report row): two buttons instead of one, full width under the name on small screens */
.report > .actions { grid-column: 1 / -1; }

@media (min-width: 600px) {
  .cards.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report > .actions { grid-column: auto; }
}
@media (min-width: 900px) {
  .step { column-gap: var(--dir-space-24); }
  .step-body { grid-column: 2; }
  .facts { grid-template-columns: minmax(0, 1fr) minmax(0, 4fr); }
  .facts dd { margin: 0; }
}

/* v2 strategy: contact form (select chevron, consent checkbox, conditional field) */
.field select { appearance: none; padding-inline-end: calc(var(--dir-space-16) * 2.5); background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - var(--dir-space-16) - 5px) 50%, calc(100% - var(--dir-space-16)) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
[dir="rtl"] .field select { background-position: calc(var(--dir-space-16)) 50%, calc(var(--dir-space-16) + 5px) 50%; }
.field[hidden] { display: none; }
.field-check { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; column-gap: var(--dir-space-12); }
.field-check input[type="checkbox"] { inline-size: 24px; block-size: 24px; min-block-size: 0; margin: 10px; padding: 0; accent-color: var(--dir-indigo-700); }
.field-check label { min-block-size: 44px; display: flex; align-items: center; flex-wrap: wrap; overflow-wrap: anywhere; }
.field-check input[type="checkbox"]:focus-visible { outline: 2px solid var(--dir-indigo-700); outline-offset: 2px; }
.field-check .field-msg { grid-column: 1 / -1; }
.field-check label { font-weight: 400; display: block; padding-block: 10px; }

/* v2 strategy: new components (design brief 07, section 4). Tokens only, logical properties. */
/* Role and group cards (4.2): programme-card surface, round icon badge (24 px icon in a 56 px tinted circle) */
.role-card .card-body { gap: var(--dir-space-8); }
.icon-badge { display: inline-grid; place-items: center; flex: none; inline-size: 56px; block-size: 56px; border-radius: var(--dir-radius-pill); background: var(--dir-bg-subtle); color: var(--dir-text-link); }
.icon-badge .i { inline-size: 24px; block-size: 24px; }
.sec-foot { margin-block-start: var(--dir-space-32); }
/* Status notice (4.3): the notice family (highlight tint, info icon) with a title line and a paragraph; no red */
.status-notice { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--dir-space-12); align-items: start; background: var(--dir-bg-highlight); color: var(--dir-text-primary); border-radius: var(--dir-radius-lg); padding: var(--dir-space-20); }
.status-notice > .i { color: var(--dir-status-warning); inline-size: 24px; block-size: 24px; }
.status-notice .status-title { font-size: 1.125rem; margin: 0 0 var(--dir-space-4); }
.status-notice p { margin: 0 0 var(--dir-space-8); max-inline-size: 68ch; }
.status-notice p:last-child { margin-block-end: 0; }
.status-notice a { color: var(--dir-text-link); font-weight: 600; }
/* UPI block (4.1): QR left and text right on desktop; stacked and centred on phones */
.upi { display: grid; gap: var(--dir-space-24); padding: var(--dir-space-24); justify-items: center; margin-block-start: var(--dir-space-16); }
.upi-qr img, .upi-qr-ph { inline-size: 200px; block-size: 200px; }
.upi-qr img { display: block; background: var(--dir-neutral-white); }
.upi-qr-ph { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--dir-space-8); padding: var(--dir-space-16); text-align: center; background: var(--dir-neutral-grey-100); border: 1px dashed var(--dir-border-default); border-radius: var(--dir-radius-md); color: var(--dir-text-secondary); font-size: 0.875rem; font-weight: 600; }
.upi-qr-ph .i { inline-size: 40px; block-size: 40px; }
.upi-text { justify-self: stretch; }
.upi-text h2 { margin-block-end: var(--dir-space-8); }
.upi-text p { margin: 0 0 var(--dir-space-12); }
.upi-id-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--dir-space-8) var(--dir-space-12); }
.upi-label { font-size: 0.8125rem; color: var(--dir-text-secondary); }
.upi-id { font-family: monospace; /* brief 4.1: the UPI ID in a monospace font (generic family, no font stack) */ font-size: 1.0625rem; font-weight: 600; overflow-wrap: anywhere; user-select: all; }
[data-state="placeholder"] .upi-id, [data-state="placeholder"] .upi-payee strong { color: var(--dir-status-warning); }
/* Report row state "Public edition in preparation" (4.4): muted text, no Download button */
.report-state { font-style: italic; }
/* Indicator rows (4.5): the tick-list pattern with the 56 px icon badge */
.indicators { list-style: none; margin: var(--dir-space-16) 0 0; padding: 0; display: grid; gap: var(--dir-space-12); }
.indicators li { display: flex; align-items: center; gap: var(--dir-space-16); padding: var(--dir-space-12) var(--dir-space-16); background: var(--dir-bg-subtle); border-radius: var(--dir-radius-md); font-weight: 600; }
/* Companies and CSR block and the volunteer CTA block */
.csr p, .vol-cta p { max-inline-size: 60ch; }
.vol-cta { display: grid; gap: var(--dir-space-8); justify-items: start; }
.vol-cta h2, .vol-cta p { margin: 0; }
.vol-cta .btn { margin-block-start: var(--dir-space-8); }
.board { margin-block-start: var(--dir-space-16); }
@media (min-width: 600px) {
  .upi { grid-template-columns: auto minmax(0, 1fr); justify-items: start; align-items: center; }
}
@media (min-width: 900px) {
  .upi-qr img, .upi-qr-ph { inline-size: 240px; block-size: 240px; }
  .indicators { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---- Content depth (docs/content/DESIGN-NOTES.md): long-form sections, "On this page" links, rhythm rows, sources
   line, video cards and role sections. Built on the mockup's .sec, .prose measure, .chips, .ticks, .quote, .stats,
   .rtable, .faq, .card and .video; only the reading column, spacing and the rhythm rows are new. Tokens only. ---- */
.lf-body { max-inline-size: 46rem; } /* text column: about 70 characters of body text */
.lf-body > :last-child { margin-block-end: 0; }
.lf-body > h3 { margin-block-start: var(--dir-space-32); }
.lf-body > h2 + h3 { margin-block-start: var(--dir-space-16); }
.lf-list { margin: 0 0 var(--dir-space-16); padding-inline-start: var(--dir-space-24); display: grid; gap: var(--dir-space-8); }
.lf-list li { max-inline-size: 68ch; padding-inline-start: var(--dir-space-4); }
.lf-body > .quote, .lf-body > .stats, .lf-body > .lf-faq { margin-block: var(--dir-space-24); }
.lf-body > .table-wrap { margin-block: var(--dir-space-16) var(--dir-space-24); }
.lf-body > .facts { margin-block: var(--dir-space-16) var(--dir-space-24); }
.lf-caption { caption-side: top; text-align: start; font-weight: 600; padding-block-end: var(--dir-space-8); }
.rtable tbody th { font-weight: 600; }
/* "In numbers" and key figures (Figures.astro): the period of a figure group (h3), of a figure (under its label) and of
   a table (second line of the caption). Stat tiles keep their contrast on a grey section. */
.figures .fig-period { margin-block: var(--dir-space-24) var(--dir-space-12); font-size: 1.0625rem; }
.figures h2 + .fig-period, .figures .en > .fig-period:first-child { margin-block-start: var(--dir-space-16); }
.stat .stat-period { font-weight: 600; }
.fig-caption-period { display: block; font-weight: 400; font-size: 0.875rem; color: var(--dir-text-secondary); }
.figures .lf-body { margin-block-start: var(--dir-space-24); }
.sec-alt .stat { background: var(--dir-bg-page); }
/* "On this page": the chip links of the gallery filter, used as in-page anchors */
.lf-toc-h { margin: 0 0 var(--dir-space-8); font-weight: 600; }
.lf-toc .chips { list-style: none; padding: 0; margin: 0; }
.lf-toc-sec { padding-block-end: 0; }
/* Rhythm and timeline rows: when (bold, link colour) and what, on a tinted row with the quote's indigo edge */
.steps { list-style: none; margin: var(--dir-space-16) 0 var(--dir-space-24); padding: 0; display: grid; gap: var(--dir-space-8); }
.steps li { display: grid; gap: var(--dir-space-4); padding: var(--dir-space-12) var(--dir-space-16); background: var(--dir-bg-subtle); border-inline-start: 4px solid var(--dir-indigo-700); border-start-end-radius: var(--dir-radius-md); border-end-end-radius: var(--dir-radius-md); }
.sec-alt .steps li { background: var(--dir-bg-page); }
.steps-when { font-weight: 700; color: var(--dir-text-link); }
/* Video cards: the tap-to-load box fills the top of a card; title, meta line, description and content note below */
.video-cards { margin-block-start: var(--dir-space-24); }
.video-card .video { max-inline-size: none; border-radius: 0; }
.video-card .card-body { gap: var(--dir-space-8); }
.video-card .card-body p { max-inline-size: none; }
.video-cn { display: flex; gap: var(--dir-space-8); align-items: flex-start; font-size: 0.875rem; }
.video-cn .i { flex: none; inline-size: 20px; block-size: 20px; color: var(--dir-status-warning); }
.video-card .small a { display: inline-flex; align-items: center; min-block-size: 44px; }
/* Role sections (Team): icon badge, role and purpose; responsibilities and "works with" beside them from 900 px */
.role-sec .icon-badge { margin-block-end: var(--dir-space-12); }
.role-sec h3 { margin-block-start: 0; font-size: 1.0625rem; }
.role-sec .ticks { margin-block-end: var(--dir-space-20); }
@media (max-width: 599.98px) {
  /* long-form tables: the row header is the card title, each cell shows its column label above the text */
  .lf .rtable tbody th { display: block; inline-size: 100%; border: 0; padding: var(--dir-space-4) 0 var(--dir-space-8); }
  .lf .rtable td { display: block; text-align: start; }
  .lf .rtable td::before { display: block; max-inline-size: none; }
}
@media (min-width: 600px) {
  .steps li { grid-template-columns: 10rem minmax(0, 1fr); gap: var(--dir-space-16); }
}
@media (min-width: 900px) {
  .lf-split { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .lf-split .lf-aside { padding-block-start: var(--dir-space-48); }
}
.video-card h3, .video-card h4 { margin: 0; font-size: 1.125rem; line-height: 1.3; }
.video-group { margin-block: var(--dir-space-32) 0; }
.sec .status-notice + .video-group { margin-block-start: var(--dir-space-32); }
.sec-alt .role-sec .icon-badge, .sec-alt.role-sec .icon-badge { background: var(--dir-bg-page); }
/* Contact: the "Open in Maps" link under the contact items (the mockup's static map slot is removed). */
.contact-maps { margin: var(--dir-space-16) 0 0; }
/* German pages: long compounds (Gesundheitsberaterinnen, Ernährungsfachkräfte) break with a hyphen in narrow columns
   (stat labels, cards, table cells) instead of running to the edge; the browser's German dictionary picks the break. */
main:lang(de) { hyphens: auto; }
/* Hindi pages: Devanagari words are never broken with a hyphen (site.css hyphenates h1–h3; some browsers carry Hindi
   patterns). Mukta's tall Devanagari metrics already fit site.css's line heights (:lang(hi) body 1.75). */
:lang(hi) :is(h1, h2, h3) { hyphens: manual; }
