/* GALLERY PAGE STYLES */

/* 1. Hero Section */
.gallery-hero {
    position: relative;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -70px; /* Pull up behind navbar if transparent */
    padding-top: 70px;
    overflow: hidden;
}
.text-shadow {
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* 2. Sticky Filter Bar */
.sticky-filter-bar {
    position: -webkit-sticky; /* Safari */
    position: sticky;
    top: var(--site-header-height, 76px);
    z-index: 90;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 10px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    
    /* [FIX] Breakout Container to Full Width (Tràn viền nền) */
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    
    /* [FIX] Smooth transition for sticky position */
    transition: top 0.3s ease;
}

@media (max-width: 991.98px) {
    .sticky-filter-bar {
        top: 0 !important;
    }
}

.filter-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none; /* Hide scrollbar */
}
.filter-scroll::-webkit-scrollbar { display: none; }

.filter-pill {
    background: #f3f4f6;
    border: 1px solid transparent;
    border-radius: 50px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #4b5563;
    white-space: nowrap;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.filter-pill:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    color: var(--primary-color);
}
.filter-pill.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* 3. Masonry Grid (CSS Columns) */
.masonry-grid {
    column-count: 4; /* Desktop: 4 cột */
    column-gap: 16px;
}

/* Responsive Columns */
@media (max-width: 1200px) {
    .masonry-grid { column-count: 3; }
}
@media (max-width: 768px) {
    .masonry-grid { column-count: 2; column-gap: 8px; }
}

.masonry-item {
    break-inside: avoid; /* Ngăn thẻ bị cắt đôi */
    margin-bottom: 16px;
}
@media (max-width: 768px) {
    .masonry-item { margin-bottom: 8px; }
}

/* 4. Photo Card */
.photo-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #eee; /* Placeholder color */
    transform: translateZ(0); /* Hardware acceleration */
    cursor: zoom-in;
    box-shadow: none;
    display: block;
}

.photo-card img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.photo-card:hover img {
    transform: scale(1.05);
}

/* Overlay Styles */
.photo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px 15px;
    border-top: none;
}

/* Desktop: Hover to show overlay */
@media (min-width: 769px) {
    .photo-card:hover .photo-overlay {
        opacity: 1;
    }
}

/* Mobile: Always show gradient at bottom, text visible */
@media (max-width: 768px) {
    .photo-overlay {
        opacity: 1;
        background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 40%);
        padding: 10px 12px;
    }
}

.overlay-content {
    color: white;
    transform: translateY(10px);
    transition: transform 0.3s ease;
    width: 100%;
}
.photo-card:hover .overlay-content {
    transform: translateY(0);
}
/* Mobile: No transform */
@media (max-width: 768px) {
    .overlay-content { transform: none; }
}

.user-info {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 4px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    color: white;
    /* Ép 1 dòng */
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.service-tag {
    font-size: 0.8rem;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    /* Ép 1 dòng */
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    display: inline-block;
    max-width: 100%;
}

/* Ẩn toàn bộ icon theo yêu cầu */
.zoom-icon {
    display: none;
}
.user-info i, .service-tag i {
    display: none;
}

/* 5. Fancybox Custom Caption (Content-to-Commerce) */
.fancybox-custom-caption {
    font-family: var(--font-family-sans-serif);
    text-align: left;
    padding: 10px 0;
}
.caption-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 8px;
}
.caption-text {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
    color: #eee;
}
.caption-cta {
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(255,255,255,0.1);
}
.cta-info {
    display: flex;
    flex-direction: column;
}
.cta-label { font-size: 0.7rem; text-transform: uppercase; opacity: 0.7; }
.cta-name { font-weight: 700; font-size: 0.9rem; color: #fff; }

/* [FIX] Ẩn icon mũi tên trong nút CTA của caption (theo yêu cầu) */
.caption-cta i, .caption-cta svg {
    display: none !important;
}

/* [NEW] Zalo Button in Gallery */
.btn-zalo-gallery {
    background-color: #0068ff !important;
    color: white !important;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    animation: pulse-blue 2s infinite; /* Hiệu ứng nhịp đập */
    text-decoration: none;
}
.btn-zalo-gallery:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 104, 255, 0.4);
}
.zalo-icon-box {
    background: white;
    color: #0068ff;
    font-family: sans-serif;
    font-weight: 900;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    line-height: 1;
}
@keyframes pulse-blue {
    0% { box-shadow: 0 0 0 0 rgba(0, 104, 255, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(0, 104, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 104, 255, 0); }
}
