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

/* ------------- Body / Layout ------------- */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0b1120;
  color: #e5e7eb;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ------------- Header ------------- */
.site-header {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.site-header .logo {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-header .subtitle {
  font-size: 0.85rem;
  color: #9ca3af;
}

/* ------------- Main / Gallery ------------- */
main {
  flex: 1;
  padding: 1.25rem 1rem 1.75rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.gallery-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.status {
  font-size: 0.85rem;
  color: #9ca3af;
}

/* Grid: 1 col mobile, then 2/3/4 wider */
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

/* ------------- Cards / Thumbnails ------------- */
.card {
  position: relative;
  border-radius: 0.75rem;
  overflow: hidden;
  background: radial-gradient(circle at top, #1e293b, #020617);
  border: 1px solid rgba(148, 163, 184, 0.25);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.7);
  border-color: rgba(248, 250, 252, 0.4);
}

/* Thumbnails: keep these modest-size */
.card img {
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: cover;
  display: block;
}

/* Card footer with timestamp + badge */
.card-footer {
  padding: 0.55rem 0.75rem 0.7rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.card-footer .timestamp {
  font-size: 0.75rem;
  color: #9ca3af;
}

.badge {
  font-size: 0.7rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: #e5e7eb;
  white-space: nowrap;
}

/* ------------- Footer ------------- */
.site-footer {
  padding: 0.9rem 1rem 1.1rem;
  font-size: 0.8rem;
  color: #6b7280;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
}

/* ------------- Lightbox Overlay ------------- */

.hidden {
  display: none !important;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(4px);
}

/* The box that holds the big image */
.lightbox-content {
  position: relative;
  z-index: 1;
  width: 100vw;
  max-width: 900px;
  max-height: 100vh;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: #020617;
  border: 1px solid rgba(148, 163, 184, 0.5);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Big image itself – the JS also reinforces this via inline styles */
.lightbox-content img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 6rem);
  object-fit: contain;
  border-radius: 0.5rem;
}

/* Close button */
.lightbox-close {
  position: absolute;
  top: 0.3rem;
  right: 0.6rem;
  border: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem;
}

.lightbox-close:hover {
  opacity: 0.8;
}

/* Caption */
.lightbox-caption {
  font-size: 0.8rem;
  color: #9ca3af;
  text-align: center;
  margin-top: 0.15rem;
}

/* ------------- Responsive Breakpoints ------------- */

@media (min-width: 600px) {
  main {
    padding-inline: 1.5rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
  }

  .card img {
    max-height: 220px;
  }
}

@media (min-width: 900px) {
  .site-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
  }

  main {
    padding: 1.75rem 1.5rem 2rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }

  .card img {
    max-height: 240px;
  }
}

@media (min-width: 1200px) {
  .gallery-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Mobile lightbox: more edge-to-edge */
@media (max-width: 600px) {
  .lightbox-content {
    width: 100vw;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }

  .lightbox-content img {
    max-height: calc(100vh - 5rem);
  }
}
