/* Ajustes específicos para páginas de Espaços */

/* 0. BACKGROUND PADRONIZADO - Tom creme suave */
.single-espaco {
    background-color: #fff3d8 !important;
}

/* Aplicar background creme apenas nas seções que NÃO são a primeira (hero) */
.single-espaco .elementor-section:not(:first-child) {
    background-color: #fff3d8 !important;
}

/* Remover backgrounds diferentes das seções (exceto a primeira) */
.single-espaco .elementor-section:not(:first-child)[data-settings*="background_color"] {
    background-color: #fff3d8 !important;
}

/* 1. HERO SECTION - Configurações sem sobrescrever background */
.single-espaco .elementor-section:first-child {
    min-height: 37.5rem !important;
    padding-top: 15.625rem !important;
    padding-bottom: 15.625rem !important;
    /* NÃO definir background-color aqui para permitir que o Elementor controle */
}

.single-espaco .elementor-section:first-child .elementor-column {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 4. ACERVO EM DESTAQUE - Melhor espaçamento e centralização */
/* Procurar pela seção que contém "ACERVO EM DESTAQUE" */
.single-espaco .elementor-section:has(.gallery-section),
.single-espaco .gallery-section,
.single-espaco section.gallery-section,
section.gallery-section,
.elementor-section.gallery-section {
    padding-top: 5rem !important;
    padding-bottom: 5rem !important;
    position: relative !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    z-index: 1 !important;
    clear: both !important;
}

/* IMPORTANTE: Remover qualquer margin negativo que possa existir */
.single-espaco .elementor-section:has(.gallery-section),
.elementor-section:has(.gallery-section),
section:has(.gallery-section) {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Forçar remoção de margin negativo em elementos internos */
.single-espaco .elementor-section .gallery-section,
.elementor-section .gallery-section,
section .gallery-section {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Garantir que não haja overlap entre seções */
.single-espaco .elementor-section {
    position: relative !important;
    z-index: auto !important;
}

/* Forçar que container da seção de Acervo não tenha margin negativo */
.single-espaco .elementor-section > .elementor-container,
.elementor-section > .elementor-container {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* FORÇA BRUTA: Remover margin negativo de QUALQUER seção do Elementor */
.elementor-section[data-settings*="margin"],
.elementor-section[style*="margin-top: -"],
.elementor-section[style*="margin-top:-"] {
    margin-top: 0 !important;
}

/* Forçar que seções com HTML widget (gallery-section) não tenham margin negativo */
.elementor-section:has(.elementor-widget-html),
.elementor-section:has(.gallery-section),
.elementor-section:has(section.gallery-section) {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Garantir espaçamento correto entre todas as seções */
.single-espaco .elementor-section + .elementor-section {
    margin-top: 0 !important;
}

/* Título da galeria */
.single-espaco h2.section-title:contains("ACERVO"),
.single-espaco .section-title {
    margin-top: 0 !important;
    margin-bottom: 2.5rem !important;
    padding-bottom: 1.25rem !important;
    font-size: 2.8rem !important;
}

.single-espaco h3.section-title {
    font-size: 2.8rem !important;
}

/* Container do Swiper de obras - centralizado */
.single-espaco .swiper-container.obras-swiper,
.single-espaco .obras-swiper {
    padding: 1.875rem 0 !important;
    margin: 1.875rem auto !important;
    max-width: 87.5rem !important;
    display: flex !important;
    justify-content: center !important;
}

/* Wrapper do swiper centralizado */
.single-espaco .obras-swiper .swiper-wrapper {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

/* Centralizar os cards de obras */
.single-espaco .obras-swiper .swiper-slide {
    display: flex !important;
    justify-content: center !important;
    width: auto !important;
}

/* AUMENTAR TAMANHO DOS CARDS */
.single-espaco .obras-swiper .work-card,
.single-espaco .swiper-container.obras-swiper .work-card {
    margin: 0 auto !important;
    display: block !important;
    max-width: 25rem !important;
    min-width: 21.875rem !important;
    width: 100% !important;
}

/* Aumentar tamanho da imagem dos cards */
.single-espaco .obras-swiper .work-image,
.single-espaco .swiper-container.obras-swiper .work-image {
    height: 25rem !important;
    min-height: 25rem !important;
}

/* Grid de obras centralizado */
.single-espaco .works-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 2.5rem !important;
    justify-items: center !important;
    max-width: 87.5rem !important;
    margin: 0 auto !important;
}

/* Forçar centralização quando show-all-cards está ativo */
.single-espaco .obras-swiper.show-all-cards {
    display: block !important;
}

.single-espaco .obras-swiper.show-all-cards .swiper-wrapper {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 2.5rem !important;
    justify-items: center !important;
    transform: none !important;
    width: 100% !important;
}

.single-espaco .obras-swiper.show-all-cards .swiper-slide {
    width: auto !important;
    margin: 0 !important;
}

.single-espaco .obras-swiper.show-all-cards .work-card {
    max-width: 25rem !important;
    min-width: 21.875rem !important;
    width: 100% !important;
}

/* Aumentar fonte dos títulos dos cards */
.single-espaco .work-info h4 {
    font-size: 1.3rem !important;
}

.single-espaco .work-info p {
    font-size: 1rem !important;
}

/* Centralizar copyright no footer */
.single-espaco .footer-bottom {
    text-align: center !important;
}

.single-espaco .footer-bottom p {
    text-align: center !important;
    margin: 0 auto !important;
    padding: 0 !important;
}

.single-espaco .footer .container {
    padding-left: 20px !important;
    padding-right: 20px !important;
}

/* 5. DADOS DO ACERVO - Melhor espaçamento */
/* Procurar pela seção que contém "DADOS DO ACERVO" */
.single-espaco .elementor-section .container {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
}

.single-espaco .container h2 {
    margin-top: 2.5rem !important;
    margin-bottom: 1.875rem !important;
    padding-top: 1.25rem !important;
}

.single-espaco .container p {
    margin-bottom: 1.5625rem !important;
    line-height: 1.8 !important;
    text-align: justify !important;
}

.single-espaco .digital-repository {
    margin-top: 3.125rem !important;
    margin-bottom: 3.125rem !important;
    padding: 1.875rem 0 !important;
}

/* 6. EQUIPE TÉCNICA - Forçar 3 cards visíveis com overflow hidden */
.single-espaco .equipe-swiper {
    overflow: hidden !important;
}

.single-espaco .equipe-swiper .swiper-wrapper {
    display: flex !important;
}

.single-espaco .equipe-swiper .swiper-slide {
    width: calc(33.333% - 16px) !important;
    flex-shrink: 0 !important;
    margin-right: 24px !important;
}

/* Garantir que o container não mostre mais de 3 */
.single-espaco .swiper-container.equipe-swiper {
    overflow: hidden !important;
    width: 100% !important;
}

/* Seção da equipe técnica */
.single-espaco section.gallery-section:has(.equipe-swiper) {
    padding-top: 5rem !important;
    padding-bottom: 5rem !important;
    position: relative !important;
    margin-top: 0 !important;
    z-index: 1 !important;
}

@media (max-width: 1024px) {
    .single-espaco .equipe-swiper .swiper-slide {
        width: calc(50% - 16px) !important;
    }
}

@media (max-width: 768px) {
    .single-espaco .equipe-swiper .swiper-slide {
        width: 100% !important;
    }
}

/* Garantir que o Elementor não sobrescreva */
.single-espaco .elementor-widget-html {
    width: 100% !important;
}

/* Espaçamento geral entre seções do Elementor */
.single-espaco .elementor-section {
    margin-bottom: 0 !important;
    position: relative !important;
    z-index: auto !important;
}

/* Prevenir qualquer posicionamento absoluto ou flutuante nas seções */
.single-espaco .elementor-section,
.single-espaco .elementor-container,
.single-espaco .elementor-column,
.single-espaco .elementor-widget-wrap {
    position: relative !important;
    float: none !important;
    clear: both !important;
}

/* CORREÇÃO: Garantir que seção de notícias tenha espaçamento quando visível */
.single-espaco .elementor-section:has(.elementor-widget-posts:has(.elementor-post)) {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
    margin-bottom: 0 !important;
    display: block !important;
}

/* Garantir que seção seguinte (Acervo) não suba quando Notícias estiver visível */
.single-espaco .elementor-section:has(.elementor-widget-posts:has(.elementor-post)) + .elementor-section {
    margin-top: 0 !important;
    padding-top: 2.5rem !important;
}

/* Forçar espaçamento interno nas seções */
.single-espaco .elementor-section > .elementor-container {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
}

/* AJUSTAR espaçamento entre seção de texto (com botão avaliações) e redes sociais */
.single-espaco .elementor-section:nth-child(2) {
    padding-bottom: 1.875rem !important;
    margin-bottom: 0 !important;
}

.single-espaco .elementor-section:nth-child(2) > .elementor-container {
    padding-bottom: 1.875rem !important;
}

.single-espaco .elementor-section:nth-child(3) {
    padding-top: 1.875rem !important;
    margin-top: 0 !important;
}

.single-espaco .elementor-section:nth-child(3) > .elementor-container {
    padding-top: 1.875rem !important;
}

/* Aumentar distância do botão de avaliações para a foto acima */
.single-espaco .digital-repository {
    margin-top: 3.125rem !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
}

.single-espaco .btn-avaliacoes {
    margin-bottom: 0 !important;
}

/* Padronizar espaçamento da seção location */
.single-espaco .location-section {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Padronizar espaçamento entre content-grid e botão */
.single-espaco .content-grid {
    margin-bottom: 0 !important;
}

.single-espaco .content-grid:last-of-type {
    margin-bottom: 0 !important;
}
