/* ===== Gallery Module ===== */
.gallery-wrap {
    max-width: 1320px;
    margin: 0 auto;
    padding: 3rem 1.25rem;
}
.gallery-header { text-align: center; margin-bottom: 2.5rem; }
.gallery-header h2 { font-size: 2rem; font-weight: 700; margin: 0 0 .5rem; }
.gallery-header p { color: #6b7280; margin: 0; }

/* Album grid */
.album-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
@media (min-width: 640px)  { .album-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 992px)  { .album-grid { grid-template-columns: repeat(5, 1fr); } }

.album-card {
    display: block; text-decoration: none; color: inherit;
    background: #fff; border-radius: 12px; overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
    transition: transform .25s ease, box-shadow .25s ease;
}
.album-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 8px rgba(0,0,0,.1), 0 12px 28px rgba(0,0,0,.1);
}

/* Album cover area */
.album-cover {
    position: relative; width: 100%; height: 200px;
    background: #e8e8e8; overflow: hidden;
}
.album-cover-img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: opacity .5s ease-in-out;
}
.album-count {
    position: absolute; top: 10px; right: 10px;
    background: rgba(0,0,0,.72); color: #fff;
    font-size: .75rem; font-weight: 600;
    padding: 4px 10px; border-radius: 999px;
    z-index: 3;
}
.album-body { padding: .9rem 1rem 1.1rem; }
.album-title {
    font-size: 1rem; font-weight: 700; margin: 0 0 .35rem;
    color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.album-desc {
    font-size: .82rem; color: #6b7280; margin: 0; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}

/* Single album view */
.album-head {
    display: flex; justify-content: space-between;
    align-items: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 2rem;
}
.album-head h2 { margin: 0 0 .25rem; font-size: 1.75rem; font-weight: 700; }
.album-head .sub { color: #6b7280; font-size: .95rem; margin: 0; }
.album-back {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .5rem 1rem; background: #fff; border: 1px solid #e5e7eb;
    border-radius: 8px; color: #111; text-decoration: none;
    font-size: .9rem; font-weight: 500; transition: background .2s;
}
.album-back:hover { background: #f3f4f6; }

/* Photo grid */
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (min-width: 640px) { .photo-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 992px) { .photo-grid { grid-template-columns: repeat(6, 1fr); } }

.photo-item {
    position: relative; display: block;
    border-radius: 8px; overflow: hidden;
    background: #f0f0f0;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    transition: transform .2s;
    min-height: 180px;
}
.photo-item:hover { transform: scale(1.03); }
.photo-item img { width: 100%; height: 180px; object-fit: cover; display: block; }

.pagination-wrap { margin-top: 2rem; display: flex; justify-content: center; }
.empty-state {
    text-align: center; padding: 3rem 1rem;
    color: #6b7280; background: #f9fafb; border-radius: 12px;
}

/* ===== Skeleton shimmer ===== */
@keyframes shimmer {
    0%   { background-position: -800px 0; }
    100% { background-position:  800px 0; }
}
.album-skeleton,
.photo-skeleton {
    position: absolute; inset: 0; z-index: 2;
    background: linear-gradient(90deg, #e8e8e8 25%, #f5f5f5 50%, #e8e8e8 75%);
    background-size: 800px 100%;
    animation: shimmer 1.4s infinite linear;
}

/* ===== Lazy loading ===== */
.lazy-img { opacity: 0; transition: opacity .4s ease; position: relative; z-index: 3; }
.lazy-img.loaded { opacity: 1; }
