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

/* NASA Brand Colors */
:root {
  --nasa-blue: #0b3d91;
  --nasa-red: #fc3d21;
  --nasa-dark: #212121;
  --nasa-light: #f4f9fb;
}

/* Base page styles */
body {
  font-family: 'Helvetica Neue', Arial, 'Liberation Sans', 'Nimbus Sans', sans-serif;
  background-color: var(--nasa-light);
  color: var(--nasa-dark);
  padding: 20px;
}

/* 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: 'Helvetica Neue', Arial, 'Liberation Sans', 'Nimbus Sans', sans-serif;
  font-weight: bold;
  color: var(--nasa-blue);
  letter-spacing: 2px;
  text-shadow: 1px 1px 0 var(--nasa-red), 2px 2px 0 #fff;
}

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

/* 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: 'Helvetica Neue', Arial, 'Liberation Sans', 'Nimbus Sans', sans-serif;
  font-weight: normal;
  color: var(--nasa-dark);
  padding: 10px 15px;
  border: 1px solid var(--nasa-blue);
  border-radius: 4px;
  font-size: 16px;
  line-height: 1.4;
  width: 100%;
  background: #fff;
}

/* Button specific */
button {
  background-color: var(--nasa-blue);
  color: #fff;
  border: 1px solid var(--nasa-red);
  font-weight: bold;
  letter-spacing: 1px;
  transition: background 0.2s, color 0.2s;
}
button:hover {
  background-color: var(--nasa-red);
  color: #fff;
}

/* 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: flex;
  flex-wrap: wrap;
  gap: 32px;
  padding: 32px;
  justify-content: center;
  border-radius: 18px;
  box-shadow: 0 6px 32px rgba(11,61,145,0.15);
  min-height: 350px;
}

/* Gallery items - NASA card style */
.gallery-item {
  flex: 1 1 100%;
  min-width: 300px;
  max-width: 370px;
  background: rgba(244,249,251,0.97);
  border: 2.5px solid var(--nasa-blue);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(11,61,145,0.13), 0 0 0 2px var(--nasa-red) inset;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: box-shadow 0.3s, transform 0.3s;
  position: relative;
  margin-bottom: 10px;
}

/* Add a subtle blue glow on hover */
.gallery-item:hover {
  box-shadow: 0 0 16px 4px var(--nasa-blue), 0 4px 24px rgba(11,61,145,0.13);
  transform: translateY(-6px) scale(1.03);
  border-color: var(--nasa-red);
}

/* Three columns on wider screens */
@media (min-width: 1000px) {
  .gallery-item {
    flex: 0 1 28%;
  }
}

.gallery-item img,
.gallery-item iframe {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 10px 10px 0 0;
  border-bottom: 2px solid var(--nasa-blue);
  background: #000;
  transition: transform 0.3s cubic-bezier(0.4, 0.2, 0.2, 1);
}

/* Scale up the image smoothly on hover */
.gallery-item:hover img {
  transform: scale(1.07);
}

/* Video embeds in gallery */
.gallery-item iframe {
  border-bottom: 2px solid var(--nasa-red);
}

/* Gallery item text */
.gallery-item p {
  margin: 8px 0 0 0;
  padding: 4px 12px;
  font-size: 15px;
  color: var(--nasa-dark);
  width: 100%;
  text-align: center;
  background: none;
}

.gallery-item p strong {
  color: var(--nasa-blue);
  font-size: 17px;
  letter-spacing: 1px;
}

.gallery-item .video-link {
  display: block;
  margin: 12px auto 0 auto;
  color: var(--nasa-red);
  font-weight: bold;
  text-decoration: underline;
  font-size: 16px;
}

/* Placeholder content */
.placeholder {
  flex: 1 1 100%;
  text-align: center;
  padding: 40px;
  color: var(--nasa-blue);
}

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

/* Modal styles */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow: auto;
  background: rgba(11, 61, 145, 0.92); /* NASA blue overlay */
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #f4f9fb;
  padding: 28px 24px 18px 24px;
  border-radius: 18px;
  max-width: 600px;
  width: 95%;
  box-shadow: 0 8px 32px rgba(11,61,145,0.25), 0 0 0 4px var(--nasa-red) inset;
  position: relative;
  text-align: center;
  border: 3px solid var(--nasa-blue);
  outline: 2px solid var(--nasa-red);
  outline-offset: -8px;
}

.modal-content img {
  width: 100%;
  max-height: 350px;
  object-fit: contain;
  border-radius: 10px;
  margin-bottom: 18px;
  border: 3px solid var(--nasa-red);
  background: #000;
  box-shadow: 0 0 16px 2px var(--nasa-blue);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 22px;
  font-size: 36px;
  color: var(--nasa-red);
  cursor: pointer;
  font-weight: bold;
  background: #fff;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  line-height: 36px;
  border: 2px solid var(--nasa-blue);
  box-shadow: 0 2px 8px rgba(11,61,145,0.10);
  transition: background 0.2s, color 0.2s;
}
.modal-close:hover {
  background: var(--nasa-red);
  color: #fff;
}

.modal-content h2 {
  margin: 12px 0 6px 0;
  font-size: 24px;
  color: var(--nasa-blue);
  letter-spacing: 1px;
  font-family: 'Helvetica Neue', Arial, 'Liberation Sans', 'Nimbus Sans', sans-serif;
  text-shadow: 1px 1px 0 #fff, 0 0 6px var(--nasa-blue);
}

.modal-content p {
  margin: 7px 0;
  font-size: 16px;
  color: var(--nasa-dark);
  background: none;
}

/* Did You Know? fact section */
.space-fact {
  background: #fff;
  border-left: 6px solid var(--nasa-red);
  border-radius: 6px;
  margin: 0 20px 20px 20px;
  padding: 16px 20px;
  font-size: 16px;
  color: var(--nasa-blue);
  box-shadow: 0 2px 6px rgba(11,61,145,0.07);
  font-style: italic;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
