/* The modern-English page (src/seo/modernEnglishPage.ts; docs/modern-english/BUILD-BRIEF.md and poc/).
   The library's dark room: the Meditations scene blurred behind the opening, the shelves as sideways reels.
   Playfair Display for headings, EB Garamond for book text, system UI for the chrome. */
:root {
  --me-room: #110f0c;
  --me-room-2: #1a1713;
  --me-text: #efe8db;
  --me-dim: #b9b0a2;
  --me-faint: #8c8478;
  --me-rule: rgba(239, 232, 219, 0.14);
  --me-display: 'Playfair Display', Georgia, serif;
  --me-book: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --me-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --me-gutter: max(16px, env(safe-area-inset-left, 0px));
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.me { margin: 0; background: var(--me-room); color: var(--me-text); font: 15px/1.5 var(--me-ui); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
.me a { color: inherit; text-decoration: none; }
.me-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Opening: the headline, search and pills ---- */
/* Only the scene is clipped to the opening: the search results may drop over the shelves below it. */
.me-opening { position: relative; }
.me-scene { position: absolute; inset: 0; overflow: hidden; }
.me-scene::before { content: ""; position: absolute; inset: -40px; background: url("/lab/library_2/assets/scene-meditations-phone.jpg") center / cover no-repeat; filter: blur(14px) brightness(0.8); }
.me-opening::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 8, 6, 0.55), rgba(10, 8, 6, 0.75)); pointer-events: none; }
.me-opening::after { content: ""; position: absolute; inset: auto 0 0; height: 120px; background: linear-gradient(transparent, var(--me-room)); pointer-events: none; }
.me-top { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto;
  padding: 40px max(16px, env(safe-area-inset-right, 0px)) 48px var(--me-gutter); }
.me-claim { min-width: 0; }
/* The wordmark: the only brand mark on the page (Anders, 23 Nov). It opens the library. */
.me-wordmark { display: inline-block; font: 500 22px/1 var(--me-display); letter-spacing: -.01em; padding: 8px 0; margin: -8px 0 22px; }
.me h1 { font: 600 clamp(32px, 5vw, 54px)/1.06 var(--me-display); margin: 0; text-wrap: balance; }
.me-sub { font: clamp(18px, 1.35vw, 20px)/1.4 var(--me-book); color: var(--me-dim); margin: 10px 0 0; }

.me-search { position: relative; margin-top: 22px; z-index: 3; }
.me-search svg { position: absolute; left: 18px; top: 16px; color: var(--me-dim); z-index: 1; pointer-events: none; }
.me-search input { width: 100%; height: 52px; border-radius: 26px; border: 0; padding: 0 20px 0 50px; font: 18px var(--me-book); color: var(--me-text);
  background: rgba(20, 17, 13, 0.62); box-shadow: inset 0 0 0 1px rgba(239, 232, 219, 0.28); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); -webkit-appearance: none; appearance: none; }
.me-search input::placeholder { color: var(--me-dim); }
.me-search input:focus { outline: 2px solid var(--me-text); outline-offset: 2px; }
.me-search input::-webkit-search-cancel-button { filter: invert(0.85); }
.me-results { position: absolute; left: 0; right: 0; top: 60px; list-style: none; margin: 0; padding: 6px; border-radius: 16px; background: #1b1814;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6), inset 0 0 0 1px var(--me-rule); max-height: min(420px, 60vh); overflow-y: auto; }
.me-results[hidden] { display: none; }
.me-results a { display: flex; gap: 12px; align-items: center; padding: 7px 8px; border-radius: 10px; }
.me-results a:hover, .me-results a[aria-selected="true"] { background: rgba(239, 232, 219, 0.08); }
.me-results img { width: 36px; height: 54px; object-fit: cover; border-radius: 2px; flex: none; background: var(--me-room-2); }
.me-results .me-result-title { font: 500 17px/1.2 var(--me-book); display: block; }
.me-results .me-result-meta { font: italic 14px/1.3 var(--me-book); color: var(--me-faint); display: block; }
.me-results .me-empty { padding: 10px; font: 16px var(--me-book); color: var(--me-dim); }

/* Each pill takes a 40px tap without looking any different (SEO audit, 1 Dec 2026): its hit area reaches 4px above and
   below it, and the row keeps 4px of room for that (padding the row scrolls inside), with the same spacing as before. */
.me-pills { display: flex; flex-wrap: nowrap; gap: 6px; margin-top: 6px; margin-bottom: -4px; padding-block: 4px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.me-pills::-webkit-scrollbar { display: none; }
.me-search + .me-pills { margin-top: 12px; }
.me-pills button { flex: none; height: 32px; padding: 0 12px; border-radius: 16px; border: 0; background: rgba(20, 17, 13, 0.55); color: var(--me-dim);
  font: 13px var(--me-ui); box-shadow: inset 0 0 0 1px rgba(239, 232, 219, 0.22); cursor: pointer; }
.me-pills button { position: relative; }
.me-pills button::after { content: ''; position: absolute; left: 0; right: 0; top: -4px; bottom: -4px; }
.me-pills button:hover { color: var(--me-text); }
.me-pills button[aria-pressed="true"] { background: var(--me-text); color: var(--me-room); box-shadow: none; }
.me-pills button:focus-visible { outline: 2px solid var(--me-text); outline-offset: 2px; }

/* No pile of covers (Anders, 20 Nov 2026): the headline and the search run across the page, and the shelves below
   carry the covers. */
.me-card a:focus-visible, .me-results a:focus-visible { outline: 2px solid var(--me-text); outline-offset: 3px; }

@media (min-width: 700px) {
  .me { --me-gutter: max(32px, env(safe-area-inset-left, 0px)); }
}
@media (min-width: 900px) {
  .me-scene::before { background-image: url("/lab/library_2/assets/scene-meditations-wide.jpg"); }
  .me-top { padding-top: 96px; padding-bottom: 56px; }
  .me h1 { font-size: clamp(48px, 5.6vw, 76px); }
  .me-sub { font-size: clamp(19px, 1.6vw, 22px); }
  .me-search { margin-top: 30px; }
  .me-search input { height: 64px; border-radius: 32px; font-size: 22px; padding-left: 60px; }
  .me-search svg { top: 22px; left: 24px; }
  .me-results { top: 72px; }
  .me-pills { flex-wrap: wrap; overflow: visible; row-gap: 8px; }
}

/* ---- Shelves ---- */
.me-main { max-width: 1240px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 var(--me-gutter); }
.me-shelves { padding: 8px 0 20px; scroll-margin-top: 16px; }
.me-shelf { padding-top: 26px; }
.me-shelf[hidden] { display: none; }
.me-shelf h2 { font: 600 22px var(--me-display); margin: 0 0 12px; }
.me-shelf h2 span { font: 400 14px var(--me-ui); color: var(--me-faint); font-variant-numeric: tabular-nums; }
.me-reel { list-style: none; margin: 0; padding: 0 0 8px; display: grid; grid-auto-flow: column; grid-auto-columns: 124px; gap: 14px; overflow-x: auto;
  scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: rgba(239, 232, 219, 0.2) transparent; }
.me-card[hidden] { display: none; }
.me-card a { display: flex; flex-direction: column; gap: 3px; scroll-snap-align: start; }
.me-card img { width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px; background: var(--me-room-2); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5); margin-bottom: 6px; }
.me-card-title { font: 500 16px/1.2 var(--me-book); }
/* The author under the title (Anders, 26 Nov 2026: Plato's dialogues all read "Jowett"); the source line below it says
   which translation the Modern English is made from. */
.me-card-author { font: 14px/1.3 var(--me-book); color: var(--me-dim); }
.me-card-source { font: italic 13px/1.3 var(--me-book); color: var(--me-faint); }
.me-card a:hover .me-card-title { text-decoration: underline; text-underline-offset: 3px; }
/* English cards split their links (cover and details: free mode; title: the book's page) but keep the same layout. */
.me-card.is-split { display: flex; flex-direction: column; gap: 3px; scroll-snap-align: start; }
.me-card.is-split > a { display: flex; flex-direction: column; gap: 3px; }
.me-card.is-split > a.me-card-title:hover, .me-card.is-split:has(.me-card-open:hover) .me-card-title { text-decoration: underline; text-underline-offset: 3px; }
.me-none { font: 18px var(--me-book); color: var(--me-dim); padding-top: 20px; margin: 0; }
@media (min-width: 900px) {
  .me-reel { grid-auto-columns: 150px; gap: 18px; }
}

/* ---- The quiet line and the footer ---- */
.me-note { font: 17px/1.5 var(--me-book); color: var(--me-faint); max-width: 60ch; border-top: 1px solid var(--me-rule); margin: 34px 0 0; padding: 22px 0 40px; }
.me-footer { border-top: 1px solid var(--me-rule); padding: 22px max(16px, env(safe-area-inset-right, 0px)) max(32px, env(safe-area-inset-bottom, 0px)) var(--me-gutter); font: 14px var(--me-ui); color: var(--me-faint); }
.me-footer nav { max-width: 1240px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.me-footer a:hover { color: var(--me-text); }
/* A finger-sized target: each link is 36px tall, its text where it was. */
.me-footer nav { margin-top: -8px; margin-bottom: -8px; }
.me-footer a { display: inline-block; padding: 9px 0; }

/* ---- Tablets: the phone layout, a size up ---- */
@media (min-width: 700px) and (max-width: 899px) {
  .me-sub { font-size: 20px; }
  .me-reel { grid-auto-columns: 140px; gap: 16px; }
  .me-card-title { font-size: 17px; }
  .me-card-author { font-size: 15px; }
  .me-card-source { font-size: 14px; }
  .me-shelf h2 { font-size: 24px; }
}

/* ---- Large monitors: a wider room and larger type, so the page does not sit small in the middle ---- */
@media (min-width: 1800px) {
  .me-top, .me-main, .me-footer nav { max-width: 1600px; }
  .me-top { padding-top: 120px; padding-bottom: 72px; }
  .me h1 { font-size: 92px; }
  .me-sub { font-size: 23px; margin-top: 14px; }
  .me-search { margin-top: 34px; }
  .me-search input { height: 72px; border-radius: 36px; font-size: 24px; padding-left: 64px; }
  .me-search svg { top: 26px; left: 26px; }
  .me-results { top: 80px; }
  .me-pills button { height: 38px; border-radius: 19px; padding: 0 15px; font-size: 15px; }
  .me-reel { grid-auto-columns: 184px; gap: 22px; }
  .me-card-title { font-size: 19px; }
  .me-card-author { font-size: 16px; }
  .me-card-source { font-size: 15px; }
  .me-shelf { padding-top: 34px; }
  .me-shelf h2 { font-size: 28px; margin-bottom: 16px; }
  .me-shelf h2 span { font-size: 16px; }
  .me-note { font-size: 20px; }
  .me-footer { font-size: 16px; }
}
