/* Global reset & box sizing */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Base page styles */
body {
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top, rgba(1, 33, 105, 0.8), rgba(10, 16, 34, 0.98) 55%),
    linear-gradient(180deg, #0b1020 0%, #050814 100%);
  color: #f4f7fb;
  padding: 20px;
  min-height: 100vh;
}

/* Centered container */
.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 20px;
  padding-bottom: 20px;
  margin-bottom: 20px;
}

h1 {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
  color: #f4f7fb;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Logo */
.logo {
  width: 140px;
  margin-right: 15px;
}

.space-fact {
  background: linear-gradient(135deg, rgba(2, 30, 84, 0.95), rgba(19, 36, 76, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 4px solid #fc3d21;
  color: #f4f7fb;
  border-radius: 12px;
  padding: 16px 18px;
  margin: 0 20px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.space-fact p {
  line-height: 1.6;
  font-size: 1rem;
}

/* Date‐picker & button row */
.filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
  padding: 0 20px;
}

/* Inputs and buttons */
input[type="date"],
button {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 600;
  color: #f4f7fb;
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  font-size: 16px;
  line-height: 1.4;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.08);
}

/* Button specific */
button {
  background: linear-gradient(135deg, #fc3d21, #ff6b4a);
  color: white;
  cursor: pointer;
}
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(252, 61, 33, 0.25);
}

/* Stack horizontally on wider screens */
@media (min-width: 600px) {
  .filters {
    flex-direction: row;
    padding: 0;
  }
  
  input[type="date"],
  button {
    width: auto;
  }
}

/* Gallery flex container */
.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 20px;
  justify-content: center;
}

/* Gallery items */
.gallery-item {
  min-width: 280px;
  background: rgba(255, 255, 255, 0.96);
  color: #0b1020;
  padding: 12px;
  border-radius: 14px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

/* Three columns on wider screens */
@media (min-width: 1000px) {
  .gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gallery-item {
    min-width: 0;
  }
}

.gallery-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 42px rgba(0, 0, 0, 0.3);
}

.gallery-media {
  overflow: hidden;
  border-radius: 10px;
  background: #06131f;
}

.gallery-item img,
.modal-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  transition: transform 0.35s ease;
}

.gallery-item:hover img {
  transform: scale(1.06);
}

.gallery-video,
.modal-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #06131f;
}

.gallery-video iframe,
.modal-video iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.video-preview {
  height: 100%;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #ffffff;
  background: linear-gradient(135deg, #0b1020, #1f3c88);
}

.video-preview-badge {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(252, 61, 33, 0.95);
  font-size: 22px;
}

.video-link {
  color: #fc3d21;
  font-weight: 700;
  text-decoration: none;
}

.gallery-item h2 {
  margin-top: 14px;
  font-size: 1.05rem;
  line-height: 1.4;
}

.gallery-item p {
  margin-top: 10px;
  padding: 0;
  font-size: 14px;
  line-height: 1.5;
}

.gallery-date,
.gallery-media-label {
  color: #4a5568;
}

/* Placeholder content */
.placeholder {
  flex: 1 1 100%;
  text-align: center;
  padding: 40px;
  color: #c8d2e0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 14px;
}

.placeholder-icon {
  font-size: 48px;
  margin-bottom: 20px;
}

.loading-state {
  animation: pulse 1.4s ease-in-out infinite;
}

.gallery-item:focus {
  outline: 3px solid #fc3d21;
  outline-offset: 3px;
}

.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 20, 0.78);
  backdrop-filter: blur(8px);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 960px);
  max-height: 90vh;
  overflow: auto;
  margin: 5vh auto;
  background: #ffffff;
  color: #101828;
  border-radius: 18px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
  padding: 18px;
}

.modal-close {
  position: sticky;
  top: 0;
  margin-left: auto;
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: #0b1020;
  color: #ffffff;
  font-size: 28px;
  line-height: 1;
}

.modal-media {
  margin-top: 12px;
  border-radius: 12px;
  overflow: hidden;
  background: #06131f;
}

.modal-image {
  height: auto;
  max-height: 60vh;
}

.modal-content {
  padding: 18px 4px 8px;
}

.modal-content h2 {
  margin-bottom: 10px;
  font-size: 1.6rem;
}

.modal-date {
  margin-bottom: 12px;
  color: #fc3d21;
  font-weight: 700;
}

body.modal-open {
  overflow: hidden;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.82;
  }

  50% {
    opacity: 1;
  }
}
