/* Self-hosted fonts (SIL Open Font License): Anek Tamil for headings and interface, Noto Serif Tamil for reading. */
/* anek-tamil tamil normal (193 KB) */
@font-face {
  font-family: 'Anek Tamil';
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url(../fonts/anek-tamil-tamil-normal.woff2) format('woff2');
  unicode-range: U+0964-0965, U+0B82-0BFA, U+200C-200D, U+20B9, U+25CC;
}
/* anek-tamil latin-ext normal (5 KB) */
@font-face {
  font-family: 'Anek Tamil';
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url(../fonts/anek-tamil-latin-ext-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* anek-tamil latin normal (96 KB) */
@font-face {
  font-family: 'Anek Tamil';
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url(../fonts/anek-tamil-latin-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* noto-serif-tamil tamil normal (51 KB) */
@font-face {
  font-family: 'Noto Serif Tamil';
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(../fonts/noto-serif-tamil-tamil-normal.woff2) format('woff2');
  unicode-range: U+0964-0965, U+0B82-0BFA, U+200C-200D, U+20B9, U+25CC;
}
/* noto-serif-tamil latin-ext normal (19 KB) */
@font-face {
  font-family: 'Noto Serif Tamil';
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(../fonts/noto-serif-tamil-latin-ext-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* noto-serif-tamil latin normal (36 KB) */
@font-face {
  font-family: 'Noto Serif Tamil';
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(../fonts/noto-serif-tamil-latin-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   Vennila Manjari (வெண்ணிலா மஞ்சரி): public site, moonlight palette
   One bold element: tonight's moon in the hero. Everything else is quiet,
   like a printed literary digest: covers on a shelf, a contents-page
   category list, reading text in a book serif.

   Tamil is a dense script: text is set a size larger and with more leading
   than Latin, never letter-spaced, never italicised (emphasis uses weight),
   and only real font weights are used (font-synthesis: none).
   Light by default; follows the device's dark setting (data-bs-theme).
   ========================================================================== */

:root {
    /* Colour (light) */
    --night: #171A33;            /* hero, page heads, footer */
    --night-raised: #23284B;
    --silver: #E8EAF1;           /* the moon, text on night */
    --silver-soft: rgba(232, 234, 241, 0.82);
    --paper: #FFFFFF;
    --mist: #F1F2F7;             /* alternate sections */
    --rule: #DCDEE8;
    --field-border: #8E92A8;     /* 3:1 against paper (WCAG 1.4.11) */
    --ink: #1C1F38;              /* 16:1 */
    --ink-read: #2B2E42;         /* long reading, 13:1 */
    --ink-soft: #565A72;         /* secondary, 6.8:1 on paper, 6:1 on mist */
    --brand-ink: var(--night);
    --lotus: #C2416F;            /* button fill, white text 4.9:1 */
    --lotus-deep: #9F2F58;       /* button hover */
    --link: #9F2F58;             /* text links, 7:1 on paper and mist */
    --link-hover: #C2416F;
    --lotus-tint: #FBEAF1;
    --lotus-light: #F2A7C3;      /* accents on night, 9:1 */
    --shadow-rgb: 23, 26, 51;
    --ok-bg: #EAF6EF; --ok-ink: #14512F; --ok-line: #1F7A4D;
    --err-bg: #FDECEA; --err-ink: #7A1A12; --err-line: #B42318;

    /* Type */
    --font-ui: 'Anek Tamil', 'Noto Sans Tamil', 'Latha', system-ui, sans-serif;
    --font-read: 'Noto Serif Tamil', 'Latha', Georgia, serif;
    --text-xs: 0.875rem;                                    /* 14px: smallest text anywhere */
    --text-sm: 0.9375rem;                                   /* 15px */
    --text-base: 1.0625rem;                                 /* 17px: interface */
    --text-md: 1.1875rem;                                   /* 19px */
    --text-lg: 1.375rem;                                    /* 22px */
    --text-xl: clamp(1.45rem, 1.25rem + 0.9vw, 1.75rem);
    --text-2xl: clamp(1.65rem, 1.3rem + 1.5vw, 2.15rem);    /* section titles */
    --text-3xl: clamp(2.2rem, 1.55rem + 3vw, 3.6rem);       /* page titles */
    --text-display: clamp(3.4rem, 1.7rem + 7.6vw, 8.2rem);  /* masthead */
    --read-size: clamp(1.125rem, 1.08rem + 0.2vw, 1.1875rem); /* 18–19px reading */
    --leading-ui: 1.65;
    --leading-read: 1.85;
    --leading-heading: 1.3;
    --measure: 64ch;

    /* Bootstrap hooks */
    --bs-body-font-family: var(--font-ui);
    --bs-body-font-size: var(--text-base);
    --bs-body-line-height: var(--leading-ui);
    --bs-body-color: var(--ink);
    --bs-body-bg: var(--paper);
    --bs-emphasis-color: var(--ink);
    --bs-secondary-color: var(--ink-soft);
    --bs-link-color: var(--link);
    --bs-link-color-rgb: 159, 47, 88;
    --bs-link-hover-color: var(--link-hover);
    --bs-link-hover-color-rgb: 194, 65, 111;
    --bs-border-color: var(--rule);
    --bs-focus-ring-color: rgba(194, 65, 111, 0.3);

    /* Browser-drawn parts (scrollbars, form controls) follow the chosen mode, not the device's */
    color-scheme: light;
}

/* Colour (dark): for reading at night; follows the device setting */
:root[data-bs-theme="dark"] {
    --night: #0C0E1F;
    --night-raised: #1E2242;
    --paper: #14162B;
    --mist: #1A1D37;
    --rule: #2E3256;
    --field-border: #737896;
    --ink: #E6E8F0;
    --ink-read: #D5D8E5;
    --ink-soft: #A9ADC2;
    --brand-ink: var(--silver);
    --link: #F2A7C3;
    --link-hover: #F8C9DA;
    --lotus-tint: rgba(242, 167, 195, 0.12);
    --shadow-rgb: 0, 0, 0;
    --ok-bg: #11291D; --ok-ink: #A9E3C2; --ok-line: #3BA272;
    --err-bg: #2E1412; --err-ink: #F5B7B1; --err-line: #E0584B;
    --bs-link-color-rgb: 242, 167, 195;
    --bs-link-hover-color-rgb: 248, 201, 218;
    color-scheme: dark;
}

/* ── Base ─────────────────────────────────────────────────────────────── */
html { font-synthesis: none; scroll-padding-top: 96px; }   /* focused fields and anchors stay clear of the sticky header */
body {
    font-family: var(--font-ui);
    font-size: var(--text-base);
    line-height: var(--leading-ui);
    color: var(--ink);
    background: var(--paper);
}
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-ui);
    font-stretch: 87.5%;
    font-weight: 700;
    line-height: var(--leading-heading);
    color: var(--ink);
    text-wrap: balance;
    overflow-wrap: break-word;
}
p { text-wrap: pretty; }
a { color: var(--link); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--lotus); outline-offset: 2px; }
a:focus-visible, button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { box-shadow: none; }
::selection { background: rgba(242, 167, 195, 0.45); color: inherit; }
img { max-width: 100%; height: auto; }
.icon { width: 1em; height: 1em; flex-shrink: 0; vertical-align: -0.125em; }
[lang="en"] { font-family: var(--font-read); font-style: normal; }   /* English names: upright serif */

/* Long-form reading text (descriptions, biographies, about) */
.reading {
    font-family: var(--font-read);
    font-size: var(--read-size);
    line-height: var(--leading-read);
    max-width: var(--measure);
    color: var(--ink-read);
}
.reading p { margin-bottom: 1.05em; }
.reading h2, .reading h3, .reading h4 { font-size: var(--text-lg); margin: 1.6em 0 0.6em; }
.reading strong, .reading b { font-weight: 700; color: var(--ink); }
.reading :is(em, i):not([lang="en"]) { font-style: normal; font-weight: 600; }   /* Tamil emphasis by weight, not slant */
.reading blockquote { margin: 1.3em 0; padding-left: 1.1em; border-left: 3px solid var(--lotus-light); color: var(--ink-soft); }
.reading ul, .reading ol { padding-left: 1.4em; margin-bottom: 1.05em; }
.reading li + li { margin-top: 0.35em; }

.vm-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: 2000; background: var(--lotus); color: #fff; padding: 10px 18px; border-radius: 6px; text-decoration: none; }
.skip-link:focus { top: 12px; color: #fff; }

/* ── Buttons & links ──────────────────────────────────────────────────── */
.btn-vm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    min-height: 46px;
    padding: 0.6em 1.35em;
    font-family: var(--font-ui);
    font-size: var(--text-base);
    font-weight: 600;
    line-height: 1.2;
    border-radius: 8px;
    border: 2px solid transparent;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn-vm-primary { background: var(--lotus); color: #fff; border-color: var(--lotus); }
.btn-vm-primary:hover, .btn-vm-primary:focus { background: var(--lotus-deep); border-color: var(--lotus-deep); color: #fff; }
.btn-vm-moon { background: var(--silver); color: #171A33; border-color: var(--silver); }
.btn-vm-moon:hover, .btn-vm-moon:focus { background: #fff; border-color: #fff; color: #171A33; }
.btn-vm-line { background: transparent; color: var(--link); border-color: currentColor; }
.btn-vm-line:hover, .btn-vm-line:focus { background: var(--lotus-tint); color: var(--link); }
.night .btn-vm-line { color: var(--silver); }
.night .btn-vm-line:hover, .night .btn-vm-line:focus { background: rgba(232, 234, 241, 0.1); color: #fff; }
.link-more { font-weight: 600; text-decoration: underline; white-space: nowrap; }

/* ── Header ───────────────────────────────────────────────────────────── */
.site-header { background: var(--paper); border-bottom: 1px solid var(--rule); z-index: 1030; }
.site-header .navbar { padding: 0; }
.brand { display: flex; align-items: center; gap: 0.65rem; padding: 0.7rem 0; text-decoration: none; color: var(--brand-ink); }
.brand__mark { width: 42px; height: 42px; flex-shrink: 0; border-radius: 10px; }
.brand__name { display: block; white-space: nowrap; font-stretch: 75%; font-weight: 800; font-size: 1.75rem; line-height: 1.05; color: var(--brand-ink); }
.brand__sub { display: block; font-family: var(--font-read); font-size: var(--text-xs); line-height: 1.3; color: var(--ink-soft); margin-top: 0.15rem; }
.site-nav .nav-link {
    position: relative;
    padding-block: 1.45rem;   /* side padding: Bootstrap's --bs-navbar-nav-link-padding-x from 1200px, 0 in the drawer */
    color: var(--ink);
    font-size: var(--text-base);
    font-weight: 500;
    white-space: nowrap;
}
.site-nav .nav-link:hover { color: var(--link); }
.site-nav .nav-link.active { color: var(--link); font-weight: 700; }
.site-nav .nav-link.active::after { content: ''; position: absolute; left: var(--bs-navbar-nav-link-padding-x); right: var(--bs-navbar-nav-link-padding-x); bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--lotus); }
.site-header .navbar-toggler { border: 0; padding: 0.6rem; min-width: 46px; min-height: 46px; }
.site-header .navbar-toggler:focus { box-shadow: none; }
.site-header .navbar-toggler:focus-visible { outline: 3px solid var(--lotus); }
/* Bootstrap's own focus styles for these are near-invisible; use the site's ring */
.site-nav .nav-link:focus-visible { outline: 3px solid var(--lotus); outline-offset: 2px; border-radius: 8px; box-shadow: none; }
@media (min-width: 1200px) {
    .site-nav .nav-link:focus-visible { outline-offset: -3px; }   /* inside the header bar */
    .site-header .brand { margin-right: 1rem; }                  /* keep the name clear of the first menu link */
}
.nav-search .btn:focus-visible { outline: 3px solid var(--lotus); outline-offset: 2px; box-shadow: none; }
/* Light/dark switch: beside the menu button below 1200px, after the search box above */
.header-tools { display: flex; align-items: center; gap: 0.35rem; margin-left: auto; }
.theme-toggle { width: 44px; height: 44px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--rule); border-radius: 50%; background: transparent; color: var(--ink); font-size: 1.1rem; cursor: pointer; transition: background-color 0.2s, color 0.2s; }
.theme-toggle:hover { background: var(--mist); color: var(--link); }
.theme-toggle__to-light { display: none; }
:root[data-bs-theme="dark"] .theme-toggle__to-dark { display: none; }
:root[data-bs-theme="dark"] .theme-toggle__to-light { display: inline-block; }
@media (max-width: 575.98px) {
    /* Name, switch and menu button on one row down to 320px */
    .brand { gap: 0.5rem; }
    .brand__mark { width: 36px; height: 36px; }
    .brand__name { font-size: clamp(1rem, 11vw - 1.2rem, 1.75rem); }
}

.nav-search { max-width: 220px; }
.nav-search .form-control { border-radius: 8px 0 0 8px; font-size: var(--text-sm); padding-block: 0.5rem; }
.nav-search .btn { border-radius: 0 8px 8px 0; background: var(--lotus); color: #fff; border: 1px solid var(--lotus); min-width: 44px; }
.nav-search .btn:hover { background: var(--lotus-deep); border-color: var(--lotus-deep); }
@media (max-width: 1199.98px) {
    .site-nav .nav-link { padding: 0.8rem 0; font-size: var(--text-md); }
    .site-nav .nav-link.active::after { display: none; }
    .nav-search { max-width: none; margin: 0.5rem 0 1.25rem; }
}
@media (min-width: 1200px) and (max-width: 1399.98px) {
    .brand__name { font-size: 1.55rem; }
    /* Bootstrap's .navbar-expand-xl .navbar-nav .nav-link takes its side padding from this variable */
    .site-header .navbar { --bs-navbar-nav-link-padding-x: 0.4rem; }
    .site-nav .nav-link { font-size: 1rem; }
}

/* ── Night surfaces ───────────────────────────────────────────────────── */
.night { background: var(--night); color: var(--silver-soft); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.night h1, .night h2, .night h3 { color: var(--silver); }
.night a:not(.btn-vm) { color: var(--silver); }
.night a:not(.btn-vm):hover { color: #fff; }

/* ── Hero: masthead and tonight's moon ────────────────────────────────── */
.hero { position: relative; overflow: hidden; padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(3rem, 7vw, 5.5rem); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.masthead { font-stretch: 75%; font-weight: 800; font-size: var(--text-display); line-height: 1.08; letter-spacing: -0.01em; color: var(--silver); margin: 0 0 1.25rem; text-wrap: initial; overflow-wrap: normal; word-break: keep-all; }
.masthead span { display: block; }
.hero__latin { font-family: var(--font-read); font-size: var(--text-md); color: var(--silver-soft); margin-bottom: 1.25rem; }
.hero__lede { font-family: var(--font-read); font-size: var(--read-size); line-height: var(--leading-read); max-width: 44ch; color: var(--silver-soft); margin-bottom: 2rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero__latest { display: flex; align-items: center; gap: 1rem; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(232, 234, 241, 0.18); max-width: 30rem; text-decoration: none; }
.hero__latest img { width: 56px; height: 78px; object-fit: cover; border-radius: 2px 3px 3px 2px; box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.6); }
.hero__latest-label { display: block; font-size: var(--text-xs); color: var(--lotus-light); }
.hero__latest-title { display: block; font-weight: 700; font-size: var(--text-md); color: var(--silver); line-height: 1.35; }
.hero__latest:hover .hero__latest-title { text-decoration: underline; }
.hero__latest-cover { position: relative; display: block; flex-shrink: 0; width: 56px; height: 78px; border-radius: 2px 3px 3px 2px; overflow: hidden; box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.6); }
.hero__latest-cover .typeset__title { display: none; }
.hero__latest-cover .typeset { justify-content: center; outline: 1px solid rgba(232, 234, 241, 0.25); }
.hero__latest-cover .typeset__mark { width: 60%; align-self: center; }

/* Typeset cover: a book without a cover image, set like a plain printed edition */
.book-tile__cover, .book-cover-lg { container-type: inline-size; }
.typeset { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 0.5rem; padding: 16% 12% 11%; color: var(--silver); background: #171A33; }
.typeset::before { content: ''; position: absolute; inset: 6%; border: 1px solid rgba(232, 234, 241, 0.28); pointer-events: none; }
.typeset--1 { background: #6E2346; }
.typeset--2 { background: #2E3B5C; }
.typeset__title { position: relative; font-family: var(--font-ui); font-stretch: 75%; font-weight: 800; font-size: clamp(1rem, 13cqi, 2.4rem); line-height: 1.2; overflow-wrap: anywhere; }
.typeset__mark { position: relative; width: 24%; height: auto; align-self: flex-end; color: var(--silver); opacity: 0.9; }
.typeset__cut { fill: #171A33; }
.typeset--1 .typeset__cut { fill: #6E2346; }
.typeset--2 .typeset__cut { fill: #2E3B5C; }

.moon { margin: 0; text-align: center; }
.moon__disc { width: min(100%, 400px); aspect-ratio: 1; filter: drop-shadow(0 0 48px rgba(176, 190, 255, 0.28)); }
.moon__shadow { fill: var(--night-raised); stroke: rgba(232, 234, 241, 0.14); stroke-width: 0.5; }
:root:not([data-bs-theme="dark"]) .moon--on-light .moon__shadow { fill: #E4E7F0; stroke: #CDD1DE; }
:root:not([data-bs-theme="dark"]) .moon--on-light .moon__disc { filter: drop-shadow(0 10px 30px rgba(23, 26, 51, 0.12)); }
.moon__lit { animation: moonrise 2.2s ease-out both; }
@keyframes moonrise { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 767.98px) {
    .hero__grid { grid-template-columns: 1fr; }
    .hero__moon { order: -1; }
    .moon__disc { width: 48vw; }
}

/* Banner slides (Admin › Banners), under the hero */
.banner-carousel { position: relative; }
.banner-carousel .carousel-item { height: clamp(300px, 42vw, 460px); background: var(--night); }
.banner-carousel .carousel-item img { width: 100%; height: 100%; object-fit: cover; }
.banner-carousel .banner-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(23, 26, 51, 0.9) 0%, rgba(23, 26, 51, 0.82) max(45%, 520px), rgba(23, 26, 51, 0) 100%); }   /* the text column stays on a dark shade, whatever the picture */
.banner-carousel .banner-text { position: absolute; inset: 0; display: flex; align-items: center; z-index: 2; }
.banner-carousel .banner-title { font-stretch: 75%; font-weight: 800; font-size: clamp(1.9rem, 4.5vw, 3.2rem); color: var(--silver); margin-bottom: 0.4rem; }
.banner-carousel .banner-sub { font-family: var(--font-read); color: var(--silver-soft); max-width: 44ch; font-size: var(--read-size); line-height: 1.7; }
/* Prev/next: a white chevron on a dark disc, visible over any picture and in both modes
   (Bootstrap would turn the chevrons black in dark mode). Bottom right at every width, so they never cover the text or its button. */
.banner-carousel .carousel-control-prev, .banner-carousel .carousel-control-next { z-index: 2; top: auto; bottom: 10px; width: 48px; height: 48px; opacity: 1; }
.banner-carousel .carousel-control-prev { left: auto; right: 62px; }
.banner-carousel .carousel-control-next { right: 12px; }
.banner-carousel .carousel-control-prev-icon, .banner-carousel .carousel-control-next-icon { width: 44px; height: 44px; border-radius: 50%; background-color: rgba(23, 26, 51, 0.62); background-size: 18px 18px; border: 1px solid rgba(232, 234, 241, 0.35); transition: background-color 0.2s; }
:root[data-bs-theme="dark"] .banner-carousel .carousel-control-prev-icon, :root[data-bs-theme="dark"] .banner-carousel .carousel-control-next-icon { filter: none; }
.banner-carousel .carousel-control-prev:hover .carousel-control-prev-icon, .banner-carousel .carousel-control-next:hover .carousel-control-next-icon { background-color: rgba(23, 26, 51, 0.88); }
.banner-carousel .carousel-control-prev:focus-visible .carousel-control-prev-icon, .banner-carousel .carousel-control-next:focus-visible .carousel-control-next-icon { outline: 3px solid var(--lotus-light); outline-offset: 2px; }
@media (max-width: 767.98px) {
    /* Phones: the text runs the full width, so shade all of it; the slide grows with longer text and keeps room for the buttons */
    .banner-carousel .banner-shade { background: linear-gradient(90deg, rgba(23, 26, 51, 0.9) 0%, rgba(23, 26, 51, 0.72) 100%); }
    .banner-carousel .carousel-item { height: auto; min-height: 300px; }
    .banner-carousel .carousel-item > img { position: absolute; inset: 0; }
    .banner-carousel .banner-text { position: relative; min-height: 300px; padding: 1.5rem 0 4.25rem; }   /* 4.25rem clears the 48px buttons */
}

/* ── Sections ─────────────────────────────────────────────────────────── */
.section { padding-block: clamp(3rem, 6vw, 5rem); }
.section--mist { background: var(--mist); }
.section__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1.5rem; margin-bottom: 2rem; }
.section__title { font-size: var(--text-2xl); margin: 0; }

/* ── Book tiles: covers on a shelf ────────────────────────────────────── */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 2.5rem 1.75rem; list-style: none; margin: 0; padding: 0; }
.shelf--row { padding-bottom: 2.25rem; border-bottom: 6px solid var(--rule); box-shadow: 0 10px 0 -4px var(--mist); }
@media (max-width: 575.98px) {
    .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1rem; }
    .shelf--row { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(var(--bs-gutter-x) * -0.5); padding-inline: calc(var(--bs-gutter-x) * 0.5); scroll-padding-inline: calc(var(--bs-gutter-x) * 0.5); }
    .shelf--row > li { flex: 0 0 44%; scroll-snap-align: start; }
}
.book-tile { height: 100%; }
.book-tile__link { display: block; text-decoration: none; color: inherit; }
.book-tile__link:hover { color: inherit; }
.book-tile__cover {
    position: relative;
    display: block;
    aspect-ratio: 5 / 7;
    border-radius: 2px 4px 4px 2px;
    overflow: hidden;
    background: var(--mist);
    box-shadow: 0 1px 2px rgba(var(--shadow-rgb), 0.16), 0 14px 22px -14px rgba(var(--shadow-rgb), 0.55);
    transition: box-shadow 0.2s;
}
.book-tile__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-tile__cover::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(0, 0, 0, 0.22) 0, rgba(255, 255, 255, 0.14) 3px, rgba(0, 0, 0, 0) 10px); }
.book-tile__flag { position: absolute; top: 0; right: 10px; z-index: 1; background: var(--lotus-light); color: #171A33; font-size: var(--text-xs); font-weight: 700; line-height: 1; padding: 0.5rem 0.5rem 0.75rem; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%); }
.book-tile__cat { display: block; margin-top: 0.95rem; font-size: var(--text-xs); font-weight: 600; color: var(--link); }
.book-tile__title { font-size: var(--text-md); font-stretch: 87.5%; font-weight: 700; line-height: 1.35; margin: 0.2rem 0 0.2rem; color: var(--ink); }
.book-tile__cover + .book-tile__title { margin-top: 0.95rem; }
.book-tile__sub { display: block; font-size: var(--text-sm); line-height: 1.45; color: var(--ink-soft); }
.book-tile__author { display: block; font-size: var(--text-sm); color: var(--ink-soft); margin-top: 0.3rem; }
.book-tile__link:hover .book-tile__cover, .book-tile__link:focus-visible .book-tile__cover { box-shadow: 0 1px 2px rgba(var(--shadow-rgb), 0.2), 0 20px 30px -14px rgba(var(--shadow-rgb), 0.7); }
.book-tile__link:hover .book-tile__title, .book-tile__link:focus-visible .book-tile__title { color: var(--link); text-decoration: underline; text-underline-offset: 0.18em; }

/* ── Contents list (categories), with dot leaders ─────────────────────── */
.contents { list-style: none; margin: 0; padding: 0; }
.contents--two { column-count: 2; column-gap: 4rem; }
@media (max-width: 767.98px) { .contents--two { column-count: 1; } }
.contents li { break-inside: avoid; }
.contents__link { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.95rem 0; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--rule); }
.contents__link:hover { color: var(--ink); }
.contents__name { font-size: var(--text-lg); font-stretch: 87.5%; font-weight: 700; line-height: 1.35; }
.contents__latin { display: block; font-size: var(--text-sm); color: var(--ink-soft); font-weight: 400; }
.contents__leader { flex: 1; min-width: 1.5rem; border-bottom: 2px dotted var(--field-border); opacity: 0.6; transform: translateY(-0.35em); }
.contents__count { font-weight: 700; font-size: var(--text-md); color: var(--link); font-variant-numeric: tabular-nums; white-space: nowrap; }
.contents__count small { font-weight: 400; font-size: var(--text-xs); color: var(--ink-soft); }
.contents__desc { font-family: var(--font-read); color: var(--ink-soft); font-size: var(--text-base); line-height: 1.7; margin: -0.3rem 0 0.9rem; max-width: var(--measure); }
.contents__link:hover .contents__name { color: var(--link); text-decoration: underline; text-underline-offset: 0.2em; }

/* ── Editor's note ────────────────────────────────────────────────────── */
.editor-note { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.editor-note__photo { width: clamp(96px, 14vw, 150px); aspect-ratio: 1; border-radius: 50%; object-fit: cover; border: 3px solid var(--silver); }
.editor-note__photo--empty { display: flex; align-items: center; justify-content: center; background: var(--night-raised); color: var(--silver-soft); font-size: 2.5rem; }
.editor-note__quote { position: relative; font-family: var(--font-read); font-size: clamp(1.3rem, 1.1rem + 1vw, 1.75rem); line-height: 1.7; color: var(--silver); margin: 0 0 1.5rem; max-width: 34ch; }
.editor-note__quote::before { content: '\201C'; position: absolute; left: -0.6em; top: -0.15em; color: var(--lotus-light); font-size: 1.6em; line-height: 1; }
.editor-note__name { font-weight: 700; font-size: var(--text-md); color: var(--silver); }
.editor-note__role { color: var(--silver-soft); font-size: var(--text-sm); }
.editor-note__bio { font-family: var(--font-read); font-size: var(--read-size); color: var(--silver-soft); line-height: var(--leading-read); max-width: 60ch; margin: 1rem 0 1.5rem; }
@media (max-width: 575.98px) {
    .editor-note { grid-template-columns: 1fr; }
    .editor-note__quote::before { position: static; display: block; margin-bottom: -0.2em; }
}

/* ── About strip ──────────────────────────────────────────────────────── */
.about-strip { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.about-strip__facts { font-size: var(--text-xl); font-stretch: 87.5%; font-weight: 700; line-height: 1.45; margin: 0; color: var(--ink); }
.about-strip__facts strong { color: var(--link); }
@media (max-width: 767.98px) { .about-strip { grid-template-columns: 1fr; } }

/* ── Inner page heads ─────────────────────────────────────────────────── */
.page-head { padding: clamp(2.25rem, 5vw, 3.5rem) 0 clamp(1.75rem, 3vw, 2.5rem); }
.page-head__title { font-stretch: 75%; font-weight: 800; font-size: var(--text-3xl); line-height: 1.15; color: var(--silver); margin: 0 0 0.6rem; overflow-wrap: anywhere; }
.page-head__latin { font-family: var(--font-read); font-size: var(--text-md); color: var(--silver-soft); margin: -0.2rem 0 0.8rem; }
.crumbs .breadcrumb { margin: 0; font-size: var(--text-sm); --bs-breadcrumb-divider-color: rgba(232, 234, 241, 0.5); }
.crumbs .breadcrumb-item, .crumbs .breadcrumb-item a { color: var(--silver-soft); text-decoration: none; }
.crumbs .breadcrumb-item a:hover { color: #fff; text-decoration: underline; }
.crumbs .breadcrumb-item.active { color: var(--lotus-light); }
.crumbs .breadcrumb-item + .breadcrumb-item::before { color: rgba(232, 234, 241, 0.5); }

/* ── Listing pages ────────────────────────────────────────────────────── */
.filter-title { display: block; font-size: var(--text-base); font-weight: 700; margin: 0 0 0.75rem; color: var(--ink); }
.filter-list { list-style: none; margin: 0 0 2rem; padding: 0; }
.filter-list a { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0 0.6rem 0.9rem; border-left: 3px solid transparent; color: var(--ink); text-decoration: none; }
.filter-list a:hover { color: var(--link); border-left-color: var(--rule); }
.filter-list a[aria-current="page"] { border-left-color: var(--lotus); color: var(--link); font-weight: 700; }
.filter-list .count { color: var(--ink-soft); font-variant-numeric: tabular-nums; font-weight: 400; }
.list-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--rule); }
.list-toolbar .form-select { width: auto; font-size: var(--text-sm); }
.result-count { color: var(--ink-soft); }
.result-count strong { color: var(--ink); }
.empty-state { padding: 3rem 0; max-width: 36rem; }
.empty-state h2 { font-size: var(--text-xl); }
.empty-state p { font-family: var(--font-read); font-size: var(--read-size); line-height: var(--leading-read); color: var(--ink-soft); }
.pagination {
    --bs-pagination-color: var(--link); --bs-pagination-bg: var(--paper); --bs-pagination-border-color: var(--rule);
    --bs-pagination-hover-color: var(--link); --bs-pagination-hover-bg: var(--mist); --bs-pagination-hover-border-color: var(--rule);
    --bs-pagination-active-bg: var(--lotus); --bs-pagination-active-border-color: var(--lotus); --bs-pagination-active-color: #fff;
    --bs-pagination-disabled-bg: var(--paper); --bs-pagination-disabled-color: var(--ink-soft); --bs-pagination-disabled-border-color: var(--rule);
    --bs-pagination-focus-box-shadow: 0 0 0 3px rgba(194, 65, 111, 0.3);
    --bs-pagination-padding-x: 0.9rem; --bs-pagination-padding-y: 0.55rem;
}
.pagination + p, nav .small.text-muted { color: var(--ink-soft) !important; }

/* ── Book page ────────────────────────────────────────────────────────── */
.book-page { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
@media (max-width: 767.98px) { .book-page { grid-template-columns: 1fr; } .book-page__aside .book-cover-lg { max-width: 240px; } }
.book-cover-lg { position: relative; border-radius: 3px 6px 6px 3px; overflow: hidden; aspect-ratio: 5 / 7; background: var(--mist); box-shadow: 0 2px 4px rgba(var(--shadow-rgb), 0.18), 0 30px 40px -22px rgba(var(--shadow-rgb), 0.6); }
.book-cover-lg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-cover-lg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, 0.24) 0, rgba(255, 255, 255, 0.16) 4px, rgba(0, 0, 0, 0) 14px); }
.book-actions { display: grid; gap: 0.6rem; margin: 1.75rem 0 0; }
.book-byline { font-size: var(--text-md); margin: 0 0 1.75rem; }
.book-byline__label { color: var(--ink-soft); font-weight: 400; margin-right: 0.4em; }
.book-byline a { font-weight: 600; }
.book-section-title { font-size: var(--text-xl); margin: 2.75rem 0 1rem; }
.details { display: grid; grid-template-columns: auto minmax(0, 1fr); margin: 0; border-top: 1px solid var(--rule); max-width: var(--measure); }
.details dt, .details dd { padding: 0.7rem 0; border-bottom: 1px solid var(--rule); margin: 0; }
.details dt { color: var(--ink-soft); font-weight: 400; padding-right: 1.5rem; }
.details dd { font-weight: 600; text-align: right; color: var(--ink); }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 1.75rem; }
.share__label { color: var(--ink-soft); margin-right: 0.25rem; }
.share-btn { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--rule); color: var(--ink); background: var(--paper); text-decoration: none; font-size: 1.05rem; cursor: pointer; }
.share-btn:hover, .share-btn:focus { background: var(--lotus); color: #fff; border-color: var(--lotus); }
.preview-frame { position: relative; aspect-ratio: 3 / 4; max-height: 85vh; width: 100%; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: var(--mist); }
.preview-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.author-card { display: flex; gap: 1.25rem; align-items: center; padding: 1.5rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-top: 2.75rem; max-width: var(--measure); }
.author-card img, .author-card__empty { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.author-card__empty { display: flex; align-items: center; justify-content: center; background: var(--mist); color: var(--ink-soft); font-size: 1.8rem; }
.author-card__name { font-weight: 700; font-size: var(--text-md); margin: 0; }
.author-card p { font-family: var(--font-read); color: var(--ink-soft); line-height: 1.7; margin: 0.25rem 0 0; }

/* ── Founder & about pages ────────────────────────────────────────────── */
.profile { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
@media (max-width: 767.98px) { .profile { grid-template-columns: 1fr; } .profile__photo { max-width: 200px; } }
.profile__photo { width: 100%; max-width: 260px; aspect-ratio: 1; object-fit: cover; border-radius: 50%; }
.profile__photo--empty { display: flex; align-items: center; justify-content: center; background: var(--mist); color: var(--ink-soft); font-size: 4rem; }
.profile__links { display: flex; gap: 0.5rem; margin-top: 1.25rem; }
.pull-quote { font-family: var(--font-read); font-size: clamp(1.3rem, 1.15rem + 0.7vw, 1.6rem); line-height: 1.7; color: var(--ink); border-left: 3px solid var(--lotus-light); padding-left: 1.25rem; margin: 0 0 2rem; max-width: 40ch; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 5vw, 4rem); }
@media (max-width: 767.98px) { .two-col { grid-template-columns: 1fr; } }
.two-col h2 { font-size: var(--text-xl); }

/* ── Contact & forms ──────────────────────────────────────────────────── */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
@media (max-width: 991.98px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-list { margin: 0; }
.contact-list dt { font-weight: 400; color: var(--ink-soft); font-size: var(--text-sm); }
.contact-list dd { font-size: var(--text-md); font-weight: 600; margin: 0.1rem 0 1.25rem; overflow-wrap: anywhere; }
.contact-list dd a { color: var(--ink); text-decoration-color: var(--rule); }
.contact-list dd a:hover { color: var(--link); }
.form-label { font-weight: 600; color: var(--ink); margin-bottom: 0.4rem; }
.form-control, .form-select { font-size: var(--text-base); color: var(--ink); background-color: var(--paper); border: 1px solid var(--field-border); border-radius: 8px; padding: 0.65rem 0.9rem; }
.form-control::placeholder { color: var(--ink-soft); opacity: 0.85; }
.form-control:focus, .form-select:focus { color: var(--ink); background-color: var(--paper); border-color: var(--lotus); box-shadow: 0 0 0 3px rgba(194, 65, 111, 0.22); }
.invalid-feedback { font-size: var(--text-sm); }
.vm-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.notice { border-left: 4px solid; padding: 0.95rem 1.15rem; margin-bottom: 1.5rem; border-radius: 0 8px 8px 0; }
.notice--ok { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok-ink); }
.notice--error { border-color: var(--err-line); background: var(--err-bg); color: var(--err-ink); }

/* ── Footer ───────────────────────────────────────────────────────────── */
.site-footer { padding: clamp(3rem, 6vw, 4.5rem) 0 2rem; margin-top: clamp(3rem, 6vw, 5rem); }
.site-footer__name { font-stretch: 75%; font-weight: 800; font-size: 2.2rem; line-height: 1.1; color: var(--silver); }
.site-footer__about { font-family: var(--font-read); line-height: 1.8; max-width: 40ch; margin-top: 0.75rem; }
.site-footer h2 { font-size: var(--text-base); font-stretch: 100%; font-weight: 700; color: var(--lotus-light); margin-bottom: 0.9rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.5rem; }
.site-footer a { color: var(--silver-soft); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer__base { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid rgba(232, 234, 241, 0.15); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; font-size: var(--text-sm); }
.social { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; }
.social-btn { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; border: 1px solid rgba(232, 234, 241, 0.35); color: var(--silver) !important; text-decoration: none !important; }
.social-btn:hover, .social-btn:focus { background: var(--silver); color: #171A33 !important; }
.social--light .social-btn { border-color: var(--rule); color: var(--ink) !important; }
.social--light .social-btn:hover, .social--light .social-btn:focus { background: var(--lotus); color: #fff !important; border-color: var(--lotus); }

/* ── Error pages ──────────────────────────────────────────────────────── */
.error-page { min-height: 100vh; display: flex; align-items: center; }
.error-page .moon__disc { width: 160px; }
.error-page__code { font-stretch: 75%; font-weight: 800; font-size: var(--text-md); color: var(--lotus-light); margin-top: 1.5rem; }
.error-page h1 { font-stretch: 75%; font-weight: 800; font-size: clamp(2.2rem, 6vw, 3.4rem); margin: 0.25rem 0 1rem; }
.error-page p { font-family: var(--font-read); font-size: var(--read-size); max-width: 46ch; margin-inline: auto; line-height: var(--leading-read); }

/* ── Dark mode details (Bootstrap pieces that keep fixed colours) ─────── */
:root[data-bs-theme="dark"] .site-header { background: var(--paper); }
:root[data-bs-theme="dark"] .modal-content { background: var(--paper); }
:root[data-bs-theme="dark"] .contents__leader { opacity: 0.8; }
/* Night-coloured covers and the logo tile would melt into the dark page: give them a faint edge */
:root[data-bs-theme="dark"] .book-tile__cover { box-shadow: 0 0 0 1px rgba(232, 234, 241, 0.14), 0 14px 22px -14px rgba(0, 0, 0, 0.55); }
:root[data-bs-theme="dark"] .book-tile__link:hover .book-tile__cover, :root[data-bs-theme="dark"] .book-tile__link:focus-visible .book-tile__cover { box-shadow: 0 0 0 1px rgba(232, 234, 241, 0.24), 0 20px 30px -14px rgba(0, 0, 0, 0.7); }
:root[data-bs-theme="dark"] .book-cover-lg { box-shadow: 0 0 0 1px rgba(232, 234, 241, 0.14), 0 30px 40px -22px rgba(0, 0, 0, 0.6); }
:root[data-bs-theme="dark"] .brand__mark--tile { box-shadow: 0 0 0 1px rgba(232, 234, 241, 0.2); }

/* ── 3D enhancements (public/frontend/js/vm3d.js) ─────────────────────── */
.moon__canvas { display: none; }
.moon--3d .moon__canvas { display: block; margin-inline: auto; }
.moon--3d svg.moon__disc { display: none; }
.page-turn-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.banner-carousel.is-3d .carousel-inner { position: relative; z-index: 1; }
.banner-carousel.is-3d .carousel-item { background: transparent; }
.banner-carousel.is-3d .carousel-item > img { visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
