/* Gallery Flip Card Styles */
.gallery-section {
  padding: 0.2rem 0 1rem 0; /* Reduced bottom padding further */
  background: var(--bg-light, #f8f8f8);
}

.gallery-heading {
  text-align: center;
  font-size: 2.7rem;
  font-weight: 800;
  letter-spacing: 2px;
  margin-top: 0; /* Removed any top margin */
  margin-bottom: 1rem; /* Reduced bottom margin */
  color: #2d3142;
  text-shadow: 0 2px 12px rgba(44,62,80,0.08);
}

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

.gallery-card {
  perspective: 1200px;
  height: 300px;
  min-height: 180px;
}

.gallery-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.4,0,0.2,1);
  transform-style: preserve-3d;
}

.gallery-card:hover .gallery-card-inner,
.gallery-card:focus-within .gallery-card-inner {
  transform: rotateY(180deg);
}

.gallery-card-front, .gallery-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,0.13);
}

.gallery-card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-card-front {
  background-color: #fff;
  color: #2d3142;
}

.gallery-card-back {
  background: linear-gradient(135deg, #22223b 60%, #4a4e69 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 1px;
  transform: rotateY(180deg);
  text-shadow: 0 2px 10px rgba(0,0,0,0.25);
}

.fun-feed {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  grid-auto-flow: dense;
}

.gallery-card--wide,
.gallery-card--tall,
.gallery-card--big {
  grid-column: unset;
  grid-row: unset;
  min-height: unset;
}

.fun-feed .gallery-card-inner {
  min-height: 100%;
  height: 100%;
}

.fun-feed .gallery-card-front img {
  min-height: 100%;
  height: 100%;
  width: 100%;
  object-fit: cover;
  border-radius: 18px;
}

.gallery-carousel-section {
  width: 100vw; 
  margin: 5rem 0 0.5rem 0; /* Increased top margin to bring the carousel down */
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.gallery-carousel {
  position: relative;
  width: 100%;
  height: 430px; /* Adjust height as needed */
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1600px;
  padding: 0;
}

.carousel-slide {
  position: absolute;
  top: 50%;
  transform: translateY(-50%) scale(0.8);
  opacity: 0.5;
  transition: 
    opacity 0.6s ease, 
    transform 0.6s ease, 
    filter 0.6s ease;
  filter: blur(1.2px) grayscale(0.5) brightness(0.6);
  pointer-events: none;
  z-index: 1;
  width: 600px; /* Increased width */
  height: 390px; /* Increased height */
}

.carousel-slide.active {
  opacity: 1;
  transform: translateX(0) translateY(-50%) scale(1);
  filter: none;
  z-index: 3;
  pointer-events: auto;
}

.carousel-slide.prev {
  transform: translateX(-30%) translateY(-50%) scale(0.9);
  opacity: 0.7;
  z-index: 2;
  filter: brightness(0.8) blur(0.5px);
}

.carousel-slide.next {
  transform: translateX(30%) translateY(-50%) scale(0.9);
  opacity: 0.7;
  z-index: 2;
  filter: brightness(0.8) blur(0.5px);
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px;
}

.carousel-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2.5rem;
  color: #fff;
  text-align: left;
  padding: 0 3.5rem;
  z-index: 4;
}

.carousel-caption h2 {
  font-size: 2.8rem;
  font-weight: 800;
  margin: 0 0 0.5rem 0;
  color: #f7b32b;
  text-shadow: 0 4px 24px rgba(0,0,0,0.25);
}

.carousel-caption p {
  font-size: 1.3rem;
  margin: 0 0 1.2rem 0;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.18);
}

.carousel-location {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.18);
}

.carousel-location i {
  color: #e74c3c;
  font-size: 1.3rem;
}

.carousel-arrows {
  display: flex;
  justify-content: space-between;
  position: absolute;
  top: 50%;
  width: 100%;
  transform: translateY(-50%);
  z-index: 10;
}

.carousel-arrow {
  background: rgba(255, 255, 255, 0.8);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  box-shadow: 0 2px 10px rgba(44, 90, 160, 0.10);
  font-size: 1.7rem;
  color: #2c5aa0;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-arrow:hover {
  background: #f7b32b;
  color: #fff;
  transform: scale(1.08);
}

/* Dark mode styles */
body.dark-theme {
  background-color: #121212;
  color: #ffffff;
}

header.dark-theme, nav.dark-theme {
  background-color: #1e1e1e;
}

.theme-switch.dark-theme .theme-icon {
  color: #ffffff;
}

.circle-container.dark-theme .circle {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Dark theme styles for gallery section */
.gallery-section.dark-theme {
  background-color: #121212;
  color: #ffffff;
}

/* Dark theme styles for gallery heading */
.gallery-heading.dark-theme {
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(255, 255, 255, 0.1);
}

/* Dark theme styles for gallery grid */
.gallery-grid.dark-theme {
  background-color: #1e1e1e;
}

/* Dark theme styles for gallery cards */
.gallery-card.dark-theme {
  background-color: #2a2a2a;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

/* Dark theme styles for gallery card front */
.gallery-card-front.dark-theme {
  background-color: #2a2a2a;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

/* Dark theme styles for gallery card back */
.gallery-card-back.dark-theme {
  background: linear-gradient(135deg, #2a2a2a 60%, #3a3a3a 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

/* Dark theme styles for carousel */
.carousel-slide.dark-theme {
  filter: brightness(0.7) grayscale(0.3);
}

.carousel-caption.dark-theme h2 {
  color: #f7b32b;
}

.carousel-caption.dark-theme p, .carousel-location.dark-theme {
  color: #ffffff;
}

.carousel-arrow.dark-theme {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.carousel-arrow.dark-theme:hover {
  background: #f7b32b;
  color: #ffffff;
}

@media (max-width: 900px) {
  .gallery-heading {
    font-size: 2rem;
    margin-bottom: 1.2rem;
  }
  .fun-feed {
    gap: 1rem;
  }
  .gallery-carousel {
    height: 260px;
    border-radius: 24px;
  }
  .carousel-slide img {
    border-radius: 24px;
  }
  .carousel-caption {
    padding: 0 1.2rem;
    bottom: 1.2rem;
  }
  .carousel-caption h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 600px) {
  .gallery-card {
    height: 180px;
  }
  .gallery-section {
    padding: 1.5rem 0 1rem 0;
  }
  .gallery-heading {
    font-size: 1.3rem;
    margin-bottom: 0.7rem;
  }
  .gallery-grid {
    gap: 1rem;
    padding: 0 0.5rem;
  }
  .fun-feed {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
  }
  .gallery-carousel-section {
    margin: 1rem 0 0.5rem 0;
  }
  .gallery-carousel {
    height: 160px;
    border-radius: 12px;
  }
  .carousel-slide img {
    border-radius: 12px;
  }
  .carousel-caption {
    padding: 0 0.5rem;
    bottom: 0.5rem;
  }
  .carousel-caption h2 {
    font-size: 1.1rem;
  }
  .carousel-caption p {
    font-size: 0.8rem;
  }
  .carousel-location {
    font-size: 0.8rem;
  }
  .carousel-arrow {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }
}
