:root {
  --bg: #f6f4f0;
  --surface: #ffffff;
  --text: #1d1b18;
  --muted: #6c665d;
  --line: #e4dfd6;
  --accent: #a8722a;
  --accent-ink: #ffffff;
  --tile-bg: #e8e3da;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.06);
  --row: 240px;
  --gap: 6px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121110;
    --surface: #1c1a18;
    --text: #ece8e1;
    --muted: #9a9389;
    --line: #2c2926;
    --accent: #e8c07d;
    --accent-ink: #1a1408;
    --tile-bg: #22201d;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
  }
}
:root { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121110; --surface: #1c1a18; --text: #ece8e1; --muted: #9a9389; --line: #2c2926;
  --accent: #e8c07d; --accent-ink: #1a1408; --tile-bg: #22201d;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body { overflow-x: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; max-width: 1600px; margin: 0 auto; padding: 0 24px 48px; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.muted { color: var(--muted); }
.muted a { color: var(--accent); }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: max(14px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) 14px max(24px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { font: 600 19px/1 var(--serif); text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
.site-header nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.site-header nav a {
  text-decoration: none; padding: 6px 12px; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: 14px;
}
.site-header nav a:hover { color: var(--text); background: var(--surface); }
.site-header nav a[aria-current] { color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.site-header nav .nav-admin { color: var(--accent); }

.site-footer {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 20px 24px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line);
}
.site-footer a { color: var(--muted); }

/* intro + headings */
.intro { padding: 56px 0 32px; max-width: 760px; }
.intro h1 { font: 400 clamp(28px, 4.5vw, 46px)/1.12 var(--serif); margin: 0 0 12px; letter-spacing: -.02em; }
.album-head { padding: 32px 0 20px; }
.album-head h1 { font: 400 clamp(28px, 4vw, 40px)/1.15 var(--serif); margin: 6px 0 6px; letter-spacing: -.015em; }
.album-head .desc { max-width: 720px; margin-top: 12px; }
.back { color: var(--muted); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--text); }
.section-title { font: 400 22px/1.3 var(--serif); margin: 40px 0 14px; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.section-title .pin { font: 14px var(--sans); color: var(--muted); }
.pin::before { content: ""; display: inline-block; width: .7em; height: .7em; margin-right: .35em; vertical-align: -.02em;
  background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.2 7 13 7 13s7-7.8 7-13a7 7 0 0 0-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.2 7 13 7 13s7-7.8 7-13a7 7 0 0 0-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E") center/contain no-repeat; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip {
  text-decoration: none; padding: 6px 14px; border-radius: 999px; font-size: 14px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
}
.chip small { color: var(--muted); margin-left: 4px; }
.chip.on { background: var(--text); color: var(--bg); box-shadow: none; }
.chip.on small { color: inherit; opacity: .7; }

.empty { text-align: center; padding: 80px 0; color: var(--muted); }
.btn {
  display: inline-block; padding: 9px 18px; border-radius: 8px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font: 600 14px var(--sans); text-decoration: none;
}

/* album cards */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 28px 20px; }
.album-card { text-decoration: none; display: block; }
.album-cover { aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--tile-bg); }
.album-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.album-card:hover .album-cover img { transform: scale(1.04); }
.album-meta h2 { font: 400 21px/1.25 var(--serif); margin: 12px 0 2px; }
.album-meta p { margin: 0; color: var(--muted); font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 4px 12px; }

/* justified photo grid */
.pgrid { display: flex; flex-wrap: wrap; gap: var(--gap); }
.pgrid .tile {
  position: relative; display: block; overflow: hidden; background: var(--tile-bg); border-radius: 3px;
  flex: calc(var(--r) * 100) 1 calc(var(--r) * var(--row));
}
.pgrid .tile::before { content: ""; display: block; padding-bottom: calc(100% / var(--r)); }
.pgrid .tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .2s; }
.pgrid .tile:hover img { opacity: .88; }
.pgrid .tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pgrid-filler { flex-grow: 1e6; }
.pgrid .tile.is-video::after {
  content: ""; position: absolute; right: 8px; bottom: 8px; width: 26px; height: 26px; border-radius: 999px;
  background: rgba(0,0,0,.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 7v10l8-5z' fill='white'/%3E%3C/svg%3E") center/18px no-repeat;
}

/* maps */
.map { width: 100%; border-radius: 10px; overflow: hidden; background: var(--tile-bg); z-index: 0; }
.map.big { height: min(62vh, 600px); }
.map.small { height: 320px; }
.photo-marker { border: 2px solid #fff; border-radius: 6px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.35); background: #333; }
.photo-marker img { width: 100%; height: 100%; object-fit: cover; }
.marker-cluster-photo { position: relative; }
.marker-cluster-photo span {
  position: absolute; right: -8px; top: -8px; background: var(--accent); color: var(--accent-ink);
  font: 600 11px/18px var(--sans); min-width: 20px; height: 20px; padding: 0 5px; text-align: center;
  border-radius: 999px; border: 2px solid #fff;
}
.leaflet-popup-content { margin: 10px; }
.map-pop { display: block; width: 180px; text-decoration: none; color: #222; font: 13px var(--sans); }
.map-pop img { width: 180px; height: 130px; object-fit: cover; border-radius: 4px; margin-bottom: 6px; }

/* places */
.country-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; margin-top: 28px; }
.country-card {
  display: flex; gap: 14px; align-items: center; text-decoration: none; padding: 10px;
  background: var(--surface); border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line);
}
.country-card:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.country-card img { width: 84px; height: 84px; object-fit: cover; border-radius: 7px; flex: none; }
.country-card h2 { font: 400 20px var(--serif); margin: 0 0 2px; }
.country-card p { margin: 0; color: var(--muted); font-size: 13px; }

/* lightbox */
.lb {
  position: fixed; inset: 0; z-index: 1000; background: rgba(8,8,8,.97); color: #eee;
  display: grid; grid-template-rows: 1fr auto; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.lb.open { opacity: 1; pointer-events: auto; }
.lb-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 16px 64px; touch-action: pan-y; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; transition: opacity .15s; }
.lb-stage img.loading { opacity: .25; }
.lb > button {
  position: absolute; background: rgba(255,255,255,.08); border: 0; color: #fff; cursor: pointer;
  width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; font-size: 22px; line-height: 1;
}
.lb > button:hover { background: rgba(255,255,255,.18); }
.lb-close { top: calc(14px + env(safe-area-inset-top)); right: 14px; z-index: 2; }
.lb-fs { top: 14px; right: 66px; z-index: 2; font-size: 18px !important; }
.lb { background: rgba(8,8,8, calc(.97 * var(--lb-fade, 1))); }
.lb-info, .lb > button { transition: opacity .2s; }
.lb.ui-hidden .lb-info, .lb.ui-hidden > button,
.lb.zoomed .lb-info, .lb.zoomed > button { opacity: 0; pointer-events: none; }

/* Touch devices: the photo uses the whole screen; caption floats over it. */
.lb.touch { display: block; height: 100dvh; }
.lb.touch .lb-stage { position: absolute; inset: 0; padding: 0; touch-action: none; }
.lb.touch .lb-stage img, .lb.touch .lb-stage video { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; }
.lb.touch .lb-stage img { will-change: transform; }
.lb.touch .lb-info {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; border-top: 0;
  padding: 36px 16px max(14px, env(safe-area-inset-bottom)) !important;
  background: linear-gradient(to top, rgba(0,0,0,.78), rgba(0,0,0,.4) 65%, transparent);
}
.lb.touch .lb-close { background: rgba(0,0,0,.35); width: 44px; height: 44px; right: 10px; top: calc(10px + env(safe-area-inset-top)); }
.lb.touch .lb-prev, .lb.touch .lb-next { display: none; }

/* likes & comments */
.lb-actions { display: flex; gap: 8px; flex-basis: 100%; }
.lb-actions button {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px;
  background: rgba(255,255,255,.1); border: 0; color: #eee; font: 500 14px var(--sans); cursor: pointer;
}
.lb-actions button:hover { background: rgba(255,255,255,.18); }
.lb-actions svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.lb-like[aria-pressed="true"] { color: #ff5a6e; }
.lb-like[aria-pressed="true"] svg { fill: currentColor; }
.lb-like.pop svg { animation: pop .35s ease; }
@keyframes pop { 50% { transform: scale(1.35); } }
.lb-actions .n:empty { display: none; }
@media (min-width: 701px) { .lb-actions { flex-basis: auto; order: 3; } }

.lb-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(380px, 100%); z-index: 5;
  background: var(--surface); color: var(--text); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .25s cubic-bezier(.2,.7,.2,1); box-shadow: -8px 0 30px rgba(0,0,0,.35);
}
.lb.panel-open .lb-panel { transform: none; }
.lb:not(.touch).panel-open .lb-stage, .lb:not(.touch).panel-open .lb-info { margin-right: 380px; }
.lb:not(.touch).panel-open .lb-next, .lb:not(.touch).panel-open .lb-close, .lb:not(.touch).panel-open .lb-fs { display: none; }
.lb-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.lb-panel-head h2 { font: 400 20px var(--serif); margin: 0; }
.lb-panel-close { background: none; border: 0; color: var(--muted); font-size: 28px; line-height: 1; cursor: pointer; padding: 0 4px; }
.lb-comments { list-style: none; margin: 0; padding: 8px 16px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.lb-comments li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.lb-comments li p { margin: 0; overflow-wrap: anywhere; }
.lb-comments .who { margin-bottom: 3px; }
.lb-comments .who span { color: var(--muted); font-size: 12.5px; }
.lb-comments li.pending { opacity: .65; }
.lb-comments li.none { color: var(--muted); border: 0; }
.lb-form { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.lb-form input, .lb-form textarea {
  font: 16px var(--sans); color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 11px; width: 100%; resize: vertical;
}
.lb-form input:focus, .lb-form textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.lb-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.lb-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lb-note { color: var(--muted); font-size: 12.5px; }

/* Phones: comments slide up as a bottom sheet. */
.lb.touch .lb-panel {
  top: auto; left: 0; width: 100%; height: min(75dvh, 600px); border-radius: 16px 16px 0 0;
  transform: translateY(100%); box-shadow: 0 -8px 30px rgba(0,0,0,.4);
}
.lb.touch.panel-open .lb-panel { transform: none; }
.lb.touch.panel-open .lb-info { opacity: 0; pointer-events: none; }

/* theme toggle */
.theme-toggle {
  flex: none; width: 36px; height: 36px; border-radius: 999px; border: 0; cursor: pointer;
  display: grid; place-items: center; background: transparent; color: var(--muted);
}
.theme-toggle:hover { background: var(--surface); color: var(--text); }
.theme-toggle svg { width: 19px; height: 19px; grid-area: 1 / 1; display: none; }
.theme-toggle[data-mode="auto"] .i-auto, .theme-toggle[data-mode="light"] .i-light, .theme-toggle[data-mode="dark"] .i-dark { display: block; }
.site-header nav { margin-left: auto; }
.nav-admin + .count, nav .count {
  display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font-size: 11px; line-height: 18px; text-align: center; font-weight: 600;
}
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-info {
  padding-bottom: max(16px, env(safe-area-inset-bottom)) !important;
  display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: baseline; justify-content: space-between;
  padding: 12px 20px 16px; font-size: 13.5px; color: #bbb; border-top: 1px solid rgba(255,255,255,.08);
}
.lb-info strong { color: #fff; font: 400 17px var(--serif); margin-right: 10px; }
.lb-info a { color: #e8c07d; text-decoration: none; }
.lb-info .lb-meta { display: flex; gap: 6px 16px; flex-wrap: wrap; }
.lb-count { color: #888; font-variant-numeric: tabular-nums; }

@media (max-width: 700px) {
  :root { --row: 130px; --gap: 4px; }
  main { padding: 0 16px 40px; }
  /* Brand on top, nav as a single swipeable row underneath. */
  .site-header { flex-direction: column; align-items: stretch; gap: 6px; padding: max(10px, env(safe-area-inset-top)) 16px 8px; }
  .brand { font-size: 18px; }
  .site-header nav {
    flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none;
    margin: 0 -16px; padding: 0 16px; -webkit-overflow-scrolling: touch;
  }
  .site-header nav::-webkit-scrollbar { display: none; }
  .site-header nav { margin-left: -16px; }
  .theme-toggle { position: absolute; right: 10px; top: max(6px, calc(env(safe-area-inset-top) - 4px)); }
  .site-header nav a { padding: 7px 12px; font-size: 14px; white-space: nowrap; flex: none; }
  .album-head { padding: 20px 0 14px; }
  .section-title { margin-top: 28px; font-size: 19px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 14px -16px 0; padding: 0 16px 4px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { white-space: nowrap; flex: none; }
  .country-card img { width: 64px; height: 64px; }
  .map.small { height: 240px; }
  .lb-close { width: 48px; height: 48px; }
  .lb-info { padding: 10px 16px; font-size: 13px; }
  .site-footer { padding: 16px; }
  .intro { padding: 36px 0 24px; }
  .album-grid { grid-template-columns: 1fr 1fr; gap: 20px 12px; }
  .album-meta h2 { font-size: 17px; }
  .album-meta p { font-size: 12px; }
  .lb-stage { padding: 8px 0; }
  .lb-prev, .lb-next { display: none !important; }
  .map.big { height: 55vh; }
}
@media (max-width: 380px) {
  .album-grid { grid-template-columns: 1fr; }
}
