/* Self-hosted Google Fonts (SIL Open Font License 1.1): Alegreya, Alegreya SC, Caveat, IBM Plex Mono. */
@font-face { font-family: 'Alegreya'; font-style: italic; font-weight: 400 800; font-display: swap;
  src: url(/assets/fonts/alegreya-italic-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Alegreya'; font-style: italic; font-weight: 400 800; font-display: swap;
  src: url(/assets/fonts/alegreya-italic-latin-ext.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; }
@font-face { font-family: 'Alegreya'; font-style: italic; font-weight: 400 800; font-display: swap;
  src: url(/assets/fonts/alegreya-italic-latin.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; }
@font-face { font-family: 'Alegreya'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/assets/fonts/alegreya-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Alegreya'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/assets/fonts/alegreya-latin-ext.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; }
@font-face { font-family: 'Alegreya'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/assets/fonts/alegreya-latin.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; }
@font-face { font-family: 'Alegreya SC'; font-style: normal; font-weight: 800; font-display: swap;
  src: url(/assets/fonts/alegreya-sc-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Alegreya SC'; font-style: normal; font-weight: 800; font-display: swap;
  src: url(/assets/fonts/alegreya-sc-latin-ext.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; }
@font-face { font-family: 'Alegreya SC'; font-style: normal; font-weight: 800; font-display: swap;
  src: url(/assets/fonts/alegreya-sc-latin.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; }
@font-face { font-family: 'Caveat'; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url(/assets/fonts/caveat-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Caveat'; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url(/assets/fonts/caveat-latin-ext.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; }
@font-face { font-family: 'Caveat'; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url(/assets/fonts/caveat-latin.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; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/assets/fonts/ibm-plex-mono-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/assets/fonts/ibm-plex-mono-latin-ext.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; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/assets/fonts/ibm-plex-mono-latin.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; }

/* Зарко пътува — "road notebook" design. See docs/design.md.
   Layout: a 70rem shell for listings, a 40rem column for reading; phones get a bottom tab bar. */
:root {
  --paper: #F2ECE0;
  --paper-2: #E8E0CF;
  --card: #FBF8F1;
  --ink: #1E2B3A;
  --ink-2: #3B4652;
  --muted: #55606B;
  --line: #D8CEBB;
  --stamp: #A8322A;
  --stamp-light: #E0786E;
  --sea: #7FA6C9;
  --read: #4E7A56;
  --water: #E1E8E8;
  --solid: #1E2B3A;        /* dark surfaces: buttons, the book cover, the "next" cards */
  --solid-hover: #2B3C50;
  --on-solid: #F2ECE0;
  --on-solid-2: #C9BFA9;
  --solid-bar: #3A4858;
  --chip: #EFE8DA;
  --highlight: #F1E3D6;
  --rule: #CFC4AE;
  --dash: #B9AD95;
  --soft-line: #E3DAC7;
  --wave-ink: #2F5E8C;
  --map-coast: #9AA79F;
  --map-border: #C2B8A3;
  --serif: "Alegreya", "Georgia", "Times New Roman", serif;
  --display: "Alegreya SC", "Alegreya", "Georgia", serif;
  --hand: "Caveat", "Segoe Print", "Comic Sans MS", cursive;
  --mono: "IBM Plex Mono", "Consolas", "Menlo", monospace;
  --reading-scale: 1;
  --bar-height: 0px;
  color-scheme: light;
  font: 18px/1.55 var(--serif);
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

/* Dark theme: the notebook at night. The site opens light; the header switch sets data-theme
   on <html> and remembers the choice (see site.js). */
:root[data-theme="dark"] {
  --paper: #171E26; --paper-2: #1F2832; --card: #1C242E;
  --ink: #E9E2D3; --ink-2: #D2CABA; --muted: #A39C8F; --line: #34404C;
  --stamp: #E0786E; --stamp-light: #E89088; --read: #82B48D; --water: #0F1419;
  --solid: #2B3C50; --solid-hover: #36495F; --solid-bar: #4A5D72;
  --chip: #26303B; --highlight: #3A2D2E; --rule: #3A4652; --dash: #56616C; --soft-line: #2C3640;
  --wave-ink: #7FA6C9; --map-coast: #6B7A82; --map-border: #4D5A66; --map-land: #27323D;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; padding-bottom: var(--bar-height); }
main { flex: 1; container-type: inline-size; }
/* Large system text sizes: long single words (German) must wrap rather than widen the page. */
h1, h2, h3, .card-title, .story-title, .next-title, main li a { overflow-wrap: anywhere; }
a { color: var(--ink); text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); text-underline-offset: .2em; }
a:hover { color: var(--stamp); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--stamp); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { line-height: 1.1; text-wrap: balance; overflow-wrap: anywhere; margin: 0; }
h1 { font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 800; }
p { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.shell { width: min(100% - 2rem, 70rem); margin-inline: auto; }
.shell-narrow { width: min(100% - 2rem, 40rem); margin-inline: auto; }
.mono { font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 400; }
.hand { font-family: var(--hand); font-weight: 500; }
.kicker { color: var(--stamp); }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 36em; }
.icon { flex: none; vertical-align: -.2em; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 50; background: var(--ink); color: var(--paper); padding: .5rem 1rem; border-radius: 6px; }
.skip-link:focus { top: 1rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.header-inner { display: flex; align-items: center; gap: 1rem 2.2rem; min-height: 4.2rem; }
.brand { display: flex; align-items: baseline; gap: .6rem; text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 1.45rem; letter-spacing: .01em; white-space: nowrap; }
.tagline { color: var(--stamp); font-size: 1.15rem; font-family: var(--hand); letter-spacing: 0; }
.top-nav { display: flex; gap: 1.6rem; margin-left: auto; }
.top-nav a { text-decoration: none; font-size: 1.02rem; white-space: nowrap; }
.top-nav a[aria-current] { color: var(--stamp); text-decoration: underline; text-decoration-thickness: 2px; }
.languages { display: flex; gap: .15rem; border: 1px solid var(--line); border-radius: 999px; padding: .2rem; font-family: var(--mono); font-size: .72rem; }
.languages a { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; text-decoration: none; padding: .3rem .6rem; border-radius: 999px; min-width: 2.4rem; }
.flag { flex: none; border-radius: 2px; box-shadow: 0 0 0 1px rgb(0 0 0 / .15); }
.languages a[aria-current] { background: var(--ink); color: var(--paper); }
.header-tools { display: flex; align-items: center; gap: .5rem; }
.theme-toggle { width: 2.5rem; height: 2.5rem; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 50%; background: none; color: var(--ink); cursor: pointer; padding: 0; }
.theme-toggle:hover { color: var(--stamp); }
.theme-toggle .icon:last-child, .theme-toggle[aria-pressed="true"] .icon:first-child { display: none; }
.theme-toggle[aria-pressed="true"] .icon:last-child { display: block; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Phone language menu: the current flag opens the list */
.language-menu { display: none; position: relative; }
.language-menu summary { display: flex; align-items: center; gap: .3rem; height: 2.5rem; padding: 0 .55rem 0 .7rem; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; list-style: none; }
.language-menu summary::-webkit-details-marker { display: none; }
.language-menu .flag { width: 22px; height: 15px; }
.language-menu summary .icon { transition: transform .2s ease; }
.language-menu[open] summary .icon { transform: rotate(180deg); }
.language-menu nav { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 40; display: flex; flex-direction: column; min-width: 11rem; padding: .3rem; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 .6rem 1.6rem -.6rem rgb(0 0 0 / .35); }
.language-menu nav a { display: flex; align-items: center; gap: .7rem; min-height: 2.75rem; padding: 0 .8rem; border-radius: 6px; text-decoration: none; }
.language-menu nav a:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.language-menu nav a[aria-current] { background: var(--ink); color: var(--paper); font-weight: 700; }

/* Buttons and small parts */
.button { display: inline-flex; align-items: center; gap: .6rem; background: var(--solid); color: var(--on-solid); text-decoration: none; font-weight: 700; padding: .85rem 1.5rem; border-radius: 6px; min-height: 3rem; }
.button:hover { color: var(--on-solid); background: var(--solid-hover); }
.button-quiet { background: none; color: var(--ink); border: 1.5px solid var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.button-quiet:hover { background: none; color: var(--stamp); border-color: var(--stamp); }
.button-disabled, .button-disabled:hover { background: var(--chip); color: var(--muted); cursor: not-allowed; }

/* About: e-mail, Facebook and donation */
.about-links { margin-top: 2.4rem; padding-top: 1.4rem; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 1rem; }
.about-links ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: flex-start; gap: .8rem; }
.about-links li { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; }
.about-links small { color: var(--muted); font-size: .75rem; }
.mail-countdown { font-size: 1.6rem; color: var(--stamp); min-width: 1.5ch; }
.mail-address { font-size: 1.2rem; font-weight: 700; overflow-wrap: anywhere; }
.continue { display: flex; flex-direction: column; gap: .3rem; border: 1.5px solid var(--ink); border-radius: 6px; padding: .6rem 1rem .75rem; text-decoration: none; min-width: min(18rem, 100%); }
.continue .mono { color: var(--muted); font-size: .64rem; }
.continue-title { font-weight: 700; }
.bar { display: block; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; background: var(--stamp); }
.round { width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--chip); color: var(--ink); cursor: pointer; }
.language-note, .draft-note { border-left: 3px solid var(--stamp); padding: .2rem 0 .2rem .8rem; color: var(--muted); margin-block: 1rem; }

/* Book cover */
.cover { position: relative; flex: none; display: flex; flex-direction: column; justify-content: space-between; width: 21rem; aspect-ratio: 19 / 27; padding: 2.2rem 2rem; background: var(--solid); color: var(--on-solid); text-decoration: none; border-radius: 3px 8px 8px 3px; box-shadow: inset 6px 0 0 rgb(0 0 0 / .18), 1rem 1.2rem 0 -.35rem var(--line); }
.cover:hover { color: var(--on-solid); transform: rotate(-.6deg); }
.cover { transition: transform .3s ease; }
.cover-author { font-family: var(--mono); font-size: .7rem; letter-spacing: .3em; text-transform: uppercase; color: var(--on-solid-2); }
.cover-title { display: flex; flex-direction: column; font-family: var(--display); font-weight: 800; font-size: 5rem; line-height: .95; }
.cover-gloss { font-size: 1.4rem; color: var(--on-solid-2); font-family: var(--hand); margin-top: .4rem; letter-spacing: 0; }
.cover-bottom { display: flex; flex-direction: column; gap: .5rem; }
.cover-shores { display: flex; justify-content: space-between; font-size: 1.3rem; }
.cover-wave { width: 100%; height: 1.4rem; fill: none; stroke: var(--sea); stroke-width: 2; }
.cover-subtitle { font-style: italic; font-size: 1.35rem; line-height: 1.2; }
.cover-stamp { position: absolute; right: -2rem; top: 5.5rem; width: 6.6rem; height: 6.6rem; border-radius: 50%; border: 3px solid var(--stamp-light); outline: 1px solid var(--stamp-light); outline-offset: -.55rem; color: var(--stamp-light); display: flex; align-items: center; justify-content: center; text-align: center; font-family: var(--mono); font-size: .58rem; letter-spacing: .06em; line-height: 1.4; text-transform: uppercase; transform: rotate(-14deg); }
.cover-small { width: 13rem; padding: 1.4rem 1.2rem; }
.cover-small .cover-title { font-size: 3.1rem; }
.cover-small .cover-gloss, .cover-small .cover-shores { font-size: 1rem; }
.cover-small .cover-subtitle { font-size: .95rem; }
.cover-small .cover-stamp { width: 4.6rem; height: 4.6rem; right: -1.4rem; top: 3.6rem; font-size: .5rem; }

/* Home */
.hero, .book-intro { display: flex; align-items: center; gap: clamp(2rem, 6vw, 5rem); padding-block: 3.5rem 3rem; }
.hero-text { display: flex; flex-direction: column; gap: 1.3rem; min-width: 0; }
.hero-text h1 { font-size: clamp(2rem, 5vw, 3.6rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: stretch; }
.contents-link { align-self: flex-start; }
.hero .contents-link { display: none; }
.home-contents { padding-bottom: 3.5rem; border-bottom: 1px solid var(--line); }

.contents { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr)); gap: 1.5rem 2.5rem; align-items: start; }
.contents-head { display: flex; flex-wrap: wrap; gap: 0 .6rem; align-items: baseline; font-size: 1.4rem; font-weight: 800; margin-bottom: .4rem; }
.contents-head .mono { color: var(--stamp); }
.contents-head .hand { font-size: 1.6rem; font-weight: 700; }
.contents ol { list-style: none; margin: 0; padding: 0; }
.contents li a { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) 1.2rem; gap: .5rem; align-items: baseline; padding: .3rem .4rem; margin-inline: -.4rem; border-radius: 4px; text-decoration: none; font-size: 1rem; line-height: 1.3; }
.contents li a:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.contents .num { color: var(--muted); }
.contents .mark { text-align: right; font-size: .85rem; }
.contents a.is-read .mark::before { content: "✓"; color: var(--read); }
.contents a.is-reading .mark::before { content: "◐"; color: var(--stamp); }
.contents a[aria-current] { background: var(--highlight); font-weight: 800; }

.travel-block { padding-block: 3.5rem; display: flex; flex-direction: column; gap: 2rem; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; }
.section-head > div { display: flex; flex-direction: column; gap: .35rem; }
.section-links { flex-direction: row !important; gap: .5rem 1.4rem !important; flex-wrap: wrap; }
.section-links a, .section-map { display: inline-flex; align-items: center; gap: .4rem; }

/* Cards: travelogues as photo prints */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr)); gap: 2.6rem 2rem; }
.card { display: flex; flex-direction: column; gap: .6rem; min-width: 0; }
.card-link { display: flex; flex-direction: column; gap: .7rem; text-decoration: none; }
.print { position: relative; display: block; background: var(--card); padding: .6rem .6rem 0; box-shadow: 0 1px 2px rgb(0 0 0 / .12), 0 .5rem 1.2rem -.7rem rgb(0 0 0 / .3); transform: rotate(var(--tilt, -.6deg)); transition: transform .25s ease; }
.card:nth-child(2n) .print { --tilt: .7deg; }
.card:nth-child(3n) .print { --tilt: -.3deg; }
.card-link:hover .print { transform: rotate(0) translateY(-3px); }
.print img { display: block; width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: cover; background: var(--paper-2); }
.print-caption { display: block; font-size: 1.25rem; padding: .25rem .1rem .45rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* An empty caption (no caption, no place) keeps its strip, so every print has the same height. */
.print-caption:empty::before { content: "\a0"; }
/* No photos: the same box as a print, outlined (an outline takes no space) instead of a border. */
.print-empty { background: transparent; box-shadow: none; outline: 1.5px dashed var(--dash); outline-offset: -1.5px; }
.print-blank { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; padding: 1rem; }
.print-empty .print-caption { text-align: center; color: var(--muted); }
.print-empty .stamp { border: 2.5px solid var(--stamp); color: var(--stamp); padding: .55rem .9rem; transform: rotate(-6deg); font-size: .85rem; letter-spacing: .2em; text-align: center; }
.badge { position: absolute; top: 1.2rem; right: 1.2rem; background: var(--solid); color: var(--on-solid); padding: .25rem .5rem; border-radius: 3px; }
.card-meta { display: flex; gap: .7rem; color: var(--muted); }
.card-place { color: var(--stamp); }
.card-place:empty { display: none; }
.card-title { font-weight: 700; font-size: 1.15rem; line-height: 1.25; }
.card-parts { margin: 0; padding-left: 1.3rem; font-size: .95rem; line-height: 1.35; display: flex; flex-direction: column; gap: .25rem; color: var(--muted); }

.map-teaser { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: 1.2rem; align-items: center; border: 1.5px solid var(--ink); border-radius: 8px; padding: .8rem; text-decoration: none; max-width: 34rem; }
.map-teaser .map-svg { border-radius: 4px; }
.map-teaser > span { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.map-teaser > span > span { color: var(--muted); font-size: .95rem; }

.band { background: var(--paper-2); }
.band-inner { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 2rem 4.5rem; padding-block: 3.2rem; }
.band-stories, .band-about { display: flex; flex-direction: column; gap: .9rem; min-width: 0; }
.band h2 { font-size: .7rem; }
.story-list { list-style: none; margin: 0; padding: 0; }
.story-list a { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--rule); text-decoration: none; min-height: 2.75rem; }
.story-title { min-width: 0; overflow-wrap: anywhere; font-weight: 700; font-size: 1.3rem; line-height: 1.25; }
.story-list time { color: var(--muted); }
.hello { font-size: 1.9rem; line-height: 1.1; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1.5rem; padding-block: 1.6rem; }
.footer-inner nav { display: flex; gap: 1.2rem; }
.footer-inner .hand { font-size: 1.35rem; }

/* Listings */
.listing { padding-block: 2.8rem 4rem; display: flex; flex-direction: column; gap: 1.2rem; }
.listing .cards { margin-top: 1rem; }
.book-contents { padding-bottom: 4rem; }

/* Reading pages */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 30; pointer-events: none; }
.progress span { display: block; height: 100%; width: 0; background: var(--stamp); }
.reading { padding-block: 2.4rem 4rem; display: flex; flex-direction: column; gap: 1.2rem; }
.reading-head { display: flex; flex-direction: column; gap: .9rem; }
.reading-head .kicker { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.minutes { color: var(--muted); }
.chapter-title { font-family: var(--display); font-size: clamp(2.2rem, 7vw, 3.4rem); line-height: 1; }
.title-wave { width: 7.5rem; height: .9rem; fill: none; stroke: var(--wave-ink); stroke-width: 2; }
.meta { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; color: var(--muted); }
.stamp-link { display: inline-flex; align-items: center; gap: .35rem; border: 2px solid var(--stamp); color: var(--stamp); padding: .3rem .6rem; text-decoration: none; transform: rotate(-2deg); }
.stamp-link:hover { background: var(--stamp); color: var(--card); }
.series-head { display: flex; flex-direction: column; gap: .6rem; color: var(--muted); }
.series-dots { display: flex; gap: .35rem; }
.series-dots span { width: 1.75rem; height: 4px; border-radius: 2px; background: var(--line); }
.series-dots .on { background: var(--stamp); }

.article-body { font-size: calc(1.1rem * var(--reading-scale)); line-height: 1.7; overflow-wrap: break-word; display: flex; flex-direction: column; gap: 1.1em; }
.article-body > * { margin: 0; }
/* Body text is justified. The build inserts soft hyphens (see hyphenate in build_site.py), which keep the gaps
   between words small on phones in every browser. */
.article-body :is(p, li, blockquote) { text-align: justify; hyphens: manual; -webkit-hyphens: manual; }
.article-body h2 { font-family: var(--mono); font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--stamp); font-weight: 500; margin-top: 1em; }
.article-body h3 { font-size: 1.2rem; margin-top: .6em; }
.article-body hr { border: 0; height: 1.2em; margin: .6em 0; text-align: center; }
.article-body hr::before { content: "✶ ✶ ✶"; color: var(--stamp); letter-spacing: .6em; font-size: .85rem; }
.article-body blockquote { margin: 0; padding-left: 1rem; border-left: 3px solid var(--line); font-style: italic; }
.article-body figure { margin: .6em calc(50% - min(50vw, 26rem)); display: flex; flex-direction: column; gap: .4rem; }
.article-body figure img, .article-body figure video { display: block; width: 100%; height: auto; max-height: 85vh; object-fit: contain; background: var(--paper-2); border-radius: 2px; }
.article-body figure .photo-button { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; width: 100%; }
.article-body figcaption { font-family: var(--hand); font-size: 1.3rem; color: var(--muted); text-align: center; padding-inline: 1rem; }
.article-body img:not(figure img) { height: auto; }

.series-box { background: var(--paper-2); border-radius: 8px; padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .4rem; margin-top: 1.5rem; }
.series-box ol { list-style: none; margin: 0; padding: 0; }
.series-box a { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: .5rem; padding: .5rem 0; text-decoration: none; line-height: 1.3; min-height: 2.75rem; }
.series-box a[aria-current] { font-weight: 800; }
.series-box .num { color: var(--muted); padding-top: .2rem; }
.next-card { display: flex; flex-direction: column; gap: .2rem; background: var(--solid); color: var(--on-solid); text-decoration: none; border-radius: 8px; padding: 1rem 1.2rem; margin-top: 1rem; }
.next-card:hover { color: var(--on-solid); background: var(--solid-hover); }
.next-card .mono { color: var(--on-solid-2); }
.next-title { font-weight: 700; font-size: 1.2rem; line-height: 1.3; }

/* Book toolbar and contents drawer */
.page-chapter { --bar-height: calc(6.2rem + env(safe-area-inset-bottom, 0px)); }
.booknav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--card); border-top: 1px solid var(--line); padding: .5rem max(.5rem, env(safe-area-inset-right, 0px)) calc(.5rem + env(safe-area-inset-bottom, 0px)) max(.5rem, env(safe-area-inset-left, 0px)); }
.booknav > * { width: min(100%, 36rem); margin-inline: auto; }
.dots { display: flex; gap: 3px; list-style: none; padding: 0 .5rem; margin-bottom: .3rem; }
.dots li { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.dots li.is-read { background: var(--read); }
.dots li[aria-current] { background: var(--stamp); }
.booknav-row { container-type: inline-size; display: flex; align-items: center; justify-content: space-between; gap: .3rem; }
.tool { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 3.3rem; min-height: 3rem; border: 0; background: none; color: var(--ink); text-decoration: none; font: inherit; font-size: .75rem; cursor: pointer; border-radius: 8px; }
.tool:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.aa { font-size: 1.25rem; line-height: 1; }
.pill { display: inline-flex; align-items: center; gap: .5rem; background: var(--solid); color: var(--on-solid); border-radius: 999px; padding: .7rem 1.1rem; text-decoration: none; font-size: .95rem; white-space: nowrap; }
.pill:hover { color: var(--on-solid); background: var(--solid-hover); }
/* Large system text sizes scale rem: let the toolbar shrink instead of widening the page. */
.booknav-row .tool { flex: 0 1 auto; min-width: max(44px, min(3.3rem, 12vw)); }
.booknav-row .pill { min-width: 0; flex: 0 1 auto; }
.pill svg { flex-shrink: 0; }
.pill-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@container (max-width: 18.5rem) { .pill-label { display: none; } }

dialog { color: var(--ink); }
.drawer { width: min(100%, 34rem); max-width: 100%; max-height: min(86vh, 48rem); margin: auto auto 0; padding: 0; border: 0; border-radius: 18px 18px 0 0; background: var(--card); box-shadow: 0 -10px 30px rgb(0 0 0 / .18); display: none; flex-direction: column; }
.drawer[open] { display: flex; animation: rise .28s ease-out; }
.drawer::backdrop { background: rgb(30 43 58 / .45); }
.drawer-head { display: flex; align-items: center; gap: 1rem; padding: 1rem 1rem .8rem 1.3rem; border-bottom: 1px solid var(--soft-line); }
.drawer-head > div { flex: 1; display: flex; flex-direction: column; }
.drawer-title { font-family: var(--display); font-weight: 800; font-size: 1.35rem; }
.drawer-head .mono { color: var(--muted); }
.drawer-body { overflow-y: auto; padding: .6rem 1.3rem calc(1.2rem + env(safe-area-inset-bottom, 0px)); overscroll-behavior: contain; }
.drawer .contents { grid-template-columns: 1fr; gap: 1rem; }
.drawer .contents li a { min-height: 2.75rem; align-items: center; }
@keyframes rise { from { transform: translateY(30%); } to { transform: none; } }

/* Photo viewer */
.lightbox { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); border: 0; background: #11171F; color: #F2ECE0; display: none; flex-direction: column; }
.lightbox[open] { display: flex; }
.lightbox::backdrop { background: #11171F; }
.lb-top { display: flex; justify-content: space-between; align-items: center; padding: .7rem .8rem .3rem 1rem; color: #C9BFA9; }
.lightbox .round { background: rgb(242 236 224 / .12); color: #F2ECE0; }
.lb-stage { flex: 1; min-height: 0; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; padding: 0 0 1rem; }
.lb-stage img { max-width: 100%; max-height: calc(100% - 3rem); object-fit: contain; display: block; touch-action: pan-y pinch-zoom; }
.lb-stage figcaption { font-size: 1.5rem; padding-inline: 1rem; text-align: center; }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { left: max(.6rem, env(safe-area-inset-left, 0px)); }
.lb-next { right: max(.6rem, env(safe-area-inset-right, 0px)); }

/* Map */
.map-layout { display: grid; grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); min-height: calc(100vh - 4.2rem); border-bottom: 1px solid var(--line); }
.map-side { padding: 2rem 1.5rem; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 1rem; }
.map-side h1 { font-size: 2.1rem; }
.map-side .lead { font-size: 1rem; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; font-size: .9rem; color: var(--muted); }
.dot { display: inline-block; width: .75rem; height: .75rem; border-radius: 50%; }
.dot-travel { background: var(--ink); }
.dot-book { background: var(--stamp); }
.places { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.place { padding: .7rem .8rem; border-radius: 8px; scroll-margin-top: 1rem; }
.place h2 { font-size: 1.15rem; display: flex; flex-direction: column; gap: .1rem; }
.place h2 .mono { color: var(--stamp); }
.place-book h2 .mono::after { content: " ●"; }
.place ul { margin: .35rem 0 0; padding-left: 1.1rem; font-size: .95rem; line-height: 1.35; display: flex; flex-direction: column; gap: .3rem; }
.place:target { background: var(--card); box-shadow: 0 1px 2px rgb(0 0 0 / .15); }
.map-frame { position: sticky; top: 0; align-self: start; }
.map-frame .map-svg { width: 100%; height: auto; max-height: 100vh; display: block; }
.map-sea { fill: var(--water); }
.map-land { fill: var(--map-land, var(--paper)); stroke: var(--map-coast); stroke-width: .8; stroke-linejoin: round; }
.map-borders { fill: none; stroke: var(--map-border); stroke-width: .7; stroke-dasharray: 3 2; }
.map-route { fill: none; stroke: var(--stamp); stroke-width: 1.6; stroke-dasharray: 5 6; opacity: .6; }
.pin circle:not(.pin-hit) { fill: var(--ink); stroke: var(--paper); stroke-width: 2.5; transform-box: fill-box; transform-origin: center; transform: scale(var(--pin-scale, 1)); transition: transform .2s ease; }
.pin-book circle:not(.pin-hit) { fill: var(--stamp); }
.pin-hit { fill: transparent; }
.pin text { font-family: var(--hand); font-size: 21px; font-weight: 700; fill: var(--ink); paint-order: stroke; stroke: var(--water); stroke-width: 4px; stroke-linejoin: round; }
a.pin:hover, a.pin:focus-visible { --pin-scale: 1.5; outline: none; }
a.pin:hover text, a.pin:focus-visible text { fill: var(--stamp); }
.map-teaser .pin circle { stroke-width: 2; }

/* Tablets and narrow windows: the top menu stays, the languages fold into the flag menu */
@media (max-width: 1200px) {
  .header-inner { gap: 1rem 1.4rem; }
  .tagline, .languages { display: none; }
  .language-menu { display: block; }
  .top-nav { gap: 1.1rem; }
}
@media (max-width: 900px) {
  .header-inner { gap: 1rem; }
  .top-nav { gap: .85rem; }
  .top-nav a { font-size: .95rem; }
}
@media (max-width: 820px) {
  .top-nav { gap: .7rem; }
  .top-nav a { font-size: .9rem; }
}

/* Phones and small tablets */
.tabbar { display: none; }
@media (max-width: 760px) {
  :root { font-size: 17px; --bar-height: calc(4.4rem + env(safe-area-inset-bottom, 0px)); }
  .page-chapter { --bar-height: calc(6.2rem + env(safe-area-inset-bottom, 0px)); }
  .top-nav, .tagline { display: none; }
  .header-inner { flex-wrap: wrap; justify-content: space-between; gap: .4rem 1rem; min-height: 3.6rem; }
  .header-tools { margin-left: auto; }
  .brand { font-size: 1.3rem; }
  .languages { display: none; }
  .language-menu { display: block; }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around; background: var(--card); border-top: 1px solid var(--line); padding: .25rem max(.5rem, env(safe-area-inset-right, 0px)) calc(.25rem + env(safe-area-inset-bottom, 0px)) max(.5rem, env(safe-area-inset-left, 0px)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; flex: 1 1 0; min-width: 0; max-width: 5rem; min-height: 3.3rem; text-align: center; text-decoration: none; font-size: .72rem; color: var(--muted); }
  .tabbar a[aria-current] { color: var(--stamp); font-weight: 700; }

  .hero { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 1.4rem 1.1rem; align-items: center; padding-block: 1.8rem 2rem; }
  .hero .cover, .book-intro .cover { width: 8.5rem; padding: .9rem .8rem; box-shadow: inset 4px 0 0 rgb(0 0 0 / .18), .5rem .6rem 0 -.2rem var(--line); }
  .hero .cover-title, .book-intro .cover-title { font-size: 2rem; }
  .hero .cover-gloss, .hero .cover-shores, .book-intro .cover-gloss, .book-intro .cover-shores { display: none; }
  .hero .cover-subtitle, .book-intro .cover-subtitle { font-size: .72rem; }
  .hero .cover-author, .book-intro .cover-author { font-size: .5rem; }
  .hero .cover-stamp, .book-intro .cover-stamp { width: 3.3rem; height: 3.3rem; right: -.9rem; top: 2.4rem; font-size: .36rem; outline-offset: -.35rem; border-width: 2px; }
  .hero-text { display: contents; }
  .hero .cover { grid-column: 1; grid-row: 1 / span 2; }
  .hero-text .kicker { grid-column: 2; grid-row: 1; align-self: end; min-width: 0; overflow-wrap: anywhere; }
  .hero-text h1 { grid-column: 2; grid-row: 2; align-self: start; font-size: 1.7rem; min-width: 0; overflow-wrap: anywhere; }
  .hero .lead { grid-column: 1 / -1; font-size: 1.05rem; }
  .hero-actions { grid-column: 1 / -1; flex-direction: column; }
  .hero-actions > * { width: 100%; justify-content: center; }
  .continue { background: var(--solid); color: var(--on-solid); border: 0; }
  .continue .mono { color: var(--on-solid-2); }
  .continue .bar { background: var(--solid-bar); }
  .continue .bar > span { background: var(--stamp-light); }
  .hero .contents-link { display: block; grid-column: 1 / -1; }
  .home-contents { display: none; }
  .book-intro { flex-direction: column; align-items: flex-start; padding-block: 1.8rem 1.5rem; }

  .travel-block { padding-block: 2rem 2.4rem; gap: 1.2rem; }
  .cards-scroll { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 1rem; gap: 1rem; margin-inline: -1rem; padding: .4rem 1rem 1rem; scrollbar-width: none; }
  .cards-scroll::-webkit-scrollbar { display: none; }
  .cards-scroll .card { flex: 0 0 78%; scroll-snap-align: start; }
  .cards { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .map-teaser { grid-template-columns: min(7rem, 35%) minmax(0, 1fr); }
  .band-inner { grid-template-columns: minmax(0, 1fr); padding-block: 2.2rem; }
  .footer-inner { padding-bottom: 1.2rem; }

  .reading { padding-top: 1.6rem; }
  .article-body figure { margin-inline: -1rem; }
  .pill { padding: .7rem .9rem; font-size: .88rem; }
  .booknav-row .tool { min-width: max(44px, min(2.9rem, 12vw)); }

  .map-layout { grid-template-columns: 1fr; }
  .map-frame { order: -1; position: static; }
  .map-frame .map-svg { position: static; }
  .pin text { display: none; }
  .map-side { border-right: 0; padding: 1.4rem 1rem; }
}

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

@media print {
  .site-header, .site-footer, .tabbar, .booknav, .progress, .next-card { display: none !important; }
  body { padding: 0; }
}

/* Very large system text: stack the home hero so the title is not squeezed beside the cover. */
@container (max-width: 14rem) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero .cover, .hero-text .kicker, .hero-text h1 { grid-column: 1; grid-row: auto; }
}
