/**
 * Nerd Legacy News - Layout e correções inspirados no Pubzi
 * Centraliza ajustes de hero, miniaturas, cards e conteúdo de posts.
 */

/* ==========================================================================
   HERO — Base (slides de fundo e container)
   ========================================================================== */

.nl-hero-5 .hero-bg-slides {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.nl-hero-5 .hero-bg-slides::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(11, 15, 25, 0.6) 0%, rgba(11, 15, 25, 0.85) 100%);
    z-index: 1;
    pointer-events: none;
}

.nl-hero-5 .hero-bg-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.nl-hero-5 .hero-bg-slide.active {
    opacity: 1;
    z-index: 2;
}

.nl-hero-5 .hero-video-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.nl-hero-5 .hero-video-bg iframe {
    width: 100vw;
    height: 56.25vw;
    min-height: 100%;
    min-width: 177.78vh;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* ==========================================================================
   1. HERO SLIDER — Posicionamento do texto e overlay
   ========================================================================== */

.nl-hero-5 {
    position: relative;
    overflow: hidden;
    min-height: 560px;
    padding: 200px 0 90px;
    display: flex;
    align-items: center;
}

.nl-hero-5 .container {
    position: relative;
    z-index: 3;
    width: 100%;
}

.nl-hero-5 .nl-hero-inner {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    flex-wrap: wrap;
    min-height: 320px;
}

/* Bloco de texto do hero: centralizado verticalmente, alinhado à esquerda */
.nl-hero-5 .nl-hero-left-content {
    flex: 0 1 auto;
    max-width: 100%;
    padding-right: 0;
}

.nl-hero-5 .hero-content {
    max-width: 520px;
    padding: 40px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.45);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.nl-hero-5 .hero-content span:first-of-type {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.nl-hero-5 .hero-content h1 a {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.nl-hero-5 .hero-content p {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    max-width: 100%;
}

.nl-hero-5 .hero-content .social {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.nl-hero-5 .hero-content span:first-of-type {
    color: var(--theme);
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
    padding: 6px 14px;
    background: rgba(225, 29, 46, 0.2);
    border-radius: 4px;
    margin-bottom: 12px;
}

.nl-hero-5 .hero-content h1 a {
    text-decoration: none;
    color: inherit;
}

.nl-hero-5 .hero-content h1 a:hover {
    color: var(--theme);
}

.nl-hero-5 .hero-content p {
    color: rgba(255, 255, 255, 0.9);
}

/* Gradiente sobre a imagem do slide (estilo Pubzi index-5) */
.nl-hero-5 .hero-bg-slide::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.4) 40%,
        rgba(0, 0, 0, 0) 80%
    );
    pointer-events: none;
    z-index: 1;
}

.nl-hero-5 .hero-bg-slide.active::before {
    z-index: 2;
}

@media (max-width: 991px) {
    .nl-hero-5 {
        min-height: 480px;
        padding: 140px 0 60px;
    }

    .nl-hero-5 .hero-content {
        max-width: 100%;
        padding: 1.25rem 1.5rem;
    }
}

/* ==========================================================================
   2. MINIATURAS DO SLIDER — Lado direito, empilhadas
   ========================================================================== */

.nl-hero-5 .nl-hero-right-preview {
    position: absolute !important;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    padding: 0;
    width: 240px;
    flex: none;
}

.nl-hero-5 .nl-hero-right-preview .slider-container,
#hero-thumb-slider.slider-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 240px;
    align-items: flex-end;
}

.nl-hero-5 .slider-container .slide {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.nl-hero-5 .slider-container .slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.nl-hero-5 .slider-container .slide:hover::after {
    opacity: 0.5;
}

.nl-hero-5 .slider-container .slide a {
    display: block;
    overflow: hidden;
}

.nl-hero-5 .slider-container .slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.nl-hero-5 .slider-container .slide:hover img {
    transform: scale(1.05);
}

.nl-hero-5 .slider-container .slide.active {
    height: 200px !important;
    max-width: 240px !important;
}

.nl-hero-5 .slider-container .slide.small {
    height: 72px !important;
    max-width: 240px !important;
}

@media (min-width: 768px) {
    .nl-hero-5 .slider-container .slide.active {
        height: 240px !important;
    }

    .nl-hero-5 .slider-container .slide.small {
        height: 88px !important;
    }
}

@media (max-width: 991px) {
    .nl-hero-5 .nl-hero-right-preview {
        position: static !important;
        transform: none;
        right: auto;
        top: auto;
        width: 100%;
        max-width: 100%;
        margin-top: 1.5rem;
    }

    .nl-hero-5 .nl-hero-right-preview .slider-container,
    #hero-thumb-slider.slider-container {
        width: 100%;
        align-items: stretch;
    }
}

/* ==========================================================================
   3. CONTEÚDO DOS POSTS — Remover caixa alta
   ========================================================================== */

.gt-news-details-body,
.nl-post-body,
.nl-post-detail .gt-news-details-body,
.nl-post-detail .nl-post-body {
    text-transform: none !important;
}

.gt-news-details-body p,
.nl-post-body p,
.gt-news-details-body li,
.nl-post-body li,
.gt-news-details-body span,
.nl-post-body span {
    text-transform: none !important;
}

/* Títulos dentro do corpo do post podem manter destaque, mas não forçar uppercase */
.gt-news-details-body h1,
.gt-news-details-body h2,
.gt-news-details-body h3,
.nl-post-body h1,
.nl-post-body h2,
.nl-post-body h3 {
    text-transform: none;
}

/* ==========================================================================
   4. ESPAÇAMENTO (estilo Pubzi)
   ========================================================================== */

.news-section-5.section-padding,
.nl-highlights-section.section-padding,
.section-padding {
    padding: 80px 0 !important;
}

.section-title-area .section-title,
.section-title {
    margin-bottom: 40px !important;
}

.news-section-5.pb-0 {
    padding-bottom: 0 !important;
}

.news-section-5.pt-0 {
    padding-top: 0 !important;
}

/* ==========================================================================
   5. CARDS DE NOTÍCIAS — Alternância e hover (estilo Pubzi)
   ========================================================================== */

.news-section-5 .news-left-items-5,
.news-section-5 .news-box-items-5,
.news-right-items-5 .news-box-items-5 {
    position: relative;
    overflow: hidden;
}

/* Overlay gradiente no hover */
.news-section-5 .news-left-items-5::after,
.news-section-5 .news-box-items-5::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 30%, rgba(0, 0, 0, 0.8) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.news-section-5 .news-left-items-5:hover::after,
.news-section-5 .news-box-items-5:hover::after {
    opacity: 1;
}

.news-section-5 .news-image {
    overflow: hidden;
}

.news-section-5 .news-image img {
    transition: transform 0.4s ease;
}

.news-section-5 .news-left-items-5:hover .news-image img,
.news-section-5 .news-box-items-5:hover .news-image img {
    transform: scale(1.06);
}

/* Alternar layout: texto em cima / imagem embaixo em cards pares */
.news-section-5 .news-right-items-5 .news-box-items-5:nth-child(2n) {
    flex-direction: column-reverse;
}

.news-section-5 .news-right-items-5 .news-box-items-5:nth-child(2n) .news-image {
    order: 2;
}

.news-section-5 .news-right-items-5 .news-box-items-5:nth-child(2n) .news-content {
    order: 1;
}

/* Card em destaque (ex.: terceiro item span 2 em grid quando aplicável) */
@media (min-width: 992px) {
    .news-section-5 .row.g-4 .col-lg-4:nth-child(3n) .news-box-items-5 .news-image {
        min-height: 240px;
    }
}

/* ==========================================================================
   6. MAIS DESTAQUES — Proporções e hover
   ========================================================================== */

.nl-highlights-section .news-box-items-5 {
    position: relative;
    overflow: hidden;
}

.nl-highlights-section .news-box-items-5::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 40%, rgba(0, 0, 0, 0.75) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.nl-highlights-section .news-box-items-5:hover::after {
    opacity: 1;
}

.nl-highlights-section .news-box-items-5 .news-image img {
    transition: transform 0.4s ease;
}

.nl-highlights-section .news-box-items-5:hover .news-image img {
    transform: scale(1.06);
}
