* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  overflow: hidden;
  font-family: sans-serif;
  background-color: #000;
}

.bg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background-size: cover;
  background-position: center;
  transition: opacity 1.5s ease-in-out;
  opacity: 0;
}

.bg-layer.active {
  opacity: 0.85; /* Slight reduction in brightness over black background */
}

.gallery-title {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  white-space: nowrap; /* Prevents wrapping and ensures true center */
  font-family: 'Cedarville Cursive', cursive;
  font-size: 2.5rem; /* Scaled down for a more delicate look */
  color: #fff;
  text-shadow: 2px 4px 10px rgba(0, 0, 0, 0.6);
  z-index: 5;
  pointer-events: none;
  opacity: 0.9;
  transition: opacity 0.5s ease;
}

.gallery-title.hidden {
  opacity: 0;
}

#polaroid-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, background-color 0.5s ease;
}

#polaroid-container.active {
  opacity: 1;
  pointer-events: auto;
  background-color: rgba(0, 0, 0, 0.7); /* Darken background to focus on polaroids */
}

#mini-cycler {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 20;
  cursor: pointer;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
  padding: 4px 4px 14px 4px; /* Reduced white space around border */
}

#mini-cycler.active {
  opacity: 0.6; /* Reduced opacity to be less distracting */
  pointer-events: auto;
}

#mini-cycler img {
  max-height: 18vh; /* Increased the corner photo size */
  width: auto;
}

#mini-cycler:hover {
  transform: scale(1.05) rotate(-3deg);
  opacity: 1; /* Pops to full opacity on hover */
}

.mini-caption {
  text-align: center;
  font-family: 'Shadows Into Light', cursive;
  font-size: 0.9rem; /* Increased size slightly */
  color: #333; /* Darkened to make it easier to see */
  margin-top: 2px; /* Slight bump down */
  margin-bottom: -10px; /* Pull text into that bottom empty space to avoid changing button height */
  line-height: 0.9; /* Tighter line height for two lines to keep total height identical */
  letter-spacing: 1px;
  font-style: normal; /* This font looks better normal */
  font-weight: 400;
  text-transform: lowercase;
}

.carousel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  position: relative;
  width: 80%;
  max-width: 1200px;
}

.polaroid {
  background: white;
  padding: 10px 10px 40px 10px; /* Reduced padding for elegance */
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transition: transform 0.4s ease, filter 0.4s ease;
  position: relative;
  border-radius: 2px; /* Slight softening of corners */
}

.polaroid img {
  display: block;
  max-height: 55vh; /* Re-increased the image significantly for the popup state */
  width: auto;
  object-fit: contain;
}

.polaroid.main {
  transform: scale(1.15); /* Slightly enlarge the centered one */
  z-index: 5;
  filter: brightness(1);
}

.polaroid.side {
  transform: scale(0.75); /* Scale down the side ones */
  opacity: 0.6;
  z-index: 1;
  filter: brightness(0.6);
  cursor: pointer;
}

.nav-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-size: 2rem;
  font-weight: 300;
  color: white;
  cursor: pointer;
  padding: 0;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  z-index: 20;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: white;
  transform: scale(1.1);
}

.collapse-btn {
  position: absolute;
  top: 40px;
  left: 40px;
  width: 45px;
  height: 45px;
  font-size: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  opacity: 0.8;
}

.collapse-btn:hover {
  opacity: 1;
}

#loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 1.5rem;
  z-index: 50;
}
