/* One question fills the screen; each answer floods the next colour from the finger (owner's choice, 4 Nov 2026).
   Navy for the first question, green for the second, white for reading. */
:root {
  color-scheme: light;
  --navy: #00548c;
  --green: #4eb657;
  --deep: #05243a;
  --ink: #0b2438;
  --soft: #54656f;
  --err: #c62828;
  --line: #e6ebee;
  --disp: "Alexandria", sans-serif;
  --body: "Almarai", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: #fff; color: var(--ink); font-family: var(--body); }
body[data-tone="navy"] { background: var(--navy); }
body[data-tone="green"] { background: var(--green); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: start; }
a { color: inherit; }
:focus-visible { outline: 3px solid #ffb300; outline-offset: 2px; }
h1, h2 { text-wrap: balance; }

/* The question screens */
.scr { min-height: 100dvh; display: flex; flex-direction: column; padding: max(16px, env(safe-area-inset-top)) clamp(20px, 4vw, 56px) 18px; }
.scr.navy { background: var(--navy); color: #fff; }
.scr.green { background: var(--green); color: var(--deep); }
.scr.white { background: #fff; color: var(--ink); padding: 0; }
.wipe { position: fixed; inset: 0; z-index: 20; overflow: hidden; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; line-height: 1.5; }
.top strong { font: 700 14px var(--disp); white-space: nowrap; }
.top span { font-size: 12px; text-align: end; }
.back { font: 400 14px var(--disp); padding: 6px 0; text-decoration: none; }
.back:hover { text-decoration: underline; }
.grid { flex: 1; display: grid; align-content: center; gap: 14px clamp(24px, 5vw, 80px); grid-template-columns: minmax(0, 1fr); padding-block: 14px; }
.said-line { margin: 0 0 8px; font-size: 15px; }
.q { font: 800 clamp(42px, 7.4vw, 100px)/1.22 var(--disp); margin: 0; }
.a { list-style: none; margin: 0; padding: 0; border-top: 1px solid color-mix(in srgb, currentColor 30%, transparent); }
.a li { border-bottom: 1px solid color-mix(in srgb, currentColor 30%, transparent); }
.a button, .a a { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: clamp(10px, 1.7vh, 18px) 0; font: 500 clamp(18px, 2.2vw, 28px)/1.45 var(--disp); text-decoration: none; transition: padding .18s ease; }
.a button:hover, .a a:hover { padding-inline-start: 10px; }
.a .ar { flex: 0 0 auto; transition: transform .18s ease; }
.a button:hover .ar, .a a:hover .ar { transform: translateX(-5px); }
.foot { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; font-size: 14px; min-height: 36px; padding-inline-end: 140px; }
.foot button, .foot a { text-decoration: underline; text-underline-offset: 4px; }
.foot.searching { padding-inline-end: 0; margin-block-end: 52px; }
.search-form { display: flex; gap: 8px; width: 100%; }
.search-form input { flex: 1; min-width: 0; height: 42px; border: 0; border-radius: 6px; padding: 0 12px; font: 15px var(--body); color: var(--ink); background: #fff; }
.search-form button { flex: 0 0 auto; text-decoration: none; padding: 0 16px; border-radius: 6px; background: var(--green); color: var(--deep); font-weight: 700; }
@media (min-width: 960px) {
  .grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; }
}

/* Reading pages: white, one column */
.bar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 20px; background: #fff; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--soft); }
.bar .back { color: var(--navy); }
.bar .brand { font: 700 13px var(--disp); color: var(--soft); text-decoration: none; }
.page { max-width: 760px; margin: 0 auto; padding: 34px 20px 60px; width: 100%; }
.page h1 { font: 800 clamp(30px, 5vw, 50px)/1.3 var(--disp); margin: 0 0 22px; color: var(--navy); }
.page .chapter { font: 700 clamp(21px, 3vw, 28px)/1.4 var(--disp); margin: 34px 0 8px; color: var(--navy); }
.page .a { color: var(--ink); }
.page .a button, .page .a a { font-size: clamp(17px, 2vw, 22px); padding-block: 10px; }
.page .empty { color: var(--soft); line-height: 1.9; }
.page.about p { font-size: 17px; line-height: 2; margin: 0 0 14px; }
.page.about .by { font-weight: 700; }
.page.about a { color: var(--navy); text-underline-offset: 4px; }

/* The topic: the book's text with each picture in its place */
.rd { max-width: 720px; margin: 0 auto; padding: 34px 20px 40px; font-size: 17px; line-height: 2; }
.rd h1 { font: 700 clamp(27px, 5vw, 42px)/1.4 var(--disp); margin: 0 0 22px; }
.rd .rd-sub { color: var(--soft); margin: -10px 0 22px; }
.rd h2 { font: 700 clamp(22px, 3.4vw, 28px)/1.45 var(--disp); margin: 46px 0 14px; }
.rd h2.k-error { color: var(--err); }
.rd h2.k-complication, .rd h2.k-treatment { color: var(--navy); }
.rd p { margin: 0 0 14px; white-space: pre-wrap; }
.rd p.rd-h3 { font-weight: 700; margin-top: 24px; }
.rd p.cap { font-size: .86em; color: var(--soft); margin: 2px 0 22px; line-height: 1.85; }
.rd p.rd-note { font-size: 13px; color: var(--soft); margin: 30px 0 0; }
.figs { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 8px; }
.figs figure { margin: 0; flex: 1 1 240px; max-width: var(--fw, 100%); min-width: 0; }
.figs a { display: block; cursor: zoom-in; }
.figs img { display: block; width: 100%; height: auto; border-radius: 6px; background: #e8edf0; }
#lb { position: fixed; inset: 0; z-index: 60; background: rgba(4, 16, 26, .94); display: flex; align-items: center; justify-content: center; padding: 18px; cursor: zoom-out; }
#lb img { max-width: 100%; max-height: 100%; }

/* The end of every page */
.end { background: var(--navy); color: #fff; padding: 34px clamp(20px, 4vw, 56px) 76px; }
.end-in { max-width: 680px; margin: 0 auto; display: grid; gap: 14px; }
.end h2 { font: 800 clamp(26px, 4vw, 40px)/1.3 var(--disp); margin: 0; }
.end-acts { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; min-height: 46px; padding: 8px 22px; border-radius: 999px; font: 700 15px var(--disp); text-decoration: none; border: 1.5px solid #fff; }
.btn.solid { background: var(--green); border-color: var(--green); color: var(--deep); }
.end-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .28); font-size: 14px; }
.end-links a { text-underline-offset: 4px; }

/* Booking, always in reach (item 12) */
.book-float { position: fixed; z-index: 30; inset-inline-end: 16px; inset-block-end: max(14px, env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 8px 15px 8px 12px; border-radius: 999px; background: var(--green); color: var(--deep); font: 700 14px var(--disp); text-decoration: none; box-shadow: 0 8px 22px rgba(4, 26, 44, .28); }
.book-float svg { width: 21px; height: 21px; fill: currentColor; flex: 0 0 auto; }
body[data-tone="green"] .book-float { background: var(--deep); color: #fff; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
