/* Gallery specific styles extracted from gallery.php */
.gallery-section {
    padding: 120px 0 80px;
    background: linear-gradient(135deg, var(--beige-light) 0%, var(--light-gold) 100%);
    min-height: 100vh;
}

.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.4rem;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
}

.filter-btn.active {
    color: var(--primary-gold);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.gallery-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: var(--white);
    box-shadow: 0 10px 30px var(--shadow-light);
    transition: all 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px var(--shadow-medium);
}

.gallery-image {
    width: 100%;
    height: 300px;
    background: linear-gradient(45deg, var(--beige-light), var(--light-gold));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 3rem;
    position: relative;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 2rem;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-info {
    padding: 1.5rem;
}

.gallery-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.gallery-description {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
}

.gallery-category {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--primary-gold);
    color: var(--white);
    padding: 0.3rem 1rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    overflow: auto;
}

.modal-content {
    position: relative;
    margin: 5% auto;
    max-width: 90%;
    max-height: 90%;
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
}

.modal-image {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    background: var(--beige-light);
}

.modal-info {
    padding: 2rem;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--white);
    font-size: 2rem;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--primary-gold);
}

.before-after {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.before-after-item {
    text-align: center;
    padding: 2rem;
    border-radius: 20px;
    background: var(--white);
    box-shadow: 0 10px 30px var(--shadow-light);
}

.before-after-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.before-after-image {
    width: 100%;
    height: 250px;
    background: linear-gradient(45deg, var(--beige-light), var(--light-gold));
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.before-after-label {
    background: var(--primary-gold);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 15px;
    font-weight: 600;
    display: inline-block;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }

    .before-after {
        grid-template-columns: 1fr;
    }

    .gallery-filters {
        gap: 0.5rem;
    }

}

/* Enhanced dynamic gallery & before/after (outside media) */
.before-after-item {
    text-align: center;
    padding: 1.25rem 1.25rem 1.5rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 32px -8px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
    position: relative;
}

.before-after-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 1rem;
    color: var(--text-dark);
}

.before-after-pair {
    display: flex;
    gap: .75rem;
}

@media (max-width:880px) {
    .before-after-pair {
        flex-direction: column;
    }
}

.before-after-img {
    position: relative;
    flex: 1;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 14px;
    background: linear-gradient(45deg, var(--beige-light), var(--light-gold));
}

.before-after-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.before-after-img .tag {
    position: absolute;
    top: .55rem;
    left: .55rem;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    padding: .25rem .6rem;
    font-size: .65rem;
    letter-spacing: .5px;
    border-radius: 8px;
    font-weight: 600;
}

.before-after-img .tag.after {
    background: var(--primary-gold);
    color: #1e1a17;
}

.before-after-label {
    margin-top: .85rem;
    background: var(--primary-gold);
    color: #fff;
    padding: .45rem .9rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: .7rem;
    letter-spacing: .5px;
    display: inline-block;
}

/* Consistent aspect ratio for all gallery thumbnails */
.gallery-image {
    position: relative;
}

.gallery-image img {
    aspect-ratio: 4 / 5;
    object-fit: cover;
}

/* Loading / empty states */
.gallery-loading {
    text-align: center;
    padding: 2rem;
    font-weight: 600;
    color: var(--text-light);
}

/* Hide items smoothly */
.gallery-item {
    opacity: 1;
    transition: opacity .3s ease, transform .3s ease;
}

.gallery-item[style*='display: none'] {
    opacity: 0;
    transform: scale(.95);
}