/* Album Header Styles */
.album-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid #d4c5a9;
}

.album-header h1 {
  font-size: 2.5rem;
  color: #2d5a3d;
  margin-bottom: 1rem;
}

.album-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1rem;
  font-size: 0.95rem;
  color: #7c9885;
  flex-wrap: wrap;
}

.album-meta time {
  font-style: italic;
}

.album-meta .location {
  font-weight: 500;
  color: #5a7c65;
  position: relative;
  padding-left: 1.25rem;
}

.album-meta .location::before {
  content: "📍";
  position: absolute;
  left: 0;
}

.album-meta .photo-count {
  background-color: #f5f2ed;
  padding: 0.375rem 0.875rem;
  border-radius: 20px;
  font-size: 0.875rem;
  border: 1px solid #d4c5a9;
}

.album-description {
  max-width: 800px;
  margin: 0 auto 3rem;
  text-align: center;
  font-size: 1.1rem;
  line-height: 1.8;
  color: #2d5a3d;
  padding: 0 1rem;
}

/* Photo Gallery Grid */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  padding: 1rem;
  margin: 0 auto;
  max-width: 1400px;
}

/* Mobile: 1-2 columns */
@media (max-width: 639px) {
  .photo-gallery {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
    padding: 0.5rem;
  }
}

/* Tablet: 3 columns */
@media (min-width: 640px) and (max-width: 1023px) {
  .photo-gallery {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
  }
}

/* Desktop: 4+ columns */
@media (min-width: 1024px) {
  .photo-gallery {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
  }
}

/* Large screens: 5 columns max */
@media (min-width: 1440px) {
  .photo-gallery {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Photo Items */
.photo-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background-color: #f9f7f4;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  aspect-ratio: 1;
}

.photo-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Handle both landscape and portrait images better */
.photo-item picture,
.photo-item img {
  width: 100%;
  height: 100%;
  display: block;
}

.photo-item img {
  object-fit: cover;
  transition: transform 0.4s ease;
  will-change: transform;
}

.photo-item:hover img {
  transform: scale(1.08);
}

/* Photo Overlay */
.photo-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(0, 0, 0, 0.3) 30%,
    transparent 50%
  );
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 1rem;
  gap: 0.625rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.photo-item:hover .photo-overlay {
  opacity: 1;
}

/* Overlay Buttons */
.photo-overlay a,
.photo-overlay button {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  transform: translateY(10px);
  opacity: 0;
}

.photo-item:hover .photo-overlay a,
.photo-item:hover .photo-overlay button {
  transform: translateY(0);
  opacity: 1;
}

.photo-item:hover .photo-overlay a:nth-child(1) {
  transition-delay: 0.05s;
}

.photo-item:hover .photo-overlay button:nth-child(2) {
  transition-delay: 0.1s;
}

.photo-overlay a:hover,
.photo-overlay button:hover {
  background-color: #5a7c65;
  transform: scale(1.1) translateY(0);
}

.photo-overlay a:hover svg,
.photo-overlay button:hover svg {
  color: white;
}

.photo-overlay svg {
  width: 20px;
  height: 20px;
  color: #2d5a3d;
  transition: color 0.2s ease;
}

/* Loading Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.photo-item {
  animation: fadeIn 0.5s ease-out;
  animation-fill-mode: backwards;
}

.photo-item:nth-child(1) { animation-delay: 0.05s; }
.photo-item:nth-child(2) { animation-delay: 0.1s; }
.photo-item:nth-child(3) { animation-delay: 0.15s; }
.photo-item:nth-child(4) { animation-delay: 0.2s; }
.photo-item:nth-child(5) { animation-delay: 0.25s; }
.photo-item:nth-child(6) { animation-delay: 0.3s; }
.photo-item:nth-child(7) { animation-delay: 0.35s; }
.photo-item:nth-child(8) { animation-delay: 0.4s; }
.photo-item:nth-child(9) { animation-delay: 0.45s; }
.photo-item:nth-child(10) { animation-delay: 0.5s; }

/* Masonry layout variation (optional - can be toggled with a class) */
.photo-gallery.masonry {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-auto-rows: 200px;
  grid-auto-flow: dense;
}

.photo-gallery.masonry .photo-item {
  aspect-ratio: unset;
}

.photo-gallery.masonry .photo-item:nth-child(3n) {
  grid-row: span 2;
}

.photo-gallery.masonry .photo-item:nth-child(5n) {
  grid-column: span 2;
  grid-row: span 2;
}

/* Lightbox Styles */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: fadeIn 0.3s ease;
}

.lightbox.active {
  display: flex;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  font-size: 1.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1) rotate(90deg);
}

.lightbox-image {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 1rem;
  text-align: center;
  padding: 0.75rem 1.5rem;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  max-width: 80%;
}

/* No photos message */
.no-photos {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: #7c9885;
  font-size: 1.125rem;
}

/* Mobile adjustments */
@media (max-width: 639px) {
  .album-header h1 {
    font-size: 1.875rem;
  }

  .album-description {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  .photo-overlay {
    opacity: 1;
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.5) 0%,
      rgba(0, 0, 0, 0.2) 30%,
      transparent 50%
    );
  }

  .photo-overlay a,
  .photo-overlay button {
    width: 36px;
    height: 36px;
    transform: translateY(0);
    opacity: 1;
  }

  .lightbox-close {
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }
}

/* Album stickers section */
.album-stickers {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #d4c5a9;
  flex-wrap: wrap;
}

.album-stickers .sticker {
  font-size: 2rem;
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.album-stickers .sticker:hover {
  opacity: 1;
  transform: scale(1.2);
}