:root {
  --paper: #f6f2ea;
  --card: #fffdf8;
  --ink: #1e1b17;
  --muted: #6d655a;
  --line: #e2d9cb;
  --accent: #b0502a;
  --accent-ink: #fff;
  --shadow: 0 1px 2px rgba(40, 30, 20, .06), 0 6px 18px rgba(40, 30, 20, .07);
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --display: "Fraunces", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #171512; --card: #211e1a; --ink: #eee7dc; --muted: #a89e90; --line: #36312a;
    --accent: #e08a5f; --accent-ink: #171512; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #171512; --card: #211e1a; --ink: #eee7dc; --muted: #a89e90; --line: #36312a;
  --accent: #e08a5f; --accent-ink: #171512; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.15rem/1.65 var(--serif); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: .15em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 99; }
.skip:focus { left: 1rem; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }
@media (min-width: 700px) { .wrap { padding: 0 28px; } }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 58px; flex-wrap: wrap; }
.brand { font: 600 1.3rem/1 var(--display); color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-size: 1rem; padding: .35rem 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }
@media (max-width: 520px) { .top-in { padding-top: .5rem; padding-bottom: .4rem; gap: .2rem; } .nav { gap: .9rem; } }

/* hero mosaic */
.hero { position: relative; background: #2b241d; }
.mosaic { display: grid; gap: 3px; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, minmax(150px, 31vh)); }
.mosaic a { position: relative; overflow: hidden; display: block; }
.mosaic img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease, filter .3s ease; }
.mosaic a:hover img { transform: scale(1.04); filter: brightness(1.08); }
.mosaic .m0 { grid-column: span 2; grid-row: span 2; }
.mosaic .m5, .mosaic .m6 { display: none; }
.hero h1 { position: absolute; left: 0; bottom: 0; margin: 0; padding: 4rem 16px 1.4rem; width: 100%; pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,.6), rgba(0,0,0,0)); color: #fff;
  font: 600 clamp(2.6rem, 8vw, 5.8rem)/.95 var(--display); letter-spacing: -.03em; text-shadow: 0 2px 18px rgba(0,0,0,.35); }
@media (min-width: 700px) { .hero h1 { padding: 5rem 28px 1.8rem; } }
@media (min-width: 1100px) { .mosaic { grid-template-columns: repeat(5, 1fr); } .mosaic .m5, .mosaic .m6 { display: block; } }
@media (max-width: 640px) { .mosaic { grid-template-columns: 1fr 1fr; grid-template-rows: 46vw 28vw 28vw; }
  .mosaic .m0 { grid-column: span 2; grid-row: span 1; } .mosaic .m5, .mosaic .m6 { display: none; } }

/* page titles, months */
.page-title { font: 600 clamp(2.1rem, 5vw, 3.4rem)/1.05 var(--display); letter-spacing: -.02em; margin: 2.2rem 0 1.2rem; }
.month { font: 600 1.35rem/1.2 var(--display); margin: 2.6rem 0 1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.meta { color: var(--muted); font-size: .92rem; letter-spacing: .01em; }
.journal { padding-bottom: 3rem; }

/* cards */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.card { display: flex; flex-direction: column; background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(40,30,20,.08), 0 12px 28px rgba(40,30,20,.12); }
.card-img { aspect-ratio: 4 / 3; background: var(--line); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-img img { transform: scale(1.03); }
.card-logo { display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.card-logo img.logo { width: 38%; height: auto; object-fit: contain; }
.card:hover .card-logo img { transform: rotate(-8deg); }
.card-body { padding: .8rem 1rem 1rem; display: flex; flex-direction: column; gap: .2rem; }
.card-title { font: 600 1.15rem/1.25 var(--display); }
.card .meta { font-size: .85rem; }

/* map */
:root { --sea: #dfe7e8; --land: #efe9de; --land-line: #cfc5b5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --sea: #1d2526; --land: #2b2722; --land-line: #3d372f; } }
:root[data-theme="dark"] { --sea: #1d2526; --land: #2b2722; --land-line: #3d372f; }
.map { height: 400px; border-radius: 12px; margin: 2rem 0 0; box-shadow: var(--shadow); background: var(--sea) !important; z-index: 0; }
.leaflet-tooltip { font: 500 .95rem var(--serif); }
.map-tall { height: min(62vh, 560px); margin-top: 0; }
@media (max-width: 600px) { .map, .map-tall { height: 280px; } }
.leaflet-container { font: inherit; }
.leaflet-popup-content a { font: 600 1rem var(--display); }
.pin { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.place-list { columns: 2 180px; padding: 0; list-style: none; margin: 1.6rem 0 3rem; }
.place-list li { padding: .25rem 0; break-inside: avoid; }
.place-list a { font: 600 1.1rem var(--display); }

/* post */
.post-head { padding-top: 2.4rem; }
.post-head h1 { font: 600 clamp(2.1rem, 5.5vw, 3.3rem)/1.08 var(--display); letter-spacing: -.02em; margin: .3rem 0 .6rem; }
.byline { font-style: italic; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1.2rem; }
.chip { font-size: .85rem; padding: .15rem .65rem; border: 1px solid var(--line); border-radius: 99px; text-decoration: none; color: var(--muted); background: var(--card); }
.chip:hover { color: var(--ink); border-color: var(--accent); }
.prose, .c-body { overflow-wrap: anywhere; }
.prose::after { content: ""; display: table; clear: both; }
.prose p { margin: 0 0 1.1em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose table { border-collapse: collapse; width: 100%; margin: 1.2em 0; font-size: .95rem; display: block; overflow-x: auto; }
.prose td, .prose th { border-bottom: 1px solid var(--line); padding: .4rem .6rem; vertical-align: top; text-align: left; }

/* photos inside posts */
.ph { display: block; margin: .4em 0 1.2em; }
.ph a { display: block; border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); cursor: zoom-in; background: var(--line); }
.ph img { width: 100%; }
@media (min-width: 760px) {
  .ph-left, .ph-right { width: 44%; }
  .ph-tall.ph-left, .ph-tall.ph-right { width: 34%; }
  .ph-left { clear: both; float: left; margin: .35em 1.6rem 1rem -9%; }
  .ph-right { clear: both; float: right; margin: .35em -9% 1rem 1.6rem; }
  .ph-center { margin: 1.4em -9%; }
  .ph-small.ph-left, .ph-small.ph-right { width: 34%; }
  .ph-small.ph-left { margin-left: 0; } .ph-small.ph-right { margin-right: 0; }
  .ph-small.ph-center { max-width: 60%; margin-left: auto; margin-right: auto; }
}
@media (max-width: 759px) { .ph-small { max-width: 70%; } }
.ph-row { display: grid; gap: 12px; margin: 1.2em 0 1.4em; clear: both; grid-template-columns: 1fr 1fr; align-items: start; }
.ph-row .ph { margin: 0; max-width: none; }
@media (min-width: 760px) { .ph-row { margin-left: -9%; margin-right: -9%; } .ph-row.n3 { grid-template-columns: repeat(3, 1fr); }
  .ph-row .ph-center { margin: 0; max-width: none; } }
.video { display: block; position: relative; aspect-ratio: 16 / 9; margin: 1.4em 0; border-radius: 8px; overflow: hidden; background: #000; clear: both; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* comments */
.comments { clear: both; border-top: 1px solid var(--line); margin-top: 2.5rem; padding-top: 1rem; }
.comments h2 { font: 600 1.35rem var(--display); }
.comments ol { list-style: none; padding: 0; margin: 0; }
.comments li { padding: .9rem 0; border-bottom: 1px solid var(--line); }
.comments .meta { margin: 0 0 .3rem; }
.comments strong { color: var(--ink); font-weight: 500; }
.c-body { font-size: 1.02rem; }
.c-body p { margin: 0 0 .6em; }

/* prev / next */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 2.5rem auto 3.5rem; clear: both; }
.pager a { display: block; padding: 1rem 1.1rem; background: var(--card); border-radius: 10px; box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none; font: 600 1rem/1.3 var(--display); }
.pager a span { color: var(--accent); }
.pager .next { text-align: right; }
.pager a:hover { box-shadow: 0 2px 4px rgba(40,30,20,.08), 0 10px 24px rgba(40,30,20,.12); }
@media (max-width: 520px) { .pager { grid-template-columns: 1fr; } .pager .next { text-align: left; } }

/* albums */
.masonry { columns: 3 260px; column-gap: 12px; margin: 1rem 0 3rem; }
.tile { display: block; margin: 0 0 12px; border-radius: 8px; overflow: hidden; break-inside: avoid; box-shadow: var(--shadow); cursor: zoom-in; background: var(--line); }
.tile img { width: 100%; transition: transform .4s ease; }
.tile:hover img { transform: scale(1.03); }

/* search */
.search input { width: 100%; font: inherit; font-size: 1.2rem; padding: .8rem 1rem; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); }
.results { display: grid; gap: 12px; margin: 1rem 0 3rem; }
.result { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: start; padding: .8rem; background: var(--card);
  border-radius: 10px; box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.result img, .result .ph0 { width: 96px; height: 72px; object-fit: cover; border-radius: 6px; background: var(--line); }
.result b { display: block; font: 600 1.1rem/1.25 var(--display); }
.result small { display: block; color: var(--muted); font-size: .92rem; margin-top: .2rem; }
.result mark { background: color-mix(in srgb, var(--accent) 25%, transparent); color: inherit; border-radius: 2px; }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 100; background: rgba(12, 10, 8, .94); display: none; align-items: center; justify-content: center;
  touch-action: pan-y; }
.lb.open { display: flex; }
.lb figure { margin: 0; max-width: 94vw; max-height: 90vh; display: flex; flex-direction: column; align-items: center; }
.lb img { max-width: 94vw; max-height: 82vh; width: auto; height: auto; border-radius: 4px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lb figcaption { color: #e9e2d6; font-size: 1rem; margin-top: .8rem; text-align: center; min-height: 1.4em; }
.lb button { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 99px; width: 48px; height: 48px;
  font-size: 1.5rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.lb button:hover { background: rgba(255,255,255,.25); }
.lb .x { top: 14px; right: 14px; }
.lb .p { left: 14px; top: 50%; transform: translateY(-50%); }
.lb .n { right: 14px; top: 50%; transform: translateY(-50%); }
.lb .count { position: absolute; top: 24px; left: 20px; color: #bfb6a8; font-size: .9rem; }
@media (max-width: 600px) { .lb .p, .lb .n { top: auto; bottom: 14px; transform: none; } }

.empty { text-align: center; padding: 5rem 0; }
.empty h1 { font: 600 5rem var(--display); margin: 0; }
.foot { border-top: 1px solid var(--line); padding: 2rem 0 2.6rem; margin-top: 2rem; }
.foot .brand { font-size: 1.05rem; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
