/* =============================
   Base Styling
============================= */

body {
  margin: 0;
  font-family: 'Cormorant Garamond', serif;
  background: radial-gradient(circle at top, #3b1d5c, #1a0d2e);
  color: #f5e6c8;
  text-align: center;
  animation: fadeIn 1.5s ease forwards;
  opacity: 0;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

.title {
  font-size: 3rem;
  margin-top: 60px;
  letter-spacing: 2px;
  font-weight: 600;
}

.subtitle {
  font-size: 1.3rem;
  margin-bottom: 50px;
  opacity: 0.85;
  font-style: italic;
}

/* =============================
   Homepage Gallery
============================= */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 60px;
  padding: 60px;
  max-width: 1200px;
  margin: 0 auto;
}

.frame {
  display: block;
  text-decoration: none;
  color: inherit;
}

.frame img {
  display: block;
  width: 100%;
  height: 220px; /* standardized homepage thumbnail height */
  object-fit: cover; /* crop while preserving aspect ratio */
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  /* Removed hover animation */
}

.caption {
  margin-top: 12px;
  font-size: 1.2rem;
  letter-spacing: 1px;
  color: #f5e6c8;
}

/* =============================
   Trip Gallery Grid
============================= */

.trip-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  padding: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.trip-gallery img {
  width: 100%;
  height: 180px; /* standardized height */
  object-fit: cover; /* crops images nicely while keeping aspect ratio */
  border-radius: 8px;
  cursor: pointer;
  /* Removed hover animation */
}

/* =============================
   Modal
============================= */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 5, 35, 0.95);
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.4s ease forwards;
  z-index: 999;
}

.modal img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
}

/* =============================
   Responsive
============================= */

@media (max-width: 768px) {
  .gallery {
    gap: 40px;
    padding: 40px 20px;
  }

  .trip-gallery {
    gap: 15px;
    padding: 30px 20px;
  }

  .trip-gallery img {
    height: 140px;
  }

  .title {
    font-size: 2.2rem;
  }
}

/* Adjust homepage thumbnail height for smaller screens */
@media (max-width: 480px) {
  .frame img {
    height: 140px;
  }
}


/* Ensure modal images scale properly on small screens */
@media (max-width: 768px) {
  .modal img {
    max-width: 95%;
    max-height: 80vh; /* max 80% of viewport height */
    border-radius: 8px;
  }
}