/* Explain: Styling for the gallery filters, cards, and lightbox. */
.gallery-filter {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: rgba(38, 42, 46, 0.8);
    padding: 0.65rem 1.35rem;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transition: background-color 300ms ease, color 300ms ease, border-color 300ms ease, box-shadow 300ms ease;
}

.gallery-filter:hover {
    border-color: var(--accent-color);
    color: var(--text-color);
}

.gallery-filter:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}

.gallery-filter.is-active {
    border-color: transparent;
    background: var(--primary-color);
    color: var(--button-text-color);
    box-shadow: var(--shadow-button);
}

.gallery-card {
    display: block;
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    border-radius: 1.9rem;
    background: rgba(38, 42, 46, 0.78);
    box-shadow: var(--shadow-soft);
    text-align: left;
    font-family: var(--font-body);
    transition: transform 300ms ease, box-shadow 300ms ease, border-color 300ms ease;
}

.gallery-card:hover {
    border-color: rgba(255, 211, 77, 0.5);
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.5);
    transform: translateY(-5px);
}

.gallery-card:focus-visible {
    border-color: var(--accent-color);
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}

.gallery-card.is-hidden {
    display: none;
}

.gallery-card-media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: var(--surface-color);
}

.gallery-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 600ms ease;
}

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

.gallery-card-body {
    display: block;
    padding: 1.1rem 1.25rem 1.4rem;
}

.gallery-tag {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: var(--sage-soft);
    padding: 0.3rem 0.85rem;
    color: var(--sage-dark);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.gallery-card-title {
    display: block;
    margin-top: 0.75rem;
    color: var(--text-color);
    font-family: var(--font-heading);
    font-size: 1.08rem;
    font-weight: 600;
    line-height: 1.35;
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
    padding: 1rem;
    backdrop-filter: blur(6px);
}

.gallery-lightbox.is-open {
    display: flex;
}

.gallery-lightbox-panel {
    position: relative;
    width: min(100%, 60rem);
    border-radius: 1.8rem;
    background: var(--background-color);
    padding: 0.85rem 0.85rem 1.35rem;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

.gallery-lightbox-close {
    position: absolute;
    top: -1.1rem;
    right: -0.4rem;
    display: inline-flex;
    width: 2.9rem;
    height: 2.9rem;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: var(--surface-color);
    color: var(--text-color);
    box-shadow: var(--shadow-soft);
    transition: background-color 300ms ease, color 300ms ease;
}

.gallery-lightbox-close:hover {
    background: var(--primary-color);
    color: var(--button-text-color);
}

.gallery-lightbox-image {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 68vh;
    margin: 0 auto;
    border-radius: 1.2rem;
    background: var(--surface-color);
    object-fit: contain;
    opacity: 1;
    transition: opacity 250ms ease;
}

.gallery-lightbox.is-loading .gallery-lightbox-image {
    opacity: 0;
}

.gallery-lightbox-spinner {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
}

.gallery-lightbox.is-loading .gallery-lightbox-spinner {
    display: flex;
}

.gallery-spinner-ring {
    width: 2.6rem;
    height: 2.6rem;
    border: 3px solid rgba(242, 128, 30, 0.28);
    border-top-color: var(--accent-color);
    border-radius: 999px;
    animation: gallery-spin 800ms linear infinite;
}

@keyframes gallery-spin {
    to {
        transform: rotate(360deg);
    }
}

.gallery-lightbox-caption {
    display: block;
    padding: 1rem 0.6rem 0;
    color: var(--text-color);
    font-family: var(--font-heading);
    font-size: 1.12rem;
    font-weight: 600;
    text-align: center;
}

.gallery-lightbox-description {
    display: block;
    padding: 0.35rem 0.6rem 0;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.65;
    text-align: center;
}

.gallery-empty {
    border: 1px dashed var(--glass-border);
    border-radius: 1.6rem;
    background: rgba(38, 42, 46, 0.7);
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.8;
    text-align: center;
}

@media (max-width: 767px) {
    .gallery-lightbox-panel {
        padding: 0.65rem 0.65rem 1.1rem;
        border-radius: 1.4rem;
    }

    .gallery-lightbox-image {
        max-height: 58vh;
    }

    .gallery-lightbox-close {
        top: -0.85rem;
        right: -0.2rem;
    }
}