/*=================================================================
  GALLERY (gallery.php)
  Colores desde $BrandColors (text.php) via variables --brand-*
=================================================================*/

.section-gallery-arch {
    --gal-bg: var(--brand-light);
    --gal-accent: var(--brand-primary);
    --gal-text: var(--brand-dark);
    --gal-muted: rgba(0, 0, 0, 0.65);

    padding: 120px 0;
    background-color: var(--gal-bg);
    color: var(--gal-text);
    position: relative;
}

/* --- Header --- */
.gal-header {
    text-align: center;
    margin: 0 auto 50px;
    max-width: 800px;
}

.gal-title {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 300;
    line-height: 1.15;
    color: var(--gal-text);
    margin-top: 10px;
}

.gal-title strong {
    font-weight: 800;
    color: var(--gal-text);
}

.gal-text {
    margin-top: 20px;
    color: var(--brand-text);
    font-size: 18px;
    line-height: 30px;
}

/* --- Filter Tabs --- */
.gallery-filter-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 auto 60px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 40px;
    max-width: fit-content;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .06), inset 0 1px 0 rgba(255, 255, 255, .8);
}

.filter-btn {
    border: none;
    outline: none;
    background: transparent;
    color: var(--gal-muted);
    padding: 12px 22px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .3px;
    cursor: pointer;
    transition: all .35s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    z-index: 0;
}

.filter-btn svg {
    width: 18px;
    height: 18px;
    transition: .35s ease;
}

.filter-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--gal-accent), color-mix(in srgb, var(--gal-accent) 75%, white));
    opacity: 0;
    transition: .35s ease;
    z-index: -1;
    border-radius: inherit;
}

.filter-btn:hover {
    color: var(--gal-text);
    transform: translateY(-3px);
}

.filter-btn:hover svg {
    transform: rotate(-10deg) scale(1.15);
}

.filter-btn.active {
    color: var(--brand-white);
    box-shadow: 0 12px 25px rgba(var(--brand-primary-rgb), .3), 0 4px 10px rgba(0, 0, 0, .08);
    transform: translateY(-2px);
}

.filter-btn.active::before {
    opacity: 1;
}

/* --- Grid --- */
.gallery-masonry {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    min-height: 300px;
}

.gallery-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    cursor: pointer;
    display: none;
    opacity: 0;
    transform: translateY(20px);
    height: 320px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, .08);
    transition: box-shadow .4s ease;
}

.gallery-card.show {
    display: block;
    animation: revealItem 0.5s forwards;
}

@keyframes revealItem {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-card:hover {
    box-shadow: 0 25px 50px rgba(0, 0, 0, .18);
}

.gallery-card-link,
.HoverEffect,
.video-item,
.HoverEffect figure {
    width: 100%;
    height: 100%;
    margin: 0;
    display: block;
    position: relative;
}

.gallery-card img,
.gallery-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease, filter 0.6s ease;
}

.gallery-card img {
    filter: grayscale(20%);
}

.gallery-card:hover img,
.gallery-card:hover video {
    transform: scale(1.08);
}

.gallery-card:hover img {
    filter: grayscale(0%);
}

/* Overlay Hover */
.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.1) 60%);
    opacity: 0;
    transition: 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 28px;
    pointer-events: none;
}

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

.card-info h4 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 5px 0;
    color: var(--brand-white);
    transform: translateY(10px);
    transition: 0.4s ease 0.1s;
}

.card-info span {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gal-accent);
    display: block;
    transform: translateY(10px);
    transition: 0.4s ease 0.2s;
}

.gallery-card:hover .card-info h4,
.gallery-card:hover .card-info span {
    transform: translateY(0);
}

.card-zoom-icon,
.video-icon {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-white);
    border-radius: 50%;
    z-index: 2;
}

.card-zoom-icon {
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    transform: translateY(-10px);
    opacity: 0;
    transition: 0.4s ease 0.1s;
}

.gallery-card:hover .card-zoom-icon {
    transform: translateY(0);
    opacity: 1;
}

.video-icon {
    top: 50%;
    left: 50%;
    width: 64px;
    height: 64px;
    transform: translate(-50%, -50%);
    background: var(--gal-accent);
    box-shadow: 0 0 0 10px rgba(var(--brand-primary-rgb), .25);
}

.gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px dashed rgba(0, 0, 0, 0.15);
    border-radius: 20px;
    color: var(--brand-text);
}

@media (max-width: 768px) {
    .section-gallery-arch {
        padding: 70px 0;
    }

    .gallery-filter-nav {
        padding: 10px;
        border-radius: 25px;
        width: 100%;
        max-width: 100%;
    }

    .filter-btn {
        flex: 1 1 calc(50% - 10px);
        justify-content: center;
        font-size: 13px;
        padding: 10px 12px;
    }

    .gallery-masonry {
        grid-template-columns: 1fr;
    }

    .gallery-card {
        height: 260px;
    }
}
