/* Album Grid Page Styles */
body {
  margin: 0;
  font-family: 'Inter', Arial, sans-serif;
  background: #161616;
  color: #fff;
}

/* Album Grid Container */
.album-grid-container {
  min-height: 100vh;
  padding: 0;
}

/* Album Header */
.album-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 30px;
  background: #181818;
  border-bottom: 2px solid #222;
  position: sticky;
  top: 0;
  z-index: 10;
}

.back-btn {
  background: transparent;
  border: 1px solid #444;
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.back-btn:hover {
  background: #333;
  border-color: #666;
}

#album-title {
  font-size: 1.8rem;
  font-weight: 300;
  margin: 0;
  text-align: center;
  flex: 1;
  letter-spacing: 0.02em;
}

h1 {
  text-align: left;
  padding-left: 15rem;
  margin-bottom: 1.2rem;
  margin-left: 0.5rem; /* Fixed typo */
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 530;
  letter-spacing: 0.01em;
}

@media (max-width: 900px) {
  h1 {
    padding-left: 4rem; /* Reduce padding for tablets */
    margin-left: 0.5rem;
    font-size: 2rem;
  }
}

@media (max-width: 600px) {
  h1 {
    padding-left: 0.7rem; /* Minimal padding for mobile */
    margin-left: 0;
    font-size: 2rem;
  }
}

/* Album Grid - Masonry Style */
.album-grid {
  column-count: 4;
  column-gap: 20px;
  padding: 30px;
  max-width: 1400px;
  margin: 0 auto;
}

.album-grid img {
  width: 90%; /* Reduced from 100% to 90% */
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  margin: 0 auto 20px auto; /* Center the image within its column */
  break-inside: avoid;
  display: block;
}

.album-grid img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* Responsive column count */
@media (max-width: 1200px) {
  .album-grid {
    column-count: 3;
  }
}

@media (max-width: 900px) {
  .album-grid {
    column-count: 2;
    column-gap: 15px;
    padding: 20px;
  }
  
  .album-grid img {
    margin-bottom: 15px;
  }
}

@media (max-width: 600px) {
  .album-grid {
    column-count: 2;
    column-gap: 12px;
    padding: 15px;
  }
  
  .album-grid img {
    margin-bottom: 12px;
  }
}

/* Photo Viewer Styles */
.viewer-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer-image-block {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

.viewer-image-block img,
#viewer-image {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease;
  cursor: pointer;
}

#viewer-image:hover {
  transform: scale(1.02);
}

/* Close Button */
.close-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, transform 0.2s;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* Navigation buttons */
.nav-button {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  width: 60px;
  height: 80px;
  font-size: 1.8rem;
  cursor: pointer;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, opacity 0.3s;
  opacity: 0.7;
}

.nav-button:hover {
  background: rgba(0, 0, 0, 0.8);
  opacity: 1;
}

#prev-btn {
  left: 20px;
  border-radius: 0 8px 8px 0;
}

#next-btn {
  right: 20px;
  border-radius: 8px 0 0 8px;
}

/* Image counter */
.image-counter {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  z-index: 100;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .album-header {
    padding: 15px 20px;
  }
  
  #album-title {
    font-size: 1.4rem;
  }
  
  /* Mobile styles are now handled above */
  
  .close-btn {
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }
  
  .nav-button {
    width: 50px;
    height: 70px;
    font-size: 1.5rem;
  }
  
  #prev-btn {
    left: 10px;
  }
  
  #next-btn {
    right: 10px;
  }
  
  .viewer-image-block img,
  #viewer-image {
    max-width: 98vw;
    max-height: 90vh;
  }

  /* Touch-friendly navigation areas */
  .touch-nav {
    position: absolute;
    top: 0;
    width: 30%;
    height: 100%;
    z-index: 25;
    cursor: pointer;
  }
  
  .touch-nav.prev {
    left: 0;
  }
  
  .touch-nav.next {
    right: 0;
  }
}

/* Loading state */
.album-grid.loading {
  column-count: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.album-grid.loading::after {
  content: 'Loading photos...';
  color: #999;
  font-size: 1.1rem;
}

/* Album Card */
.photo-card {
  background: #181818;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  text-align: center;
  padding: 8px;
  transition: transform 0.2s;
}

.photo-card:hover {
  transform: scale(1.02);
}

.photo-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  margin: 0 auto;
}

.album-card {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  text-align: left; /* Align content inside the card to the left */
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* Align content inside the card to the left */
  max-width: 100%;
  margin-bottom: 2rem; /* Add spacing below the card */
  position: relative; /* Make title positioning relative to this */
}

.album-card:hover {
  transform: scale(1.025);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}
.album-card img {
  width: 100%;
  max-width: 900px;
  aspect-ratio: auto 3902 / 3177;
  height: auto;
  display: block;
  margin-left: 0;   /* Remove auto margin */
  margin-right: 0;  /* Remove auto margin */
  border-radius: 10px;
  object-fit: contain;
  background: transparent;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
}

/* Album Title */
.title, .album-title {
  margin-top: 2rem;   /* Space between image and title */
  margin-left: 0;       /* Align with image edge */
  font-size: 1.3rem;
  color: rgb(255, 255, 255);
  font-weight: 525;
  font-family: 'playfair-display', serif;
  line-height: 1.4;
  letter-spacing: 0.01em;
  text-shadow: none;
  background: none;
  text-align: left;
  position: static;
  width: 100%;
  max-width: 532px;     /* Match image width */
}

/* Viewer Layout */
.viewer-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-color: #000;
}

.viewer-image-block {
  position: relative;
  max-width: 90%;
  max-height: 90vh;
  overflow: hidden;
}

.viewer-image-block img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
}

.overlay-title {
  position: absolute;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 2rem;
  text-align: center;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.7);
}

@media (max-width: 600px) {
  .album-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .photo-card {
    padding: 4px;
  }
  .photo-card img {
    aspect-ratio: 1/1;
    height: auto;
    min-width: 0;
    min-height: 0;
  }
  .title {
    font-size: 2rem;
    padding: 0.3em 0;
  }
}
