/* The Odyssey — its own look. Greek black-figure pottery: terracotta, black glaze, cream incised lines,
   meander borders, carved capitals. Loaded on top of style.css; everything is scoped to html[data-book="odyssey"]. */
@import url('/fonts/book-odyssey.css');

html[data-book="odyssey"] {
  --cap: 'Cinzel', 'Alegreya SC', Georgia, serif;
  --epic: 'Alegreya', 'EB Garamond', Georgia, serif;
  --clay: #c8683a; --clay2: #d9814f; --glaze: #1b120c; --cream: #f1e2c4;
  --meander: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M2 38V2h32v28H10V10h16v12h-8' fill='none' stroke='%23000' stroke-width='4'/%3E%3C/svg%3E");
}
html[data-book="odyssey"] body[data-theme='clay']  { --bg: #e9c9a3; --ink: #1b120c; --muted: #5e3d27; --accent: #923b17; --card: #f3dcbd; --line: rgba(27, 18, 12, .2); }
html[data-book="odyssey"] body[data-theme='wine']  { --bg: #22101f; --ink: #f1e2c4; --muted: #c2a98f; --accent: #e07a48; --card: rgba(40, 20, 36, .94); --line: rgba(241, 226, 196, .18); }
html[data-book="odyssey"] body[data-theme='night'] { --bg: #111627; --ink: #ece2cc; --muted: #a5a593; --accent: #e08a52; --card: rgba(20, 26, 46, .94); --line: rgba(236, 226, 204, .16); }
html[data-book="odyssey"] body[data-theme='storm'] { --bg: #151425; --ink: #ece6da; --muted: #a8a3b8; --accent: #d9a35c; --card: rgba(24, 22, 40, .94); --line: rgba(236, 230, 218, .16); }
html[data-book="odyssey"] body[data-theme='cave']  { --bg: #120b08; --ink: #f1e2c4; --muted: #b59a7c; --accent: #ff9a40; --card: rgba(30, 20, 14, .94); --line: rgba(241, 226, 196, .16); }
html[data-book="odyssey"] body[data-theme='dawn']  { --bg: #f4e1d2; --ink: #2a1a14; --muted: #7a5848; --accent: #aa4428; --card: #faeee4; --line: rgba(42, 26, 20, .16); }

/* ---------- type ---------- */
html[data-book="odyssey"] body { font-family: var(--epic); }
html[data-book="odyssey"] .kicker, html[data-book="odyssey"] .note .k { font-family: var(--cap); font-weight: 500; letter-spacing: .24em; }
html[data-book="odyssey"] .cover h1 { font-family: var(--cap); font-style: normal; font-weight: 700; letter-spacing: .04em; font-size: clamp(44px, 6.4vw, 108px); line-height: 1.04; margin: .12em 0 .2em; }
html[data-book="odyssey"] .cover h1::after { content: ''; display: block; width: 200px; height: 14px; margin: .24em auto 0; background: var(--clay); -webkit-mask: var(--meander) 0 0 / 14px 14px repeat-x; mask: var(--meander) 0 0 / 14px 14px repeat-x; }
html[data-book="odyssey"] .cover-txt { top: clamp(72px, 11vh, 120px); bottom: auto; inset-inline: 20px; margin: 0 auto; text-align: center; }
html[data-book="odyssey"] .cover .tag { max-width: 42ch; margin-inline: auto; }
html[data-book="odyssey"] .cover .meta { justify-content: center; }
html[data-book="odyssey"] .cover::after { background: linear-gradient(to bottom, rgba(18, 8, 16, .92) 0, rgba(18, 8, 16, .7) 36%, rgba(18, 8, 16, 0) 50%, rgba(18, 8, 16, 0) 88%, var(--bg) 100%); }

/* part headers: a panel framed by a meander band, like the shoulder of a vase */
html[data-book="odyssey"] .part-n { font-family: var(--cap); }
html[data-book="odyssey"] .part::before, html[data-book="odyssey"] .part::after {
  content: ''; position: absolute; left: 0; right: 0; height: 22px; background: var(--accent); opacity: .55;
  -webkit-mask: var(--meander) 0 0 / 22px 22px repeat-x; mask: var(--meander) 0 0 / 22px 22px repeat-x;
}
html[data-book="odyssey"] .part::before { top: 14vh; } html[data-book="odyssey"] .part::after { bottom: 14vh; }
html[data-book="odyssey"] .part h2 { font-family: var(--cap); font-style: normal; font-weight: 700; letter-spacing: .03em; font-size: clamp(46px, 8vw, 120px); overflow-wrap: anywhere; }
html[data-book="odyssey"] .part p { font-style: italic; max-width: 32ch; }

html[data-book="odyssey"] .h { font-family: var(--cap); font-weight: 500; letter-spacing: .06em; text-align: center; }
html[data-book="odyssey"] .h::before { display: none; }
html[data-book="odyssey"] .h::after { content: ''; display: block; width: 120px; height: 12px; margin: .55em auto 0; background: var(--accent); -webkit-mask: var(--meander) 0 0 / 12px 12px repeat-x; mask: var(--meander) 0 0 / 12px 12px repeat-x; }
html[data-book="odyssey"] .p.drop::first-letter { font-family: var(--cap); font-weight: 700; color: var(--accent); }

html[data-book="odyssey"] .q blockquote { font-family: var(--epic); font-style: italic; font-weight: 500; }
html[data-book="odyssey"] .q.hero blockquote { font-size: clamp(28px, 1.1rem + 2.4vw, 56px); line-height: 1.25; }
html[data-book="odyssey"] .q figcaption i[lang="grc"] { font-family: 'Alegreya', 'GFS Didot', 'Palatino Linotype', Georgia, serif; font-style: normal; font-size: 18px; line-height: 1.6; color: var(--ink); opacity: .85; }

html[data-book="odyssey"] .note { border-radius: 0; border: 0; background: var(--card); border-top: 3px solid var(--accent); box-shadow: 0 16px 34px -22px rgba(0, 0, 0, .55); }
html[data-book="odyssey"] .note h3 { font-family: var(--cap); font-weight: 500; font-style: normal; }
html[data-book="odyssey"] .card { border-radius: 0; border-top: 3px solid var(--accent); }
html[data-book="odyssey"] .card b { font-family: var(--cap); font-weight: 700; letter-spacing: .03em; }

html[data-book="odyssey"] .block-h h3 { font-family: var(--cap); font-weight: 500; font-style: normal; }
html[data-book="odyssey"] .stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); border-radius: 0; }
html[data-book="odyssey"] .stat b { font-family: var(--cap); font-weight: 700; }
html[data-book="odyssey"] .fin h2 { font-family: var(--cap); font-weight: 700; font-style: normal; }

/* ---------- x: the cast as medallions ---------- */
html[data-book="odyssey"] .x-cast { max-width: 66rem; margin: 3em auto; padding: 0 20px; }
html[data-book="odyssey"] .od-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 18px; }
html[data-book="odyssey"] .od-card { position: relative; padding: 22px 22px 20px 98px; min-height: 120px; background: var(--card); border: 1px solid var(--line); }
html[data-book="odyssey"] .od-med { position: absolute; inset-inline-start: 18px; top: 22px; width: 62px; height: 62px; border-radius: 50%; background: var(--glaze); box-shadow: 0 0 0 3px var(--clay), 0 0 0 5px var(--glaze); display: grid; place-items: center; }
html[data-book="odyssey"] .od-med span { font-family: var(--cap); font-weight: 700; font-size: 30px; color: var(--clay2); }
html[data-book="odyssey"] .od-card h4 { font-family: var(--cap); font-weight: 700; font-size: 20px; margin: 0; line-height: 1.2; }
html[data-book="odyssey"] .od-role { font-style: italic; color: var(--muted); margin: .15em 0 .6em; font-size: 16px; }
html[data-book="odyssey"] .od-card p { font-size: 16px; line-height: 1.55; margin: 0; }
html[dir="rtl"][data-book="odyssey"] .od-card { padding: 22px 98px 20px 22px; }

/* ---------- x: Penelope's loom ---------- */
html[data-book="odyssey"] .x-loom { max-width: 48rem; margin: 3.5em auto; padding: 0 20px; --w: 0; }
html[data-book="odyssey"] .lm { display: grid; grid-template-columns: 1fr 150px; gap: 24px; align-items: stretch; }
html[data-book="odyssey"] .lm-frame { position: relative; height: 300px; border: 10px solid #5a3420; border-top-width: 16px; background: #2a1a12; overflow: hidden; }
html[data-book="odyssey"] .lm-warp { position: absolute; inset: 0; display: flex; justify-content: space-around; }
html[data-book="odyssey"] .lm-warp i { width: 1px; background: rgba(241, 226, 196, .45); }
html[data-book="odyssey"] .lm-cloth { position: absolute; left: 0; right: 0; top: 0; height: calc(var(--w) * 100%); background: var(--cream); transition: height .25s linear; overflow: hidden; border-bottom: 3px solid #b89a6a; }
html[data-book="odyssey"] .lm-pat { position: absolute; left: 0; right: 0; top: 18px; height: 26px; background: var(--glaze); -webkit-mask: var(--meander) 0 0 / 26px 26px repeat-x; mask: var(--meander) 0 0 / 26px 26px repeat-x; }
html[data-book="odyssey"] .lm-pat::after { content: ''; }
html[data-book="odyssey"] .lm-sky { position: absolute; inset-inline-end: 10px; bottom: 10px; width: 44px; height: 44px; }
html[data-book="odyssey"] .lm-sun, html[data-book="odyssey"] .lm-moon { position: absolute; inset: 0; border-radius: 50%; transition: opacity .5s; }
html[data-book="odyssey"] .lm-sun { background: #f2b04f; box-shadow: 0 0 20px #f2b04f; }
html[data-book="odyssey"] .lm-moon { background: transparent; box-shadow: inset -10px 4px 0 0 #e8e0c8; opacity: 0; }
html[data-book="odyssey"] .x-loom.night .lm-sun { opacity: 0; } html[data-book="odyssey"] .x-loom.night .lm-moon { opacity: 1; }
html[data-book="odyssey"] .x-loom.night .lm-frame { filter: brightness(.7) saturate(.7); }
html[data-book="odyssey"] .lm-when { position: relative; height: 40px; font-family: var(--cap); font-size: 17px; }
html[data-book="odyssey"] .lm-when b { position: absolute; inset-inline-start: 0; top: 0; transition: opacity .4s; color: var(--accent); }
html[data-book="odyssey"] .lm-n { opacity: 0; }
html[data-book="odyssey"] .x-loom.night .lm-d { opacity: 0; } html[data-book="odyssey"] .x-loom.night .lm-n { opacity: 1; }
html[data-book="odyssey"] .lm-years { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
html[data-book="odyssey"] .lm-years li { font-family: var(--cap); font-size: 15px; padding: 6px 10px; border: 1px solid var(--line); opacity: .72; transition: opacity .4s, background .4s, color .4s; }
html[data-book="odyssey"] .lm-years li.on { opacity: 1; background: var(--glaze); color: var(--cream); }
html[data-book="odyssey"] .x-loom.done .lm-years li:last-child { background: #8e2a1a; }
html[data-book="odyssey"] .lm-text { margin: 1.4em 0 0; font-size: 19px; line-height: 1.6; }

/* ---------- x: the fleet ---------- */
html[data-book="odyssey"] .x-fleet { max-width: 52rem; margin: 3em auto; padding: 0 20px; text-align: center; }
html[data-book="odyssey"] .fl-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px 10px; }
html[data-book="odyssey"] .fl-row svg { width: 100%; height: auto; color: var(--ink); transition: opacity .7s, transform .9s; }
html[data-book="odyssey"] .fl-row svg path, html[data-book="odyssey"] .fl-row svg line { fill: var(--ink); stroke: var(--ink); }
html[data-book="odyssey"] .fl-row svg path[d^="M-54"] { fill: var(--accent); }
html[data-book="odyssey"] .fl-row svg circle { display: none; }
html[data-book="odyssey"] .fl-row svg.gone { opacity: .1; transform: translateY(14px) rotate(8deg); }
html[data-book="odyssey"] .fl-n { margin-top: .8em; font-family: var(--cap); }
html[data-book="odyssey"] .fl-n span { display: block; font-size: 15px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
html[data-book="odyssey"] .fl-n b { display: block; font-size: 64px; line-height: 1.05; color: var(--accent); }

/* ---------- x: the twelve axes ---------- */
html[data-book="odyssey"] .x-axes, html[data-book="odyssey"] .x-bed { max-width: 52rem; margin: 3.5em auto; padding: 0 20px; }
html[data-book="odyssey"] .ax svg, html[data-book="odyssey"] .bd svg { display: block; width: 100%; height: auto; box-shadow: 0 0 0 6px var(--glaze); }
html[data-book="odyssey"] .ax-text, html[data-book="odyssey"] .bd-text { margin: 1.3em 0 0; font-size: 19px; line-height: 1.6; }
html[data-book="odyssey"] .x-axes.hit .ax svg { animation: od-hit .4s; }
@keyframes od-hit { 30% { transform: translateX(4px); } 60% { transform: translateX(-3px); } }

/* ---------- x: the bed in the olive tree ---------- */
html[data-book="odyssey"] .x-bed { --c: 1; --b: 0; }
html[data-book="odyssey"] .bd-crown { opacity: var(--c); }
html[data-book="odyssey"] .bd-frame, html[data-book="odyssey"] .bd-walls { opacity: var(--b); }
html[data-book="odyssey"] .bd svg { max-width: 640px; margin: 0 auto; }

/* ---------- x: the held-back dawn ---------- */
html[data-book="odyssey"] .x-dawn { margin: 3em 0; --h: .12; }
html[data-book="odyssey"] .dw { position: relative; height: 340px; overflow: hidden; background: #0e1022; }
html[data-book="odyssey"] .dw-sky { position: absolute; inset: 0; background: linear-gradient(to top, #e8905a 0, #b4566a calc(var(--h) * 60%), #2a2650 calc(var(--h) * 140%), #0e1022 100%); transition: background .3s; }
html[data-book="odyssey"] .dw-glow { position: absolute; left: 50%; width: 220px; height: 220px; margin-left: -110px; bottom: calc(var(--h) * 260px - 30px); border-radius: 50%; background: radial-gradient(circle, #ffd59a, rgba(255, 170, 90, 0) 70%); }
html[data-book="odyssey"] .dw-sea { position: absolute; left: 0; right: 0; bottom: 0; height: 90px; z-index: 2; background: repeating-linear-gradient(0deg, #141834 0 8px, #1d2244 8px 10px); }
/* "rosy-fingered Dawn": pink rays held just under the horizon until Athena lets go */
html[data-book="odyssey"] .dw-fingers { position: absolute; z-index: 1; left: 50%; bottom: 88px; width: 900px; height: 340px; margin-left: -450px;
  background: repeating-conic-gradient(from -90deg at 50% 100%, rgba(250, 160, 130, .8) 0 4deg, transparent 4deg 15deg);
  -webkit-mask: radial-gradient(ellipse 50% 100% at 50% 100%, #000 20%, transparent 75%); mask: radial-gradient(ellipse 50% 100% at 50% 100%, #000 20%, transparent 75%);
  transform-origin: 50% 100%; transform: scaleY(calc(.4 + var(--h) * 1.3)); opacity: calc(.6 + var(--h) * .6); }
html[data-book="odyssey"] .dw-text { max-width: 36rem; margin: 1.3em auto 0; padding: 0 20px; text-align: center; font-style: italic; font-size: clamp(20px, 1rem + .8vw, 26px); line-height: 1.5; }

/* ---------- the voyage plate in the corner ---------- */
html[data-book="odyssey"] .x-at { display: block; height: 0; }
html[data-book="odyssey"] .vp {
  position: fixed; z-index: 40; inset-inline-end: 18px; bottom: 18px; width: 230px; cursor: pointer;
  background: var(--glaze); color: var(--cream); border-radius: 14px; padding: 10px 10px 9px;
  box-shadow: 0 0 0 3px var(--clay), 0 0 0 5px var(--glaze), 0 18px 34px -14px rgba(0, 0, 0, .6);
  opacity: 0; transform: translateY(16px); transition: opacity .6s, transform .6s, width .5s; pointer-events: none;
}
html[data-book="odyssey"] .vp.on { opacity: 1; transform: none; pointer-events: auto; }
html[data-book="odyssey"] .vp svg { display: block; width: 100%; height: auto; border-radius: 6px; }
html[data-book="odyssey"] .vp-ship { transition: transform 1.6s cubic-bezier(.5, 0, .2, 1); }
html[data-book="odyssey"] .vp-pt { transition: r .4s, opacity .4s; }
html[data-book="odyssey"] .vp-pt.on { r: 16px; opacity: 1; }
html[data-book="odyssey"] .vp-txt { text-align: center; margin-top: 6px; font-family: var(--ui); }
html[data-book="odyssey"] .vp-t { font-family: var(--cap); font-size: 11px; letter-spacing: .14em; color: var(--clay2); text-transform: uppercase; }
html[data-book="odyssey"] .vp-p { display: block; font-family: var(--cap); font-size: 17px; line-height: 1.2; margin-top: 2px; }
html[data-book="odyssey"] .vp-y { display: block; font-size: 11.5px; color: #c9b597; margin-top: 2px; }
html[data-book="odyssey"] .vp.past { box-shadow: 0 0 0 3px #7b6fa8, 0 0 0 5px var(--glaze), 0 18px 34px -14px rgba(0, 0, 0, .6); }
html[data-book="odyssey"] .vp.ping .vp-p { animation: od-ping 1s; }
@keyframes od-ping { from { color: var(--clay2); transform: translateY(-3px); } }
html[data-book="odyssey"] .vp.big { width: min(460px, 90vw); }
@media (max-width: 640px) {
  /* on phones the plate becomes a thin strip under the top bar: a small map and the place name */
  html[data-book="odyssey"] .vp { inset-inline: 0; top: 56px; bottom: auto; width: auto; padding: 4px 12px; border-radius: 0; display: flex; align-items: center; gap: 12px;
    box-shadow: 0 2px 0 var(--clay), 0 8px 16px -10px rgba(0, 0, 0, .6); transform: translateY(-8px); }
  html[data-book="odyssey"] .vp.past { box-shadow: 0 2px 0 #7b6fa8, 0 8px 16px -10px rgba(0, 0, 0, .6); }
  html[data-book="odyssey"] .vp svg { width: 92px; flex: 0 0 92px; border-radius: 3px; }
  html[data-book="odyssey"] .vp-txt { margin: 0; text-align: start; display: grid; grid-template-columns: auto; }
  html[data-book="odyssey"] .vp-t { display: none; }
  html[data-book="odyssey"] .vp-p { font-size: 14px; margin: 0; }
  html[data-book="odyssey"] .vp-y { font-size: 11px; margin: 0; }
  html[data-book="odyssey"] .vp.big { width: auto; }
  html[data-book="odyssey"] .vp.big svg { width: 200px; flex-basis: 200px; }
  html[data-book="odyssey"] .lm { grid-template-columns: 1fr; }
  html[data-book="odyssey"] .lm-frame { height: 220px; }
  html[data-book="odyssey"] .lm-years { grid-template-columns: repeat(4, 1fr); }
  html[data-book="odyssey"] .lm-years li { font-size: 12px; padding: 5px 4px; text-align: center; }
  html[data-book="odyssey"] .fl-row { grid-template-columns: repeat(4, 1fr); }
  html[data-book="odyssey"] .dw { height: 260px; }
}

/* ---------- scripts without these fonts ---------- */
html[data-book="odyssey"]:is([lang=zh], [lang=ja], [lang=ko], [lang=ar], [lang=hi]) { --cap: var(--display); --epic: var(--display); }
html[data-book="odyssey"]:is([lang=zh], [lang=ja], [lang=ko]) .cover h1 { font-size: clamp(38px, 7vw, 110px); line-height: 1.2; }
html[data-book="odyssey"]:is([lang=ar], [lang=hi], [lang=zh], [lang=ja], [lang=ko]) :is(.kicker, .note .k, .vp-t) { letter-spacing: 0; }
html[data-book="odyssey"]:is([lang=ru], [lang=sr]) { --cap: 'Alegreya SC', Georgia, serif; }

html[data-book="odyssey"] .x-axes, html[data-book="odyssey"] .x-fleet, html[data-book="odyssey"] .x-dawn { overflow-x: clip; }

/* short screens (small laptops, share images): keep the title block above the plate */
@media (max-height: 760px) and (min-width: 641px) {
  html[data-book="odyssey"] .cover-txt { top: 52px; }
  html[data-book="odyssey"] .cover h1 { font-size: clamp(40px, 5vw, 72px); margin: .08em 0 .1em; }
  html[data-book="odyssey"] .cover h1::after { margin-top: .12em; }
  html[data-book="odyssey"] .cover .tag { font-size: 18px; line-height: 1.45; max-width: 52ch; margin-block: .5em; }
}
