:root {
  --text: #2c2c2c;
  --bg: #fefefe;
  --accent: #555;
  --light: #999;
  --max-width: 52rem;
  --wall-gap: 4px;
  --wall-thumb-min: 180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  padding: 2rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* --- Navigation --- */
header nav {
  margin-bottom: 3rem;
}

header nav a {
  margin-right: 1.5rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
}

header nav a:hover {
  text-decoration: underline;
}

/* --- Typography --- */
h1 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

h2 {
  font-size: 1.1rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

h3 {
  font-size: 1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

p { margin-bottom: 0.8rem; }

.subtitle {
  color: var(--light);
  font-size: 0.9rem;
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
}

/* --- Links --- */
a { color: var(--accent); }
a:hover { color: var(--text); }

/* --- Lists --- */
ul, ol { padding-left: 1.5rem; }
li { margin-bottom: 0.3rem; }

.post-list { list-style: none; padding-left: 0; }
.post-list li { margin-bottom: 0.5rem; }

/* === PHOTO WALL === */
.photo-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--wall-thumb-min), 1fr));
  gap: var(--wall-gap);
}

.photo-wall a {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f0f0f0;
  cursor: pointer;
}

.photo-wall a img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.photo-wall a:hover img {
  transform: scale(1.05);
}

/* Year dividers in photo index */
.year-divider {
  font-size: 0.85rem;
  color: var(--light);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.05em;
}

section:first-of-type .year-divider {
  margin-top: 0;
}

/* === GALLERY CARDS === */
.gallery-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.gallery-card {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 3px;
  text-decoration: none;
  background: #f0f0f0;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.gallery-card:hover img {
  transform: scale(1.05);
}

.gallery-card .card-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 1rem 0.8rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
}

/* === GALLERY PAGE (individual) === */
.gallery-lightbox {
  margin-top: 1.5rem;
}

/* === TAGS === */
.tags-section {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
}

.tags a {
  color: var(--light);
  text-decoration: none;
  font-size: 0.85rem;
}

.tags a:hover {
  color: var(--text);
  text-decoration: underline;
}

.tags-bottom {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
  font-size: 0.85rem;
}

.tags-bottom a {
  color: var(--light);
  text-decoration: none;
}

.tags-bottom a:hover {
  color: var(--text);
}

/* === RECIPE === */
.recipe-hero {
  margin: 1.5rem 0;
}

.recipe-hero img {
  width: 100%;
  height: auto;
  display: block;
}

/* === BACK LINK === */
.back-link {
  margin-top: 2.5rem;
  font-size: 0.85rem;
}

.back-link a {
  color: var(--light);
  text-decoration: none;
}

.back-link a:hover {
  color: var(--text);
}

/* === POST IMAGES === */
.post-images figure {
  margin: 1.5rem 0;
}

.post-images img {
  width: 100%;
  height: auto;
  display: block;
}

figcaption {
  font-size: 0.8rem;
  color: var(--light);
  margin-top: 0.3rem;
}

/* === FOOTER === */
footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
  font-size: 0.8rem;
  color: var(--light);
}

/* === ARTICLE === */
article { margin-top: 0.5rem; }
article h2 { margin-top: 2rem; }
article ul, article ol { margin-bottom: 1rem; }

/* === PHOTOSWIPE OVERRIDES === */
.pswp__bg {
  background: rgba(0, 0, 0, 0.95) !important;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
  :root {
    --wall-thumb-min: 120px;
    --wall-gap: 3px;
  }

  .gallery-cards {
    grid-template-columns: 1fr;
  }

  body {
    padding: 1rem;
  }

  header nav a {
    margin-right: 1rem;
    font-size: 0.9rem;
  }
}