/* Esconde loops secundários da homepage sem paginação */
.gb-element-977e3fc5:not(:has(.gb-looper-a0414682, .gb-looper-f79b4eb4)) {
    display: none;
}

.gb-element-1f992b8d:not(:has(.gb-looper-f79b4eb4)) {
    display: none;
}

/* Esconde o span inteiro com todas as categorias */
.gb-text-2bcf6394 .gb-text {
    font-size: 0;
}

/* Esconde todas as vírgulas e links */
.gb-text-2bcf6394 .gb-text a {
    display: none;
}

/* Mostra só o primeiro como badge */
.gb-text-2bcf6394 .gb-text a:first-of-type {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 3px;
    text-decoration: none;
    background: #1a1a2e;
    color: #ffffff;
    margin-bottom: 8px;
}

.gb-text-2bcf6394 .gb-shape {
    display: none;
}

.gb-text-2bcf6394 .gb-text a:first-of-type:hover {
    opacity: 0.75;
}

/* Loop Motos */
.gb-text-4666a877 {
	padding: 2px 16px;
    position: relative;
}

.gb-text-4666a877::before {
    content: "";
    position: absolute;
    left: -2px;
    top: 0;
    width: 8px;
    height: 100%;
    background-color: #e10600;
}

/* Loop Carros */
.gb-text-54ea9bb4 {
	padding: 2px 16px;
    position: relative;
}

.gb-text-54ea9bb4::before {
    content: "";
    position: absolute;
    left: -2px;
    top: 0;
    width: 8px;
    height: 100%;
    background-color: #004aad;
}

/* Loop Recentes */
.gb-text-d64c05e6 {
	padding: 2px 16px;
    position: relative;
}

.gb-text-d64c05e6::before {
    content: "";
    position: absolute;
    left: -2px;
    top: 0;
    width: 8px;
    height: 100%;
    background-color: #383838;
}

/* Logo */
.navigation-branding img {
    height: auto;
    width: 182px;
}

.main-navigation {
    border-bottom: 2px solid #004aad;
}

.navigation-branding {
    margin-left: -76px !important;
}

@media (max-width: 768px) {
    .navigation-branding {
        margin-left: 0px !important;
    }
}

@media (max-width: 1024px) {
    .navigation-branding {
        margin-left: 0px !important;
    }
}

/* Borda Imag */
.dynamic-entry-content img {
    border-radius: 4px;
}

/* Remove a moldura cinza forçada pelo bloco de imagem do Gutenberg */
.dynamic-entry-content .wp-block-image img {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
}

/* Caso o seu site use o seletor sem a classe do container principal */
.wp-block-image img {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
}

/* Garante que o contêiner da imagem/legenda nunca seja maior que a tela */
.dynamic-entry-content figure,
.dynamic-entry-content .wp-block-image,
.dynamic-entry-content .wp-caption {
    max-width: 100% !important;
    width: auto !important;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Garante que a imagem dentro do bloco também respeite o limite */
.dynamic-entry-content figure img {
    max-width: 100% !important;
    height: auto !important;
}

/* Mantém sua legenda atualizada e impede que ela force a largura */
/* Compatível com Gutenberg + Editor Clássico */
.dynamic-entry-content figcaption,
.dynamic-entry-content .wp-caption-text {
    font-size: 13px;
    font-style: italic;
    text-align: center;
    line-height: 1.5;
    margin: 0;
    padding: 0.5em 0;
    color: #555;
    word-break: break-word;
    display: block;
}

/* Tamanho dos elementos do menu */
.main-navigation .menu-toggle,
.main-navigation .menu-bar-items,
.main-navigation .gp-icon.icon-search {
    font-size: 18px !important;
}

/* Peso apenas para textos */
.main-navigation .menu-toggle,
.main-navigation .menu-bar-items {
    font-weight: 500;
}

/* Ajuste de vídeo: Aplica APENAS em dispositivos móveis */
@media (max-width: 768px) {

    /* Força o contêiner principal a ter a largura total */
    #player,
    .html5-video-container,
    .html5-main-video {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
    }

    /* Força a tag de vídeo do YouTube a se comportar */
    .html5-main-video {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        aspect-ratio: 16 / 9 !important;
        object-fit: cover !important;
    }

    /* Remove o deslocamento negativo (erro do JS do YouTube) */
    .html5-video-container {
        height: auto !important;
        padding-bottom: 56.25% !important;
        position: relative !important;
    }

    .html5-main-video {
        position: absolute !important;
        top: 0 !important;
    }
}

/* Ajuste de vídeo: Aplica em CELULARES e TABLETS (telas de até 1024px) */
@media (max-width: 1024px) {

    /* Força o contêiner principal a ter a largura total */
    #player,
    .html5-video-container,
    .html5-main-video {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
    }

    /* Força a tag de vídeo do YouTube a se comportar */
    .html5-main-video {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        aspect-ratio: 16 / 9 !important;
        object-fit: cover !important;
    }

    /* Garante que o vídeo não fique esticado ou com altura zero */
    .dynamic-entry-content iframe:not([id*="aswift"]):not([id*="google_ads"]):not(.adsbygoogle),
    .dynamic-entry-content video {
        width: 100% !important;
        height: auto !important;
        min-height: 260px;
    }

    /* Remove o deslocamento negativo (erro do JS do YouTube) */
    .html5-video-container {
        height: auto !important;
        padding-bottom: 56.25% !important;
        position: relative !important;
    }

    .html5-main-video {
        position: absolute !important;
        top: 0 !important;
    }
}

/* ===================================
   ESTILOS PARA GALERIAS WORDPRESS
   =================================== */

/* Container principal da galeria */
.wp-block-gallery,
.blocks-gallery-grid,
.gallery {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 30px 0 !important;
    padding: 0 !important;
    list-style: none !important;
    width: 100% !important;
}

/* Item individual da galeria */
.wp-block-gallery .blocks-gallery-item,
.wp-block-gallery .wp-block-image,
.gallery .gallery-item,
.blocks-gallery-grid .blocks-gallery-item {
    position: relative;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100% !important;
    height: 200px;
    background: transparent !important;
}

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

/* Figura dentro do item */
.wp-block-gallery figure,
.gallery .gallery-item figure,
.blocks-gallery-item figure {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 100% !important;
    width: 100% !important;
    display: block !important;
    background: transparent !important;
}

/* Links dentro da galeria */
.wp-block-gallery a,
.gallery a,
.gallery-item a,
.blocks-gallery-item a {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

/* Imagens da galeria */
.wp-block-gallery img,
.gallery img,
.blocks-gallery-item img,
.wp-block-gallery figure img,
.gallery figure img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    border-radius: 8px;
    transition: transform 0.3s ease;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

/* Efeito hover na imagem */
.wp-block-gallery .blocks-gallery-item:hover img,
.gallery .gallery-item:hover img {
    transform: scale(1.05);
}

/* ======================================
   ÚLTIMA IMAGEM - TAMANHO COMPLETO
   ====================================== */

/* Apenas a ÚLTIMA imagem da galeria ocupa largura total */
.wp-block-gallery .blocks-gallery-item:last-child,
.gallery .gallery-item:last-child {
    grid-column: 1 / -1;
    height: 350px !important;
}

/* Legenda sobreposta */
.wp-block-gallery figcaption,
.gallery .gallery-caption,
.gallery-item .gallery-caption,
.blocks-gallery-item figcaption,
.wp-block-gallery .wp-block-image figcaption {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 12px 15px !important;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.65) 70%,
        transparent 100%
    ) !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    text-align: left !important;
    border-radius: 0 0 8px 8px;
    z-index: 2;
}

/* Texto da legenda */
.wp-block-gallery figcaption,
.gallery-caption {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Overlay escuro ao hover */
.wp-block-gallery .blocks-gallery-item::before,
.gallery .gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    z-index: 1;
    border-radius: 8px;
    pointer-events: none;
}

.wp-block-gallery .blocks-gallery-item:hover::before,
.gallery .gallery-item:hover::before {
    background: rgba(0, 0, 0, 0.15);
}

/* ======================================
   RESPONSIVO - MOBILE
   ====================================== */

/* MOBILE - 3 colunas com altura mais quadrada */
@media (max-width: 767px) {

    .wp-block-gallery,
    .blocks-gallery-grid,
    .gallery {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px;
    }

    /* Imagens normais - MAIS QUADRADAS no mobile */
    .wp-block-gallery .blocks-gallery-item,
    .gallery .gallery-item {
        height: 100px !important;
        border-radius: 6px;
    }

    /* Última imagem - proporção melhor para mobile */
    .wp-block-gallery .blocks-gallery-item:last-child,
    .gallery .gallery-item:last-child {
        grid-column: 1 / -1 !important;
        height: 180px !important;
    }

    /* OCULTAR legendas nas imagens pequenas do mobile */
    .wp-block-gallery .blocks-gallery-item:not(:last-child) figcaption,
    .gallery .gallery-item:not(:last-child) .gallery-caption {
        display: none !important;
    }
}

/* ======================================
   RESPONSIVO - TABLET
   ====================================== */

/* Tablets - mantém 3 colunas */
@media (min-width: 768px) and (max-width: 1023px) {

    .wp-block-gallery,
    .blocks-gallery-grid,
    .gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .wp-block-gallery .blocks-gallery-item,
    .gallery .gallery-item {
        height: 180px !important;
    }

    .wp-block-gallery .blocks-gallery-item:last-child,
    .gallery .gallery-item:last-child {
        height: 300px !important;
    }
}

/* Galeria alinhada ao centro */
.aligncenter > .wp-block-gallery,
.aligncenter > .gallery {
    margin-left: auto;
    margin-right: auto;
}

/* Galeria em largura total */
.alignwide > .wp-block-gallery,
.alignfull > .wp-block-gallery {
    max-width: 100%;
}

/* Remover estilos conflitantes do WordPress */
.wp-block-gallery .blocks-gallery-item,
.gallery .gallery-item {
    flex-grow: unset !important;
    flex-basis: unset !important;
}

/* Garantir que legendas vazias não apareçam */
.wp-block-gallery figcaption:empty,
.gallery-caption:empty {
    display: none !important;
}

/* Estilo para crédito/fonte na legenda */
.wp-block-gallery figcaption strong,
.gallery-caption strong {
    font-weight: 600;
    opacity: 0.9;
}

/* Animação suave ao carregar */
.wp-block-gallery .blocks-gallery-item,
.gallery .gallery-item {
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}

.wp-block-gallery .blocks-gallery-item:nth-child(1),
.gallery .gallery-item:nth-child(1) { animation-delay: 0.1s; }

.wp-block-gallery .blocks-gallery-item:nth-child(2),
.gallery .gallery-item:nth-child(2) { animation-delay: 0.2s; }

.wp-block-gallery .blocks-gallery-item:nth-child(3),
.gallery .gallery-item:nth-child(3) { animation-delay: 0.3s; }

.wp-block-gallery .blocks-gallery-item:nth-child(4),
.gallery .gallery-item:nth-child(4) { animation-delay: 0.4s; }

.wp-block-gallery .blocks-gallery-item:nth-child(5),
.gallery .gallery-item:nth-child(5) { animation-delay: 0.5s; }

.wp-block-gallery .blocks-gallery-item:nth-child(6),
.gallery .gallery-item:nth-child(6) { animation-delay: 0.6s; }

.wp-block-gallery .blocks-gallery-item:nth-child(7),
.gallery .gallery-item:nth-child(7) { animation-delay: 0.7s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Compatibilidade com Gutenberg */
.wp-block-gallery.has-nested-images figure.wp-block-image {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Desabilitar espaçamento padrão do WordPress */
.gallery br {
    display: none !important;
}

.gallery-columns-1 .gallery-item,
.gallery-columns-2 .gallery-item,
.gallery-columns-3 .gallery-item,
.gallery-columns-4 .gallery-item,
.gallery-columns-5 .gallery-item {
    width: auto !important;
    padding: 0 !important;
}

/* Forçar o container do GeneratePress a segurar o Disqus */
#disqus_thread {
    width: 100% !important;
    max-width: 100vw !important;
    margin: 20px 0 !important;
    padding: 0 10px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* Forçar o reset do iframe que o Disqus gera */
#disqus_thread iframe[src*="disqus.com"] {
    width: 1px !important;
    min-width: 100% !important;
    max-width: 100% !important;
}