/* HomeNew3 Gallery — premium violet glass grid */

.hn3-gallery {
    --hn3g-primary: #6d28d9;
    --hn3g-primary-dark: #5b21b6;
    --hn3g-soft: #ede9fe;
    --hn3g-ink: #1e1b2e;
    --hn3g-muted: #64748b;
    --hn3g-ease: cubic-bezier(0.22, 1, 0.36, 1);
    padding: 0.25rem 0 0.5rem;
}

.hn3-gallery__intro {
    max-width: 640px;
    margin: 0 auto 1.75rem;
    text-align: center;
}

.hn3-gallery__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.65rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: var(--hn3g-soft);
    color: var(--hn3g-primary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hn3-gallery__title {
    margin: 0;
    font-family: var(--hn2-serif, 'Playfair Display', Georgia, serif);
    font-size: clamp(1.55rem, 3vw, 2.1rem);
    font-weight: 600;
    color: var(--hn3g-ink);
    line-height: 1.2;
}

.hn3-gallery__title em {
    font-style: italic;
    color: var(--hn3g-primary);
}

.hn3-gallery__lead {
    margin: 0.6rem 0 0;
    color: var(--hn3g-muted);
    font-size: 0.95rem;
    line-height: 1.55;
}

.hn3-gallery__filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
    list-style: none;
    margin: 0 0 1.75rem;
    padding: 0;
}

.hn3-gallery__filter {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(109, 40, 217, 0.16);
    background: #fff;
    color: var(--hn3g-ink);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 650;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.hn3-gallery__filter:hover {
    border-color: rgba(109, 40, 217, 0.35);
    color: var(--hn3g-primary-dark);
}

.hn3-gallery__filter.is-active {
    background: var(--hn3g-primary);
    border-color: var(--hn3g-primary);
    color: #fff;
    box-shadow: 0 8px 22px rgba(109, 40, 217, 0.28);
}

.hn3-gallery__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.hn3-gallery__item {
    animation: hn3gRise 0.65s var(--hn3g-ease) var(--hn3g-delay, 0s) both;
}

.hn3-gallery__item.is-hidden {
    display: none;
}

.hn3-gallery__card {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 1.1rem;
    overflow: hidden;
    cursor: zoom-in;
    background: #ede9fe;
    aspect-ratio: 4 / 3;
    box-shadow: 0 12px 32px rgba(76, 29, 149, 0.1);
    transition: transform 0.3s var(--hn3g-ease), box-shadow 0.3s ease;
}

.hn3-gallery__card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 44px rgba(76, 29, 149, 0.18);
}

.hn3-gallery__card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s var(--hn3g-ease);
}

.hn3-gallery__card:hover img {
    transform: scale(1.06);
}

.hn3-gallery__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem;
    background: linear-gradient(180deg, transparent 35%, rgba(30, 10, 60, 0.78) 100%);
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hn3-gallery__card:hover .hn3-gallery__overlay,
.hn3-gallery__card:focus-visible .hn3-gallery__overlay {
    opacity: 1;
}

.hn3-gallery__caption {
    font-size: 0.9rem;
    font-weight: 700;
    text-align: left;
}

.hn3-gallery__zoom {
    align-self: flex-end;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
}

.hn3-gallery__empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--hn3g-muted);
    padding: 2rem;
}

/* Lightbox */
.hn3-gallery-lightbox {
    border: 0;
    padding: 0;
    max-width: min(920px, 94vw);
    background: transparent;
}

.hn3-gallery-lightbox::backdrop {
    background: rgba(15, 10, 30, 0.78);
    backdrop-filter: blur(6px);
}

.hn3-gallery-lightbox__close-wrap {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 2;
    margin: 0;
}

.hn3-gallery-lightbox__close {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--hn3g-ink);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.hn3-gallery-lightbox__img {
    display: block;
    width: 100%;
    max-height: min(78vh, 820px);
    object-fit: contain;
    border-radius: 1rem;
    background: #0f0a1e;
}

.hn3-gallery-lightbox__title {
    margin: 0.75rem 0 0;
    text-align: center;
    color: #fff;
    font-weight: 600;
}

@keyframes hn3gRise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    .hn3-gallery__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .hn3-gallery__grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hn3-gallery__item,
    .hn3-gallery__card,
    .hn3-gallery__card img {
        animation: none;
        transition: none;
    }
}
