/* ===============================================
   GALLERY ENHANCEMENT CSS
   Works with existing layout-sidebar.css
   =============================================== */

/* ================= ALBUMS GRID ================= */
.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 3rem;
}

.album-tile {
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.album-thumb {
  position: relative;
  width: 100%;
  padding-bottom: 133.33%; /* 3:4 aspect ratio */
  overflow: hidden;
  background: #f5f5f5;
}

.album-thumb img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s ease, opacity 0.3s ease;
}

.album-tile:hover .album-thumb img {
  transform: scale(1.05);
  opacity: 0.85;
}

.album-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.85) 0%,
    rgba(0,0,0,0.5) 70%,
    transparent 100%
  );
  color: white;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
  opacity: 1;
  transition: background 0.3s ease;
}

.album-tile:hover .album-overlay {
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.95) 0%,
    rgba(0,0,0,0.7) 70%,
    transparent 100%
  );
}

/* ================= PHOTOS GRID (loose photos) ================= */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 3rem;
}

.photo-item {
  position: relative;
  display: block;
  width: 100%;
  padding-bottom: 133.33%; /* 3:4 aspect ratio */
  overflow: hidden;
  background: #f5f5f5;
  cursor: pointer;
}

.photo-item img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s ease;
}

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

/* ================= PAGE HEADER ================= */
.page-header {
  margin-bottom: 2.5rem;
}

.page-number {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #888;
  font-weight: 500;
  margin-bottom: 12px;
}

.page-title {
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 16px;
  color: #000;
}

.page-subtitle {
  font-size: 16px;
  line-height: 1.6;
  color: #666;
  max-width: 600px;
}

/* ================= ALBUM DETAIL (model.php) ================= */
.album-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 60px;
  align-items: start;
  max-width: 1100px;
}

.album-photos {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.album-photo {
  display: block;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.album-photo img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}

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

.album-meta {
  position: sticky;
  top: 2rem;
  align-self: start;
}

.album-nav {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  font-size: 20px;
}

.album-nav a {
  color: #000;
  text-decoration: none;
  transition: opacity 0.3s;
}

.album-nav a:hover {
  opacity: 0.5;
}

.album-nav span {
  color: #ccc;
}

.album-description {
  font-size: 14px;
  line-height: 1.7;
  color: #666;
  margin-bottom: 30px;
}

.album-videos video {
  width: 100%;
  margin-bottom: 20px;
  border-radius: 4px;
}

/* ================= RESPONSIVE ================= */

/* TABLET */
@media (max-width: 999px) {
  .albums-grid,
  .photos-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
  }
  
  .album-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .album-meta {
    position: relative;
    top: 0;
  }
}

/* MOBILE */
@media (max-width: 720px) {
  .albums-grid,
  .photos-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .album-overlay {
    font-size: 13px;
    padding: 12px;
  }
  
  .page-header {
    margin-bottom: 2rem;
  }
  
  .album-photos {
    gap: 15px;
  }
}

/* SMALL MOBILE */
@media (max-width: 480px) {
  .albums-grid,
  .photos-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .album-overlay {
    font-size: 12px;
    padding: 10px;
  }
}

/* ================= LOADING STATE ================= */
.album-thumb.loading,
.photo-item.loading {
  background: linear-gradient(
    90deg,
    #f0f0f0 0%,
    #f8f8f8 50%,
    #f0f0f0 100%
  );
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ================= UTILITIES ================= */
.mb-small { margin-bottom: 20px; }
.mb-medium { margin-bottom: 40px; }
.mb-large { margin-bottom: 80px; }
.text-center { text-align: center; }
