/* tabla-js site: the swaralipi-js docs' palette and layout. */
:root {
  color-scheme: light dark;
  --ink: light-dark(#1b1b1f, #e8e6e3);
  --muted: light-dark(#5b5b66, #a0a0ab);
  --line: light-dark(#e3e3e8, #34343c);
  --accent: light-dark(#b5560f, #f08a3c);
  --on-accent: light-dark(#fff, #1b1b1f);
  --bg: light-dark(#fbfaf7, #17171b);
  --panel: light-dark(#fff, #1f1f25);
  --code-bg: light-dark(#f3f1ec, #24242b);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Noto Sans Bengali', 'Kohinoor Bangla', 'Noto Sans Devanagari', 'Kohinoor Devanagari', sans-serif;
}
:root[data-theme='light'] { color-scheme: light; }
:root[data-theme='dark'] { color-scheme: dark; }

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); line-height: 1.55; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

header {
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); background: var(--panel);
}
.brand { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; text-decoration: none; color: var(--ink); }
.brand svg { width: 1.6rem; height: 1.6rem; flex: none; }
/* the mark and banner are inline, so the theme reaches them: the brand's own colours */
svg .ink { fill: light-dark(#2a1c12, #ece6dd); }
svg .muted { fill: light-dark(#6b5642, #b3a58f); }
svg .accent { fill: #c76418; }
nav { display: flex; gap: 1rem; flex-wrap: wrap; }
nav a { text-decoration: none; color: var(--muted); }
nav a[aria-current='page'] { color: var(--accent); font-weight: 600; }
nav button { min-height: 0; padding: 0; border: 0; background: none; color: var(--muted); }
nav button:hover { color: var(--accent); }
/* the icon IS the state: half-circle auto, sun light, moon dark */
#theme::before { content: '\f042'; }
:root[data-theme='light'] #theme::before { content: '\f185'; }
:root[data-theme='dark'] #theme::before { content: '\f186'; }

main { max-width: 50rem; margin: 0 auto; padding: 1.75rem 1rem 3rem; }
footer { max-width: 50rem; margin: 0 auto; padding: 1rem 1rem 2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
h1 { font-size: 1.7rem; margin: 0 0 0.25rem; }
h2 { font-size: 1.25rem; margin: 2.25rem 0 0.5rem; }
h3 { font-size: 1rem; margin: 1.25rem 0 0.35rem; }
.lead { font-size: 1.05rem; color: var(--muted); }
.banner { margin: 0 0 1rem; line-height: 0; }
.banner svg { width: 100%; height: auto; }

code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 4px; }
pre { background: var(--code-bg); padding: 0.9rem 1rem; border-radius: 8px; overflow-x: auto; }
pre code { background: none; padding: 0; font-size: 0.82rem; line-height: 1.5; }
.code { position: relative; }
.code pre { padding-right: 2.75rem; }
.copy { position: absolute; top: 0.4rem; right: 0.4rem; min-height: 0; padding: 0.4rem; font-size: 0.85rem; border: 0; border-radius: 6px; background: var(--code-bg); color: var(--muted); cursor: pointer; }
.copy:hover { color: var(--accent); }
.copy[aria-label='Copied']::before { content: '\f00c'; }

/* a table scrolls inside its own box on a phone, never the page */
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
/* a long default like context.destination may wrap, so the last column keeps its room */
td:not(:first-child, :last-child) code { overflow-wrap: anywhere; }

button, input, select { font: inherit; color: inherit; }
button, select, input { min-height: 2.5rem; padding: 0 0.75rem; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
button { cursor: pointer; }
button:disabled { opacity: 0.5; cursor: default; }
.btn { display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0 1rem; border: 0; border-radius: 8px; background: var(--accent); color: var(--on-accent); text-decoration: none; font-weight: 600; }

.cards { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); margin: 1rem 0; }
.card { display: block; border: 1px solid var(--line); border-radius: 8px; padding: 0.9rem 1rem; background: var(--panel); color: var(--ink); text-decoration: none; }
.card:hover { border-color: var(--accent); }
.card h3 { margin: 0 0 0.25rem; color: var(--accent); }
.card p { margin: 0; color: var(--muted); }

.demo { border: 1px solid var(--line); border-radius: 8px; padding: 1rem; background: var(--panel); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.row select { flex: 1 1 10rem; }
.row input { width: 5.5rem; }
#status { color: var(--muted); font-size: 0.9rem; }
.cells { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
.cells li { min-width: 3.25rem; padding: 0.3rem 0.4rem; border: 1px solid var(--line); border-radius: 6px; text-align: center; font-size: 0.85rem; }
.cells li.vibhag { margin-left: 0.6rem; }
.cells li.now { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
