/**
 * Nossa Cidade - Experiência PREMIUM 2026
 * Hero full-viewport, galerias, lightbox com navegação, player customizado.
 * Nenhuma prefeitura tem isso. ANIMAL E FODA.
 */

/* ========================================
   HERO VÍDEO (tela cheia)
   ======================================== */
.nc-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.nc-hero-video-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
    /* Evita tela branca enquanto o vídeo carrega */
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
}

.nc-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;
    z-index: 1;
}

/* Poster fallback: visível enquanto o vídeo carrega ou em economia de bateria */
.nc-hero-video-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.nc-hero-video-embed {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.nc-hero-video-embed iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 56.25vw;
    min-height: 100vh;
    min-width: 177.78vh;
    transform: translate(-50%, -50%);
    border: none;
}

.nc-hero-overlay {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--text-inverse);
    padding: var(--spacing-2xl);
    max-width: 800px;
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nc-hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    margin: 0 0 var(--spacing-md);
    color: #ffffff;
    letter-spacing: -0.02em;
    animation: fadeInUp 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));
}

.nc-hero-subtitle {
    font-size: var(--font-size-lg);
    margin: 0 0 var(--spacing-xl);
    color: #ffffff;
    opacity: 0.98;
    animation: fadeInUp 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));
}

.nc-hero-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    justify-content: center;
    animation: fadeInUp 1s ease-out 0.6s both;
}

.nc-hero-cta {
    display: inline-block;
    padding: var(--spacing-md) var(--spacing-2xl);
    background: var(--primary-base);
    color: var(--text-inverse);
    font-weight: 600;
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: background var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(59, 130, 246, 0.3);
    animation: fadeInUp 1s ease-out 0.6s both;
    cursor: pointer;
    position: relative;
}

.nc-hero-cta::after {
    content: '↓';
    display: inline-block;
    margin-left: var(--spacing-sm);
    transition: transform var(--transition-base);
}

.nc-hero-cta:hover {
    background: var(--primary-dark);
    color: var(--text-inverse);
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl), 0 0 30px rgba(59, 130, 246, 0.5);
}

.nc-hero-cta:hover::after {
    transform: translateY(4px);
    animation: bounceDown 1s ease infinite;
}

.nc-hero-cta-secondary {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.nc-hero-cta-secondary::after {
    content: none;
}

.nc-hero-cta-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

@keyframes bounceDown {

    0%,
    100% {
        transform: translateY(4px);
    }

    50% {
        transform: translateY(8px);
    }
}

.nc-hero-fallback {
    background: linear-gradient(135deg, var(--primary-darker) 0%, var(--primary-dark) 50%, var(--primary-base) 100%);
}

/* ========================================
   PÁGINA E SEÇÕES
   ======================================== */
.nc-page {
    padding: var(--spacing-3xl) 0;
    background: linear-gradient(to bottom, rgba(30, 64, 175, 0.95) 0%, rgba(37, 99, 235, 0.92) 50%, rgba(59, 130, 246, 0.9) 100%);
    min-height: 100vh;
    position: relative;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
    padding-left: calc(50vw - 50%);
    padding-right: calc(50vw - 50%);
}

.nc-secao {
    margin-bottom: var(--spacing-3xl);
    position: relative;
}

.nc-secao-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    padding: 0 var(--spacing-lg);
}

.nc-secao-titulo {
    font-size: var(--font-size-3xl);
    color: var(--text-inverse);
    margin: 0 0 var(--spacing-sm);
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nc-secao-descricao {
    font-size: var(--font-size-lg);
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* ========================================
   GALERIA (grid responsivo)
   ======================================== */
.nc-galeria {
    display: grid;
    gap: var(--spacing-lg);
    padding: 0 var(--spacing-lg);
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.nc-galeria-galeria_fotos {
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: var(--spacing-lg);
    align-items: stretch;
}

.nc-galeria-galeria_fotos .nc-card-link {
    aspect-ratio: 4 / 3;
    min-height: 285px;
}

.nc-galeria-galeria_videos .nc-card-video-wrap,
.nc-galeria-misto .nc-card-video-wrap {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   CARDS COM ANIMAÇÃO DE ENTRADA
   ======================================== */
.nc-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: transparent;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.08);
    transition: transform var(--transition-base), box-shadow var(--transition-base), opacity 0.6s ease;
    will-change: transform;
    opacity: 0;
    transform: translateY(30px);
}

.nc-card.nc-visible {
    opacity: 1;
    transform: translateY(0);
}

.nc-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 16px 32px rgba(30, 64, 175, 0.2), 0 8px 16px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.nc-card-link {
    display: block;
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    width: 100%;
}

.nc-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
    display: block;
}

.nc-card-link:hover .nc-card-img {
    transform: scale(1.08);
}

.nc-card-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-md);
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: var(--text-inverse);
    font-size: var(--font-size-sm);
    margin: 0;
}

/* ========================================
   VIDEO CINEMA - autoplay inline, sem controles
   ======================================== */
.nc-card-video-wrap {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #000;
}

.nc-card-video-cinema {
    display: block;
}

.nc-video-cinema {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    border: none;
}

.nc-card-video-wrap .nc-card-caption {
    position: static;
    padding: var(--spacing-md);
    background: transparent;
    color: var(--text-inverse);
}

.nc-card-video-wrap .nc-card-caption cite {
    font-style: normal;
    color: rgba(255, 255, 255, 0.85);
}

/* ========================================
   LIGHTBOX PREMIUM (com navegação)
   ======================================== */
.nc-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
}

.nc-lightbox:not([hidden]) {
    display: flex;
}

.nc-lightbox-close {
    position: absolute;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-inverse);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    z-index: 10;
}

.nc-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Navegação ←→ */
.nc-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-inverse);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.nc-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.nc-lightbox-nav svg {
    width: 28px;
    height: 28px;
}

.nc-lightbox-prev {
    left: var(--spacing-lg);
}

.nc-lightbox-next {
    right: var(--spacing-lg);
}

.nc-lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    text-align: center;
    position: relative;
    pointer-events: auto;
}

.nc-lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    transition: opacity 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.nc-lightbox-info {
    margin-top: var(--spacing-lg);
}

.nc-lightbox-caption {
    color: var(--text-inverse);
    font-size: var(--font-size-lg);
    margin: 0 0 var(--spacing-xs);
}

.nc-lightbox-credits {
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--font-size-sm);
    margin: 0;
}

.nc-lightbox-counter {
    display: inline-block;
    margin-top: var(--spacing-md);
    padding: var(--spacing-xs) var(--spacing-md);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

/* ========================================
   VIDEO MODAL (fullscreen player)
   ======================================== */
.nc-video-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.98);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
}

.nc-video-modal:not([hidden]) {
    display: flex;
}

.nc-video-modal-close {
    position: absolute;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 56px;
    height: 56px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-inverse);
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    z-index: 10;
}

.nc-video-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.nc-video-modal-content {
    width: 100%;
    max-width: 1400px;
    aspect-ratio: 16 / 9;
}

.nc-video-player {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-lg);
    background: #000;
    outline: none;
}

/* Customizar controles do vídeo */
.nc-video-player::-webkit-media-controls-panel {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
}

/* ========================================
   EMPTY / RESPONSIVO
   ======================================== */
.nc-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    padding: var(--spacing-3xl);
}

@media (max-width: 768px) {
    /* Hero vídeo: garante altura no mobile (iOS 100vh fix) */
    .nc-hero.nc-hero-video {
        min-height: -webkit-fill-available;
        min-height: 100dvh;
    }

    /* Vídeo hero cobrindo 100% da tela no mobile */
    .nc-hero-video-el {
        width: 100%;
        height: 100%;
        min-width: 100%;
        min-height: 100%;
        object-fit: cover;
    }

    .nc-hero-title {
        font-size: 2rem;
    }

    .nc-galeria-galeria_fotos {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .nc-galeria-galeria_fotos .nc-card-link {
        min-height: 220px;
    }

    .nc-secao-titulo {
        font-size: var(--font-size-2xl);
    }

    /* Lightbox mobile */
    .nc-lightbox-nav {
        width: 44px;
        height: 44px;
    }

    .nc-lightbox-prev {
        left: var(--spacing-sm);
    }

    .nc-lightbox-next {
        right: var(--spacing-sm);
    }

    .nc-lightbox-close {
        top: var(--spacing-sm);
        right: var(--spacing-sm);
    }

    /* Video play button menor */
    .nc-video-play-btn {
        width: 60px;
        height: 60px;
    }

    .nc-video-play-btn svg {
        width: 24px;
        height: 24px;
    }
}

/* Animação de entrada para cards */
@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}