:root {
  --ink: #1a2228;
  --muted: #5a656c;
  --accent: #1f6f78;
  --accent-hover: #18565d;
  --bg: #e9ece8;
  --surface: #f6f7f4;
  --border: #cfd5cf;
  --tile-empty: #d5dbd6;
  --max-read: 42rem;
  --max-wide: 68rem;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --shadow-soft: 0 12px 40px rgba(26, 34, 40, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 10% -20%, rgba(31, 111, 120, 0.07), transparent 55%),
    radial-gradient(ellipse 90% 60% at 100% 0%, rgba(26, 34, 40, 0.05), transparent 50%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
  line-height: 1.65;
  font-size: 1.05rem;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--accent-hover); text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(246, 247, 244, 0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.site-title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  font-weight: 650;
  font-optical-sizing: auto;
  color: var(--ink);
  line-height: 1.2;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.site-title:hover {
  color: var(--accent);
  text-decoration: none;
}
.site-tagline {
  color: var(--muted);
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  font-style: italic;
  font-weight: 400;
}
.site-nav ul {
  display: flex;
  gap: 0.25rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  padding-bottom: 0.15rem;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover,
.site-nav a.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

/* Main */
.site-main {
  max-width: var(--max-read);
  margin: 0 auto;
  padding: 2.75rem 1.5rem 4rem;
}
.site-main--wide {
  max-width: var(--max-wide);
}

/* Home intro */
.home-intro {
  margin: 0 0 2.25rem;
  max-width: 36rem;
}
.home-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.55;
}

/* Post grid */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem 1.25rem;
}
.post-tile {
  animation: tile-in 0.55s ease both;
}
.post-tile:nth-child(1) { animation-delay: 0.02s; }
.post-tile:nth-child(2) { animation-delay: 0.06s; }
.post-tile:nth-child(3) { animation-delay: 0.1s; }
.post-tile:nth-child(4) { animation-delay: 0.14s; }
.post-tile:nth-child(5) { animation-delay: 0.18s; }
.post-tile:nth-child(6) { animation-delay: 0.22s; }
.post-tile:nth-child(n+7) { animation-delay: 0.26s; }

@keyframes tile-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.post-tile-link {
  display: block;
  color: inherit;
  text-decoration: none;
  height: 100%;
}
.post-tile-link:hover { text-decoration: none; color: inherit; }
.post-tile-image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.post-tile-image--empty {
  background: linear-gradient(145deg, var(--tile-empty), #bcc4be);
}
.post-tile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}
.post-tile-link:hover .post-tile-image img {
  transform: scale(1.04);
}
.post-tile-body {
  padding: 0.85rem 0.1rem 0;
}
.post-tile-body h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 650;
  margin: 0 0 0.25rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.post-tile-link:hover .post-tile-body h2 {
  color: var(--accent);
}
.post-tile-body time {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
  font-weight: 500;
}
.pagination a { color: var(--ink); text-decoration: none; }
.pagination a:hover { color: var(--accent); }
.pagination .is-disabled { color: var(--border); }
.pagination-status { color: var(--muted); font-variant-numeric: tabular-nums; }

/* Page headers */
.page-header {
  margin-bottom: 2rem;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 650;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.page-eyebrow {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-style: italic;
}
.page-intro {
  margin-top: 0.75rem;
  color: var(--muted);
}
.page-intro p { margin: 0; }

/* About */
.about-page .page-content {
  margin-top: 0.5rem;
}
.about-hero {
  margin: 0 0 2rem;
}
.about-hero img {
  width: 100%;
  display: block;
  box-shadow: var(--shadow-soft);
}
.page-content h2 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 650;
  margin: 0 0 1rem;
  letter-spacing: -0.015em;
  line-height: 1.25;
}
.page-content p {
  margin: 1.1rem 0;
  color: var(--ink);
}

/* Single post */
.post-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.5vw, 2.5rem);
  font-weight: 650;
  margin: 0 0 0.4rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.post-header time {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}
.post-cover {
  margin: 1.75rem 0 0;
}
.post-cover img {
  width: 100%;
  display: block;
  box-shadow: var(--shadow-soft);
}
.post-content {
  margin-top: 2rem;
}
.post-content p { margin: 1.2rem 0; }
.post-content img {
  max-width: 100%;
  display: block;
  margin: 1rem auto;
}
.post-content figure.wp-caption {
  margin: 1.75rem auto;
  max-width: 100%;
  text-align: center;
}
.post-content figure.wp-caption img { margin: 0 auto; }
.post-content figure.wp-caption figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.post-nav a {
  color: var(--ink);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.post-nav a:hover { color: var(--accent); }
.post-nav .next { text-align: right; grid-column: 2; }
.post-nav .prev { grid-column: 1; }
.post-nav-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}
.post-nav-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.3;
}

/* Archive */
.archive-year {
  margin: 2.5rem 0;
  scroll-margin-top: 5rem;
}
.archive-year h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 650;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.archive-list li {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(207, 213, 207, 0.55);
}
.archive-list time {
  color: var(--muted);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}
.archive-list a {
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}
.archive-list a:hover { color: var(--accent); }

/* Photo gallery */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
  margin: 1.5rem 0;
}
.photo-gallery-item {
  position: relative;
  border: none;
  padding: 0;
  margin: 0;
  cursor: zoom-in;
  background: none;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.photo-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}
.photo-gallery-item:hover img { transform: scale(1.05); }

/* Cue that this thumb has a caption (opens in lightbox) */
.photo-gallery-caption-cue {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 18px;
  height: 14px;
  border-radius: 2px;
  background: rgba(26, 34, 40, 0.72);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  z-index: 1;
}
.photo-gallery-caption-cue::before,
.photo-gallery-caption-cue::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  height: 1.5px;
  background: #f6f7f4;
  border-radius: 1px;
}
.photo-gallery-caption-cue::before { top: 4px; }
.photo-gallery-caption-cue::after { top: 8px; width: 60%; right: auto; }

.photo-gallery-caption-preview {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.4rem 0.4rem 0.35rem;
  background: linear-gradient(transparent, rgba(16, 20, 22, 0.88));
  color: #f4f5f3;
  font-size: 0.68rem;
  line-height: 1.3;
  text-align: left;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  z-index: 1;
}
.photo-gallery-item.has-caption:hover .photo-gallery-caption-preview,
.photo-gallery-item.has-caption:focus-visible .photo-gallery-caption-preview {
  opacity: 1;
  transform: translateY(0);
}
.photo-gallery-item.has-caption:hover .photo-gallery-caption-cue,
.photo-gallery-item.has-caption:focus-visible .photo-gallery-caption-cue {
  opacity: 0;
}

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 16, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.lightbox-overlay.open { display: flex; }
.lightbox-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 90vh;
}
.lightbox-image {
  max-width: 90vw;
  max-height: 78vh;
  object-fit: contain;
}
.lightbox-caption {
  margin: 0.85rem 0 0;
  max-width: min(40rem, 90vw);
  color: #d7d7d7;
  font-size: 0.95rem;
  line-height: 1.45;
  text-align: center;
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.2rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  line-height: 1;
  opacity: 0.8;
  font-family: var(--font-body);
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { opacity: 1; }
.lightbox-close { top: 1rem; right: 1rem; font-size: 2rem; }
.lightbox-prev { left: 0.5rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 0.5rem; top: 50%; transform: translateY(-50%); }
.lightbox-counter {
  position: absolute;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  color: #ccc;
  font-size: 0.85rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(246, 247, 244, 0.7);
  margin-top: auto;
}
.site-footer-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 2.25rem 1.5rem 2.75rem;
  text-align: center;
}
.footer-brand {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  margin: 0 0 1rem;
  color: var(--ink);
}
.footer-years {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.25rem;
}
.footer-years a {
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
}
.footer-years a:hover { color: var(--accent); }
.footer-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .site-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .post-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .post-nav {
    grid-template-columns: 1fr;
  }
  .post-nav .next,
  .post-nav .prev {
    grid-column: 1;
    text-align: left;
  }
  .photo-gallery {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
  .lightbox-prev,
  .lightbox-next {
    font-size: 1.8rem;
    padding: 0.4rem 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .post-tile { animation: none; }
  .post-tile-image img { transition: none; }
  html { scroll-behavior: auto; }
}
