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

:root {
  --color-bg: #0f1117;
  --color-surface: #1a1d27;
  --color-border: #2a2d3a;
  --color-text: #e4e4e7;
  --color-text-muted: #a1a1aa;
  --color-primary: #6366f1;
  --color-primary-light: #818cf8;
  --color-accent: #22d3ee;
  --radius: 8px;
  --max-width: 800px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1rem;
}

a {
  color: var(--color-primary-light);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Band Page */
.band-header {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}

/* Band Banner (#286): full-width 3:1 masthead above the band header; the SPA
   uploader enforces the 3:1 crop. Gradient scrim adds depth without affecting
   text legibility (the header renders below the banner, not over it). */
.band-banner {
  width: 100%;
  aspect-ratio: 3 / 1;
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.band-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 17, 23, 0.55), transparent 40%);
  pointer-events: none;
}

.band-image {
  width: 120px;
  height: 120px;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
}

.band-info h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.genre-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
  background: rgba(99, 102, 241, 0.15);
  color: var(--color-primary-light);
}

.description {
  color: var(--color-text-muted);
  max-width: 60ch;
}

/* Social links (#248) — icon row under the band header */
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  list-style: none;
  padding: 0;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  background: var(--color-surface);
  transition: color 150ms ease, border-color 150ms ease;
}

.social-link:hover {
  color: var(--color-primary-light);
  border-color: var(--color-primary-light);
  text-decoration: none;
}

.social-link svg {
  width: 1.25rem;
  height: 1.25rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Sections */
.section {
  margin-bottom: 2rem;
}

.section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

/* Members */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.member-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.member-card strong {
  font-size: 0.95rem;
}

.instruments {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Gigs */
.gigs-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gig-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.gig-image {
  display: block;
  width: 100%;
  height: auto;
}

.gig-card-body {
  padding: 1rem;
}

.gig-card-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.gig-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.gig-description {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* Error Page */
.error-page {
  text-align: center;
  padding-top: 4rem;
}

.error-page h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.error-page p {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius);
  background: var(--color-primary);
  color: white;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s;
}

.btn:hover {
  background: var(--color-primary-light);
  text-decoration: none;
}

/* Photo gallery — server-computed masonry (feature 068) */
.gallery-header {
  margin-bottom: 1rem;
}

.gallery-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

/* Album switcher */
.album-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.album-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem 0.375rem 0.375rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  color: var(--color-text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.album-chip:hover {
  border-color: var(--color-primary);
}

.album-chip.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--color-primary);
  color: var(--color-primary-light);
}

.album-chip-thumb {
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  object-fit: cover;
  flex-shrink: 0;
}

.album-chip-name {
  font-weight: 500;
  max-width: 16ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-chip-count {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.album-chip.active .album-chip-count {
  color: var(--color-primary-light);
}

/* Album switch transition (US4); only meaningful when .js-reveal is active. */
.masonry-grid {
  transition: opacity 0.15s ease;
}

.masonry-grid.is-switching {
  opacity: 0;
}

/* Entrance + scroll-reveal animation (feature 068).
   .js-reveal is added to <html> synchronously in <head> (before first paint) when the user
   allows motion, so these sections start hidden with no flash. The deferred reveal.js then
   adds .is-visible to trigger the transition. Without JS or under reduced motion the
   .js-reveal class is never present, so content is simply visible (no animation).
   Only opacity/transform animate => no layout shift. */
@media (prefers-reduced-motion: no-preference) {
  .js-reveal .band-header,
  .js-reveal .band-page .section,
  .js-reveal .site-footer {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.45s ease, transform 0.45s ease;
    will-change: opacity, transform;
  }

  .js-reveal .band-header.is-visible,
  .js-reveal .band-page .section.is-visible,
  .js-reveal .site-footer.is-visible {
    opacity: 1;
    transform: none;
  }
}

.masonry-grid {
  --masonry-row: 10px;
  --masonry-gap: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  grid-auto-rows: var(--masonry-row);
  grid-auto-flow: row dense;
  gap: var(--masonry-gap);
}

.masonry-item {
  display: block;
  grid-row: span var(--span, 22);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  transition: transform 0.2s, box-shadow 0.2s;
}

.masonry-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  text-decoration: none;
}

.masonry-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Responsive */
@media (max-width: 600px) {
  .band-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .band-info h1 {
    font-size: 1.5rem;
  }

  .genres {
    justify-content: center;
  }

  .members-grid {
    grid-template-columns: 1fr;
  }
}
