/* A3 Indices & works — only what the Gita Folio system lacks (multi-column index lists, compact memorable lines,
   paired passages, the references sheet). Tokens only; loaded on the A3 pages. */

/* Verse indices: on wide screens the entries run down the first column, then the second (the order of the alphabet
   reads column by column, as in a printed index; script and server render the same ul > li) */
.idx-letters{margin-top:var(--s-2)}
.idx-results .results-head h2 [lang=sa]{font-size:1.5rem}
.idx-list{display:block;columns:2 17rem;column-gap:var(--s-6);margin-top:var(--s-2)}
.idx-list li{min-width:0;break-inside:avoid}
.idx-list [lang]{overflow-wrap:anywhere}
/* ITRANS (qvir) is a typing scheme, not a reading one: upright in the UI face, the IAST under it in small italics */
.idx-list [lang=sa-Latn-x-itrans]{font:400 1rem/1.5 var(--ff-ui);letter-spacing:.01em}
.idx-list a:hover [lang=sa-Latn-x-itrans]{color:var(--accent)}
.idx-gloss{display:block;font:italic 400 var(--fs-small)/1.4 var(--ff-text);color:var(--text-muted)}
.idx-list [lang=sa-Latn]{font-size:1.0625rem;line-height:1.5}
.idx-list a:hover [lang=sa-Latn]{color:var(--accent)}
.idx-item{display:grid;grid-template-columns:3rem minmax(0,1fr);column-gap:var(--s-3);min-height:var(--tap);padding-block:var(--s-2);border-top:1px solid var(--border)}
.idx-item [lang=sa]{font:1.125rem/1.6 var(--ff-sanskrit)}
/* the reference sits on the text's baseline; rows are ruled below, so under the head's heavy rule (in one column or
   two) no second hairline appears */
.idx-list a,.idx-item{align-items:baseline}
.idx-list .vref{padding-top:0}
.idx-list a,.idx-list .idx-item{border-top:0;border-bottom:1px solid var(--border)}
.idx-list small .vref{font-size:1rem}
.idx-noref{color:var(--text-subtle)}
.idx-results[aria-busy=true] .idx-list{opacity:.45;transition:opacity var(--t)}
.idx-results .results-head h2:focus{outline:none}
.idx-foot{display:grid;gap:var(--s-3);margin-top:var(--s-4)}
.idx-foot .more{justify-self:start}
.idx-foot .pager .s{font-style:normal}

/* Search: four match modes fit 320px; results column */
.search-page__head .kicker{margin-bottom:var(--s-2)}
.search-well__go .btn--quiet{min-height:var(--tap)}
.search-try{margin-top:var(--s-6)}
.search-try .chips{margin-top:var(--s-3)}
.search-try .chip [lang=sa],.search-try .chip[lang=sa]{font-family:var(--ff-sanskrit);font-size:1.0625rem}
.hit__skt{margin-block:var(--s-1) var(--s-2)}
.hit .hit__speaker[lang=sa]{display:inline;margin-left:var(--s-3);font-size:1rem;line-height:1.5;color:var(--text-subtle)}
.hit .hit__speaker mark{color:var(--text)}
/* one clear control: the design system's ×, not the browser's own (blue) one */
.searchbox input::-webkit-search-cancel-button,.searchbox input::-webkit-search-decoration{-webkit-appearance:none;appearance:none;display:none}
/* "Starts with" / "Ends with" keep their full accessible name on phones, where " with" is only visually hidden */
@media(max-width:47.99rem){.vh-sm{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}}
.search-well__go .btn--quiet[aria-pressed=true]{color:var(--accent);background:var(--accent-wash)}
/* the jump hint beside the match modes (mockup: "… or go to a verse: type 2.47 · press / anywhere"); the live jump row */
.search-jump-hint{flex:1 1 14rem;min-width:0;color:var(--text-subtle)}
.search-jump-hint b{font-weight:600;color:var(--text-muted);font-variant-numeric:tabular-nums}
.search-jump-hint kbd{margin-inline:.15em}
.search-jump__row{margin-top:var(--s-2);border-bottom:1px solid var(--border)}
.search-jump__row .row__lead{display:grid;min-width:2rem;color:var(--accent)}
.search-jump__row .row__t{font:500 var(--fs-h4)/1.3 var(--ff-text)}
.search-jump__row:hover .row__t{color:var(--accent)}
/* the clear button only once there is something to clear; the example placeholder smaller than typed text */
.search-page .searchbox:has(input:placeholder-shown) [data-clear]{visibility:hidden}
.search-page .searchbox input::placeholder{font-size:.7em}
.search-results[aria-busy=true] .result-group{opacity:.5;transition:opacity var(--t)}
.search-results .pagination{padding-top:var(--s-5)}
/* phones show first, current and last page only (shared rule): the first hidden page after a shown one becomes "…",
   so 1 3 reads 1 … 3 (still a link to that page, named "Page 2") */
@media(max-width:30rem){
  .search-results .pagination ol li:is(:first-child,:has([aria-current]))+li:not(:last-child,:has([aria-current])){display:block}
  .search-results .pagination ol li:is(:first-child,:has([aria-current]))+li:not(:last-child,:has([aria-current])) a{font-size:0}
  .search-results .pagination ol li:is(:first-child,:has([aria-current]))+li:not(:last-child,:has([aria-current])) a::before{content:"…";font-size:1.25rem}
}
@media(max-width:30rem){
  .search-modes{display:flex;width:100%}
  .search-modes>button{flex:1 1 auto;min-width:0;padding-inline:.45rem}
}

/* Memorable lines: saying blocks at reading size, one under another */
.ml-jump a{font:500 1.25rem/1 var(--ff-display);font-variant-numeric:oldstyle-nums}
.ml-chapter .results-head h2{font-size:var(--fs-h4)}
.ml-title{font-style:italic}
.ml-list>li{padding-block:var(--s-6)}
.ml-list>li+li{border-top:1px solid var(--border)}
.ml-line [lang=sa]{font-size:var(--fs-deva);line-height:1.8;text-wrap:balance}
.ml-jump .ml-jump__none{display:grid;place-items:center;min-width:var(--tap);min-height:var(--tap);font:500 1.25rem/1 var(--ff-display);font-variant-numeric:oldstyle-nums;color:var(--text-subtle);opacity:.45}
.ml-line .iast{margin-top:var(--s-2);font-size:var(--fs-body)}
.ml-line .meaning{font-size:var(--fs-h4);text-wrap:pretty}
.ml-line .saying__ref{display:inline-flex;align-items:center;justify-content:center;min-width:var(--tap);min-height:var(--tap);padding-inline:var(--s-2);font-size:1.125rem}

/* Names: Devanagari name, IAST, meaning, verses */
.name-meaning{display:block;font:400 var(--fs-small)/1.45 var(--ff-text);color:var(--text-muted)}
.names-refs{margin-top:.15rem}
.names-refs .vref{font-size:1.0625rem}
.names-more{white-space:nowrap}
.names-group .row__lead{min-width:7rem;text-align:left}
@media(max-width:30rem){
  .names-group .row{grid-template-columns:minmax(0,1fr) auto}
  .names-group .row__lead{grid-column:1/-1;place-items:start;min-width:0}
}

/* Works of Sri Aurobindo and the Mother */
.works,.bw-list{max-width:calc(48rem + 2 * var(--gutter))}
/* The three legacy works cards as doors (base.css §15.5 .doors / .door / .door__links): the card title is an h2 (the page
   has no section heading above the doors) set like .door h3. */
.works-doors{margin:0 0 var(--s-7)}
.works-doors .door__title{margin:.3rem 0 .4rem;font-size:var(--fs-h4);line-height:var(--lh-h4)}
.works-head{margin-bottom:var(--s-2)}
.works-group+.works-group{margin-top:var(--s-6)}
.works-group{scroll-margin-top:var(--s-5)}
.essay-head .crumbs{justify-content:center;margin-bottom:var(--s-4)}
.work-passages>li{padding-block:var(--s-6)}
.work-passages>li+li{border-top:1px solid var(--border)}
/* a hanging numeral: a wrapped title returns under its own text, not under the number */
.work-passage h2{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:.5em;margin-bottom:var(--s-3);font-size:var(--fs-h3)}
.work-passage h2 .num{font-variant-numeric:oldstyle-nums;color:var(--accent)}
/* the work's description under its title, set as a dek within the measure */
.work-dek{max-inline-size:40rem;margin:var(--s-3) auto 0;font:italic var(--fw-medium) var(--fs-h4)/1.4 var(--ff-display);color:var(--text-muted);text-wrap:balance}
.work-passage .pull p+p,.work-passage .pull .work-items{margin-top:var(--s-3)}
.work-items{padding-left:1.4em;list-style:lower-alpha}
.work-items li+li{margin-top:var(--s-3)}
.work-items li::marker{font-style:normal;color:var(--accent)}
.pull .work-items li{font:italic var(--fw-medium) var(--fs-h4)/1.4 var(--ff-display)}
.work-passage .pull{margin-block:var(--s-2) var(--s-4)}
.work-passage>.label{margin-top:var(--s-2)}
.work-by{margin-top:var(--s-3);text-align:right;font-style:italic;color:var(--text-subtle)}
.work .pager,.bw-reader .pager{margin-top:var(--s-6)}

/* Bengali writings reader */
.bw-note{margin-top:var(--s-2)}
.bw-reader .prose p:first-child{text-indent:0}
/* Sanskrit quotations (restored from the old font encoding) set off as verse, not as run-on paragraphs */
.bw-reader .prose .sa-quote{margin-block:var(--s-3);padding-left:var(--s-5);text-indent:0}
.bw-reader .prose .sa-quote+.sa-quote{margin-top:calc(-1 * var(--s-2))}
.bw-reader .prose .sa-quote+p:not(.sa-quote){text-indent:0}

/* References sheet (legacy "References" modal) */
.refs-dialog .modal__body{max-height:min(70vh,36rem);overflow-y:auto}
.refs-more{width:100%;margin-top:var(--s-4)}
.ref-card+.ref-card{margin-top:var(--s-4);padding-top:var(--s-4);border-top:1px solid var(--border)}
.ref-card .vref{display:inline-flex;align-items:center;min-height:var(--tap);font-size:1.25rem}
.ref-card [lang=sa]{font:var(--fs-deva-sm)/1.8 var(--ff-sanskrit)}
.ref-card .iast{margin-top:var(--s-1);font-size:var(--fs-small);line-height:1.5}
.ref-card .ref-trans{margin-top:var(--s-2);font-size:var(--fs-small);line-height:1.5;color:var(--text-muted)}

/* Contents descriptions: their own line at reading leading (inline, they took the title's 1.6 line box) */
.works .contents .desc,.bw-list .contents .desc{display:block;line-height:1.5;margin-top:.15em}

/* Works and Bengali writings contents on phones: no leaders, the count under the title, a narrow numeral column */
@media(max-width:30rem){
  .works .contents a,.bw-list .contents a{grid-template-columns:1.75rem minmax(0,1fr);column-gap:var(--s-2)}
  .works .contents .line{display:block}
  .works .contents .leader{display:none}
  .works .contents .value{display:block;margin-top:var(--s-1)}
}

/* Phone switcher: room for the 2px focus ring and its offset inside the scrolling strip (layout unchanged) */
.tool-main>.tool-nav--chips{padding-block:6px;margin-top:-4px;margin-bottom:calc(var(--s-5) - 4px);scroll-padding-inline:calc(var(--gutter) + 6px)}
.tool-head h1{text-wrap:balance}
