:root {
    --bg: #faf8f4;
    --surface: #ffffff;
    --text: #1f2328;
    --muted: #6b6f76;
    --line: #e6e1d8;
    --accent: #e4572e;
    --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.06);
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
    :root { --bg: #15171a; --surface: #1e2125; --text: #e8e6e3; --muted: #9aa0a6; --line: #2e3238;
            --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3); }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.65 var(--sans); }
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .4em; }

.site-header { position: sticky; top: 0; z-index: 1000; display: flex; justify-content: space-between; align-items: center;
    padding: .7rem clamp(1rem, 4vw, 2.5rem); background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.2rem; text-decoration: none; }
.site-header nav a { margin-left: 1.2rem; text-decoration: none; color: var(--muted); }
.site-header nav a:hover { color: var(--text); }
.site-footer { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; color: var(--muted); font-size: .85rem;
    padding: 2rem clamp(1rem, 4vw, 2.5rem); border-top: 1px solid var(--line); margin-top: 4rem; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem); }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 1rem; }
.hero { text-align: center; padding: clamp(2.5rem, 7vw, 5rem) 1rem 2rem; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
.hero p { color: var(--muted); font-size: 1.15rem; margin: 0; }
.section-title { font-size: 1.6rem; margin: 2.5rem 0 1rem; }
.section-title .count { font: 600 .8rem var(--sans); color: var(--muted); background: var(--line); padding: .15em .6em; border-radius: 99px; vertical-align: middle; }
.meta { color: var(--muted); font-size: .9rem; }
.lead { font-size: 1.15rem; }

.map { height: 380px; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); background: var(--line); }
.map-tall { height: min(62vh, 560px); }
.map-popup a { font-weight: 600; }

.trip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.5rem; }
.trip-card { display: flex; flex-direction: column; background: var(--surface); border-radius: 14px; overflow: hidden;
    text-decoration: none; box-shadow: var(--shadow); border-top: 4px solid var(--accent); transition: transform .15s; }
.trip-card:hover { transform: translateY(-3px); }
.trip-cover { aspect-ratio: 16/10; background: var(--line); }
.trip-cover img { width: 100%; height: 100%; object-fit: cover; }
.trip-body { padding: 1rem 1.2rem 1.2rem; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: .5rem 0; }
.chip { font-size: .75rem; padding: .1rem .55rem; border-radius: 99px; background: color-mix(in srgb, var(--accent) 14%, transparent); }
.stats { display: flex; flex-wrap: wrap; gap: .9rem; font-size: .88rem; color: var(--muted); }

.trip-hero { position: relative; min-height: 340px; display: flex; align-items: flex-end; color: #fff; background: #333; margin-bottom: 2rem; }
.trip-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.trip-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 30%, rgba(0,0,0,.72)); }
.trip-hero-text { position: relative; z-index: 1; padding: 2rem clamp(1rem, 4vw, 2.5rem); max-width: 1180px; width: 100%; margin: 0 auto; }
.trip-hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.trip-hero .meta, .trip-hero .stats { color: rgba(255,255,255,.88); }
.back { display: inline-block; text-decoration: none; color: var(--muted); font-size: .9rem; margin: 1.5rem 0 .5rem; }
.trip-hero .back { color: rgba(255,255,255,.85); margin-top: 0; }

.timeline { list-style: none; padding: 0 0 0 1.4rem; margin: 0; border-left: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.timeline li { position: relative; margin-bottom: 1.2rem; }
.timeline li::before { content: ""; position: absolute; left: -1.4rem; top: 1.4rem; width: 13px; height: 13px; margin-left: -8px;
    border-radius: 50%; background: var(--accent); border: 3px solid var(--bg); }
.post-card { display: grid; grid-template-columns: 180px 1fr; gap: 1.2rem; background: var(--surface); border-radius: 12px; overflow: hidden;
    text-decoration: none; box-shadow: var(--shadow); transition: transform .15s; }
.post-card:hover { transform: translateX(3px); }
.post-thumb { background: var(--line); min-height: 130px; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card-body { padding: 1rem 1.2rem 1rem 0; }
.post-card-body h3 { font-size: 1.25rem; }
.post-card-body p { margin: 0; color: var(--muted); font-size: .95rem; }
@media (max-width: 600px) { .post-card { grid-template-columns: 1fr; } .post-thumb { aspect-ratio: 16/9; } .post-card-body { padding: 0 1rem 1rem; } }

.post header { margin: .5rem 0 1.5rem; }
.post h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
.places { color: var(--muted); }
.post-cover img { border-radius: 12px; width: 100%; max-height: 520px; object-fit: cover; }
.prose { font-size: 1.08rem; }
.prose p { margin: 0 0 1.1em; }
.prose figure, .post-cover { margin: 1.8rem 0; }
.prose img { border-radius: 10px; margin: 0 auto; max-height: 75vh; cursor: zoom-in; }
.prose figcaption { text-align: center; color: var(--muted); font-size: .88rem; margin-top: .4rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.gallery-item { aspect-ratio: 1; overflow: hidden; border-radius: 8px; background: var(--line); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.gallery-item:hover img { transform: scale(1.05); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; }
.post-nav a { display: block; padding: 1rem 1.2rem; background: var(--surface); border-radius: 12px; text-decoration: none; box-shadow: var(--shadow); font-family: var(--serif); }
.post-nav small { display: block; font: .8rem var(--sans); color: var(--muted); margin-bottom: .2rem; }
.post-nav .next { text-align: right; grid-column: 2; }

.lightbox { position: fixed; inset: 0; z-index: 3000; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 6px; }
.lightbox button { position: absolute; background: none; border: 0; color: #fff; font-size: 2.6rem; cursor: pointer; padding: 1rem; opacity: .8; }
.lightbox button:hover { opacity: 1; }
.lb-close { top: 0; right: 0; font-size: 1.8rem !important; }
.lb-prev { left: 0; } .lb-next { right: 0; }

.lightbox video { max-width: 94vw; max-height: 88vh; border-radius: 6px; background: #000; }
.lightbox video[hidden], .lightbox img[hidden] { display: none; }
.gallery-item.video { position: relative; }
.gallery-item .play { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2rem; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.6); pointer-events: none; }
.album-link { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1rem; padding: 1rem 1.3rem;
    background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); text-decoration: none; font-family: var(--serif); font-size: 1.15rem;
    border-left: 4px solid var(--accent); }
.album-link span { font: .9rem var(--sans); color: var(--muted); }
.album h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
/* album lightbox info (EXIF + map, outside privacy zones only):
   PC = panel right of the photo, phone = bottom sheet that the ⓘ button shows/hides */
.lightbox .lb-info[hidden], .lightbox .lb-map-wrap[hidden], .lightbox .lb-info-btn[hidden] { display: none; }
.lightbox .lb-info { position: absolute; z-index: 3; display: flex; flex-direction: column; gap: .8rem;
                     background: rgba(18,18,18,.97); color: #eee; font-size: .86rem; line-height: 1.45; }
.lightbox .lb-text { display: flex; flex-direction: column; gap: .4rem; }
.lightbox .lb-map-wrap { display: flex; flex-direction: column; gap: .3rem; }
.lightbox .lb-map { width: 100%; height: 260px; border-radius: 8px; overflow: hidden; }
.lightbox .lb-map .leaflet-control-attribution { font-size: 9px; }
.lightbox .lb-map-tools { display: flex; justify-content: space-between; align-items: center; gap: .6rem; font-size: .78rem; }
.lightbox .lb-map-tools .lb-map-big { position: static; font-size: .78rem; padding: .2rem .55rem; opacity: 1; border: 1px solid rgba(255,255,255,.35);
                                      border-radius: 6px; color: #fff; background: rgba(255,255,255,.08); }
.lightbox .lb-map-tools a { color: #cfe3ff; text-decoration: none; }
.lightbox .lb-info-btn { display: none; }
.lightbox .lb-prev, .lightbox .lb-next, .lightbox .lb-close { z-index: 4; text-shadow: 0 0 6px rgba(0,0,0,.8); }

@media (min-width: 900px) {
    .lightbox.has-info { padding-right: 360px; }
    .lightbox.has-info img, .lightbox.has-info video { max-width: calc(100vw - 360px - 7rem); }
    .lightbox.has-info .lb-next { right: 360px; }
    .lightbox .lb-info { top: 0; right: 0; bottom: 0; width: 360px; padding: 3.4rem 1.1rem 1.2rem; overflow-y: auto;
                         border-left: 1px solid rgba(255,255,255,.08); }
    .lightbox .lb-info.big-map .lb-map { height: 58vh; }
}
@media (max-width: 899px) {
    .lightbox .lb-info-btn { display: block; position: absolute; top: .5rem; left: .5rem; z-index: 4; width: 42px; height: 42px; padding: 0;
                             border-radius: 50%; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.45);
                             font-size: 1.25rem; line-height: 40px; text-align: center; opacity: 1; }
    .lightbox.info-open .lb-info-btn { background: #fff; color: #111; }
    .lightbox.info-open { align-items: flex-start; padding-top: 3.6rem; }  /* photo moves up above the sheet */
    .lightbox.info-open img, .lightbox.info-open video { max-height: 36vh; }
    .lightbox:not(.info-open) .lb-info { display: none; }
    .lightbox .lb-info { left: 0; right: 0; bottom: 0; max-height: 72vh; overflow-y: auto; padding: .9rem 1rem 1.1rem;
                         border-radius: 14px 14px 0 0; font-size: .82rem; gap: .6rem; }
    .lightbox .lb-text { gap: .25rem; }
    .lightbox .lb-map { height: 170px; }
    .lightbox .lb-info.big-map .lb-map { height: 44vh; }
}
.live-badge { display: inline-block; padding: 0 .45rem; border-radius: 6px; background: rgba(46,158,91,.15); color: #2e9e5b; font-weight: 600; }
.hero .ai-note { max-width: 46rem; margin: .9rem auto 0; padding: .7rem 1rem; border-radius: 12px; font-size: .9rem; line-height: 1.55;
                 background: rgba(127,127,127,.1); text-align: left; }
