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

/* Base page styles */
body {
  /* Primary: Helvetica. Fallback: Garamond, then generic serif. */
  font-family: Helvetica, Garamond, serif;
  /* night-sky gradient for a NASA-like look + star canvas on top */
  background: radial-gradient(ellipse at bottom, #081226 0%, #000814 60%, #000000 100%);
  color: #fff;
  padding: 20px;
}

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

/* ensure content sits above the starfield canvas */
.container {
  position: relative;
  z-index: 1;
}

/* When the page is in its initial state (no gallery yet),
   center all main content vertically and horizontally. */
.container.centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 40px); /* account for body padding */
  text-align: center;
}

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

h1 {
  /* Keep heading styling but use the page font stack */
  font-family: Helvetica, Garamond, serif;
  font-weight: bold;
  color: #ffffff; /* header text should be white */
}

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

/* Make placeholder logo image smaller and responsive */
.placeholder-icon img {
  max-width: 140px;
  width: 100%;
  height: auto;
  display: inline-block;
}

/* 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 {
  /* match the page font stack for form controls */
  font-family: Helvetica, Garamond, serif;
  font-weight: normal;
  color: #666;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  line-height: 1.4;
  width: 100%;
}

/* Button specific */
button {
  background-color: #dd361c; /* primary action color */
  color: #ffffff;
  cursor: pointer;
  border-color: rgba(0,0,0,0.08);
}
button:hover {
  background-color: #c32f16;
}

/* 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: 20px;
  padding: 20px;
  justify-content: center;
}

/* Gallery items */
.gallery-item {
  flex: 1 1 100%;  /* full width by default */
  min-width: 280px;
  max-width: 500px;
  background: #e4e2e0;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: #000;
}

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

.gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
}

/* Hover/interactive effect: smooth scale + subtle lift */
.gallery-item {
  position: relative;
  transition: transform 280ms ease, box-shadow 280ms ease;
}

.gallery-item img {
  transition: transform 280ms ease;
  will-change: transform;
}

.gallery-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.14);
}

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

/* Video badge centered over thumbnails */
.video-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  pointer-events: none; /* allow clicks to pass through to card */
}

.video-badge::after {
  content: '';
  display: inline-block;
  margin-left: 4px;
  width: 0;
  height: 0;
  border-left: 14px solid #fff;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
}

.gallery-item p {
  margin-top: 10px;
  padding: 5px;
  font-size: 14px;
}

.gallery-item h3 {
  color: #000;
}

.gallery-item p {
  color: #000;
}

/* Placeholder content */
.placeholder {
  flex: 1 1 100%;
  text-align: center;
  padding: 40px;
  color: #666;
}

/* Make the placeholder paragraph text black for better contrast */
.placeholder p {
  color: #fff;
  font-weight: bold;
}

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

/* Did You Know section: center the fact text when visible
   Stack the heading above the fact (column layout) and add a small gap */
#did-you-know {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 20px;
  margin: 20px auto;
  width: 100%;
}


/* Modal styles */
.modal-overlay {
  position: fixed;
  inset: 0; /* top:0; right:0; bottom:0; left:0 */
  background: rgba(0,0,0,0.6);
  display: none; /* toggled via JS */
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

/* Full-screen canvas used for the animated starfield */
#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0; /* sit behind content */
  pointer-events: none; /* not interactive */
  display: block;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  width: 100%;
  max-width: 900px;
  background: #e4e2e0;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  overflow: auto;
  color: #000; /* ensure modal text is black */
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  color: #000;
}

.modal-body {
  padding: 16px;
}

.modal img {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 4px;
  background: #000;
}

.modal h2 {
  margin: 0;
  font-size: 20px;
  color: #000;
}

.modal .meta {
  color: #000;
  font-size: 13px;
  margin-top: 6px;
}

.modal .explanation {
  margin-top: 12px;
  line-height: 1.5;
  color: #000;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
}
.modal-close {
  color: #000; /* ensure the X is black for contrast */
}
.modal-close:hover,
.modal-close:focus {
  color: #222;
  outline: none;
}

/* Visible focus ring for keyboard users */
.modal-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(11,102,195,0.35);
  border-radius: 4px;
}

.modal a.modal-link {
  color: #0b66c3;
}
