:root {
  --bg: hsl(350 20% 7%);
  /* A wide, muted sunset glow from the top of the window. */
  --bg-gradient: radial-gradient(ellipse 140% 90% at top,
    hsl(30 46% 23.5%), hsl(8 32% 14%) 40%, hsl(350 20% 7%) 95%);
  --surface: #211a1a;
  --text: #eee;
  --muted: #999;
  --accent: #fff;
  --gap: 24px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg) var(--bg-gradient) fixed;
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: inherit; text-decoration: none; }

.site-header {
  padding: 16px 24px;
  border-bottom: 1px solid #2a2021;
}

.crumbs { color: var(--muted); font-size: 14px; }
.crumbs a:hover { color: var(--accent); }
.crumbs span:last-child { color: var(--text); }
.crumbs .sep { margin: 0 6px; color: #555; }

main { padding: 24px; max-width: 1600px; margin: 0 auto; }

h1 { font-weight: 600; font-size: 28px; margin: 0 0 24px; }
h1 small { font-weight: 400; font-size: 15px; color: var(--muted); margin-left: 8px; }

/* Event description from index.md */
.intro { margin-bottom: 32px; max-width: 75ch; }
.intro h1 { margin-bottom: 8px; }
.intro h2, .intro h3 { font-weight: 500; margin: 0 0 12px; }
.intro h2 { font-size: 20px; }
.intro h3 { font-size: 16px; color: var(--muted); }
.intro p { margin: 0 0 12px; }
.intro a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.intro a:hover { color: var(--muted); }

/* Event and album cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface);
  border-radius: 6px;
  overflow: hidden;
  transition: transform .15s;
}
.card:hover { transform: translateY(-2px); }

.card-img { aspect-ratio: 3 / 2; background: #000; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.card-text { padding: 12px 16px 14px; }
.card-text h2 { font-size: 17px; font-weight: 600; margin: 0; }
.card-text p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }

/* Thumbnail grid: justified rows built by justify.js. Without JS it
   falls back to fixed-height wrapping rows. */
.grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
}
.grid.justified { display: block; }

.row {
  display: flex;
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.tile {
  display: block;
  height: 200px;
  width: calc(200px * var(--ratio, 1));
  min-width: 0;
  background: var(--surface);
  overflow: hidden;
  border-radius: 3px;
}
.row .tile { height: 100%; width: auto; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .15s; }
.tile:hover img { opacity: .85; }
.tile.current { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Full-size viewer */
.viewer {
  position: fixed;
  inset: 0;
  background: var(--bg) var(--bg-gradient);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}
.viewer[hidden] { display: none; }

.viewer-img {
  max-width: 100%;
  max-height: calc(100% - 52px);
  object-fit: contain;
  user-select: none;
}

.viewer-btn, .viewer-close {
  background: none;
  border: 0;
  color: var(--text);
  cursor: pointer;
  opacity: .7;
}
.viewer-btn:hover, .viewer-close:hover { opacity: 1; }

.viewer-btn {
  position: absolute;
  top: 0;
  bottom: 52px;
  width: 15%;
  min-width: 60px;
  font-size: 64px;
}
.viewer-prev { left: 0; text-align: left; padding-left: 20px; }
.viewer-next { right: 0; text-align: right; padding-right: 20px; }
.viewer-btn:disabled { visibility: hidden; }

.viewer-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  font-size: 14px;
  color: var(--muted);
}
.viewer-counter { flex: 1; }
.viewer-original:hover { color: var(--accent); }
.viewer-close { font-size: 22px; }

body.viewing { overflow: hidden; }

@media (max-width: 600px) {
  main { padding: 16px; }
  .site-header { padding: 12px 16px; }
  .grid { --gap: 8px; }
  .viewer-btn { font-size: 40px; }
}
