:root {
  --green-dark: #1b4d3e;
  --green: #2e7d5b;
  --gold: #d9a441;
  --bg: #f6f4ee;
  --ink: #222;
  --muted: #888;
  --card: #fff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.site-head {
  background: linear-gradient(160deg, var(--green-dark), var(--green));
  color: #fff;
  text-align: center;
  padding: 3rem 1rem 2rem;
}
.site-head h1 { margin: 0; font-size: 2rem; letter-spacing: 0.02em; }
.tagline { color: #cfd9d2; margin: 0.4rem 0 0; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  padding: 1rem 1rem 0.25rem;
  position: sticky;
  top: 0;
  background: rgba(246, 244, 238, 0.95);
  z-index: 10;
}
.chip {
  border: 1px solid #ccc;
  background: var(--card);
  color: var(--ink);
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  cursor: pointer;
}
.chip.active { background: var(--green); border-color: var(--green); color: #fff; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  padding: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.cell {
  position: relative;
  border: 0;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #ddd;
  cursor: zoom-in;
  display: block;
  font-family: inherit;
}
.cell img, .cell video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #ddd;
}
.play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  pointer-events: none;
  padding-left: 4px;
}
.cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  color: #fff;
  font-size: 0.8rem;
  padding: 1rem 0.5rem 0.4rem;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty { text-align: center; color: var(--muted); padding: 3rem; }

footer {
  text-align: center;
  color: var(--muted);
  padding: 1.5rem 1rem;
  border-top: 1px solid #ddd;
  background: var(--card);
  font-size: 0.9rem;
}
footer a { color: var(--green); text-decoration: none; }

.lb {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.93);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
}
.lb-body { max-width: min(1100px, 100%); max-height: 100%; text-align: center; }
.lb-body img, .lb-body video { max-width: 100%; max-height: 76vh; border-radius: 6px; }
.lb-meta { color: #ddd; margin-top: 0.7rem; font-size: 0.95rem; }

.lb-close {
  position: fixed;
  top: 10px;
  right: 16px;
  background: none;
  border: 0;
  color: #fff;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  z-index: 51;
}
.lb-prev, .lb-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 0;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  z-index: 51;
}
.lb-prev { left: 12px; }
.lb-next { right: 12px; }

@media (max-width: 720px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .lb-prev, .lb-next { width: 44px; height: 44px; font-size: 1.4rem; }
  .lb-prev { left: 6px; }
  .lb-next { right: 6px; }
}
