/* Galeria PhotoSwipe */
.post-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 30px 0;
    padding: 0;
    list-style: none;
}

/* Item da galeria */
.gallery-item {
    position: relative;
    display: block;
    text-decoration: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background: #f8f9fa;
    aspect-ratio: 1;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

/* Thumbnails */
.gallery-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
    border: none;
}

.gallery-item:hover .gallery-thumbnail {
    transform: scale(1.08);
}

/* Caption overlay */
.gallery-caption-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 25px 15px 15px;
    font-size: 14px;
    line-height: 1.4;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-weight: 500;
}

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

/* Indicador de zoom */
.gallery-item::before {
    content: '🔍';
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 8px;
    border-radius: 50%;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
}

.gallery-item:hover::before {
    opacity: 1;
    transform: scale(1.1);
}

/* Loading placeholder */
.gallery-thumbnail[src=""] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Responsivo */
@media (max-width: 768px) {
    .post-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin: 20px 0;
    }
    
    .gallery-item {
        border-radius: 8px;
    }
    
    .gallery-caption-overlay {
        font-size: 12px;
        padding: 20px 12px 12px;
    }
}

@media (max-width: 480px) {
    .post-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin: 15px 0;
    }
    
    .gallery-item {
        border-radius: 6px;
    }
    
    .gallery-caption-overlay {
        font-size: 11px;
        padding: 15px 10px 10px;
    }
    
    .gallery-item::before {
        top: 8px;
        right: 8px;
        padding: 4px 6px;
        font-size: 12px;
    }
}

/* Para tablets */
@media (min-width: 769px) and (max-width: 1023px) {
    .post-gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

/* Para desktop: 4 colunas */
@media (min-width: 1024px) {
    .post-gallery {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
    
    .gallery-item {
        border-radius: 12px;
    }
}

/* Para telas muito grandes */
@media (min-width: 1400px) {
    .post-gallery {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }
}

/* Melhorias de acessibilidade */
.gallery-item:focus {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}

.gallery-item:focus:not(:focus-visible) {
    outline: none;
}

/* Título da galeria (opcional) */
.post-gallery-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    margin-top: 30px;
    color: #333;
}

/* Contador de imagens (opcional) */
.gallery-count {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
    text-align: center;
}