/*
Galeria de Fotos - Estilos
*/

/* Reset para garantir que o grid funcione corretamente */
.gallery-summary * {
    box-sizing: border-box;
}

/* Forçar grid layout */
.gallery-summary .gallery-mosaic {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 1rem !important;
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto 2rem auto !important;
    grid-auto-rows: 1fr !important;
}

/* Garantir que o container tenha largura adequada */
.gallery-summary .container {
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 1rem !important;
    box-sizing: border-box !important;
}

/* Garantir que o item da galeria tenha tamanho adequado */
.gallery-summary .gallery-item {
    width: 100% !important;
    height: 100% !important;
    min-height: 200px !important;
    max-height: 300px !important;
    aspect-ratio: 1 !important;
}

/* Garantir que a imagem tenha tamanho adequado */
.gallery-summary .gallery-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

/* Responsividade específica para o mosaico */
@media (max-width: 768px) {
    .gallery-summary .gallery-mosaic {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
        gap: 0.75rem !important;
    }
}

@media (max-width: 480px) {
    .gallery-summary .gallery-mosaic {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
        gap: 0.5rem !important;
    }
}

/* Garantir que o grid funcione em todos os navegadores */
.gallery-summary .gallery-mosaic {
    display: -ms-grid !important;
    display: grid !important;
    -ms-grid-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    grid-auto-flow: row !important;
    grid-auto-rows: 1fr !important;
    align-items: stretch !important;
    justify-items: stretch !important;
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto 2rem auto !important;
    gap: 1rem !important;
    box-sizing: border-box !important;
}

/* Seção de resumo na página inicial */
.gallery-summary {
    padding: 4rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    width: 100%;
    overflow: hidden;
}

.gallery-summary .container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 1rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.gallery-summary-header {
    text-align: center;
    margin-bottom: 3rem;
}

.gallery-summary-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
}

.gallery-summary-subtitle {
    font-size: 1.1rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
}

.gallery-mosaic {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 1rem !important;
    margin-bottom: 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    width: 100% !important;
    grid-auto-rows: 1fr !important;
}

.gallery-item {
    position: relative !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    aspect-ratio: 1 !important;
    min-height: 200px !important;
    max-height: 300px !important;
    width: 100% !important;
    height: 100% !important;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.3s ease !important;
    display: block !important;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
    transform: translateY(0);
}

.gallery-item-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.gallery-item-author {
    font-size: 0.875rem;
    opacity: 0.9;
}

.gallery-view-more {
    text-align: center;
}

.gallery-view-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #3b82f6;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.gallery-view-more-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Página dedicada da galeria */
.gallery-page {
    min-height: 100vh;
    background: #f8fafc;
}

.gallery-page-header {
    background: white;
    padding: 2rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.gallery-page-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
}

.gallery-page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    margin-bottom: 1rem;
}

.gallery-page-subtitle {
    text-align: center;
    color: #64748b;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* =========================
   Gallery Filters - Same as News Page
   ========================== */

/* Garantir que o espaçamento seja igual ao da página de notícias */
.space-y-4 > * + * {
    margin-top: 1rem !important;
}

/* Botões de categoria - estilos básicos (mesmo da página de notícias) */
.gallery-filter {
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.gallery-filter.active {
    background-color: #dbeafe !important;
    color: #1e40af !important;
}

.gallery-filter:not(.active) {
    background-color: #f3f4f6 !important;
    color: #374151 !important;
}

.gallery-filter:not(.active):hover {
    background-color: #e5e7eb !important;
    color: #111827 !important;
}

/* Responsividade básica (mesmo da página de notícias) */
@media (max-width: 640px) {
    .gallery-filter {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
}

@media (max-width: 480px) {
    .gallery-filter {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Layout estático para a página da galeria completa */
.gallery-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    min-height: 200px;
    background: transparent;
}

.gallery-grid-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    break-inside: avoid;
    display: flex;
    flex-direction: column;
    min-height: 410px;
    position: relative;
    z-index: 1;
    user-select: none;
    height: 100%;
}

.gallery-grid-item-category {
    display: inline-block;
    background: rgba(224, 231, 255, 0.6);
    color: blue;
    font-size: 0.85rem;
    font-weight: 400;
    border-radius: 8px;
    padding: 2px 10px;
    width: fit-content;
    margin-bottom: 0.5rem;
    margin-top: 0.2rem;
}

.gallery-grid-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.gallery-grid-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    background-color: #f8fafc;
}

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

.gallery-grid-item-content {
    padding: 1.2rem 1.2rem 1rem 1.2rem;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.gallery-grid-item-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.gallery-grid-item-description {
    color: #64748b;
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
    line-height: 1.5;
    flex-grow: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.gallery-grid-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: auto;
    padding-top: 0.7rem;
    border-top: 1px solid #f1f5f9;
}

/* Remover variações de altura do mosaico */
.gallery-grid-item:nth-child(3n+1) img,
.gallery-grid-item:nth-child(3n+2) img,
.gallery-grid-item:nth-child(3n+3) img,
.gallery-grid-item:nth-child(5n+1) img,
.gallery-grid-item:nth-child(7n+1) img {
    height: 180px !important;
}

/* Modal de visualização */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-modal.active {
    display: flex;
    opacity: 1;
}

.gallery-modal-content {
    position: relative;
    width: 70%;
    max-height: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.gallery-modal.active .gallery-modal-content {
    transform: scale(1);
}

.gallery-modal-img {
    width: 100%;
    max-height: 60vh;
    object-fit: contain;
    background: #f8fafc;
}

.gallery-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: #000000;
    font-size: 1.5rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.gallery-modal-close:hover {
    background: white;
    color: #4779ca;
    transform: scale(1.1);
}

.gallery-modal-info {
    padding: 2rem;
    background: white;
    color: #1e293b;
}

.gallery-modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #17202e;
}

.gallery-modal-description {
    color: #424c5b;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.gallery-modal-author {
    font-size: 0.875rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Responsividade */
@media (max-width: 768px) {
    .gallery-summary-title {
        font-size: 2rem;
    }
    
    .gallery-mosaic {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
        gap: 0.75rem !important;
        max-width: 100% !important;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
        padding: 1rem;
    }
    
    .gallery-filters {
        padding: 1rem 0;
    }
    
    .gallery-filters .container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .gallery-filter {
        text-align: center;
    }
    
    /* Modal responsivo */
    .gallery-modal {
        padding: 1rem;
    }
    
    .gallery-modal-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .gallery-modal-img {
        max-height: 60vh;
    }
    
    .gallery-modal-info {
        padding: 1.5rem;
    }
    
    .gallery-modal-title {
        font-size: 1.25rem;
    }
    
    .gallery-modal-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 35px;
        height: 35px;
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .gallery-mosaic {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
        gap: 0.5rem !important;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-summary-title {
        font-size: 1.75rem;
    }
    
    .gallery-page-title {
        font-size: 2rem;
    }
    
    /* Modal para mobile */
    .gallery-modal {
        padding: 0.5rem;
    }
    
    .gallery-modal-content {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .gallery-modal-img {
        max-height: 50vh;
    }
    
    .gallery-modal-info {
        padding: 1rem;
    }
    
    .gallery-modal-title {
        font-size: 1.1rem;
    }
    
    .gallery-modal-description {
        font-size: 0.9rem;
    }
    
    .gallery-modal-close {
        top: 0.25rem;
        right: 0.25rem;
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
} 

/* Layout estático para o resumo da galeria na home */
.gallery-summary .gallery-mosaic {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
    gap: 1.5rem !important;
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto 2rem auto !important;
    grid-auto-rows: unset !important;
    align-items: stretch !important;
    justify-items: stretch !important;
}

.gallery-summary .gallery-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.10);
    transition: box-shadow 0.3s, transform 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    min-height: 370px;
    max-width: 100%;
    aspect-ratio: unset !important;
    height: 100%;
}

.gallery-summary .gallery-item img {
    width: 100% !important;
    height: 180px !important;
    object-fit: cover !important;
    display: block !important;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.gallery-summary .gallery-item-content {
    padding: 1.2rem 1.2rem 1rem 1.2rem;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.gallery-summary .gallery-grid-item-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.gallery-summary .gallery-grid-item-category {
    display: inline-block;
    background: #e0e7ff;
    color: #3730a3;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 8px;
    padding: 2px 10px;
    margin-bottom: 0.5rem;
    margin-top: 0.2rem;
}

.gallery-summary .gallery-grid-item-description {
    color: #64748b;
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
    line-height: 1.5;
    flex-grow: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.gallery-summary .gallery-grid-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: auto;
    padding-top: 0.7rem;
    border-top: 1px solid #f1f5f9;
}

/* Sobrescrever variações de altura do mosaico apenas no resumo */
.gallery-summary .gallery-item img,
.gallery-summary .gallery-item,
.gallery-summary .gallery-item-content {
    height: unset !important;
    min-height: unset !important;
    max-height: unset !important;
} 