/* The book: the look sample's styles (design/sources/look/index.html, as approved with the plan on 27 November 2026),
   with the site's file paths, the language switch, the plan's new pages, Tamil and Sinhala, and the dark look added at
   the end. The site builder links our website basics (nsys-basics.css) before this file. */
@font-face { font-family: "Fraunces"; src: url("/assets/fonts/fraunces.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
/* While Fraunces is on its way (on a slow connection), the device's own serif stands in for it with Fraunces' own
   heights (from the font file: ascent 97.8%, descent 25.5%, no line gap), so a line is as tall before the font arrives
   as after, and a page fitted to its screen doesn't jump when it does. Found by the release check on 29 November 2026:
   the Tamil cover on a phone fitted itself to the stand-in, then moved 0.19 as the font came. Heights only: a word's
   width may still differ a little. Browsers without these descriptors use the stand-in as it is, as before. */
@font-face { font-family: "Fraunces stand-in"; font-weight: 100 900; ascent-override: 97.8%; descent-override: 25.5%; line-gap-override: 0%;
  src: local("Georgia"), local("Times New Roman"), local("TimesNewRomanPSMT"), local("Noto Serif"), local("NotoSerif-Regular"),
    local("DejaVu Serif"), local("Liberation Serif"); }   /* one face, as the site builder allows two font faces: bold is drawn from it */

:root {
  --cloth: #0b3b46;      /* the cover and binding: the library's dark teal */
  --gold: #d9b45a;       /* foil */
  --cream: #f3ead3;
  --paper: #fbf8f1;
  --paper-back: #efe8d8;
  --endpaper: #d8ccb0;    /* the inside of the covers */
  --ink: #1d2a2e;
  --muted: #5c6a6e;
  --line: #e3dccb;
  --desk: #e6e0d2;
  --ok: #2f6b3a;
  --turn: 0.55s;         /* page turn: longer than our usual 0.25 s, for the user's OK */
  --serif: "Fraunces", "Fraunces stand-in", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ribbons: 4.125rem;   /* room for the open section's ribbon, the longest (it starts 2px up, under the book) */
  --silk: var(--endpaper);   /* every bookmark ribbon: the colour of the inside of the cover */
  --silk-edge: #bfb08c;      /* its woven edge, so it stands out from the desk, which is nearly the same colour */
  --threads: repeating-linear-gradient(90deg, rgba(60, 48, 26, .04) 0 1px, transparent 1px 0.1875rem);   /* a ribbon's weave */
  --cloth-weave: repeating-linear-gradient(45deg, rgba(255,255,255,.025) 0 2px, transparent 2px 0.3125rem);   /* the cover's cloth */
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
/* Our website basics come from the site builder's basics.css (content width, side margins, 16 px text, running text
   width), linked above. Every size here is in rem, so a reader's own text-size setting and zoom work fully. */
body { background: var(--desk); color: var(--ink); font: 1rem/1.55 var(--sans); overflow: hidden; -webkit-text-size-adjust: 100%; }
a { color: inherit; }
.ic { display: inline-block; width: 1.125rem; height: 1.125rem; flex: none; background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }

/* ---------- the book ---------- */
.desk { height: 100%; display: flex; flex-direction: column; align-items: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); }
.book { width: 100%; flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; z-index: 2; }

.binding { position: relative; z-index: 1; display: flex; align-items: center; gap: 0.625rem; padding: 0.5rem 0.75rem;
  background: var(--cloth); color: var(--cream); min-height: 3rem;
  background-image: var(--cloth-weave);
  border-bottom: 2px solid #072a32; }
.binding::after { content: ""; position: absolute; left: 0.625rem; right: 0.625rem; bottom: 0.3125rem; border-bottom: 1px dashed rgba(217,180,90,.45); }
.bind-name { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; flex: 1; min-width: 0; }
.bind-name span { font: 500 0.875rem/1.15 var(--serif); letter-spacing: .01em; }
.seal { display: block; background: var(--gold); -webkit-mask: url("/assets/seal.png") center / contain no-repeat;
  mask: url("/assets/seal.png") center / contain no-repeat; }
.seal.mini { width: 1.75rem; height: 1.75rem; flex: none; }
.nsys-languages { display: flex; border: 1px solid rgba(243,234,211,.35); border-radius: 62.4375rem; overflow: hidden; font-size: 0.75rem; }
.nsys-languages__item { padding: 0.1875rem 0.5rem; line-height: 1.4; }
.nsys-languages__item[lang="ta"] { font-family: var(--nsys-font-tamil); }
.nsys-languages__item[lang="si"] { font-family: var(--nsys-font-sinhala); }
.nsys-languages__item[aria-current] { background-color: var(--gold); color: var(--cloth); font-weight: 700; }
.signin { display: flex; align-items: center; gap: 0.3125rem; font-size: 0.8125rem; text-decoration: none; white-space: nowrap; }
.signin .ic { width: 1rem; height: 1rem; }

.stack { position: relative; flex: 1; min-height: 0; z-index: 2;
  /* The edges of the pages still to read, under the open one: as many lines as --edges (0 to 6), which the script sets
     from the pages left (the user, 26 November 2026: "What if we change the number of lines based on the pages left
     next?"). All six at the cover, fewer as the book is read, none on the last page, with only the back board under
     it. A line shows only if --edges reaches it; the book's shadow follows the edges' depth. */
  --edges: 6;
  box-shadow: 0 2px 0 rgb(241 235 222 / clamp(0, var(--edges), 1)), 0 0.1875rem 0 rgb(217 209 191 / clamp(0, var(--edges) - 1, 1)),
    0 0.3125rem 0 rgb(239 232 218 / clamp(0, var(--edges) - 2, 1)), 0 0.375rem 0 rgb(212 203 183 / clamp(0, var(--edges) - 3, 1)),
    0 0.5rem 0 rgb(235 228 212 / clamp(0, var(--edges) - 4, 1)), 0 0.5625rem 0 rgb(207 197 176 / clamp(0, var(--edges) - 5, 1)),
    0 calc(0.3125rem + var(--edges) * 1.5px) 1.375rem rgba(30, 25, 15, .22); }

.sheet { position: absolute; inset: 0; }
.sheet.turned, .sheet.lifted { visibility: hidden; }
.sheet > .back { display: none; }
.front { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: none; background: var(--paper);
  background-image: linear-gradient(to bottom, rgba(40,30,10,.10), transparent 1rem); }
.front:focus { outline: none; }
/* The thin band of the section's colour lies over the top of the page, so a page can be laid out as a whole. It's the
   page's last part (::after), so it's drawn over photos without a z-index: a z-index would lift it out of the turning
   page's face into the 3D space beside it, where Safari can't tell which of the two is in front, and it flickers. */
.front::after { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 0.25rem; background: var(--accent); opacity: .9; }
.front { --rows: calc(0.5 + 0.5 * var(--fit, 1)); }   /* the rows of a list close up half as much as the page's big spacing */
/* A page that nearly fits its screen is made to fit, so it never scrolls by just a little (see fit() in the script):
   first its photo, shelf or seal gives way (--give), down to its smallest, then its spacing closes up (--fit). A page
   with more than that keeps its full spacing and scrolls. */
.page-in { max-width: 42.5rem; margin: 0 auto; padding: calc(1.75rem * var(--fit, 1)) 1.25rem calc(2rem * var(--fit, 1)); }

/* the turning page: the page cut into thin strips, each tilted a little more than the one above, so it bends */
/* Pages in the air are drawn in one 3D space, so where several overlap, the one nearer the eye shows, as with paper.
   The depth (how far the eye is, looking from the middle of the binding) is part of this space's own transform:
   Safari ignores a perspective set on the book around it, and draws the turning pages flat. */
.sky { position: absolute; inset: 0; z-index: 300; pointer-events: none; transform-style: preserve-3d;
  transform: perspective(112.5rem); transform-origin: 50% 0; }
.bender { position: absolute; inset: 0; pointer-events: none; transform-style: preserve-3d; }
.bender.parked { transform: translateX(-200%); }   /* made before its turn, or landed: out of sight, as adding or
   removing one while others move would hold them up */
.strip { position: absolute; left: 0; right: 0; transform-origin: 50% 0; transform-style: preserve-3d; }
.face { position: absolute; left: 0; right: 0; top: 0; bottom: -2px; overflow: hidden;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  /* A face holds its own layers, so its shade goes away with it when it turns from the eye. Without this Safari drew the
     front's shade as a layer of its own beside the face, not hidden with it: the page's back and the bar it lands on
     darkened and flickered as the shade and the back fought over which was in front (the user, 29 November 2026, in
     Safari on a Mac: "It's getting flickering with the shadows and things"; measured in Safari's recordings: the bar dark
     for about half a second at the end of every turn, none with this). */
  isolation: isolate; }
.face.b { transform: rotateX(180deg); background: var(--paper-back); }
.cover .face.b { background: var(--endpaper); }
.cover.leaf .face.b { background: var(--paper-back); }   /* the cover turning with pages after it: their back shows */
/* Our credit, once, on the back of each page at its free edge, the bottom edge that lifts first as the page turns, with
   the back cover's colophon above it: the copyright and who envisioned the library's site (the user, 26 November 2026:
   "What if we put Copyright and "Envisioned by Municipal Commissioner Mr. N. Thananjeyan" above our credit to the page
   back and back cover?"). Nearest the free edge is uppermost as the page curls over, so the colophon comes first. */
.back-in { position: absolute; left: 0; right: 0; }
/* The lines are kept narrower than the page (18rem, or 60% of a wide page), as the curl brings the free edge toward
   the eye and magnifies it: on a phone a line across the whole page ran off both sides of the screen.
   The text is a tint of its brown, at 50% (the user, 26 November 2026: "tint the mark behind the pages", then "All the
   text behind the pages"; a teal tint was tried, then "Go back the color. Only tint (50% opacity)"). It was 85%. At
   50% it's 2.7 to 1 on a page's back and 2.5 to 1 on the inside of the front cover, under the 4.5 to 1 the shared
   contrast check asks of reading text. */
.back-text { position: absolute; left: 0; right: 0; top: 1.5rem; margin: 0 auto; max-width: max(18rem, 60%); text-align: center;
  color: rgba(60, 48, 26, .5); font-size: 0.9375rem; line-height: 1.45; letter-spacing: .03em; }
.back-text p { margin: 0; }
.back-text .colophon { margin-bottom: 0.625rem; }
.back-text .colophon p + p { margin-top: 0.375rem; }
.back-text .back-lines { color: inherit; font-size: inherit; line-height: inherit; }
/* two names are bold: the Commissioner's and ours (the user, 26 November 2026: "Bold the names", then "Bold only the
   names "Mr. N. Thananjeyan" and "NSysNets"") */
:is(.back-text, .colophon, .credit) b { font-weight: 700; }
/* our credit stays whole, never split between "Developed by" and "NSysNets" (the rule of 27 November 2026: work made
   for one client says "Developed by NSysNets") */
.credit a, .credit-line { white-space: nowrap; }
.back-in a { color: inherit; pointer-events: auto; }   /* the turning page ignores clicks, except on this link */
/* A turned page comes to rest over the top bar: the end of its back nearest the binding carries a copy of the bar, so
   it lands looking just like it, and the rest of it runs on up to the top edge of the screen. */
.back-bind { position: absolute; left: 0; right: 0; bottom: 0; }
.back-bind a { pointer-events: none; }
/* The copy is printed on the paper, in the paper's own colour. Once a page has turned, its back lies on the bar, so the
   bar shows that paper too, printed the same way: the inside of the cover once the cover is open, a page's back after
   that. Closed, at the cover, the bar is the bare cloth binding. */
.back-bind, .binding.paper, .binding.endpaper { color: var(--ink); background-image: none; border-bottom-color: rgba(60, 48, 26, .18); }
.back-bind { background: transparent; }
.binding.paper { background-color: var(--paper-back); }
.binding.endpaper { background-color: var(--endpaper); }
:is(.back-bind, .binding.paper, .binding.endpaper)::after { border-bottom-color: rgba(60, 48, 26, .3); }
/* the turned page goes on up past the bar to the top edge, so its paper fills the space above the bar too */
.binding.paper::before, .binding.endpaper::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 100vh; background: inherit; }
.binding.paper, .binding.endpaper { border-radius: 0; }
:is(.back-bind, .binding.paper, .binding.endpaper) .seal.mini { background: var(--cloth); }
:is(.back-bind, .binding.paper, .binding.endpaper) .nsys-languages { border-color: rgba(60, 48, 26, .25); }
:is(.back-bind, .binding.paper, .binding.endpaper) .nsys-languages__item[aria-current] { background-color: var(--cloth); color: var(--cream); }
.back-cover .frame { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.seal.mid { width: 6.5rem; height: 6.5rem; margin: 0 auto 0.875rem; }
.back-lines { margin: 0.75rem 0 0; color: #d8d0bb; font-size: 0.875rem; line-height: 1.6; }
.credit { margin: 1.75rem 0 0; font-size: 0.875rem; }
.credit a { color: #cfc6ae; }
.face .front { inset: auto; left: 0; right: 0; overflow: hidden; background-image: none; }
.shade { position: absolute; inset: 0; background: #1a140a; opacity: 0; }
.drop { position: absolute; inset: 0; z-index: 250; pointer-events: none; opacity: 0;
  background: linear-gradient(to bottom, rgba(20,15,5,.55), rgba(20,15,5,.18) 45%, rgba(20,15,5,0) 85%); }
.turnon .hint { font-size: 0.875rem; color: var(--muted); }

/* ---------- ribbons: the menu ---------- */
.ribbons { position: relative; z-index: 1; width: 100%; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.3125rem; padding: 0 0.625rem calc(env(safe-area-inset-bottom)); height: calc(var(--ribbons) + env(safe-area-inset-bottom)); margin-top: 0; }
/* Every ribbon is the colour of the inside of the cover (the endpaper), and wears its section's colour (--rib) on its
   icon and label; the open section's ribbon is the cover's own cloth, lettered in its gold (the user, 26 November 2026:
   "What if we use same color for the bookmarks and colored icon and labels?", then "Maybe back of the front cover for
   all ribbons and front cover color for the selected one?"). On the endpaper the section colours are a little deeper
   (80%, the rest black), as Books' brown was 3.5 to 1 and Read's green only just 4.5: now 4.75 to 1 (Books) to 8.4
   (Home), on a thread. The gold is 5.7 to 1 on the cloth's weave. The ribbon itself is the edge colour, and its
   face is drawn 1px inside it (::before), so it keeps a fine edge along its sides and its notch. */
.ribbon { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px;
  height: 3.625rem; padding: 0 2px 0.75rem; margin-top: -2px; text-decoration: none; color: color-mix(in srgb, var(--rib) 80%, #000);
  background: var(--silk-edge); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 0.5625rem), 0 100%);
  transition: height .2s ease-out; }
.ribbon::before { content: ""; position: absolute; inset: 0 1px 1px; background-color: var(--silk);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 0.5625rem), 0 100%);
  background-image: linear-gradient(to bottom, rgba(40, 30, 10, .22), transparent 0.625rem), var(--threads); }
.ribbon > * { position: relative; }   /* the icon and label lie on the ribbon's face */
.ribbon span { font-size: 0.75rem; font-weight: 600; line-height: 1.1; letter-spacing: .01em; }
.ribbon .ic { width: 1.0625rem; height: 1.0625rem; }
.ribbon[aria-current="page"] { height: 4.125rem;   /* 8px lower */
  --silk: var(--cloth); --silk-edge: #072a32; --threads: var(--cloth-weave); color: var(--gold); }
/* Every ribbon hangs far enough below the book's page edges (0.5625rem) that its icon shows whole, not only the open
   section's (the user, 26 November 2026: "Can we make the bookmark icons visible fully always?") */
@media (prefers-reduced-motion: reduce) { .ribbon { transition: none; } }

/* ---------- shared page parts ---------- */
.eyebrow { margin: 0 0 0.5rem; font-size: 0.7812rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; }
h1 { font-size: 2rem; line-height: 1.12; letter-spacing: -0.01em; margin-bottom: 0.75rem; }
h2 { font-size: 1.375rem; margin: calc(2.25rem * var(--fit, 1)) 0 0.75rem; }
h3 { font-size: 1.0312rem; }
p { margin: 0 0 0.75rem; }
.lead { color: var(--muted); font-size: 1.125rem; margin-bottom: calc(1.5rem * var(--fit, 1)); }
.rule { border: 0; border-top: 1px solid var(--line); margin: 1.375rem 0; }
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.6875rem 1rem; border-radius: 0.625rem; font-weight: 600; font-size: 0.9375rem;
  text-decoration: none; border: 1px solid transparent; cursor: pointer; font-family: inherit; }
.btn.solid { background: var(--cloth); color: var(--cream); }
.btn.ghost { border-color: var(--line); background: #fff; color: var(--ink); }
.btn .ic { width: 1.0625rem; height: 1.0625rem; }
/* a link that opens the library's system or a map in a new tab: the shared arrow pointing out (an arrow
   character in the text until the rule of 29 November 2026 against picture symbols) */
.out::after { content: ""; display: inline-block; flex: none; width: 1em; height: 1em; margin-left: -0.0625em; vertical-align: -0.125em;
  background-color: currentColor; -webkit-mask: url("icons/arrow-up-right.svg") center / contain no-repeat; mask: url("icons/arrow-up-right.svg") center / contain no-repeat; }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.turnon { margin-top: calc(1.875rem * var(--fit, 1)); display: flex; justify-content: center; }
.turnon button { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; cursor: pointer;
  color: var(--muted); font: 0.875rem var(--sans); padding: 0.5rem 0.875rem; }
.turnon b { color: var(--ink); font: 600 1rem var(--serif); }
.turnon b::after { content: ""; display: inline-block; width: 1.125em; height: 1.125em; margin-left: 0.125em; vertical-align: -0.1875em;
  background-color: currentColor; -webkit-mask: url("icons/arrow-up.svg") center / contain no-repeat; mask: url("icons/arrow-up.svg") center / contain no-repeat; }   /* the next page lifts up from below: the shared arrow (an arrow character in the text before) */
.imprint { margin-top: 1.625rem; padding-top: 0.875rem; border-top: 1px solid var(--line); font-size: 0.875rem; color: var(--muted); text-align: center; }
.imprint a { color: var(--muted); }
.search { display: flex; gap: 0.5rem; }
.search input { flex: 1; min-width: 0; font: 1rem var(--sans); padding: 0.75rem 0.875rem; border-radius: 0.625rem; border: 1px solid #d6cdb8; background: #fff; color: var(--ink); }
.search button { border: 0; border-radius: 0.625rem; padding: 0 1rem; background: var(--cloth); color: var(--cream); font: 600 0.9375rem var(--sans); cursor: pointer; display: flex; align-items: center; gap: 0.375rem; }
.chips { display: flex; flex-wrap: wrap; gap: var(--nsys-tap-gap); margin: 0.625rem 0 0; }
.chip { font-size: 0.875rem; padding: 0.3125rem 0.6875rem;   /* 14 px: a chip of three words is reading text (was 13.5) */ border-radius: 62.4375rem; border: 1px solid var(--line); background: #fff; }
.chip.on { background: var(--cloth); color: var(--cream); border-color: var(--cloth); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin: 1rem 0 0.25rem; }
.stats div { background: #fff; border: 1px solid var(--line); border-radius: 0.625rem; padding: 0.625rem; }
.stats b { display: block; font: 600 1.1875rem var(--serif); }
.stats span { font-size: 0.875rem; color: var(--muted); line-height: 1.3; display: block; }
/* Until the library's feed answers (book.json's feedSoon, PLAN.md): the cover's two counts give way to one tile, a link to the
   catalogue in the library's system, and Find a book's band says so in one line across it */
.stats .soon { grid-column: span 2; padding: 0; }
.stats .soon a { display: block; height: 100%; padding: 0.625rem; text-decoration: none; }

/* ---------- roomy pages, with parts that run edge to edge across the page ---------- */
.gap { margin-top: calc(1.25rem * var(--fit, 1)); }
.bleed { position: relative; margin: 0; background: #d9d2c2; }
.bleed img { display: block; width: 100%; height: max(10rem, clamp(12rem, 40vh, 28rem) - var(--give, 0px)); object-fit: cover; }
.bleed figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 2.5rem 1.25rem 0.75rem; color: #fff; font-size: 0.875rem;
  background: linear-gradient(to top, rgba(10, 10, 10, .6), transparent); }
.band { background: var(--accent); color: #fff; padding: calc(2.25rem * var(--fit, 1)) 0; margin: 0.5rem 0; }
.band .page-in { padding-top: 0; padding-bottom: 0; }
.figures { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem 1rem; }
.figures b, .fees b { display: block; font: 600 2.25rem/1.05 var(--serif); letter-spacing: -0.01em; }
.figures span, .fees span, .fees small, .band-text > span { display: block; font-size: 0.9375rem; color: rgba(255, 255, 255, .88); margin-top: 0.25rem; }
.band-text > b { display: block; font: 600 1.5rem var(--serif); }   /* the band's own heading and line, not those of a list in it */
.band-text > span { font-size: 1.0625rem; max-width: var(--nsys-text); }
.figures > .soon { grid-column: 1 / -1; margin: 0; font-size: 1.0625rem; max-width: var(--nsys-text); }
.fees { display: grid; gap: 1.5rem; }
.fees span { text-transform: uppercase; letter-spacing: .08em; font-size: 0.875rem; font-weight: 700; margin: 0 0 0.25rem; }
.fees b { font-size: 3rem; }
.btn.light { background: transparent; border-color: rgba(255, 255, 255, .7); color: #fff; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 0.5rem; }
.tile { display: flex; flex-direction: column; gap: 0.25rem; min-height: 7.5rem; padding: 1rem 1.125rem; border-radius: 0.875rem;
  background: var(--t); color: #fff; text-decoration: none; }
.tile .ic { width: 1.5rem; height: 1.5rem; margin-bottom: auto; }
.tile b { font: 600 1.125rem var(--serif); }
.tile span { font-size: 0.875rem; color: rgba(255, 255, 255, .9); }
.shelf { display: flex; align-items: flex-end; gap: 2px; height: max(3.5rem, 6rem - var(--give, 0px)); padding: 0 1rem; overflow: hidden;
  background: linear-gradient(to bottom, #f6f1e6, #ece3d1); border-bottom: 0.5rem solid #8a6a43; }
.shelf i { flex: none; border-radius: 2px 2px 0 0; box-shadow: inset 0 0.4rem 0 rgba(255, 255, 255, .14), inset 0 -0.9rem 0 rgba(0, 0, 0, .12); }
.popular { list-style: none; counter-reset: pop; margin: 0; padding: 0; display: grid; gap: 0.25rem 2rem; }
.popular li { counter-increment: pop; display: grid; grid-template-columns: 2.75rem 1fr; align-items: baseline; padding: calc(0.875rem * var(--rows)) 0; border-bottom: 1px solid var(--line); }
.popular li::before { content: counter(pop); grid-row: span 2; font: 600 1.75rem var(--serif); color: var(--accent); }
.popular b { font: 600 1.125rem var(--nsys-font-tamil); }
.popular span { font: 0.9375rem var(--nsys-font-tamil); color: var(--muted); }
.cards.two { margin-top: 0.5rem; }
.bigsteps { list-style: none; counter-reset: step; margin: 0.5rem 0 0; padding: 0; }
.bigsteps li { counter-increment: step; position: relative; padding: 0.375rem 0 calc(1.25rem * var(--rows)) 3.5rem; font-size: 1.0625rem; }
.bigsteps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 2.5rem; height: 2.5rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: #fff; font: 600 1.125rem var(--serif); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.facts b { display: block; font: 600 2rem/1.1 var(--serif); color: var(--accent); }
.facts span { font-size: 0.9375rem; color: var(--muted); }
/* On a narrow phone the three figures share 98 to 129 px each, and "Rs. 5.00" needs 124 px at 2rem: all three are
   1.5rem there, the same size, so none breaks onto two lines (money with its cents since 27 November 2026) */
@media (max-width: 28.6875em) { .facts b { font-size: 1.5rem; } }
/* and the two-across figures, "Rs. 5.00" on the rules page, on the narrowest phones (360 px): 1.75rem, all of a band's
   figures the same size */
@media (max-width: 23.375em) { .figures b { font-size: 1.75rem; } }
.addr { margin: 2px 0 0; }

/* ---------- cover ---------- */
.cover .front { background: var(--cloth); color: var(--cream);
  background-image: var(--cloth-weave), radial-gradient(ellipse at 50% 0, rgba(255,255,255,.07), transparent 60%); }
.cover .front::after { display: none; }
.cover .page-in { padding-top: calc(1.125rem * var(--fit, 1)); text-align: center; min-height: 100%; display: flex; flex-direction: column; }
.cover .frame { flex: 1; }   /* the gold frame runs round the whole cover */
.frame { border: 1px solid rgba(217,180,90,.6); outline: 1px solid rgba(217,180,90,.35); outline-offset: 0.25rem; border-radius: 0.25rem; --frame-x: 1.125rem; --frame-top: calc(1.625rem * var(--fit, 1)); padding: var(--frame-top) var(--frame-x) calc(1.375rem * var(--fit, 1)); margin: 0.375rem; }
.seal.big { width: max(5rem, 8.25rem - var(--give, 0px)); height: max(5rem, 8.25rem - var(--give, 0px)); margin: 0 auto 0.875rem; }
/* The cover's title: the library's name in the reader's language only, as the switch in the top bar offers the other
   two (the user, 26 November 2026: "Since we have 3 language options, we can display only selected language title?").
   This sample is the English version; the Tamil and Sinhala versions show their own name the same way. */
.title { font: 600 2.25rem/1.1 var(--serif); letter-spacing: -0.005em; color: var(--gold); margin: 0; }
.title:lang(ta) { font: 700 2rem/1.35 var(--nsys-font-tamil); }
.title:lang(si) { font: 600 2rem/1.35 var(--nsys-font-sinhala); }
.name-en { font: 600 0.875rem/1.4 var(--serif); letter-spacing: .22em; text-transform: uppercase; margin: 0.375rem 0 0; }
.since { display: flex; align-items: center; gap: 0.625rem; justify-content: center; margin: 0.75rem 0 1.125rem; color: var(--gold); font: italic 500 0.9375rem var(--serif); }
.since::before, .since::after { content: ""; width: 2.375rem; border-top: 1px solid rgba(217,180,90,.6); }
.cover .search input { border-color: transparent; }
.cover .search button { background: var(--gold); color: var(--cloth); }
.open-now { display: inline-flex; align-items: center; gap: 0.4375rem; margin: 0.875rem 0 0; font-size: 0.875rem; }
.open-now i { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #7fd18f; }
.cover .stats div { background: rgba(255,255,255,.06); border-color: rgba(217,180,90,.3); }
.cover .stats b { color: var(--gold); }
.cover .stats span { color: #d8d0bb; }
.plate { margin: 1.25rem auto 0; padding: 0.375rem; background: var(--cream); border-radius: 0.1875rem; box-shadow: 0 0.375rem 1.125rem rgba(0,0,0,.35); max-width: 32.5rem; }
.plate img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
/* on the one-column cover, the photo gives way too (75cqw: its 4:3 height) */
@media (max-width: 1099px) { .plate { container-type: inline-size; } .plate img { aspect-ratio: auto; height: max(10rem, 75cqw - var(--give, 0px)); } }
.plate figcaption { color: #4a4436; font: italic 0.875rem var(--serif); padding: 0.375rem 2px 0; }
.opener { margin-top: calc(1.375rem * var(--fit, 1)); background: none; border: 1px solid rgba(217,180,90,.6); color: var(--gold); border-radius: 62.4375rem; padding: 0.625rem 1.125rem;
  font: 600 0.9375rem var(--sans); display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; }

/* The last page is the inside of the back cover (the user, 26 November 2026: "Is it correct using the cover's outside
   design/pattern to the inside of the back cover?"; it wasn't, then "Try"). Turning past the last page shows the back
   board's inside, so it's the endpaper, as the inside of the front cover is, with the seal and words printed in ink;
   the cloth is only the covers' outside. */
.back-cover .front { background: var(--endpaper); color: var(--ink); background-image: linear-gradient(to bottom, rgba(40, 30, 10, .08), transparent 1rem); }
.back-cover .frame { border-color: rgba(60, 48, 26, .35); outline-color: rgba(60, 48, 26, .18); }
.back-cover .seal { background: var(--cloth); }
.back-cover .since { color: var(--cloth); }
.back-cover .since::before, .back-cover .since::after { border-top-color: rgba(60, 48, 26, .4); }
.back-cover .back-lines, .back-cover .credit a { color: var(--ink); }
.back-cover .opener { color: var(--cloth); border-color: rgba(11, 59, 70, .5); }

/* ---------- books ---------- */
.books { list-style: none; margin: 0; padding: 0; }
.books li { display: flex; gap: 0.75rem; padding: calc(0.75rem * var(--rows)) 0; border-bottom: 1px solid var(--line); }
.spine { width: 2.375rem; height: 3.375rem; flex: none; border-radius: 2px 0.25rem 0.25rem 2px; color: #fff; display: grid; place-items: center;
  font: 600 1.0625rem var(--nsys-font-tamil); box-shadow: inset 0.25rem 0 0 rgba(0,0,0,.18); }
.bk h3 { font-size: 1rem; }
.bk h3:lang(ta) { font-family: var(--nsys-font-tamil); font-weight: 600; font-size: 0.9688rem; }
.bk .by { font-size: 0.875rem; color: var(--muted); margin: 1px 0 0.25rem; }
.bk .by:lang(ta) { font-family: var(--nsys-font-tamil); }
.meta { display: flex; flex-wrap: wrap; gap: 0.375rem 0.625rem; align-items: center; font-size: 0.875rem; color: var(--muted); }
.pill { padding: 2px 0.5rem; border-radius: 62.4375rem; font-size: 0.875rem; font-weight: 600; }
.pill.ok { background: #e3f0e5; color: var(--ok); }
.pill.ref { background: #efe9dc; color: #5b5240; }
.callno { font-family: ui-monospace, Menlo, monospace; font-size: 0.7812rem; }

/* what a search finds, on Find a book: shown only while there's a search, in place of the counts */
.found h2 { margin: calc(1.75rem * var(--fit, 1)) 0 0.25rem; }
.front:not(.searching) .found, .front.searching .band { display: none; }

/* ---------- read ---------- */
.cards { display: grid; gap: 0.625rem; }
@media (min-width: 640px) { .cards { grid-template-columns: 1fr 1fr; } }
.card { display: flex; gap: 0.75rem; padding: 0.875rem; background: #fff; border: 1px solid var(--line); border-radius: 0.75rem; text-decoration: none; }
.card .ic { width: 1.375rem; height: 1.375rem; color: var(--accent); margin-top: 2px; }
.card b { display: block; font: 600 1rem var(--serif); }
.card small { display: block; color: var(--muted); font-size: 0.875rem; line-height: 1.4; }
.card em { font-style: normal; font-weight: 700; color: var(--ink); }

/* ---------- events ---------- */
.ev { display: flex; gap: 0.875rem; padding: calc(0.75rem * var(--rows)) 0; border-bottom: 1px solid var(--line); }
.date { width: 3.625rem; flex: none; text-align: center; border: 1px solid var(--line); border-radius: 0.5rem; background: #fff; padding: 0.375rem 0; }
.date b { display: block; font: 600 1.25rem/1 var(--serif); }
.date span { font-size: 0.75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 700; }
.ev p { margin: 2px 0 0; font-size: 0.875rem; color: var(--muted); }
.empty { padding: 0.875rem; border: 1px dashed #d6cdb8; border-radius: 0.625rem; color: var(--muted); font-size: 0.9062rem; }

/* ---------- join ---------- */
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
th, td { text-align: left; padding: 0.5625rem 0.5rem; border-bottom: 1px solid var(--line); }
th { font-size: 0.8125rem; color: var(--muted); font-weight: 600; }
td.n { white-space: nowrap; }
.steps { margin: 0; padding-left: 1.375rem; }
.steps li { margin-bottom: 0.375rem; }

/* ---------- about ---------- */
.svc { display: grid; gap: 0.5rem; }
@media (min-width: 640px) { .svc { grid-template-columns: 1fr 1fr; } }
.svc div { background: #fff; border: 1px solid var(--line); border-radius: 0.625rem; padding: 0.6875rem 0.8125rem; font-size: 0.9062rem; }
.svc b { display: block; font-size: 0.9375rem; }

/* ---------- visit ---------- */
.place { background: #fff; border: 1px solid var(--line); border-radius: 0.75rem; padding: 0.875rem 1rem; }
.place > h2 { font-size: 1.0312rem; margin: 0; }   /* under the page's h1, the size an h3 has */
.hours { width: 100%; font-size: 0.9062rem; margin-top: 0.5rem; }
.hours td { padding: 0.25rem 0; border: 0; }
.hours td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.branches { columns: 2; column-gap: 1rem; padding: 0; margin: 0; list-style: none; font-size: 0.9375rem; }
.branches li { break-inside: avoid; padding: 0.375rem 0; border-bottom: 1px solid var(--line); }
.branches small { display: block; color: var(--muted); font-size: 0.875rem; }

/* ---------- other page layouts, so a turn doesn't always show the same shape (the user, 26 November 2026: "We used
   mostly horizontal layouts for pages, right? What if we use some others too?") ---------- */
/* Photo page: the photo fills the page, and the words lie on a dark fade at its foot */
.poster { position: relative; min-height: 100%; display: flex; flex-direction: column; justify-content: flex-end; background: #1d2a2e; color: #fff; }
.poster > .bleed { position: absolute; inset: 0; }
.poster > .bleed picture::after { content: ""; position: absolute; inset: 0;   /* on the photo, so the caption after it lies on top, with no z-index (see .front::after) */
  background: linear-gradient(to top, rgba(10, 14, 16, .94), rgba(10, 14, 16, .82) 45%, rgba(10, 14, 16, .3) 75%, rgba(10, 14, 16, 0) 92%); }
.poster > .bleed figcaption { top: 0; bottom: auto; text-align: right; padding: 0.875rem 1.25rem 2.5rem;
  background: linear-gradient(to bottom, rgba(10, 10, 10, .55), transparent); }
.poster > .page-in { position: relative; width: 100%; max-width: none; padding-top: calc(6rem * var(--fit, 1));
  /* the words always lie on dark, however far up the page they reach: this fade starts just above them */
  background: linear-gradient(to bottom, rgba(10, 14, 16, 0), rgba(10, 14, 16, .9) calc(5rem * var(--fit, 1))); }
.poster .eyebrow { color: var(--gold); }
.poster .lead, .poster p { color: rgba(255, 255, 255, .92); }
.poster .turnon button, .poster .turnon .hint { color: rgba(255, 255, 255, .86); }
.poster .turnon b { color: #fff; }
/* a photo that fills its part of the page, whatever the words beside it need */
.poster > .bleed img { position: absolute; inset: 0; height: 100%; }
/* Poster number: one figure as big as the page allows, everything else small around it */
.centred > :is(.eyebrow, h1, .lead) { text-align: center; margin-left: auto; margin-right: auto; }
.bignum { text-align: center; padding: calc(0.5rem * var(--fit, 1)) 1.25rem calc(1.5rem * var(--fit, 1)); }
/* the number gives way, like a photo, when the page needs the room (see fit() in the script) */
.bignum b { display: block; font: 600 max(3.5rem, 4.5rem - var(--give, 0px))/0.95 var(--serif); letter-spacing: -0.03em; color: var(--accent); }
.bignum span { display: block; max-width: 34rem; margin: 0.75rem auto 0; font-size: 1.0625rem; color: var(--muted); }
/* Mosaic: tiles of different sizes, the first large and in the section's colour */
.mosaic { display: grid; grid-template-columns: 1fr 1fr; gap: 0.625rem; }
.mosaic .card { flex-direction: column; gap: 0.5rem; }
.mosaic .card:first-child { grid-column: 1 / -1; background: var(--accent); border-color: transparent; }
.mosaic .card:first-child :is(b, small, em, .ic) { color: #fff; }
.mosaic .card:nth-child(4) { background: #edf2ea; }
/* Centre timeline: a line down the middle, the years on it, the events either side in turn. Each event starts 1.5rem
   before the one above it ends, on the other side, so they step down the page in order and never meet. */
.zigzag { list-style: none; margin: 0.75rem auto 0; padding: 0; max-width: 60rem;
  background: linear-gradient(var(--line), var(--line)) 50% 0 / 2px 100% no-repeat; }
.zigzag li { position: relative; width: calc(50% - 0.75rem); padding: 0 0 calc(0.75rem * var(--rows)); }
.zigzag li + li { margin-top: -1.5rem; }
.zigzag li:nth-child(odd) { text-align: right; }
.zigzag li:nth-child(even) { margin-left: auto; }
.zigzag li::after { content: ""; position: absolute; top: 0.4375rem; width: 0.75rem; height: 0.75rem; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--accent); box-sizing: border-box; }
.zigzag li:nth-child(odd)::after { right: calc(-0.75rem - 0.375rem); }
.zigzag li:nth-child(even)::after { left: calc(-0.75rem - 0.375rem); }
.zigzag b { display: block; font: 600 1.375rem var(--serif); color: var(--accent); }
.zigzag p { margin: 0; font-size: 0.9375rem; }
/* Newspaper columns: a masthead across the top, then columns with rules between them */
.masthead { text-align: center; border-top: 3px double var(--ink); border-bottom: 1px solid var(--ink);
  padding: calc(0.875rem * var(--fit, 1)) 0 calc(0.625rem * var(--fit, 1)); margin-bottom: calc(1.25rem * var(--fit, 1)); }
.masthead h1 { margin: 0; }
.masthead .eyebrow { margin-bottom: 0.25rem; }
.masthead .lead { margin: 0.375rem auto 0; max-width: var(--nsys-text); }
@media (max-width: 899px) {   /* on a phone the masthead stays light, so the columns below it get the room */
  .masthead { border-top-width: 3px; padding: calc(0.5rem * var(--fit, 1)) 0 calc(0.375rem * var(--fit, 1)); margin-bottom: calc(0.75rem * var(--fit, 1)); }
  .masthead .lead { margin-top: 0.25rem; }
  .col-title { padding-bottom: 0.25rem; }
}
.popular.cols li { grid-template-columns: 3.5rem 1fr; }
.popular.cols li::before { font-size: 2.75rem; line-height: 1; }
.col-title { font: 700 0.8125rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
  margin: 0 0 0.25rem; padding-bottom: 0.375rem; border-bottom: 1px solid var(--ink); }
.newspaper-col + .newspaper-col { margin-top: calc(1.75rem * var(--fit, 1)); }
.newspaper .date { width: 4.25rem; }
.newspaper .date b { font-size: 1.5rem; }
@media (min-width: 900px) {
  /* Split page: a photo the full height of the page on one side, the words on the other */
  .split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); min-height: 100%; }
  .split > .bleed { grid-area: 1 / 1; }
  .split > .page-in { grid-area: 1 / 2; align-self: center; width: 100%; }
  .split.flip { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
  .split.flip > .bleed { grid-area: 1 / 2; }
  .split.flip > .page-in { grid-area: 1 / 1; }
  .split > .bleed img { position: absolute; inset: 0; height: 100%; }
  .split > .bleed figcaption { padding-left: 1.25rem; }
  .split .tiles { grid-template-columns: 1fr 1fr; }
  .split .tile { min-height: max(5.5rem, 9rem - var(--give, 0px)); }   /* the tiles give way, as the photo did above them */
  .bignum b { font-size: max(6rem, 9rem - var(--give, 0px)); }
  .mosaic { grid-template-columns: minmax(0, 1.5fr) 1fr 1fr; gap: 0.75rem; }
  .mosaic .card { padding: 1.125rem; }
  .mosaic .card:first-child { grid-column: 1; grid-row: 1 / span 2; justify-content: flex-end; padding: 1.5rem; }
  .mosaic .card:first-child .ic { width: 2.25rem; height: 2.25rem; margin-bottom: auto; }
  .mosaic .card:first-child b { font-size: 1.75rem; }
  .mosaic .card:first-child small { font-size: 1rem; }
  .zigzag li { width: calc(50% - 1.5rem); }
  .zigzag li:nth-child(odd)::after { right: calc(-1.5rem - 0.375rem); }
  .zigzag li:nth-child(even)::after { left: calc(-1.5rem - 0.375rem); }
  .zigzag b { font-size: 1.75rem; }
  .zigzag p { font-size: 1rem; }
  .popular.cols { display: block; columns: 3; column-gap: 2.5rem; column-rule: 1px solid var(--line); }
  .popular.cols li { break-inside: avoid; }
  .newspaper { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .newspaper-col:first-child { padding-right: 2.5rem; }
  .newspaper-col + .newspaper-col { margin-top: 0; padding-left: 2.5rem; border-left: 1px solid var(--line); }
}
@media (min-width: 1100px) {
  /* Side heading: the title in a narrow column on the left, what the page holds in a wide one beside it */
  .side { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); column-gap: 4rem; align-items: start; }
  .side > .turnon { grid-column: 1 / -1; }
  .side-head { padding-top: 0.375rem; }
  .side .branches { columns: 2; }
  .side .svc { grid-template-columns: 1fr 1fr; }
  .bignum b { font-size: max(7rem, 12rem - var(--give, 0px)); }
}

@media (min-width: 900px) {
  body { padding: 0.875rem 0 0; }   /* the desk above the book; it gave the ribbons 4px */
  /* The book is the site's content: 1320 px at most, with the side margin as desk either side. */
  .desk { padding-left: var(--nsys-margin-left); padding-right: var(--nsys-margin-right); }
  .book { max-width: var(--nsys-content); }
  .book { border-radius: 0.25rem 0.25rem 0 0; }
  .binding { border-radius: 0.375rem 0.375rem 0 0; padding: 0.625rem 1.5rem; }
  .page-in { padding: calc(3rem * var(--fit, 1)) 3rem; }
  h1 { font-size: 3rem; }
  .lead { font-size: 1.25rem; }
  .band { padding: calc(3.25rem * var(--fit, 1)) 0; }
  .figures { grid-template-columns: repeat(4, 1fr); }
  .figures b, .fees b { font-size: 3.25rem; }
  .band-text > b { font-size: 2rem; }
  .fees { grid-template-columns: 1fr 1fr; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .tile { min-height: 9rem; padding: 1.25rem 1.375rem; }
  .shelf { height: max(3.5rem, 8rem - var(--give, 0px)); padding: 0 2rem; }
  .bleed figcaption { padding-left: 3rem; }
  .facts b { font-size: 2.5rem; }
  .ribbons { grid-template-columns: repeat(7, 7rem); justify-content: center; gap: 0.625rem; }
  .ribbon span { font-size: 0.8125rem; }
  .sky { transform: perspective(200rem); }
}
/* Wider screens: text keeps a readable width; the extra width goes to cards, lists and the cover. */
@media (min-width: 1100px) {
  .page-in { max-width: 73.75rem; padding: calc(3.5rem * var(--fit, 1)) 4rem; }
  .page-in > :is(.eyebrow, h1, h2, p, .lead, ol:not(.popular), table, .search, .chips, .row, .place, .empty, .evs) { max-width: var(--nsys-text); }
  .popular { grid-template-columns: 1fr 1fr; }
  .cards.two { grid-template-columns: 1fr 1fr; }
  .bleed figcaption { padding-left: 4rem; }
  .page-in > .imprint { max-width: none; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .svc { grid-template-columns: repeat(3, 1fr); }
  .books { display: grid; grid-template-columns: 1fr 1fr; column-gap: 2rem; }
  .branches { columns: 4; }
  .cover .page-in { max-width: none; padding: calc(1.5rem * var(--fit, 1)) 1.75rem; }
  .frame { --frame-x: 3rem; --frame-top: calc(2.5rem * var(--fit, 1)); padding: var(--frame-top) var(--frame-x) calc(1.75rem * var(--fit, 1)); width: 100%;
    max-width: 87.5rem; margin: 0.375rem auto; }
}
/* The cover in rows (the user, 26 November 2026: "Try the horizontal layout for the cover page?", then "What if we
   make the image top half?"): the building's photo fills the top half of the cover, from one side of the frame to the
   other, then the seal beside the library's name, the search, today's hours and the counts. On a phone the photo is
   across its top too (the user, 29 November 2026: "What if we keep the same layout of the cover image on the mobile
   too?"), a third of the page tall, so the seal, the name and the search still show on the first screen, the rest in
   one column under it. */
.cover:not(.back-cover) .frame > .plate { max-width: none; width: auto;
  margin: calc(-1 * var(--frame-top)) calc(-1 * var(--frame-x)) calc(1.25rem * var(--fit, 1));
  padding: 0; background: none; border-radius: 0; box-shadow: none; border-bottom: 1px solid rgba(217, 180, 90, .6); container-type: normal;
  position: relative; }
.cover:not(.back-cover) .frame > .plate img { aspect-ratio: auto; object-position: 50% 62%;
  height: max(8rem, var(--book-h, 45rem) / 3 - var(--give-last, 0px)); }   /* gives way last (see fit()) */
/* The photo is printed on the cover's cloth (the user, 26 November 2026: "Can we put the cover page pattern on the
   cover page image like the image printed on the cover?"): the cloth's weave shows through the ink, as on the cloth
   round it, and the ink sits a little flat. Drawn over the photo by order alone, under its caption (no z-index). The
   flattening is on the whole print, not the photo: a filter on the photo would draw it over the weave. The caption lies
   on the photo's corner, on a soft fade, so the cloth below is all the library's. */
.cover:not(.back-cover) .frame > .plate { filter: saturate(.85) contrast(.94); }
.cover:not(.back-cover) .frame > .plate::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .08) 0 2px, transparent 2px 0.3125rem),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, .05) 0 1px, transparent 1px 0.3125rem), rgba(11, 59, 70, .08); }
.cover:not(.back-cover) .frame > .plate figcaption { position: absolute; left: 0; right: 0; bottom: 0; color: #fff; text-align: right;
  padding: 1.75rem var(--frame-x) 0.5rem; background: linear-gradient(to top, rgba(10, 10, 10, .6), transparent); }
@media (min-width: 900px) {
  .cover:not(.back-cover) .frame { display: grid; grid-template-columns: 1fr auto auto 1fr; column-gap: 1.75rem; align-content: start; }
  .cover:not(.back-cover) .frame > * { grid-column: 1 / -1; }
  /* the photo: half the page's height (--book-h, set by the script), less the frame above it */
  .cover:not(.back-cover) .frame > .plate { grid-row: 1; margin-bottom: calc(1.5rem * var(--fit, 1)); }
  .cover:not(.back-cover) .frame > .plate img { height: max(9rem, var(--book-h, 50rem) / 2 - 2rem - var(--give-last, 0px)); }
  .cover:not(.back-cover) .frame > .seal { grid-column: 2; grid-row: 2 / span 2; align-self: center; margin: 0;
    width: max(4.5rem, 6rem - var(--give, 0px)); height: max(4.5rem, 6rem - var(--give, 0px)); }   /* as tall as the title beside it */
  .cover:not(.back-cover) .frame > :is(.title, .since) { grid-column: 3; text-align: left; }
  .cover:not(.back-cover) .frame > .title { grid-row: 2; align-self: end; font-size: 3rem; }
  .cover:not(.back-cover) .frame > .since { grid-row: 3; align-self: start; justify-content: flex-start; margin: 0.5rem 0 0; }
  .cover:not(.back-cover) .frame > .since::before { display: none; }
  .cover:not(.back-cover) .frame > :is(.search, .stats) { width: min(100%, 40rem); justify-self: center; }
  .cover:not(.back-cover) .frame > .search { grid-row: 4; margin-top: calc(1.25rem * var(--fit, 1)); }
  .cover:not(.back-cover) .frame > .open-now { grid-row: 5; justify-self: center; }
  .cover:not(.back-cover) .frame > .stats { grid-row: 6; }
  .cover:not(.back-cover) .frame > .opener { grid-row: 7; justify-self: center; }
}
/* Every screen, mouse or touch: anything tappable is at least 44 px each way (our standard), with at least 8 px
   between neighbours, or 44 px parts in one control, like the language switch (on every screen since 27 November
   2026, the user's "Yes, every screen"; before, only on touch screens) */
.binding { padding-top: 0.125rem; padding-bottom: 0.25rem; }
.bind-name, .signin { min-height: var(--nsys-tap); }
.signin { padding: 0 0.25rem; }
.nsys-languages__item { min-width: var(--nsys-tap); min-height: var(--nsys-tap); display: grid; place-items: center; padding: 0 0.125rem; }
.btn, .opener, .chip { min-height: var(--nsys-tap); }
.search :is(input, button) { min-height: var(--nsys-tap); }   /* 45 px in English; Tamil's text set it at 42 */
.chip { display: inline-flex; align-items: center; }
.credit a { display: inline-block; padding: 0.8125rem 0; }
@media (max-width: 360px) { .bind-name span { font-size: 0.8125rem; } }
@media (max-width: 480px) { .signin span { display: none; } .signin { min-width: var(--nsys-tap); justify-content: center; } .signin .ic { width: 1.25rem; height: 1.25rem; } }
@media (max-width: 420px) { .search button span { display: none; } .search button { padding: 0 0.875rem; } .search button .ic { width: 1.25rem; height: 1.25rem; } }

/* ---------- plain view: the same pages as an ordinary website, with no book (the user, 26 November 2026: "Can we add
   a button to stop the book effect and behave like normal website?") ---------- */
/* The switch, in the top bar beside the language switch. It names the view it changes to; the words for the view the
   reader isn't in are hidden, here and anywhere else a part differs between the two views. */
.plain .when-book, :root:not(.plain) .when-plain { display: none; }
:root[data-plain-view="off"] .view { display: none; }   /* switched off for now: no switch anywhere (see the <head>) */
.view { display: flex; align-items: center; padding: 0.1875rem 0.625rem; border: 1px solid rgba(243,234,211,.35); border-radius: 62.4375rem;
  background: none; color: inherit; font: 0.8125rem/1.4 var(--sans); white-space: nowrap; cursor: pointer; }
.view > span { display: inline-flex; align-items: center; gap: 0.3125rem; }
.view .ic { width: 1rem; height: 1rem; }
:is(.back-bind, .binding.paper, .binding.endpaper) .view { border-color: rgba(60, 48, 26, .25); }
/* Up to 639 px the switch is its icon alone, named for screen readers by its hidden words. On a phone, up to 480 px,
   the bar shows the seal without the library's name, which screen readers still hear, and on the right the switch, the
   languages and Sign in, or in the plain view the menu, which then holds Sign in (the user, 29 November 2026: "On
   mobile, do we need the Batticaloa public library heading? If we hide that on the mobile, we can place the disable book
   effect button there in the header, right?", then "What if we place the button on the right before the language
   options?"). The cover shows the name, large. */
@media (max-width: 480px) {
  .bind-name { flex: none; min-width: var(--nsys-tap); justify-content: center; margin-right: auto; }
  .bind-name span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .plain .binding .signin { display: none; }   /* in the plain view's menu instead (see the menu below) */
}
@media (max-width: 639px) {
  .binding .view { min-width: var(--nsys-tap); justify-content: center; padding: 0.1875rem 0.5rem; }
  .binding .view .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .binding .view .ic { width: 1.25rem; height: 1.25rem; }
}
.view { min-height: var(--nsys-tap); }
/* The bar's pills, the switch and the languages, are drawn 5 px in from the top and bottom of their 44 px taps, so they
   stand clear of the bar's edges and the dashed line under them (the user, 29 November 2026: "What if we reduce the
   height of the buttons to avoid the buttons touching the bottom line and edges?", then "Look at the language option
   highlight. It's getting out of the area."); a finger still has the whole 44 px. The outline is drawn by ::after, which
   takes the colour each bar gives the pill's border; the chosen language's fill stays inside it. */
.view, .nsys-languages { position: relative; border-width: 0; overflow: visible; }
.view::after, .nsys-languages::after { content: ""; position: absolute; inset: 0.3125rem 0; border: 1px solid; border-color: inherit;
  border-radius: 62.4375rem; pointer-events: none; }
/* The chosen language's fill lies just inside the outline, its ends rounded as the outline's inside is, so it follows the
   pill's curve (the user, 29 November 2026: "the language selection highlight also didn't matching the curve of the
   section": the fill was the item's own box less its padding, whose ends came out flatter, 2 to 5 px inside the curve).
   Each item's transparent borders reach the outline's inside (and its 1 px line at the two ends), the fill is clipped to
   within them, and the outer corners are sized so the fill's ends are half circles of the outline's inside radius. The
   fill stays the item's own background, so the contrast check reads the words on it (a layer behind the words it can't
   see). Sizes from the 44 px tap (--nsys-tap), as the outline's are. */
.nsys-languages__item { padding-top: 0; padding-bottom: 0; border: solid transparent; border-width: calc(0.3125rem + 1px) 0;
  background-clip: padding-box; }
.nsys-languages__item:first-child { border-left-width: 1px;
  border-radius: calc(var(--nsys-tap) / 2 - 0.3125rem) 0 0 calc(var(--nsys-tap) / 2 - 0.3125rem) / calc(var(--nsys-tap) / 2) 0 0 calc(var(--nsys-tap) / 2); }
.nsys-languages__item:last-child { border-right-width: 1px;
  border-radius: 0 calc(var(--nsys-tap) / 2 - 0.3125rem) calc(var(--nsys-tap) / 2 - 0.3125rem) 0 / 0 calc(var(--nsys-tap) / 2) calc(var(--nsys-tap) / 2) 0; }

/* The page scrolls as a whole, as a website does: every page of the book one after another, from the cover down to
   the back cover, which ends it as its footer. The top bar stays at the top of the screen. Nothing turns. */
.plain, .plain body { height: auto; }
.plain body { overflow: visible; padding-top: 0; }
.plain .desk { height: auto; padding-top: 0; }
.plain .book { flex: none; }
.plain .binding { position: sticky; top: 0; z-index: 400; border-radius: 0; border-top: env(safe-area-inset-top) solid var(--cloth); }
.plain .stack { flex: none; box-shadow: none; }
.plain :is(.sky, .drop) { display: none; }
.plain .sheet { position: relative; inset: auto; }
.plain .front { position: relative; inset: auto; overflow: visible; background-image: none; }
.plain :is(.turnon, .opener[data-next]) { display: none; }   /* nothing to turn, or to open */
.plain .page-in:has(> .turnon:only-child) { display: none; }   /* nor the space at a page's end that only held it */
/* --view-h: the screen's height less the bars, set by the script. The cover fills the first screen, and the photo
   page a whole screen, as each filled its page. */
.plain .cover:not(.back-cover) .page-in { min-height: var(--view-h, 100vh); }
.plain .poster { min-height: var(--view-h, 100vh); }
/* The plain view's menu (the user, 29 November 2026: "What if we keep the bookmark on the bottom, only move to menu when
   disabling the book effect?"): the ribbons move into the top bar. On computers they're words in the bar, with the open
   section's ribbon hanging from the bar below its name; where the bar has no room for them beside the name, they take a
   second row. On phones and tablets they're the menu (below). In the book view they stay along the bottom, as bookmarks. */
@media (min-width: 900px) {
  .plain .binding { flex-wrap: wrap; column-gap: 1rem; padding-top: 0; padding-bottom: 0; min-height: 3.75rem; }
  .plain .binding > :not(.ribbons) { margin: 0.625rem 0; }
  .plain .ribbons { order: 1; flex: 1 0 100%; display: flex; justify-content: flex-start; align-self: stretch; gap: 0; width: auto; height: auto;
    padding: 0; margin: 0 0 0 -0.75rem; }
  .plain .ribbon, .plain .ribbon[aria-current="page"] { height: auto; min-height: 2.75rem; margin: 0; padding: 0 0.75rem; flex-direction: row; align-items: center;
    background: none; clip-path: none; color: var(--cream); transition: none; }
  .plain .ribbon .ic, .plain .ribbon::before { display: none; }
  .plain .ribbon span { font-size: 0.875rem; font-weight: 500; }
  .plain .ribbon:hover span { text-decoration: underline; text-underline-offset: 0.25em; }
  .plain .ribbon[aria-current="page"] { color: var(--gold); }
  .plain .ribbon[aria-current="page"]::after { content: ""; position: absolute; left: 50%; top: calc(100% + 2px); width: 1rem; height: 1.375rem;
    margin-left: -0.5rem; background: var(--rib); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 0.4375rem), 0 100%); }
}
@media (min-width: 70em) {   /* in em, so it follows the reader's text size: from here the menu fits beside the name
                                  (the bar's parts need about 990 px; at 1120 px wide the bar is 1021) */
  .plain .ribbons { order: 0; flex: 0 1 auto; margin-left: 0; }
}
@media (min-width: 900px) { .plain .ribbons { gap: var(--nsys-tap-gap); } }
/* ---------- the plain view's menu on phones and tablets, up to 899 px: the ribbons are a list that drops from the top
   bar, opened by the menu button at its right, each section in its colour on the ribbons' endpaper, the open one in the
   cover's cloth lettered in gold, as the ribbons are. On a phone, Sign in is at its end, as the bar has no room for it
   beside the menu. The book view keeps the ribbons along the bottom. ---------- */
.menu-btn, .menu-signin { display: none; }
@media (max-width: 899px) {
  .plain .menu-btn { display: grid; place-items: center; min-width: var(--nsys-tap); min-height: var(--nsys-tap); padding: 0; border: 0;
    background: none; color: inherit; cursor: pointer; }
  .menu-btn .ic { width: 1.375rem; height: 1.375rem; }
  :root:not(.menu-open) .menu-btn .when-open, :root.menu-open .menu-btn .when-closed { display: none; }
  .plain .ribbons { position: fixed; left: 0; right: 0; top: var(--menu-top, 3.375rem); z-index: 450; display: none; height: auto; margin: 0;
    grid-template-columns: 1fr; gap: 0; padding: 0.375rem 0 calc(0.5rem + env(safe-area-inset-bottom));
    background-color: var(--silk); background-image: var(--threads); border-bottom: 1px solid var(--silk-edge);
    box-shadow: 0 0.75rem 1.5rem rgba(30, 25, 15, .25); }
  :root.plain.menu-open .ribbons { display: grid; }
  .plain .ribbon, .plain .ribbon[aria-current="page"] { height: auto; min-height: 3rem; margin: 0; padding: 0 1.25rem; flex-direction: row;
    justify-content: flex-start; align-items: center; gap: 0.875rem; clip-path: none; background: none; transition: none; }
  .plain .ribbon::before { display: none; }
  .plain .ribbon[aria-current="page"] { background-color: var(--cloth); background-image: var(--cloth-weave); }
  .plain :is(.ribbon, .menu-signin) span { font-size: 1rem; }
  .plain :is(.ribbon, .menu-signin) .ic { width: 1.25rem; height: 1.25rem; }
}
@media (max-width: 480px) {
  .plain .menu-signin { display: flex; align-items: center; gap: 0.875rem; min-height: 3rem; margin-top: 0.25rem; padding: 0 1.25rem;
    border-top: 1px solid var(--silk-edge); color: var(--ink); text-decoration: none; }
}

/* ---- Added for the site ---- */

/* The language switch: the site builder's own ({{> nsys-languages.html}}: தமிழ் · සිංහල · English in that order, each
   read out in full), drawn as the plan's boards show it: the short names in a pill, the open language in gold. */
.nsys-languages__item { color: inherit; text-decoration: none; }
.nsys-languages__item + .nsys-languages__item::before { content: none; }
.binding .nsys-languages__short, .back-bind .nsys-languages__short { display: inline; }
.binding .nsys-languages__name, .back-bind .nsys-languages__name { position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; }

/* The plan's new pages (staff, rules), with what their boards wrote inline as classes */
.gap.flush { margin-bottom: 0; }
.svc .gap.tag { margin: 0.5rem 0 0; }
.pill.on-band { background: rgba(255, 255, 255, .16); color: #fff; }
.nw { white-space: nowrap; }   /* times never break inside, such as 07:00 – 19:00 */

/* Tamil and Sinhala pages, as the plan's boards drew them: the device's own font for headings, the hint, buttons and
   chips (Fraunces has no Tamil or Sinhala letters; the big numbers keep it), "since 1855" upright, and no letter
   spacing in eyebrows. In :where(), so each weighs only as much as the boards' own rules did. */
:where(html:lang(ta)) :is(body, h1, h2, h3, .bind-name span, .tile b, .turnon b, .opener, .since, .search input, .search button, .chip) { font-family: var(--nsys-font-tamil); }
:where(html:lang(si)) :is(body, h1, h2, h3, .bind-name span, .tile b, .turnon b, .opener, .since, .search input, .search button, .chip) { font-family: var(--nsys-font-sinhala); }
:where(html:lang(ta), html:lang(si)) h1 { line-height: 1.35; }
:where(html:lang(ta), html:lang(si)) .since { font-style: normal; }
:where(html:lang(ta), html:lang(si)) .eyebrow { letter-spacing: 0; }
/* Words a page shows in another language than its own, such as an English book's title on a Tamil page or an event the
   library wrote only in English: in that language's fonts, as on its own language's pages */
:where(html:lang(ta), html:lang(si)) .front [lang="en"] { font-family: var(--sans); }
:where(html:lang(ta), html:lang(si)) .front :is(h1, h2, h3)[lang="en"] { font-family: var(--serif); }
:where(html:lang(en), html:lang(si)) .front :is(h1, h2, h3, p, b, span)[lang="ta"] { font-family: var(--nsys-font-tamil); }
:where(html:lang(en), html:lang(ta)) .front :is(h1, h2, h3, p, b, span)[lang="si"] { font-family: var(--nsys-font-sinhala); }
:where(html:lang(en)) .front h1:is([lang="ta"], [lang="si"]) { line-height: 1.35; }

/* Find a book's results: each whole row is one link, as the plan's board has it */
.books .hit { display: flex; gap: 0.75rem; flex: 1; text-decoration: none; }
.books .hit h3 { text-decoration: underline; text-underline-offset: 0.2em; }

/* The pages made from the library's feed (step 4), with what their boards wrote inline as classes */
.spine.tall { width: 4.75rem; height: 6.75rem; font: 600 2.25rem var(--serif); margin: 0.25rem 0 1.25rem; }   /* a book's own page */
.note { font-size: 0.875rem; color: var(--muted); }
.col-title.on-date { font-size: 0.875rem; }
/* Each item in a list is a link to its page, as Find a book's results are: the row's content, its title underlined,
   with the row's padding between one link and the next */
.ev > .hit { display: flex; gap: 0.875rem; flex: 1; color: inherit; text-decoration: none; }
.ev > .hit h3 { text-decoration: underline; text-underline-offset: 0.2em; }
.popular li > a { display: grid; grid-template-columns: 2.75rem 1fr; align-items: baseline; color: inherit; text-decoration: none; }
.popular li > a::before { content: counter(pop); grid-row: span 2; font: 600 1.75rem var(--serif); color: var(--accent); }
.popular li:has(> a), .popular li.down { display: block; }
.popular li:has(> a)::before, .popular li.down::before { content: none; }
.popular li.down { column-span: all; max-width: var(--nsys-text); }   /* its one line runs across the columns */
.popular li > a b { text-decoration: underline; text-underline-offset: 0.2em; }
.popular.cols li > a { grid-template-columns: 3.5rem 1fr; }
.popular.cols li > a::before { font-size: 2.75rem; line-height: 1; }
/* What's on: the events still to come, on the band */
.band .evs { margin-top: calc(0.75rem * var(--fit, 1)); max-width: var(--nsys-text); }
.band .ev { border-color: rgba(255, 255, 255, .28); }
.band .ev h3 { color: #fff; }
.band .ev p { color: rgba(255, 255, 255, .88); }
.band .ev .date { color: var(--ink); }
/* Find a book's choice of library: a chip that opens the list of libraries, with the shared chevron at its right, in
   its words' colour, as the board's chip has it (a select can't draw one itself, so its holder does) */
select.chip { appearance: none; -webkit-appearance: none; color: inherit; font: inherit; font-size: 0.875rem; padding-right: 1.75rem;
  background: #fff; cursor: pointer; }
.pick-wrap { position: relative; display: inline-flex; }
.pick-wrap::after { content: ""; position: absolute; top: 50%; right: 0.6875rem; width: 0.875rem; height: 0.875rem; margin-top: -0.4375rem;
  background-color: currentColor; -webkit-mask: url("icons/chevron-down.svg") center / contain no-repeat; mask: url("icons/chevron-down.svg") center / contain no-repeat; pointer-events: none; }
.chip { cursor: pointer; }
button.chip, select.chip { font-family: inherit; color: inherit; line-height: inherit; }
select.chip { field-sizing: content; }   /* as wide as the library chosen, where the browser can */
.paging { align-items: center; justify-content: space-between; }
.paging[hidden] { display: none; }
.paging .pages { font-size: 0.9375rem; color: var(--muted); }
.paging .btn[disabled] { color: var(--muted); cursor: default; }

/* and four across, from 900 px wide, at 3.25rem: "Rs. 5.00" fits from 1100 px, so up to there they're 2rem, all the
   same size (found on the test tablet turned sideways, 1006 px wide, 28 November 2026) */
@media (min-width: 900px) and (max-width: 68.6875em) { .figures b { font-size: 2rem; } }
/* In Tamil, "ஒருமுறை" can't break and widens its column (186 px at 2rem in the test tablet's Tamil font, 28 November
   2026), leaving "ரூ. 5.00" 2 px short in its own at 1006 px wide: there, all four figures 1.75rem */
@media (min-width: 900px) and (max-width: 68.6875em) { :where(html:lang(ta)) .figures b { font-size: 1.75rem; } }

/* The book at night: follows the device's dark setting only; the light look is untouched. Contrasts in NOTES.md. */
@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; --paper: #24201a; --paper-back: #1b1813; --endpaper: #3d3528; --ink: #ece4d4; --muted: #a89e8b;
    --line: #4a4337; --desk: #12100d; --ok: #9fd6a8; --silk-edge: #5c513f; --card: #2d2821; --lift: #155e70; --field: #8a7f6c; }
  .front, .front [style*="--accent"] { --acc-text: color-mix(in srgb, var(--accent) 50%, #fff); --acc-deep: color-mix(in srgb, var(--accent) 80%, var(--paper)); }
  .front { background-image: linear-gradient(to bottom, rgba(0, 0, 0, .3), transparent 1rem); }
  .stack { box-shadow: 0 2px 0 rgb(58 51 42 / clamp(0, var(--edges), 1)), 0 0.1875rem 0 rgb(30 27 22 / clamp(0, var(--edges) - 1, 1)),
    0 0.3125rem 0 rgb(54 48 39 / clamp(0, var(--edges) - 2, 1)), 0 0.375rem 0 rgb(28 25 20 / clamp(0, var(--edges) - 3, 1)),
    0 0.5rem 0 rgb(50 44 36 / clamp(0, var(--edges) - 4, 1)), 0 0.5625rem 0 rgb(26 23 18 / clamp(0, var(--edges) - 5, 1)),
    0 calc(0.3125rem + var(--edges) * 1.5px) 1.375rem rgba(0, 0, 0, .55); }

  .back-bind, .binding.paper, .binding.endpaper { border-bottom-color: rgba(236, 228, 212, .14); }
  :is(.back-bind, .binding.paper, .binding.endpaper)::after { border-bottom-color: rgba(236, 228, 212, .25); }
  :is(.back-bind, .binding.paper, .binding.endpaper) .seal.mini { background: var(--gold); }
  :is(.back-bind, .binding.paper, .binding.endpaper) :is(.nsys-languages, .view) { border-color: rgba(236, 228, 212, .3); }
  .back-text { color: rgba(236, 228, 212, .5); }

  .ribbon:not([aria-current="page"]) { color: color-mix(in srgb, var(--rib) 40%, #fff); }
  .plain .ribbons { border-bottom-color: var(--line); box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, .5); }

  .back-cover .seal { background: var(--gold); }
  .back-cover .since, .back-cover .opener { color: var(--gold); }
  .back-cover .since::before, .back-cover .since::after { border-top-color: rgba(217, 180, 90, .5); }
  .back-cover .opener { border-color: rgba(217, 180, 90, .6); }
  .back-cover .frame { border-color: rgba(236, 228, 212, .3); outline-color: rgba(236, 228, 212, .15); }

  .eyebrow, .facts b, .zigzag b, .bignum b, .col-title, .card .ic, .date span, .popular li::before, .popular li > a::before { color: var(--acc-text); }
  .band, .mosaic .card:first-child { background: var(--acc-deep); }
  .tile { background: color-mix(in srgb, var(--t) 85%, var(--paper)); }
  .mosaic .card:nth-child(4) { background: #24302a; }

  .search input, .chip, .btn.ghost, .stats div, .card, .date, .svc div, .place, .bleed { background: var(--card); }
  .search input { border-color: var(--field); color: var(--ink); }
  .search input::placeholder { color: var(--muted); }
  .cover .search input { border-color: rgba(217, 180, 90, .6); }
  .chip.on { border-color: var(--lift); }
  .chip.on, .btn.solid, .search button { background: var(--lift); }
  select.chip { background-color: var(--card); }
  .empty { border-color: var(--field); }
  .pill.ok { background: #1f3a25; }
  .pill.ref { background: #37322a; color: #d6ccb8; }
  .shelf { background: linear-gradient(to bottom, #2b261f, #1e1a15); border-bottom-color: #5e4a30; }
}

/* The not-found page, with what its board wrote inline as classes */
.search.middle { max-width: var(--nsys-text); margin: 0 auto; }
h2.middle { text-align: center; margin-left: auto; margin-right: auto; }
.opener.on-page { color: var(--ink); border-color: var(--line); text-decoration: none; }
