/**
 * Nossa História - Layout editorial alternado
 * Blocos texto + imagem, mobile-first, harmonizado com o design system
 */

/* ========================================
   HERO
   ======================================== */
.nh-hero {
    position: relative;
    background: linear-gradient(135deg, var(--primary-darker) 0%, var(--primary-dark) 50%, var(--primary-base) 100%);
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--spacing-2xl);
}

/* Hero com imagem de fundo */
.nh-hero-imagem {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.nh-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.75) 0%, rgba(37, 99, 235, 0.6) 50%, rgba(59, 130, 246, 0.5) 100%);
}

.nh-hero-imagem .nh-hero-content {
    position: relative;
    z-index: 2;
}

/* Hero com vídeo (YouTube/Vimeo) */
.nh-hero-video {
    min-height: 50vh;
}

@media (max-width: 768px) {
    .nh-hero-video {
        min-height: -webkit-fill-available;
        min-height: 50dvh;
    }
}

.nh-hero-video-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-darker) 0%, var(--primary-dark) 50%, var(--primary-base) 100%);
}

.nh-hero-video-el {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

.nh-hero-video-embed {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.nh-hero-video-embed iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 56.25vw;
    min-height: 100%;
    min-width: 177.78vh;
    transform: translate(-50%, -50%);
    border: none;
}

.nh-hero-video .nh-hero-content {
    position: relative;
    z-index: 2;
}

.nh-hero-content {
    max-width: 720px;
    animation: nhFadeInUp 1s ease-out both;
}

@keyframes nhFadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nh-hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin: 0 0 var(--spacing-md);
    color: #ffffff;
    letter-spacing: -0.02em;
    animation: nhFadeInUp 1s ease-out 0.2s both;
    text-shadow:
        0 0 10px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(0, 0, 0, 0.6),
        0 0 30px rgba(0, 0, 0, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.9);
    filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.5));
}

.nh-hero-subtitle {
    font-size: var(--font-size-lg);
    color: #ffffff;
    opacity: 0.98;
    margin: 0 0 var(--spacing-xl);
    line-height: 1.5;
    animation: nhFadeInUp 1s ease-out 0.4s both;
    text-shadow:
        0 0 8px rgba(0, 0, 0, 0.7),
        0 0 16px rgba(0, 0, 0, 0.5),
        0 0 24px rgba(0, 0, 0, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.8);
    filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.4));
}

.nh-hero-cta {
    display: inline-block;
    padding: var(--spacing-md) var(--spacing-xl);
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 600;
    border-radius: var(--radius-lg);
    text-decoration: none;
    border: 2px solid rgba(255, 255, 255, 0.5);
    transition: background var(--transition-base), transform var(--transition-base);
    animation: nhFadeInUp 1s ease-out 0.6s both;
}

.nh-hero-cta:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
    transform: translateY(-2px);
}

/* ========================================
   PÁGINA E BLOCOS
   ======================================== */
.nh-page {
    padding: var(--spacing-2xl) 0 var(--spacing-3xl);
    max-width: 1100px;
    margin: 0 auto;
}

.nh-bloco {
    margin-bottom: var(--spacing-3xl);
    scroll-margin-top: 100px;
}

.nh-bloco:last-child {
    margin-bottom: 0;
}

.nh-bloco-titulo {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 700;
    color: var(--primary-darker);
    margin: 0 0 var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    border-bottom: 3px solid var(--primary-light);
    display: inline-block;
}

/* ========================================
   LAYOUT: IMAGEM À ESQUERDA
   ======================================== */
.nh-bloco-esquerda .nh-bloco-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-2xl);
    align-items: start;
}

@media (max-width: 768px) {
    .nh-bloco-esquerda .nh-bloco-inner {
        grid-template-columns: 1fr;
    }

    .nh-bloco-esquerda .nh-bloco-imagem-wrap {
        order: 1;
    }

    .nh-bloco-esquerda .nh-bloco-texto {
        order: 2;
    }
}

/* ========================================
   LAYOUT: IMAGEM À DIREITA
   ======================================== */
.nh-bloco-direita .nh-bloco-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-2xl);
    align-items: start;
}

@media (max-width: 768px) {
    .nh-bloco-direita .nh-bloco-inner {
        grid-template-columns: 1fr;
    }

    .nh-bloco-direita .nh-bloco-texto {
        order: 1;
    }

    .nh-bloco-direita .nh-bloco-imagem-wrap {
        order: 2;
    }
}

/* ========================================
   LAYOUT: IMAGEM FULLWIDTH (simétrico: imagem e texto mesma largura)
   ======================================== */
.nh-bloco-fullwidth .nh-bloco-inner {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.nh-bloco-imagem-fullwrap {
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.nh-bloco-imagem-full {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 500px;
}

/* Texto em largura total, igual à imagem, para manter simetria */
.nh-bloco-texto-abaixo {
    width: 100%;
}

/* Mobile: imagem full-bleed (borda a borda), texto com padding */
@media (max-width: 768px) {
    .nh-bloco-fullwidth .nh-bloco-inner {
        margin-left: calc(-1 * var(--spacing-lg, 1rem));
        margin-right: calc(-1 * var(--spacing-lg, 1rem));
        width: calc(100% + 2 * var(--spacing-lg, 1rem));
    }

    .nh-bloco-fullwidth .nh-bloco-imagem-fullwrap {
        border-radius: 0;
    }

    .nh-bloco-fullwidth .nh-bloco-texto-abaixo {
        padding-left: var(--spacing-lg);
        padding-right: var(--spacing-lg);
    }

    .nh-bloco-imagem-full {
        max-height: 350px;
    }
}

/* ========================================
   LAYOUT: SEM IMAGEM
   ======================================== */
.nh-bloco-sem-imagem .nh-bloco-inner {
    display: block;
}

.nh-bloco-texto-sozinho {
    max-width: 720px;
}

/* ========================================
   IMAGEM E LEGENDA
   ======================================== */
.nh-bloco-imagem-wrap {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.nh-bloco-imagem {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 4/3;
}

.nh-bloco-legenda {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    background: var(--bg-body);
    font-style: italic;
}

.nh-bloco-imagem-fullwrap .nh-bloco-legenda {
    padding: var(--spacing-md);
}

/* ========================================
   TEXTO (conteúdo rico)
   ======================================== */
.nh-bloco-texto-inner {
    font-size: var(--font-size-base);
    line-height: 1.7;
    color: var(--text-primary);
}

.nh-bloco-texto-inner p {
    margin: 0 0 var(--spacing-md);
}

.nh-bloco-texto-inner p:last-child {
    margin-bottom: 0;
}

.nh-bloco-texto-inner strong {
    font-weight: 600;
}

.nh-bloco-texto-inner ul,
.nh-bloco-texto-inner ol {
    margin: 0 0 var(--spacing-md);
    padding-left: var(--spacing-xl);
}

.nh-bloco-texto-inner li {
    margin-bottom: var(--spacing-xs);
}

.nh-bloco-texto-inner h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin: var(--spacing-lg) 0 var(--spacing-sm);
}

.nh-bloco-texto-inner a {
    color: var(--primary-base);
    text-decoration: underline;
}

.nh-bloco-texto-inner a:hover {
    color: var(--primary-dark);
}

/* ========================================
   EMPTY STATE
   ======================================== */
.nh-empty {
    text-align: center;
    padding: var(--spacing-3xl);
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
}
