/* Retro Geek Repairs - Gallery Styles */

body {
  background-color: #000;
  color: #f5f5f5;
  font-family: 'Courier New', monospace;
  margin: 0;
  padding: 0;
}

header {
  background-color: #555;
  padding: 20px;
  text-align: center;
  border-bottom: 3px solid #000;
}

header h1 {
  font-size: 3em;
  margin: 0;
}

nav {
  background-color: #222;
  font-size: 1.9em;
  padding: 10px;
  text-align: center;
}

nav a {
  color: #B22222;
  margin: 0 15px;
  text-decoration: none;
}

.section {
  font-size: 1.2em;
  padding: 25px;
  border-bottom: 1px solid #B22222;
  text-align: center;
}

.section h2 {
  font-size: 1.9em;
  color: #B22222;
}

/* 🔧 Updated: Make gallery responsive and spaced */
.gallery-grid {
  color: #B22222;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding: 10px 0;
}

/* 🔧 Improved: Style each image+caption block for clarity and containment */
.gallery-grid > div {
  background-color: #111;
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 10px;
  text-align: center;
  height: 290px; /* Limits tall growth */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;      /* ✅ Centers content horizontally */
  overflow: hidden;         /* ✅ Prevents overflow issues */
}

/* 🔧 New: Image constraints */
.gallery-grid a img {
  width: auto;
  max-height: 200px;         /* ✅ Limits vertical growth */
  object-fit: contain;
  border: 2px solid #B22222;
  transition: transform 0.3s ease;
}

/* 🔧 Refined: Caption styling */
.gallery-grid > div p {
  font-size: 1.2rem;
  margin: 0;
  overflow-wrap: break-word;
  text-align: center;
}

.gallery-grid a img:hover {
  transform: scale(1.1);
}

footer {
  background-color: #222;
  text-align: center;
  padding: 10px;
  font-size: 0.8em;
  border-top: 2px solid #000;
}

img.header-image {
  max-width: 100%;
  height: auto;
  border: 3px solid #000;
}

/* Responsive tweak for smaller screens */
@media only screen and (max-width: 768px) {
  body {
    font-size: 1em;
  }

  header h1 {
    font-size: 3em;
  }

  nav {
    font-size: 2em;
  }

  .section h2 {
    font-size: 2em;
  }

  footer {
    font-size: 0.6em;
  }
}