/* ----- Base ------------------------------------------------------------ */
:root {
  --bg: #0e1117;
  --text: #f8f9fa;
  --muted: #aab4bf;
  --tile-bg: #151a22;
  --tile-ring: #1d2230;
  --thumb-w: 240px;
  --thumb-h: 240px;
}

@media (max-width: 1100px) { :root { --thumb-w: 200px; --thumb-h: 200px; } }
@media (max-width: 800px)  { :root { --thumb-w: 180px; --thumb-h: 180px; } }
@media (max-width: 560px)  { :root { --thumb-w: 160px; --thumb-h: 160px; } }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

/* ----- Header ---------------------------------------------------------- */
header {
  padding: 16px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
}

/* ----- Year layout ----------------------------------------------------- */
.year-section { margin: 16px 14px 28px; }

.year {
  margin: 0 4px 10px;
  font: 700 18px/1.2 system-ui;
  color: #e2e8f0;
  letter-spacing: .3px;
  /* Uncomment to make year headers stick while scrolling
  position: sticky; top: 0; z-index: 2;
  backdrop-filter: blur(3px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  padding: 8px 4px 10px;
  */
}

/* Row of tiles that wraps on wider screens */
.year-row {
  display: flex;
  flex-flow: row wrap;
  gap: 12px;
  align-items: flex-start;
}

/* ----- Photo cards ----------------------------------------------------- */
.card {
  width: var(--thumb-w);
  max-width: var(--thumb-w);
  border: 1px solid var(--tile-ring);
  border-radius: 12px;
  overflow: hidden;
  background: var(--tile-bg);
  transition: transform .06s ease, box-shadow .06s ease, border-color .06s ease;
}
.card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
  border-color: color-mix(in srgb, var(--tile-ring) 60%, #2a3347 40%);
}

.thumb {
  width: 100%;
  height: var(--thumb-h);
  display: block;
  object-fit: cover;
}

.caption {
  padding: 8px 10px;
  font: 12px/1.4 system-ui;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ----- Lightbox -------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(0,0,0,.9);
  z-index: 9999;
}
.lightbox.active { display: grid; }

.lb-figure { margin: 0; max-width: 92vw; max-height: 88vh; }
#lb-img { max-width: 92vw; max-height: 80vh; object-fit: contain; border-radius: 16px; }
#lb-caption { text-align: center; color: #ccc; margin-top: 8px; font-size: 13px; }

#lb-close {
  position: absolute; top: 20px; right: 24px;
  padding: 4px 10px; border-radius: 10px;
  border: 1px solid #444; background: #111; color: #eee; cursor: pointer;
}

/* ----- Defensive: kill any legacy grid class if it sneaks in ----------- */
.grid { all: unset; }
