:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --text: #27231f;
  --muted: #7a7168;
  --line: #e7e1d8;
  --accent: #b5452f;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171513;
    --surface: #211e1b;
    --text: #ebe6df;
    --muted: #a39a90;
    --line: #34302b;
    --accent: #e0826b;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 18px/1.65 var(--serif);
}
a { color: var(--accent); }
img { display: block; max-width: 100%; height: auto; }

.site-header, .site-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px;
  font-family: var(--sans);
}
.site-title {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .04em;
}
.site-title span { color: var(--muted); font-weight: 400; margin-left: .4em; }
.site-footer { color: var(--muted); font-size: 14px; padding-block: 48px; text-align: center; }

/* Home */
.hero { position: relative; max-width: 1100px; margin: 0 auto; }
.hero img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; border-radius: 6px; }
.hero-text {
  position: absolute; inset: auto 0 0 0;
  padding: 64px 28px 24px;
  color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
  border-radius: 0 0 6px 6px;
}
.hero h1 { margin: 0; font-size: clamp(40px, 8vw, 72px); line-height: 1; font-weight: 400; }
.hero p { margin: 8px 0 0; font: 15px var(--sans); opacity: .9; }
@media (max-width: 600px) {
  .hero { margin: 0 16px; }
  .hero img { aspect-ratio: 4 / 3; }
}

.trip { max-width: 1100px; margin: 0 auto; padding: 32px 16px; }
.trip > h2 { font-weight: 400; }
.cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 28px 24px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.card { display: block; color: inherit; text-decoration: none; }
.card-img { overflow: hidden; border-radius: 6px; background: var(--line); }
.card-img img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-img img { transform: scale(1.03); }
.card-body { padding-top: 12px; }
.card time, .count, .entry-header time {
  font: 13px var(--sans); color: var(--muted); letter-spacing: .03em; text-transform: uppercase;
}
.card h3 { margin: 2px 0 6px; font-size: 22px; font-weight: 400; line-height: 1.25; }
.card:hover h3 { color: var(--accent); }
.card p { margin: 0 0 6px; color: var(--muted); font-size: 16px; line-height: 1.5; }

/* Post */
.entry { padding: 24px 16px 0; }
.entry > *, article > * { max-width: 680px; margin-left: auto; margin-right: auto; }
.entry-header { margin-bottom: 28px; }
.entry h1 { font-size: clamp(32px, 6vw, 48px); font-weight: 400; line-height: 1.15; margin: 4px 0 0; }
.entry h2 { font-weight: 400; }

article > .photos { max-width: 1100px; margin-block: 28px; }
.photos { display: flex; flex-wrap: wrap; gap: 6px; }
.photos::after { content: ""; flex: 10 1 0; } /* keeps the last row from stretching */
.photo {
  flex: var(--r) 1 calc(var(--r) * 200px);
  display: block;
  overflow: hidden;
  border-radius: 3px;
  background: var(--line);
  cursor: zoom-in;
}
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photos.single::after { display: none; }
.photos.single .photo { flex: 0 1 auto; margin: 0 auto; max-width: calc(var(--r) * 80vh); }
@media (max-width: 600px) {
  .photo { flex-basis: calc(var(--r) * 120px); }
}

.post-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line);
}
.post-nav a { text-decoration: none; color: var(--text); }
.post-nav a:hover { color: var(--accent); }
.post-nav small { display: block; font: 13px var(--sans); color: var(--muted); }
.post-nav .next { text-align: right; }

.guestbook { margin-top: 56px; }
.guestbook h2 { font-size: 22px; }
.guestbook ol { list-style: none; padding: 0; margin: 0; }
.comment {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 16px; margin-bottom: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  font-size: 16px;
}
.comment.reply { margin-left: 32px; }
.comment p { margin: 4px 0 0; }
.comment-meta { font: 13px var(--sans); color: var(--muted); }
.comment-meta strong { color: var(--text); }
.comment-photo { flex: 0 0 96px; }
.comment-photo img { width: 96px; height: 96px; object-fit: cover; }

/* Lightbox */
.lightbox {
  border: 0; padding: 0; margin: 0;
  width: 100vw; height: 100vh; max-width: none; max-height: none;
  background: rgba(10, 9, 8, .94);
  color: #fff;
}
.lightbox::backdrop { background: transparent; }
.lightbox img {
  position: absolute; inset: 0; margin: auto;
  max-width: calc(100vw - 32px); max-height: calc(100vh - 32px);
  width: auto; height: auto; object-fit: contain;
}
.lightbox button {
  position: absolute; border: 0; background: none; color: #fff;
  font: 32px/1 var(--sans); padding: 16px; cursor: pointer; opacity: .75;
}
.lightbox button:hover { opacity: 1; }
.lightbox .close { top: 0; right: 0; }
.lightbox .prev { left: 0; top: 50%; transform: translateY(-50%); }
.lightbox .next { right: 0; top: 50%; transform: translateY(-50%); }
.lightbox .counter { position: absolute; bottom: 12px; width: 100%; text-align: center; font: 13px var(--sans); opacity: .7; }
