/* 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;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
}

/* Location dropdown */
.location-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.location-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font: inherit;
  font-weight: 600;
  color: #e5e7eb;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 999px;
  padding: 0.22rem 2rem 0.22rem 0.75rem;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.location-select:hover {
  border-color: rgba(248, 250, 252, 0.4);
}

.location-select:focus {
  outline: none;
  border-color: rgba(248, 250, 252, 0.55);
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.2);
}

.location-picker::after {
  content: "";
  position: absolute;
  right: 0.7rem;
  width: 14px;
  height: 14px;
  pointer-events: none;
  opacity: 0.9;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e5e7eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

.location-select option {
  color: #0b1120;
}

/* Main */
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;
}

/* Uniform grid */
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

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

@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));
  }
}

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

/* Uniform cards */
.card {
  border-radius: 0.75rem;
  overflow: hidden;
  background: radial-gradient(circle at top, #1e293b, #020617);
  border: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  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);
}

/* This is what makes the grid uniform */
.card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

@media (min-width: 900px) {
  .card img {
    height: 240px;
  }
}

.card-footer {
  padding: 0.55rem 0.75rem 0.7rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  min-width: 0;
}

.card-footer .timestamp {
  font-size: 0.75rem;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.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;
  flex: 0 0 auto;
}

/* 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 */
.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);
}

.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;
}

.lightbox-content img {
  width: 100%;
  height: auto;
  max-height: calc(100vh - 6rem);
  object-fit: contain;
  border-radius: 0.5rem;
}

.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-caption {
  font-size: 0.8rem;
  color: #9ca3af;
  text-align: center;
  margin-top: 0.15rem;
}

.no-scroll {
  overflow: hidden;
}

@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);
  }
}