/*!
 * Pixel and People — shared base styles (v1)
 * Copied into every demo site as assets/css/core.css.
 * Each site defines its look through the custom properties below (see theme.css).
 *
 * Required tokens:
 *   --bg --fg --muted --surface --line --accent --accent-ink
 *   --font-body --font-display --radius --radius-lg --shadow
 *   --header-h  --wrap
 */

/* ------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h, 64px) + 12px); }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.6; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4, p, figure, ul, ol, dl, dd { margin: 0; }
:where(ul[role="list"], ol[role="list"]) { list-style: none; padding: 0; }
:where(h1, h2, h3, h4) { line-height: 1.1; text-wrap: balance; }
p { text-wrap: pretty; }
[hidden] { display: none !important; }
body.menu-open, body.has-dialog { overflow: hidden; }
/* dim the page behind the open mobile menu */
body.menu-open::before { content: ""; position: fixed; inset: 0; z-index: 45; background: rgb(0 0 0 / .45); animation: fade-in .25s ease; }
.site-header .brand { min-height: 44px; }

/* Hindi: Devanagari needs more vertical room and no tight tracking */
html.is-hi body { line-height: 1.75; }
html.is-hi :where(h1, h2, h3) { line-height: 1.3; letter-spacing: 0 !important; }

/* ------------------------------------------------------ accessibility */
.sr-only { position: absolute !important; 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: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--accent); color: var(--accent-ink); border-radius: var(--radius); font-weight: 600; text-decoration: none; transition: top .2s; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--focus, var(--accent)); outline-offset: 3px; }

/* ------------------------------------------------------------- layout */
.wrap { width: min(100% - 2.5rem, var(--wrap, 1180px)); margin-inline: auto; }

/* ------------------------------------------------------- lang toggle */
.lang-toggle { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; align-items: center; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: transparent; font-size: .8125rem; font-weight: 600; line-height: 1; }
.lang-toggle span { position: relative; z-index: 1; padding: 11px 11px; text-align: center; transition: color .25s; }
.lang-toggle::before { content: ""; position: absolute; inset: 3px auto 3px 3px; width: calc(50% - 3px); border-radius: 999px; background: var(--accent); transition: transform .3s cubic-bezier(.3, .7, .2, 1); }
.lang-toggle[data-active="hi"]::before { transform: translateX(100%); }
.lang-toggle[data-active="en"] [data-l="en"],
.lang-toggle[data-active="hi"] [data-l="hi"] { color: var(--accent-ink); }

/* ------------------------------------------------- mobile action bar */
.action-bar { position: fixed; inset: auto 0 0 0; z-index: 40; display: none; grid-template-columns: 1fr 1fr 1.4fr; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--actionbar-bg, var(--surface)); border-top: 1px solid var(--line); transition: transform .3s; }
.action-bar a, .action-bar button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; border-radius: var(--radius); border: 1px solid var(--line); background: transparent; font-weight: 600; font-size: .9375rem; text-decoration: none; }
.action-bar svg { width: 18px; height: 18px; flex: none; }
.action-bar .is-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.action-bar.is-hidden { transform: translateY(110%); }
@media (max-width: 760px) {
  .action-bar { display: grid; }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
}

/* -------------------------------------------------------------- dialog */
dialog { padding: 0; border: 0; color: var(--fg); background: transparent; max-width: none; max-height: none; }
dialog::backdrop { background: rgb(0 0 0 / .55); backdrop-filter: blur(3px); }
.sheet { width: min(100% - 24px, 520px); margin: auto; }
.sheet__panel { position: relative; background: var(--surface); border-radius: var(--radius-lg); padding: 28px 24px 24px; box-shadow: var(--shadow); max-height: calc(100dvh - 32px); overflow: auto; }
.sheet__close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: transparent; font-size: 1rem; }
@media (max-width: 600px) {
  .sheet { width: 100%; margin: auto 0 0; }
  .sheet__panel { border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}
dialog[open] .sheet__panel { animation: sheet-in .32s cubic-bezier(.2, .8, .2, 1); }
dialog[open]::backdrop { animation: fade-in .25s ease; }
dialog.is-closing .sheet__panel { animation: sheet-out .2s ease forwards; }
dialog.is-closing::backdrop { animation: fade-in .2s ease reverse forwards; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px) scale(.98); } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(16px); } }
@keyframes fade-in { from { opacity: 0; } }

/* --------------------------------------------------------------- forms */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: .875rem; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field-bg, transparent); }
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline-offset: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-note { font-size: .8125rem; color: var(--muted); margin-top: 10px; }

/* ---------------------------------------------------------------- toast */
.toast { position: fixed; left: 50%; bottom: 96px; z-index: 200; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 12px 18px; border-radius: 999px; background: var(--fg); color: var(--bg); font-weight: 600; font-size: .9375rem; box-shadow: var(--shadow); transition: opacity .25s, transform .25s; max-width: calc(100% - 32px); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 761px) { .toast { bottom: 28px; } }

/* ------------------------------------------------------------- lightbox */
.lightbox { width: 100vw; height: 100dvh; margin: 0; background: rgb(0 0 0 / .92); color: #fff; }
.lightbox::backdrop { background: transparent; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox__fig { display: grid; gap: 12px; justify-items: center; padding: 56px 16px; }
.lightbox__fig img { max-width: min(1100px, 92vw); max-height: 78dvh; object-fit: contain; border-radius: 6px; }
.lightbox__fig figcaption { font-size: .9375rem; opacity: .8; }
.lightbox__btn, .lightbox__close { position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgb(255 255 255 / .3); background: rgb(0 0 0 / .4); color: #fff; font-size: 1.6rem; line-height: 1; }
.lightbox__prev { left: 16px; top: 50%; translate: 0 -50%; }
.lightbox__next { right: 16px; top: 50%; translate: 0 -50%; }
.lightbox__close { top: 16px; right: 16px; font-size: 1.1rem; }

/* ------------------------------------------------------------- facades */
.facade { position: relative; width: 100%; border: 0; padding: 0; background: var(--surface); overflow: hidden; }
.facade.is-live { border: 0; }

/* ----------------------------------------------------- disclosure (FAQ) */
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 0; cursor: pointer; list-style: none; font-weight: 600; font-size: 1.0625rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 12px; height: 12px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-3px); transition: transform .25s; }
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.faq details > div { padding: 0 0 20px; color: var(--muted); max-width: 64ch; }
.faq details[open] > div { animation: fade-in .3s ease; }

/* --------------------------------------------------------- demo ribbon */
.demo-ribbon { position: fixed; right: 14px; bottom: 14px; z-index: 30; padding: 6px 12px; border-radius: 999px; background: rgb(0 0 0 / .72); color: #fff; font: 500 .75rem/1.4 system-ui, sans-serif; text-decoration: none; }
@media (max-width: 760px) { .demo-ribbon { display: none; } }

/* ------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* footer credit */
.credit { font-weight: 600; color: var(--fg); }
