/* grandparents.travel: one stylesheet for every page.
   Written for older readers first: large type (19px body), high contrast, generous tap targets,
   underlined links, nothing that moves. Atkinson Hyperlegible was designed for low-vision readers. */
:root, :root[data-theme="light"] {
  --bg: #faf6ef;
  --surface: #ffffff;
  --ink: #1f2a2e;
  --muted: #55605f;
  --rule: #e4dccd;
  --accent: #1d5c63;
  --accent-soft: #e3efee;
  --warm: #a8481f;
  --na: #5a4a8c;
  --sea: #e6eef0;
}
:root[data-theme="dark"] {
  --bg: #141a1c;
  --surface: #1d2528;
  --ink: #eef0ec;
  --muted: #a9b3b0;
  --rule: #33403f;
  --accent: #7cc4c9;
  --accent-soft: #1f3336;
  --warm: #f0a07a;
  --na: #b3a4e6;
  --sea: #18262a;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 19px/1.65 "Atkinson Hyperlegible", system-ui, sans-serif;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--warm); }
:focus-visible { outline: 3px solid var(--warm); outline-offset: 2px; }
h1, h2, h3 { font-family: "Source Serif 4", Georgia, serif; line-height: 1.2; font-weight: 600; }
h1 { font-size: clamp(34px, 6vw, 52px); margin: 0 0 16px; letter-spacing: -0.01em; }
h2 { font-size: 28px; margin: 40px 0 12px; }
h3 { font-size: 22px; margin: 28px 0 8px; }
img { max-width: 100%; height: auto; }

.skip-link { position: absolute; left: -9999px; top: 0; }
.skip-link:focus { left: 16px; top: 12px; z-index: 100; padding: 10px 14px; border-radius: 8px; background: var(--surface); border: 2px solid var(--warm); }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.wrap.wide { max-width: 1080px; }

.mast { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 22px 0; border-bottom: 1px solid var(--rule); }
.brand { font: 700 24px/1 "Source Serif 4", Georgia, serif; color: var(--ink); text-decoration: none; }
.brand span { color: var(--warm); }
.mast-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; }
.mast-nav a { color: var(--ink); text-decoration: none; font-weight: 700; padding: 6px 0; }
.mast-nav a:hover, .mast-nav a.on { color: var(--accent); text-decoration: underline; }

.hero { padding: 48px 0 24px; }
.lede { font-size: 22px; color: var(--muted); max-width: 680px; margin: 0; }
.eyebrow { font-size: 15px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--warm); margin-bottom: 6px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 20px; margin: 24px 0 48px; }
.card { display: block; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 24px; text-decoration: none; color: var(--ink); }
.card:hover { border-color: var(--accent); color: var(--ink); }
.card h3 { margin: 0 0 8px; color: var(--accent); }
.card p { margin: 0; color: var(--muted); }

.panel { background: var(--accent-soft); border-radius: 14px; padding: 24px 28px; margin: 32px 0; }
.panel h2 { margin-top: 0; }

article { padding: 40px 0 24px; }
article .meta { color: var(--muted); font-size: 16px; margin-bottom: 28px; }
article ul, article ol { padding-left: 1.3em; }
article li { margin: 6px 0; }
.check { background: var(--surface); border: 1px solid var(--rule); border-left: 5px solid var(--accent); border-radius: 10px; padding: 18px 22px; margin: 24px 0; }
.check h3 { margin-top: 0; }
.note { font-size: 16px; color: var(--muted); }

footer { border-top: 1px solid var(--rule); margin-top: 56px; padding: 28px 0 40px; font-size: 16px; color: var(--muted); }
footer p { margin: 4px 0; }
footer a { color: var(--muted); }

/* Country guide pages */
.facts { border-collapse: collapse; width: 100%; margin: 8px 0 16px; }
.facts th, .facts td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.facts th { width: 38%; font-weight: 700; }
.links li { margin: 8px 0; }

/* Country map (/countries), after the Bloch Index map */
.map-tools { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.map-tools button { font: 700 17px/1 inherit; font-family: inherit; padding: 12px 18px; min-height: 44px; border-radius: 999px; border: 2px solid var(--accent); background: var(--surface); color: var(--accent); cursor: pointer; }
.map-tools button.on { background: var(--accent); color: var(--bg); }
.map-box { position: relative; border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; }
#travel-map { height: min(68vh, 620px); min-height: 380px; background: var(--sea); }
.map-legend { position: absolute; left: 12px; bottom: 12px; z-index: 500; background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-radius: 10px; padding: 10px 14px; font-size: 15px; }
.legend-title { font-weight: 700; margin-bottom: 4px; }
.legend-row { display: flex; align-items: center; gap: 8px; }
.swatch { width: 16px; height: 16px; border-radius: 4px; display: inline-block; }
.leaflet-tooltip { font: 700 16px/1.3 "Atkinson Hyperlegible", system-ui, sans-serif; }
.leaflet-container { font-family: inherit; }
.country-lists { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.country-list { list-style: none; padding: 0; columns: 3 180px; column-gap: 24px; }
.country-lists > div:last-child .country-list { columns: 1; }
.country-list li { padding: 5px 0; break-inside: avoid; }
@media (max-width: 720px) { .country-lists { grid-template-columns: 1fr; } }

.panel-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0); z-index: 999; display: none; transition: background-color .3s ease; }
.panel-overlay.open { background: rgba(0,0,0,.4); }
.country-panel { position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 92vw; background: var(--surface); color: var(--ink); z-index: 1000; display: none; box-shadow: -8px 0 32px rgba(0,0,0,.2); transform: translateX(100%); transition: transform .3s cubic-bezier(.4,0,.2,1); overflow-y: auto; }
.country-panel.open { transform: translateX(0); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--rule); background: var(--bg); position: sticky; top: 0; }
.panel-head h2 { margin: 0; font-size: 28px; }
.panel-close { background: none; border: 0; font-size: 34px; line-height: 1; width: 44px; height: 44px; cursor: pointer; color: var(--muted); border-radius: 8px; }
.panel-close:hover { color: var(--ink); }
.panel-body { padding: 20px 24px 32px; }
.panel-facts dt { font-weight: 700; margin-top: 14px; }
.panel-facts dd { margin: 2px 0 0; }
.panel-links { margin: 20px 0 0; }
.btn { display: inline-block; background: var(--accent); color: var(--bg); text-decoration: none; font-weight: 700; padding: 12px 18px; border-radius: 10px; }
.btn:hover { color: var(--bg); background: var(--warm); }
.leaflet-interactive:focus { outline: none; }

/* Travel guide photos (added with <!-- photo: ... --> slots) */
.photo { margin: 28px 0; }
.photo img { display: block; width: 100%; border-radius: 12px; }
.photo figcaption { font-size: 16px; color: var(--muted); margin-top: 8px; }
.place-facts { font-size: 17px; color: var(--muted); margin-top: -4px; }
