/* -------------------- Reset & Base -------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f9f9f9;
  color: #222;
  line-height: 1.6;
}

/* -------------------- Top Navigation -------------------- */
.topnav {
  background-color: #333;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  padding: 15px 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.topnav a {
  color: #fff;
  text-decoration: none;
  margin: 0 20px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: color 0.3s;
}

.topnav a:hover {
  color: #ffcc00;
}

/* -------------------- Hero Image -------------------- */
.hero img {
  width: 100%;
  max-width: 1200px;
  height: auto;
  display: block;
  margin: 20px auto;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* -------------------- Image Grid -------------------- */
.image-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr); /* 6 equal columns */
  grid-auto-rows: 150px;                 /* base row height */
  gap: 10px;                             /* spacing between images */
  padding: 10px;
}

/* Assign different grid spans for a collage effect */
.image-grid img:nth-child(1) {
  grid-column: span 2;
  grid-row: span 2;
}

.image-grid img:nth-child(2) {
  grid-column: span 2;
  grid-row: span 1;
}

.image-grid img:nth-child(3) {
  grid-column: span 1;
  grid-row: span 1;
}

.image-grid img:nth-child(4) {
  grid-column: span 1;
  grid-row: span 2;
}

.image-grid img:nth-child(5) {
  grid-column: span 3;
  grid-row: span 1;
}

.image-grid img:nth-child(6) {
  grid-column: span 2;
  grid-row: span 1;
}

.image-grid img:nth-child(7) {
  grid-column: span 1;
  grid-row: span 2;
}

.image-grid img:nth-child(8) {
  grid-column: span 2;
  grid-row: span 2;
}

.image-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

.image-grid img:hover {
  outline: 4px solid #ffcc00;
  outline-offset: -4px;
  transform: none;  /* remove scaling */
}


/* Lightbox overlay */
#lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.85);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* Content wrapper for image + caption */
#lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 90vh;
}

/* Image — reduced max height so caption always fits */
#lightbox-img {
  max-width: 90%;
  max-height: 70vh;   /* <<< THIS FIXES THE PROBLEM */
  border-radius: 8px;
  box-shadow: 0 0 20px black;
  display: block;
}

/* Caption */
#lightbox-caption {
  color: white;
  margin-top: 15px;
  font-size: 1.2rem;
  text-align: center;
  max-width: 80%;
}

#lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 3rem;
  color: white;
  cursor: pointer;
}
/* -------------------- Cards -------------------- */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  transition: box-shadow 0.3s;
}

.card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.card img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin-bottom: 15px;
  object-fit: cover;
}

/* -------------------- Footer -------------------- */
.footer {
  background: #222;
  color: #ddd;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 40px 10%;
  font-size: 0.9rem;
}

.footer a {
  color: #ddd;
  text-decoration: none;
  transition: color 0.3s;
}

.footer a:hover {
  color: #ffcc00;
}

/* -------------------- Responsive -------------------- */
@media screen and (max-width: 900px) {
  .topnav {
    flex-direction: column;
    align-items: center;
  }

  .image-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    padding: 0 10px;
  }

  .footer {
    flex-direction: column;
    text-align: center;
  }
}

@media screen and (max-width: 500px) {
  .topnav a {
    margin: 10px 0;
    font-size: 1rem;
  }

  .card {
    padding: 15px;
  }
}