:root {
  --bg: #faf7f2; --ink: #1f1b16; --muted: #6b6259; --card-shadow: 0 10px 30px rgba(0,0,0,.12);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #16140f; --ink: #f3ede4; --muted: #a79d91; --card-shadow: 0 10px 30px rgba(0,0,0,.5); }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, system-ui, sans-serif; }

.top { max-width: 1200px; margin: 0 auto; padding: 56px 16px 24px; }
.top h1 { font-family: Fraunces, Georgia, serif; font-weight: 900; font-size: clamp(2.4rem, 6vw, 4.2rem); margin: 0; letter-spacing: -.02em; }
.top p { color: var(--muted); margin: 8px 0 0; font-size: 1.05rem; }

.grid { max-width: 1200px; margin: 0 auto; padding: 16px; display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.card { position: relative; aspect-ratio: 3 / 4; border-radius: 22px; overflow: hidden; cursor: pointer;
  box-shadow: var(--card-shadow); transition: transform .25s ease, box-shadow .25s ease; border: 0; padding: 0;
  text-align: left; background: #000; color: #fff; font: inherit; }
.card:hover, .card:focus-visible { transform: translateY(-6px) rotate(-.4deg); box-shadow: 0 18px 40px rgba(0,0,0,.2); outline: none; }
.card svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.card .label { position: absolute; left: 18px; right: 18px; top: 18px; }
.card .city { font-family: Fraunces, Georgia, serif; font-weight: 900; font-size: 2.1rem; line-height: .95;
  letter-spacing: -.02em; text-shadow: 0 1px 2px rgba(0,0,0,.35), 0 2px 14px rgba(0,0,0,.35); margin: 0; }
.card .meta { margin-top: 6px; font-size: .85rem; font-weight: 600; opacity: .92; text-transform: uppercase; letter-spacing: .08em; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.card .count { position: absolute; left: 18px; bottom: 16px; font-size: .8rem; font-weight: 600;
  background: rgba(255,255,255,.9); color: #1f1b16; padding: 5px 10px; border-radius: 999px; }

.foot { text-align: center; padding: 48px 16px 64px; }
.foot a { color: var(--muted); }

dialog { border: 0; padding: 0; }
dialog::backdrop { background: rgba(10,8,6,.7); }
#gallery { width: min(1100px, 100vw - 32px); max-height: calc(100vh - 32px); border-radius: 20px;
  background: var(--bg); color: var(--ink); }
.g-head { display: flex; justify-content: space-between; align-items: start; padding: 22px 22px 8px; position: sticky; top: 0; background: var(--bg); }
.g-head h2 { font-family: Fraunces, Georgia, serif; font-size: 2rem; margin: 0; }
.g-head p { margin: 4px 0 0; color: var(--muted); }
#g-close, .v-close { font-size: 2rem; line-height: 1; background: none; border: 0; cursor: pointer; color: inherit; }
.g-body { padding: 12px 22px 24px; columns: 3 240px; column-gap: 12px; }
.g-body img { width: 100%; margin-bottom: 12px; border-radius: 12px; display: block; cursor: zoom-in; break-inside: avoid; }
.g-empty { color: var(--muted); padding: 40px 0; text-align: center; column-span: all; }

#viewer { background: transparent; width: 100vw; height: 100vh; max-width: none; max-height: none; }
#viewer[open] { display: grid; place-items: center; }
#v-img { max-width: 92vw; max-height: 90vh; border-radius: 8px; }
.v-nav { position: fixed; top: 50%; transform: translateY(-50%); font-size: 3rem; background: rgba(0,0,0,.35);
  color: #fff; border: 0; width: 52px; height: 72px; border-radius: 12px; cursor: pointer; }
.v-prev { left: 12px; } .v-next { right: 12px; }
.v-close { position: fixed; top: 12px; right: 18px; color: #fff; }
