:root {
    --bg-dark: #F5EFE2;      /* Warm Ivory - nền chính */
    --bg-card: #FFFDF7;      /* Off White - card / vùng nổi */
    --sand: #E6D7BC;         /* Soft Sand - section phụ */
    --border-color: #E6D7BC;
    --gold: #B84A2B;         /* Terracotta - highlight chính */
    --gold-hover: #9C3B20;
    --burgundy: #681F1B;     /* Deep Burgundy - CTA / section nổi bật */
    --olive: #686B4D;        /* Muted Olive - accent phụ */
    --text-main: #171513;    /* Soft Black - heading / text */
    --text-muted: #4A3429;   /* Warm Brown - chữ phụ */
    --nav-green: #FFFDF7;
    --logo-gold: #B84A2B;
}

.albumdetail-page-wrapper {
    padding: 40px 20px 100px;
    min-height: 100vh;
    background-color: var(--bg-dark);
}

.albumdetail-container {
    max-width: 1400px;
    margin: 0 auto;
}

.albumdetail-topbar {
    margin-bottom: 25px;
}

.albumdetail-back-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.25s;
}
.albumdetail-back-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.albumdetail-header {
    text-align: center;
    margin-bottom: 35px;
}

.albumdetail-title {
    color: var(--text-main);
    font-size: 2rem;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: bold;
}

.albumdetail-count {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* LƯỚI MASONRY THEO CỘT - mỗi ảnh giữ NGUYÊN tỉ lệ gốc lúc tải lên, không cắt, không ô trống */
.albumdetail-masonry {
    column-count: 4;
    column-gap: 16px;
}

.albumdetail-item {
    position: relative;
    display: block;
    break-inside: avoid;
    margin-bottom: 16px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(184,74,43,0.15);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.albumdetail-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease, filter 0.4s ease;
    filter: brightness(0.95);
}
.albumdetail-item.gallery-add-tile { min-height: 160px; }

.albumdetail-item:hover {
    border-color: var(--gold);
    transform: translateY(-3px);
}
.albumdetail-item:hover img {
    transform: scale(1.06);
    filter: brightness(1.05);
}

/* LIGHTBOX */
.albumdetail-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(245,239,226,0.95);
    z-index: 3000;
    align-items: center;
    justify-content: center;
}
.albumdetail-lightbox.show { display: flex; }

.albumdetail-lightbox img {
    max-width: 88%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.albumdetail-lightbox-close {
    position: absolute;
    top: 25px;
    right: 30px;
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-main);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.2s;
}
.albumdetail-lightbox-close:hover { border-color: var(--gold); color: var(--gold); }

.albumdetail-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(23,21,19,0.08);
    border: 1px solid var(--text-muted);
    color: var(--text-main);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.2s;
}
.albumdetail-lightbox-nav:hover { border-color: var(--gold); color: var(--gold); background: rgba(184,74,43,0.1); }
.albumdetail-lightbox-prev { left: 25px; }
.albumdetail-lightbox-next { right: 25px; }

/* RESPONSIVE */
@media (max-width: 1100px) {
    .albumdetail-masonry { column-count: 3; }
}
@media (max-width: 768px) {
    .albumdetail-masonry { column-count: 2; column-gap: 10px; }
    .albumdetail-item { margin-bottom: 10px; }
    .albumdetail-title { font-size: 1.5rem; }
    .albumdetail-lightbox-nav { width: 38px; height: 38px; font-size: 1rem; }
    .albumdetail-lightbox-prev { left: 10px; }
    .albumdetail-lightbox-next { right: 10px; }
}
@media (max-width: 480px) {
    .albumdetail-masonry { column-gap: 8px; }
}