/* ══════════════════════════════════════════════════════════════
   Book pages (book-gis.html, book-optical.html)
   Shared layout, reading typography, accordion and section styles.
   Site nav, footer and contact modal styles stay inline in each page.
   ══════════════════════════════════════════════════════════════ */

:root { --ink: #0d1a2e; --text: #2f4058; --soft: #5a6f8c; --rule: #d9e3ee; --tint: #f5f8fc; --subnav-h: 52px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 3px; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.book-wrap { max-width: 1160px; margin: 0 auto; padding: 0 40px; }
.book-reading { max-width: 720px; }

/* ── Header ── */
.book-hero { position: relative; overflow: hidden; background: var(--navy); }
.book-hero .hero-bg { position: absolute; inset: 0; z-index: 0; background: radial-gradient(ellipse 100% 70% at 70% 25%, rgba(29,120,196,0.13) 0%, transparent 60%), radial-gradient(ellipse 60% 50% at 0% 90%, rgba(29,120,196,0.07) 0%, transparent 60%), var(--navy); }
.book-hero .hero-grid { position: absolute; inset: 0; z-index: 1; background-image: radial-gradient(rgba(29,120,196,0.18) 1px, transparent 1px); background-size: 36px 36px; mask-image: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.22) 20%, rgba(0,0,0,0.18) 65%, transparent 100%); }
.book-hero-inner { position: relative; z-index: 2; max-width: 1160px; margin: 0 auto; padding: 146px 40px 64px; }
.book-crumbs { display: flex; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 28px; }
.book-crumbs a { color: var(--muted); text-decoration: none; }
.book-crumbs a:hover { color: #fff; }
.book-title { font-size: clamp(36px, 5.4vw, 64px); font-weight: 800; line-height: 1.02; letter-spacing: -0.035em; color: var(--bright); }
.book-title-2 { display: block; font-size: 0.56em; font-weight: 600; line-height: 1.15; letter-spacing: -0.025em; color: rgba(238,244,255,0.92); margin-top: 14px; }
.book-subtitle { font-size: clamp(20px, 2.4vw, 28px); font-weight: 300; font-style: italic; line-height: 1.3; letter-spacing: -0.01em; color: rgba(238,244,255,0.82); margin-top: 12px; }
.book-hero--cover .book-subtitle { font-size: clamp(18px, 1.9vw, 22px); margin-top: 16px; }
.book-descriptor { font-size: 16px; line-height: 1.65; color: rgba(238,244,255,0.78); max-width: 560px; margin-top: 24px; }
.book-meta { display: flex; flex-wrap: wrap; gap: 20px 48px; margin-top: 40px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.12); }
.book-meta:empty { display: none; }
.book-meta dt { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.book-meta dd { font-size: 15px; font-weight: 500; color: #fff; }
.book-status { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 10px; border: 1px solid rgba(52,149,232,0.55); border-radius: 999px; background: rgba(29,120,196,0.14); font-size: 13.5px; color: #d6e8fa; }
.book-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #3495e8; }

/* Header with typographic cover concept */
.book-hero-grid { display: grid; grid-template-columns: 1fr 264px; gap: 64px; align-items: end; }
.book-cover { margin: 0; }
.cover { aspect-ratio: 2 / 3; background: #f3f6fa; border-radius: 2px 6px 6px 2px; box-shadow: inset 6px 0 0 rgba(13,26,46,0.08), 0 24px 48px rgba(0,0,0,0.45); padding: 26px 22px 22px; display: flex; flex-direction: column; color: var(--ink); }
.cover-title { font-size: 25px; font-weight: 800; line-height: 1.04; letter-spacing: -0.03em; }
.cover-sub { font-size: 11.5px; font-weight: 500; line-height: 1.4; color: #3c4e66; margin-top: 10px; }
.cover-comb { margin-top: auto; height: 64px; display: flex; align-items: flex-end; gap: 3px; }
.cover-comb span { flex: 1; background: var(--brand); border-radius: 1px; }
.cover-author { font-size: 11px; font-weight: 600; color: var(--ink); margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(13,26,46,0.15); }
.book-cover figcaption { font-size: 12.5px; color: var(--muted); margin-top: 12px; }

/* ── On-page nav ── */
.book-subnav { position: sticky; top: 90px; z-index: 400; background: rgba(255,255,255,0.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--rule); }
.book-subnav .book-wrap { display: flex; gap: 32px; height: var(--subnav-h); align-items: stretch; overflow-x: auto; scrollbar-width: none; }
.book-subnav .book-wrap::-webkit-scrollbar { display: none; }
.book-subnav a { display: flex; align-items: center; flex-shrink: 0; white-space: nowrap; font-size: 14px; font-weight: 600; color: var(--soft); text-decoration: none; border-bottom: 2px solid transparent; }
.book-subnav a:hover { color: var(--ink); }
.book-subnav a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--brand); }

/* ── Sections and reading text ── */
.book-section { padding: 72px 0 88px; scroll-margin-top: calc(90px + var(--subnav-h)); }
.book-section + .book-section { border-top: 1px solid var(--rule); }
.book-section--tint { background: var(--tint); }
.book-section h2 { font-size: clamp(26px, 3vw, 34px); font-weight: 750; line-height: 1.15; letter-spacing: -0.025em; color: var(--ink); margin-bottom: 24px; }
.book-section h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); margin: 44px 0 14px; }
.book-reading p { font-size: 17px; line-height: 1.75; color: var(--text); margin-bottom: 1.1em; }
.book-reading cite { font-style: italic; }
.book-note { font-size: 14.5px; line-height: 1.65; color: var(--soft); max-width: 720px; }

/* ── Status tags ── */
.st { display: inline-block; font-size: 12px; font-weight: 500; line-height: 1.6; padding: 1px 9px; border-radius: 999px; white-space: nowrap; }
.st--proposed, .st--planned { color: #5a6f8c; background: #fff; border: 1px dashed #b7c6d8; }
.st--draft, .st--available { color: #fff; background: var(--brand); border: 1px solid var(--brand); }

/* ── Accordion (shared) ── */
.toc { max-width: 880px; margin-top: 40px; }
.toc-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.toc-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 13.5px; color: var(--soft); }
.legend-item { display: inline-flex; align-items: center; gap: 8px; }
.toc-actions { gap: 8px; margin-left: auto; }
.toc-btn { font: 600 13px 'Inter', sans-serif; color: var(--ink); background: #fff; border: 1px solid #c9d6e6; border-radius: 6px; padding: 8px 14px; cursor: pointer; transition: border-color 0.15s, color 0.15s; }
.toc-btn:hover { border-color: var(--brand); color: var(--brand); }
.acc-chev { width: 20px; height: 20px; color: var(--soft); transition: transform 0.2s ease; }
.acc-btn[aria-expanded="true"] .acc-chev { transform: rotate(180deg); }
/* Without JavaScript every item stays open and the controls are hidden */
.toc-actions, .acc-chev { display: none; }
.js .toc-actions { display: flex; }
.js .acc-chev { display: block; }
.acc-btn { cursor: default; }
.js .acc-btn { cursor: pointer; }
.js .acc-panel:not(.is-open) { display: none; }

/* Parts with chapter lists (GIS) */
.part { border-top: 1px solid var(--rule); }
.part:last-child { border-bottom: 1px solid var(--rule); }
.book-section .part-h { margin: 0; font-size: inherit; }
.part-btn { width: 100%; display: grid; grid-template-columns: 88px 1fr 24px; align-items: center; gap: 0 8px; padding: 22px 4px; background: none; border: 0; text-align: left; font-family: inherit; color: inherit; }
.part-num { font-size: 40px; font-weight: 300; line-height: 1; letter-spacing: -0.02em; color: var(--brand); }
.part-title { display: block; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); transition: color 0.15s; }
.part-range { display: block; font-size: 13.5px; font-weight: 400; color: var(--soft); margin-top: 4px; }
.part-btn:hover .part-title { color: var(--brand); }
.part-btn[aria-expanded="true"] .part-num { font-weight: 500; }
.part-panel { padding: 0 4px 28px 100px; }
.part-desc { font-size: 15.5px; line-height: 1.7; color: var(--text); max-width: 640px; margin-bottom: 14px; }
.ch-list { list-style: none; margin: 0; padding: 0; }
.ch { display: grid; grid-template-columns: 44px 1fr auto; align-items: baseline; gap: 4px 12px; padding: 10px 0; border-top: 1px solid #e6edf5; }
.ch-num { font-size: 14px; font-weight: 600; color: var(--brand); font-variant-numeric: tabular-nums; }
.ch-title { font-size: 15.5px; line-height: 1.5; color: var(--ink); }
.ch-title a { color: var(--brand); font-weight: 600; text-underline-offset: 3px; }

/* Chapters with summaries (Optical) */
.chap { border-top: 1px solid var(--rule); }
.chap:last-child { border-bottom: 1px solid var(--rule); }
.book-section .chap-h { margin: 0; font-size: inherit; }
.chap-btn { width: 100%; display: grid; grid-template-columns: 64px 1fr 24px; align-items: center; gap: 0 8px; padding: 18px 4px; background: none; border: 0; text-align: left; font-family: inherit; color: inherit; }
.chap-num { font-size: 30px; font-weight: 300; line-height: 1; letter-spacing: -0.02em; color: var(--brand); font-variant-numeric: tabular-nums; }
.chap-title { font-size: 17.5px; font-weight: 650; line-height: 1.35; letter-spacing: -0.01em; color: var(--ink); transition: color 0.15s; }
.chap-btn:hover .chap-title { color: var(--brand); }
.chap-btn[aria-expanded="true"] .chap-num { font-weight: 500; }
.chap-panel { padding: 0 32px 22px 76px; }
.chap-panel p { font-size: 15.5px; line-height: 1.7; color: var(--text); max-width: 640px; }
.chap-panel a { color: var(--brand); font-weight: 600; }

.ms-status { margin-top: 48px; padding: 4px 0 4px 20px; border-left: 3px solid var(--brand); max-width: 720px; }
.book-section .ms-status h3 { font-size: 17px; margin: 0 0 8px; }
.ms-status p { font-size: 15.5px; line-height: 1.7; color: var(--text); }

/* ── Learning beyond the book ── */
.planned-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 32px; font-size: 14.5px; color: var(--soft); }
.learn-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; max-width: 1080px; }
.learn-item { border-top: 2px solid var(--brand); padding-top: 18px; }
.book-section .learn-name { font-size: 15px; font-weight: 800; letter-spacing: 0.12em; margin: 0 0 10px; color: var(--ink); }
.learn-item p { font-size: 15px; line-height: 1.65; color: var(--text); }

/* ── Readers ── */
.readers-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; max-width: 880px; }
.readers-list li { font-size: 16.5px; line-height: 1.5; color: var(--ink); padding: 14px 0 14px 22px; border-top: 1px solid var(--rule); position: relative; }
.readers-list li::before { content: ''; position: absolute; left: 0; top: 23px; width: 8px; height: 2px; background: var(--brand); }

/* ── Author ── */
.book-section .author-name { margin: 0 0 4px; }
.book-reading p.author-cred { font-size: 14px; color: var(--soft); margin-bottom: 18px; }
.author-links { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 8px; }
.author-links a { font-size: 15px; font-weight: 600; color: var(--brand); text-underline-offset: 3px; }

/* ── Manuscript and resources status ── */
.updates-list { display: grid; grid-template-columns: 200px 1fr; gap: 0; max-width: 720px; }
.updates-list dt, .updates-list dd { padding: 14px 0; border-top: 1px solid var(--rule); font-size: 15.5px; }
.updates-list dt { font-weight: 600; color: var(--ink); }
.updates-list dd { color: var(--text); }

@media (prefers-reduced-motion: reduce) { .acc-chev, .part-title, .chap-title, .toc-btn { transition: none; } }

@media (max-width: 1024px) {
  .learn-grid { grid-template-columns: 1fr 1fr; }
  .book-hero-grid { grid-template-columns: 1fr 200px; gap: 40px; }
  .cover-title { font-size: 19px; }
}
@media (max-width: 768px) {
  :root { --subnav-h: 48px; }
  .book-wrap { padding: 0 20px; }
  .book-hero-inner { padding: 100px 20px 44px; }
  .book-crumbs { margin-bottom: 20px; }
  .book-meta { margin-top: 28px; gap: 16px 32px; }
  .book-hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .book-cover { width: 180px; }
  .cover { padding: 18px 16px 16px; }
  .cover-title { font-size: 17px; }
  .cover-sub { font-size: 9.5px; }
  .cover-comb { height: 44px; gap: 2px; }
  .book-subnav { top: 68px; }
  .book-subnav .book-wrap { gap: 24px; }
  .book-section { padding: 48px 0 64px; scroll-margin-top: calc(68px + var(--subnav-h)); }
  .book-reading p { font-size: 16px; }
  .toc-toolbar { flex-direction: column; align-items: flex-start; }
  .toc-actions { margin-left: 0; }
  .part-btn { grid-template-columns: 52px 1fr 20px; padding: 18px 0; }
  .part-num { font-size: 28px; }
  .part-title { font-size: 17px; }
  .part-panel { padding: 0 0 22px 0; }
  .ch { grid-template-columns: 34px 1fr auto; gap: 4px 10px; }
  .chap-btn { grid-template-columns: 44px 1fr 20px; padding: 16px 0; }
  .chap-num { font-size: 24px; }
  .chap-title { font-size: 16px; }
  .chap-panel { padding: 0 0 20px 0; }
  .learn-grid, .readers-list { grid-template-columns: 1fr; gap: 28px; }
  .readers-list { gap: 0; }
  .updates-list { grid-template-columns: 1fr; }
  .updates-list dd { border-top: 0; padding-top: 0; }
}
.toc-note { margin-top: 20px; }
.learn-item p.learn-status { margin-top: 12px; }
@media (max-width: 560px) { .book-cover { display: none; } }
