
.public-gallery-description {
    margin: 8px 0 16px;
    color: var(--muted);
    font-size: 13px;
}

.gallery-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0 12px;
    scrollbar-width: none;
}

.gallery-filters::-webkit-scrollbar {
    display: none;
}

.gallery-filter {
    flex-shrink: 0;
    padding: 9px 15px;
    border: 0;
    border-radius: 999px;
    background: var(--background);
    color: var(--primary);
    font-size: 12px;
}

.gallery-filter.active {
    background: var(--primary);
    color: #FFFFFF;
}

.public-portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.public-portfolio-grid [hidden] {
    display: none !important;
}

.gallery-photo {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: var(--background);
    cursor: zoom-in;
}

.gallery-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 250ms ease;
}

.gallery-photo:hover img {
    transform: scale(1.035);
}

.gallery-photo:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.gallery-hint {
    margin: 16px 0 0;
    color: var(--muted);
    text-align: center;
    font-size: 11px;
}

/* Visualização ampliada */

.gallery-dialog {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 20px;
    border: 0;
    background: #111111;
    color: #FFFFFF;
    overflow-y: auto;
}

.gallery-dialog[open] {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gallery-dialog::backdrop {
    background: rgba(0, 0, 0, 0.95);
}

.gallery-close {
    position: absolute;
    z-index: 2;
    top: max(20px, env(safe-area-inset-top));
    right: 20px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
}

.gallery-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
}

.gallery-stage img {
    display: block;
    max-width: 100%;
    max-height: 68dvh;
    object-fit: contain;
    border-radius: 10px;
}

.gallery-caption {
    max-width: 600px;
    margin-top: 20px;
    text-align: center;
    overflow-wrap: anywhere;
}

.gallery-caption h2 {
    margin: 0 0 8px;
    font-size: 16px;
}

.gallery-caption p {
    margin: 0;
    color: #C7C7CC;
    font-size: 13px;
    white-space: pre-line;
}

.gallery-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 26px;
    margin-top: 20px;
}

.gallery-controls button {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #FFFFFF;
}

.gallery-controls button:disabled {
    opacity: 0.3;
}

#gallery-counter {
    font-size: 12px;
    color: #FFFFFF;
}

@media (prefers-reduced-motion: reduce) {
    .gallery-photo img {
        transition: none;
    }

    .gallery-photo:hover img {
        transform: none;
    }
}
