/* Atlas Ledger: an editorial travel magazine. Light and dark themes share one set of tokens. */
:root {
  --bg: #f7f3ec;
  --surface: #fffdf9;
  --ink: #1d1b18;
  --muted: #6b645a;
  --line: #e4dccf;
  --accent: #b4532a;
  --accent-ink: #fff;
  --chip: #efe7da;
  --shadow: 0 1px 2px rgba(40, 30, 20, .06), 0 8px 24px rgba(40, 30, 20, .08);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px;
  --max: 1240px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141311; --surface: #1d1b18; --ink: #efe9df; --muted: #a39b8f; --line: #34302a;
    --accent: #e0814f; --accent-ink: #1a1410; --chip: #2a2722;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141311; --surface: #1d1b18; --ink: #efe9df; --muted: #a39b8f; --line: #34302a;
  --accent: #e0814f; --accent-ink: #1a1410; --chip: #2a2722;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
main:focus { outline: none; }
.muted { color: var(--muted); }

/* ---------- navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50; transition: background .25s, box-shadow .25s, color .25s;
  color: #fff;
}
.nav.solid, .nav.light-page { background: color-mix(in srgb, var(--bg) 88%, transparent); color: var(--ink);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); box-shadow: 0 1px 0 var(--line); }
.nav-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { font: 600 22px/1 var(--serif); text-decoration: none; letter-spacing: -.02em; white-space: nowrap; margin: 0; }
.brand em { font-style: italic; font-weight: 400; color: var(--accent); }
.nav:not(.solid):not(.light-page) .brand em { color: #ffd2b5; }
.nav-links { display: flex; gap: 20px; font-size: 14px; font-weight: 500; }
.nav-links a { text-decoration: none; opacity: .85; }
.nav-links a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.nav-search { margin-left: auto; }
.nav-search input {
  width: 240px; height: 38px; border-radius: 999px; padding: 0 16px; font: inherit; font-size: 14px;
  border: 1px solid color-mix(in srgb, currentColor 25%, transparent); background: color-mix(in srgb, currentColor 8%, transparent); color: inherit;
}
.nav-search input::placeholder { color: inherit; opacity: .7; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; cursor: pointer;
  border: 1px solid color-mix(in srgb, currentColor 25%, transparent); background: color-mix(in srgb, currentColor 8%, transparent);
}
@media (max-width: 860px) { .nav-links { display: none; } .nav-search input { width: 170px; } }
@media (max-width: 420px) { .nav-search input { width: 130px; } .nav-inner { gap: 12px; } }

/* ---------- hero ---------- */
.hero { position: relative; min-height: min(88vh, 820px); color: #fff; display: flex; align-items: flex-end; overflow: hidden; background: #2a2520; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s ease; }
.hero-slide.on { opacity: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 9s ease-out; }
.hero-slide.on img { transform: scale(1); }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,0) 28%, rgba(0,0,0,.15) 55%, rgba(0,0,0,.78) 100%); pointer-events: none; }
.hero-content { position: relative; z-index: 2; width: 100%; padding-bottom: 56px; }
.eyebrow { font: 600 12px/1.5 var(--sans); letter-spacing: .16em; text-transform: uppercase; margin: 0 0 14px; opacity: .9; }
.hero h1 { font-size: clamp(40px, 7vw, 88px); font-weight: 600; max-width: 14ch; letter-spacing: -.025em; }
.hero h1 em { font-weight: 400; }
.hero-lead { font-size: clamp(16px, 1.6vw, 19px); max-width: 52ch; margin: 18px 0 28px; opacity: .92; }
.hero-search { display: flex; max-width: 560px; background: #fff; border-radius: 999px; padding: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.hero-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; padding: 0 18px; color: #1d1b18; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 22px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; }
.btn.ghost { background: transparent; color: inherit; border: 1px solid var(--line); }
.hero-caption { position: absolute; right: 24px; bottom: 20px; z-index: 2; font-size: 13px; text-align: right; max-width: 40ch; }
.hero-caption a { text-decoration: none; font-weight: 600; }
.hero-caption a:hover { text-decoration: underline; }
.hero-caption small { display: block; opacity: .7; font-size: 11px; }
.hero-dots { display: flex; gap: 6px; justify-content: flex-end; margin-top: 10px; }
.hero-dots button { width: 22px; height: 3px; border: 0; padding: 0; border-radius: 2px; background: rgba(255,255,255,.4); cursor: pointer; }
.hero-dots button.on { background: #fff; }
@media (max-width: 760px) { .hero-caption { position: relative; right: auto; bottom: auto; text-align: left; margin-top: 22px; } .hero-dots { justify-content: flex-start; } }

/* ---------- sections ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.stat { padding: 26px 24px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat b { display: block; font: 600 clamp(26px, 3vw, 36px)/1 var(--serif); }
.stat span { color: var(--muted); font-size: 14px; }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); } .stat:nth-child(2) { border-right: 0; } .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); } .stat { padding: 18px 16px; } }

.section { padding-block: 72px 8px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 42px); }
.section-head p { margin: 8px 0 0; color: var(--muted); max-width: 60ch; }
.section-head a.more { font-weight: 600; font-size: 14px; color: var(--accent); text-decoration: none; white-space: nowrap; }
.section-head a.more:hover { text-decoration: underline; }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 28px 24px; }
.card { text-decoration: none; display: flex; flex-direction: column; gap: 12px; }
.card .ph { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--chip); }
.card .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.card:hover .ph img { transform: scale(1.05); }
.card .ph .badge { position: absolute; left: 12px; top: 12px; }
.card .ph .count { position: absolute; right: 12px; bottom: 12px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; padding: 3px 9px; border-radius: 999px; backdrop-filter: blur(6px); }
.card .kicker { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.card h3 { font-size: 21px; margin-top: 4px; }
.card:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.card p { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.noimg { width: 100%; height: 100%; display: grid; place-items: center; font: italic 400 22px var(--serif); color: var(--muted); padding: 16px; text-align: center; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(255,255,255,.92); color: #1d1b18; padding: 5px 9px; border-radius: 999px; }

/* Feature mosaic: one large story, four smaller ones. */
.mosaic { display: grid; grid-template-columns: 1.4fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 20px; height: 620px; }
.tile { position: relative; border-radius: var(--radius); overflow: hidden; color: #fff; text-decoration: none; background: #2a2520; }
.tile:first-child { grid-row: span 2; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.tile:hover img { transform: scale(1.05); }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.8)); }
.tile .t { position: absolute; left: 20px; right: 20px; bottom: 18px; z-index: 1; }
.tile .t span { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.tile h3 { font-size: 22px; margin-top: 6px; }
.tile:first-child h3 { font-size: clamp(26px, 3vw, 38px); }
.tile:first-child p { margin: 10px 0 0; max-width: 50ch; opacity: .9; font-size: 15px; }
@media (max-width: 900px) {
  .mosaic { grid-template-columns: 1fr 1fr; grid-template-rows: none; grid-auto-rows: 220px; height: auto; }
  .tile:first-child { grid-column: span 2; grid-row: auto; height: 380px; }
}
@media (max-width: 520px) { .mosaic { grid-template-columns: 1fr; } .tile:first-child { grid-column: auto; } }

.continents { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.cont { position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden; color: #fff; text-decoration: none; background: #2a2520; }
.cont img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.cont:hover img { transform: scale(1.06); }
.cont::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.75)); }
.cont div { position: absolute; left: 14px; bottom: 12px; z-index: 1; }
.cont b { display: block; font: 600 20px/1.1 var(--serif); }
.cont span { font-size: 12px; opacity: .85; }

.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 300px); gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; scrollbar-width: thin; }
.rail > * { scroll-snap-align: start; }

/* ---------- explore ---------- */
.page-top { padding-block: 112px 24px; }
.page-top h1 { font-size: clamp(34px, 5vw, 58px); }
.page-top p { color: var(--muted); max-width: 62ch; margin: 12px 0 0; }
.filters { position: sticky; top: 64px; z-index: 20; background: var(--bg); padding: 14px 0; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.filters .wrap { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.chip { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 14px; font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.filters select, .filters input[type=search] { height: 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 0 14px; font: inherit; font-size: 14px; }
.filters input[type=search] { min-width: 200px; flex: 1; max-width: 320px; }
.filters .sep { width: 1px; height: 24px; background: var(--line); }
.result-count { margin-left: auto; color: var(--muted); font-size: 14px; }
.load-more { display: flex; justify-content: center; padding: 40px 0 0; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; font: italic 20px var(--serif); }

/* ---------- article ---------- */
.p-hero { position: relative; height: min(82vh, 760px); min-height: 440px; color: #fff; display: flex; align-items: flex-end; background: #2a2520; overflow: hidden; }
.p-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.p-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.5) 0%, transparent 25%, transparent 45%, rgba(0,0,0,.82) 100%); }
.p-hero .wrap { position: relative; z-index: 1; width: 100%; padding-bottom: 44px; }
.crumbs { font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; opacity: .92; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span[aria-hidden] { opacity: .6; }
.p-hero h1 { font-size: clamp(36px, 6vw, 76px); max-width: 18ch; letter-spacing: -.025em; }
.p-hero .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.p-hero .photo-credit { position: absolute; right: 24px; bottom: 14px; z-index: 1; font-size: 11px; opacity: .7; max-width: 50ch; text-align: right; }
.p-hero .photo-credit a { text-decoration: none; }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 64px; padding-top: 56px; }
@media (max-width: 1000px) { .article-layout { grid-template-columns: 1fr; gap: 32px; } }
.prose { font-size: 18px; line-height: 1.75; max-width: 70ch; }
.prose p { margin: 0 0 1.15em; }
.prose .lead { font: 400 clamp(20px, 2vw, 24px)/1.55 var(--serif); margin-bottom: 1.3em; }
.prose .lead::first-letter { float: left; font: 600 4.2em/.8 var(--serif); padding: .08em .1em 0 0; color: var(--accent); }
.prose h2 { font-size: clamp(26px, 2.6vw, 34px); margin: 1.8em 0 .6em; padding-top: .9em; border-top: 1px solid var(--line); }
.prose h3 { font-size: 23px; margin: 1.5em 0 .5em; }
.prose h4 { font-size: 19px; margin: 1.3em 0 .4em; }
.prose figure { margin: 2em 0; }
.prose figure img { width: 100%; border-radius: 10px; cursor: zoom-in; background: var(--chip); }
.prose figure.side { float: right; width: 44%; margin: .3em 0 1em 28px; }
@media (max-width: 640px) { .prose { font-size: 17px; } .prose figure.side { float: none; width: auto; margin: 1.5em 0; } }
figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.45; }
figcaption a { color: inherit; }
.note { background: var(--chip); border-radius: 10px; padding: 14px 18px; font-size: 14.5px; margin-bottom: 1.6em; }

.aside { display: flex; flex-direction: column; gap: 22px; }
.aside-sticky { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 22px; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.box h4 { font: 600 12px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.facts { margin: 0; display: grid; gap: 12px; }
.facts div { display: grid; grid-template-columns: 96px 1fr; gap: 10px; font-size: 14.5px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; }
.map { width: 100%; aspect-ratio: 4 / 3; border: 0; border-radius: 10px; display: block; background: var(--chip); }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 46vh; overflow: auto; }
.toc a { display: block; text-decoration: none; font-size: 14px; padding: 5px 10px; border-radius: 8px; color: var(--muted); border-left: 2px solid transparent; }
.toc a.sub { padding-left: 22px; font-size: 13px; }
.toc a:hover { color: var(--ink); background: var(--chip); }
.toc a.on { color: var(--ink); border-left-color: var(--accent); background: var(--chip); }
.read-time { font-size: 14px; color: var(--muted); }

.gallery { columns: 3 280px; column-gap: 14px; }
.gallery button { display: block; width: 100%; padding: 0; border: 0; background: var(--chip); margin: 0 0 14px; border-radius: 10px; overflow: hidden; cursor: zoom-in; break-inside: avoid; }
.gallery img { width: 100%; height: auto; transition: transform .5s, opacity .3s; }
.gallery button:hover img { transform: scale(1.03); }

.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.video iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; background: #000; }
.video p { font-size: 14px; margin: 8px 0 0; color: var(--muted); }

.credits { font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.credits summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.credits ol { padding-left: 20px; }
.credits a { word-break: break-word; }

/* ---------- country ---------- */
.country-intro { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 64px; padding-top: 48px; }
@media (max-width: 1000px) { .country-intro { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(10, 9, 8, .96); color: #fff; display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; }
.lightbox[hidden] { display: none; }
.lb-figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; height: 100vh; justify-content: center; padding: 56px 0 24px; }
.lb-figure img { max-height: calc(100vh - 170px); max-width: 100%; object-fit: contain; border-radius: 4px; }
.lb-figure figcaption { color: rgba(255,255,255,.75); max-width: 80ch; text-align: center; font-size: 13.5px; padding: 0 12px; }
.lb-figure figcaption b { color: #fff; font-weight: 500; display: block; font-size: 15px; margin-bottom: 4px; }
.lb-close { position: absolute; top: 14px; right: 14px; color: #fff; }
.lb-nav { justify-self: center; color: #fff; width: 48px; height: 48px; font-size: 28px; }
@media (max-width: 640px) { .lightbox { grid-template-columns: 1fr; } .lb-nav { position: absolute; bottom: 18px; } .lb-prev { left: 18px; } .lb-next { right: 18px; } .lb-figure { padding-bottom: 80px; } }

/* ---------- footer, loading ---------- */
.footer { margin-top: 96px; border-top: 1px solid var(--line); padding-block: 40px 56px; color: var(--muted); font-size: 14px; }
.footer-inner { display: grid; grid-template-columns: 220px 1fr; gap: 32px; }
.footer .brand { color: var(--ink); }
@media (max-width: 640px) { .footer-inner { grid-template-columns: 1fr; gap: 12px; } }
.skeleton { background: linear-gradient(90deg, var(--chip) 0%, color-mix(in srgb, var(--chip) 60%, var(--bg)) 50%, var(--chip) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }
.loading-page { padding: 140px 0; text-align: center; color: var(--muted); font: italic 20px var(--serif); }
.fade-in { animation: fade .5s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
