:root {
    --gallery-shadow: 0 10px 34px rgba(18, 48, 99, .08);
}

.gallery-page {
    background: rgb(255, 255, 255);
}

.gallery-hero {
    padding: 24px 0px 36px;
    background: linear-gradient(135deg, rgb(242, 246, 255), rgb(251, 253, 255));
    border-bottom: 1px solid var(--line);
}

.gallery-hero-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gallery-hero-row > div > span, .gallery-section-head > div > span {
    font-size: 11px;
    font-weight: 700;
    color: var(--blue2);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.gallery-hero h1 {
    font-size: clamp(27px, 3vw, 42px);
    font-weight: 800;
    color: var(--blue);
    margin: 8px 0px;
}

.gallery-hero p {
    color: var(--muted);
    margin: 0px;
}

.gallery-hero-icon {
    font-size: 88px;
    color: rgb(217, 230, 250);
    margin-right: 6%;
}

.gallery-section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 17px;
}

.gallery-section-head h2 {
    font-size: 22px;
    color: var(--blue);
    font-weight: 800;
    text-transform: uppercase;
    margin: 5px 0px 0px;
}

.album-nav {
    display: flex;
    gap: 7px;
}

.album-nav button {
    width: 39px;
    height: 39px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgb(255, 255, 255);
    color: var(--blue);
}

.album-nav button:hover {
    background: var(--blue);
    color: rgb(255, 255, 255);
}

.album-card {
    height: 270px;
    border-radius: 11px;
    overflow: hidden;
    box-shadow: var(--gallery-shadow);
}

.album-card a {
    display: block;
    height: 100%;
    position: relative;
    color: rgb(255, 255, 255);
}

.album-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
}

.album-card:hover img {
    transform: scale(1.06);
}

.album-overlay {
    position: absolute;
    inset: 0px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 22px;
    background: linear-gradient(transparent 35%, rgba(0, 25, 75, 0.92));
}

.album-overlay > span {
    width: max-content;
    padding: 5px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.17);
    font-size: 11px;
}

.album-overlay h3 {
    font-size: 16px;
    line-height: 1.5;
    font-weight: 700;
    margin: 9px 0px 5px;
    /* CSS của Radzen.Blazor (dùng cho khu quản trị) nạp toàn site nên có sẵn luật
       "h3, .h3 { color: var(--rz-text-title-color) }" — màu tối này đè lên trước khi kịp kế thừa
       màu trắng từ .album-card a, khiến tiêu đề album chìm vào nền ảnh. Khai báo màu rõ ràng ở đây
       thay vì trông chờ kế thừa (bug thật, user 21/07/2026 báo qua ảnh chụp). */
    color: rgb(255, 255, 255);
}

.album-overlay small {
    font-size: 11px;
    color: rgb(220, 229, 244);
}

.gallery-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin: 38px 0px 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--blue);
}

.gallery-filters {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    scrollbar-width: none;
}

.gallery-filters::-webkit-scrollbar {
    display: none;
}

.gallery-filters button {
    flex: 0 0 auto;
    height: 39px;
    padding: 0px 14px;
    border: 1px solid var(--line);
    border-radius: 19px;
    background: rgb(255, 255, 255);
    color: rgb(88, 100, 121);
    font-size: 12px;
    font-weight: 650;
}

.gallery-filters button.active {
    background: var(--blue);
    border-color: var(--blue);
    color: rgb(255, 255, 255);
}

.gallery-tools {
    display: flex;
    gap: 6px;
}

.gallery-tools select {
    height: 39px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgb(255, 255, 255);
    color: rgb(88, 100, 121);
    padding: 0px 10px;
    font-size: 12px;
}

.gallery-tools button {
    width: 39px;
    height: 39px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgb(255, 255, 255);
    color: rgb(104, 116, 137);
}

.gallery-tools button.active {
    background: var(--blue);
    color: rgb(255, 255, 255);
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 220px;
    grid-auto-flow: dense;
    gap: 13px;
}

.photo-item {
    position: relative;
    border: 0px;
    border-radius: 9px;
    overflow: hidden;
    padding: 0px;
    background: rgb(238, 242, 247);
}

.photo-item.photo-wide {
    grid-column: span 2;
}

.photo-item.photo-tall {
    grid-row: span 2;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
}

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

.photo-hover {
    position: absolute;
    inset: 0px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    text-align: left;
    padding: 18px;
    color: rgb(255, 255, 255);
    background: linear-gradient(transparent 35%, rgba(0, 25, 69, 0.88));
    opacity: 0;
    transition: 0.3s;
}

.photo-item:hover .photo-hover, .photo-item:focus .photo-hover {
    opacity: 1;
}

.photo-hover > i {
    position: absolute;
    right: 14px;
    top: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.18);
}

.photo-hover strong {
    font-size: 15px;
    line-height: 1.5;
}

.photo-hover small {
    font-size: 11px;
    color: rgb(223, 231, 244);
    margin-top: 4px;
}

.photo-grid.masonry-mode {
    display: block;
    columns: 4;
    column-gap: 13px;
}

.masonry-mode .photo-item {
    width: 100%;
    height: auto;
    min-height: 190px;
    margin-bottom: 13px;
    break-inside: avoid;
    display: block;
}

.masonry-mode .photo-item:nth-child(3n) {
    height: 330px;
}

.masonry-mode .photo-item img {
    min-height: 190px;
}

.gallery-empty {
    text-align: center;
    padding: 55px;
    color: rgb(124, 135, 153);
}

.gallery-empty i {
    font-size: 50px;
    color: rgb(194, 205, 221);
}

.gallery-empty h3 {
    font-size: 16px;
    color: rgb(66, 80, 105);
}

.load-more-photos {
    display: block;
    margin: 28px auto 0px;
    height: 41px;
    padding: 0px 17px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgb(255, 255, 255);
    color: var(--blue);
    font-size: 12px;
    font-weight: 650;
}

.load-more-photos:disabled {
    color: rgb(141, 151, 168);
}

.lightbox-open {
    overflow: hidden;
}

.gallery-lightbox {
    position: fixed;
    inset: 0px;
    z-index: 10000;
    background: rgba(2, 8, 20, 0.96);
    color: rgb(255, 255, 255);
}

.gallery-lightbox[hidden] {
    display: none;
}

.lightbox-top {
    position: absolute;
    left: 0px;
    right: 0px;
    top: 0px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0px 24px;
    background: linear-gradient(rgba(0, 0, 0, 0.733), transparent);
    z-index: 2;
}

.lightbox-counter {
    font-size: 11px;
    color: rgb(220, 227, 238);
}

.lightbox-top > div {
    display: flex;
    gap: 5px;
}

.lightbox-top button, .lightbox-top a {
    width: 39px;
    height: 39px;
    border: 0px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.086);
    color: rgb(255, 255, 255);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-sizing: border-box;
}

.gallery-lightbox figure {
    position: absolute;
    inset: 65px 80px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0px;
}

.lightbox-image {
    max-width: 100%;
    max-height: calc(100% - 60px);
    object-fit: contain;
    box-shadow: rgb(0, 0, 0) 0px 15px 50px;
}

.gallery-lightbox figcaption {
    display: grid;
    text-align: center;
    margin-top: 14px;
}

.lightbox-title {
    font-size: 16px;
}

.lightbox-date {
    font-size: 12px;
    color: rgb(174, 184, 199);
    margin-top: 4px;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 47px;
    height: 47px;
    border: 0px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.094);
    color: rgb(255, 255, 255);
    font-size: 20px;
    z-index: 2;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-nav:hover, .lightbox-top button:hover, .lightbox-top a:hover {
    background: rgb(255, 255, 255);
    color: rgb(19, 36, 72);
}

@media (max-width: 1199px) {
    .photo-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .photo-grid.masonry-mode {
        columns: 3;
    }
}

@media (max-width: 767px) {
    .gallery-hero {
        padding: 16px 0px 25px;
    }

    .gallery-hero-icon {
        display: none;
    }

    .gallery-hero h1 {
        font-size: 24px;
    }

    .gallery-hero p {
        font-size: 11px;
    }

    .gallery-content.section {
        padding-top: 20px;
    }

    .gallery-section-head h2 {
        font-size: 17px;
    }

    .album-card {
        height: 235px;
    }

    .gallery-toolbar {
        display: block;
        margin-top: 27px;
    }

    .gallery-filters {
        margin-right: -15px;
        padding-right: 15px;
    }

    .gallery-tools {
        margin-top: 10px;
    }

    .gallery-tools select {
        flex: 1 1 0%;
    }

    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 150px;
        gap: 8px;
    }

    .photo-item.photo-wide {
        grid-column: span 2;
    }

    .photo-grid.masonry-mode {
        columns: 2;
        column-gap: 8px;
    }

    .masonry-mode .photo-item {
        margin-bottom: 8px;
    }

    .masonry-mode .photo-item:nth-child(3n) {
        height: 250px;
    }

    .photo-hover {
        opacity: 1;
        padding: 11px;
    }

    .photo-hover > i {
        display: none;
    }

    .photo-hover strong {
        font-size: 10px;
    }

    .gallery-lightbox figure {
        inset: 65px 12px 70px;
    }

    .lightbox-nav {
        width: 38px;
        height: 38px;
        background: rgba(0, 0, 0, 0.533);
    }

    .lightbox-prev {
        left: 7px;
    }

    .lightbox-next {
        right: 7px;
    }

    .lightbox-top {
        padding: 0px 10px;
    }

    .lightbox-top button, .lightbox-top a {
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 420px) {
    .photo-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 230px;
    }

    .photo-item.photo-wide {
        grid-column: auto;
    }

    .photo-grid.masonry-mode {
        columns: 1;
    }
}

@media print {
    header, .smart-search, .footer, .backtop, .video-modal, .gallery-hero, .featured-albums, .album-nav, .gallery-toolbar, .load-more-photos, .gallery-lightbox {
        display: none !important;
    }

    .gallery-content {
        padding: 0px;
    }

    .photo-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 180px;
    }
}
