/* Estilos Gerais */
body {
    background-color: #121212;
    color: #f8f9fa;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    zoom: 90%;
    padding-top: 64px;
}

/* ===== MENU ESTILO BOOTSTRAP ===== */
header {
    width: 100%;
    background: #232324 !important;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    box-shadow: 0 2px 8px rgba(17, 16, 16, 0.138);
    border-bottom: none !important;
}

/* Navbar Bootstrap customização */
.navbar {
    background: #1c1c1d7b !important;
    border-bottom: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.navbar .navbar-brand,
.navbar .nav-link {
    color: #fff !important;
    font-weight: 500;
    font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
    color: #0d6efd !important;
}

.navbar .navbar-brand img {
    border-radius: 50%;
    border: none;
}

.navbar-toggler {
    border: none;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* Barra de pesquisa no menu */
form[role="search"] {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

form[role="search"] .form-control {
    padding-right: 2.5rem;
    /* espaço para o ícone */
    background: #a9a6a688;
    color: #ffffff;
    border: 1px solid #33323200;
    border-radius: 0.375rem;
    min-width: 180px;
}

form[role="search"] .btn {
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #f9f9fa;
    padding: 0 0.5rem;
    z-index: 2;
    font-size: 1.1rem;
    height: 2rem;
    line-height: 2rem;
}

form[role="search"] .btn:focus {
    box-shadow: none;
    background: #e9ecef;
}

form[role="search"] .btn i {
    pointer-events: none;
}

/* Redes sociais no topo ao lado direito da barra de pesquisa */
.header-social {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: 1rem;
}

.header-social a {
    color: #fff;
    font-size: 1.3rem;
    transition: color 0.2s;
}

.header-social a:hover {
    color: #0d6efd;
}

@media (max-width: 991px) {
    .header-social {
        margin-top: 10px;
        margin-left: 0;
    }

    .navbar .navbar-collapse {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Busca ocupa largura total e ícone bem alinhado no colapso */
    form[role="search"] {
        width: 100%;
        margin: 8px 0 0 0;
    }

    form[role="search"] .form-control {
        width: 100%;
        min-width: 0;
        padding-right: 2.25rem;
    }

    form[role="search"] .btn {
        right: 0.5rem;
        height: 1.8rem;
        line-height: 1.8rem;
        font-size: 1rem;
    }
}

/* Estilos das Seções */
section {
    padding: 24px 16px;
    text-align: left;
    background: transparent;
    margin: 0 0 32px 0;
    border-radius: 0;
    box-shadow: none;
}

/* Seção introdução: título à esquerda e texto justificado */
#introducao h1 {
    text-align: left !important;
}

#introducao .introducao-texto {
    text-align: justify !important;
}

/* Estilo de blog para seções de introdução */
.blog-section {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    padding: 24px 16px;
    margin-bottom: 32px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.blog-title {
    text-align: left !important;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: #f8f9fa;
    letter-spacing: 0.01em;
}

.blog-text {
    text-align: left !important;
    font-size: 1.25rem;
    color: #e0e0e0;
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.introducao-imagem {
    width: 100%;
    min-height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0;
}

.blog-img,
.introducao-imagem img {
    width: 100% !important;
    max-width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 14px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.18);
}

/* (removido) Estilos de cards custom genéricos não usados para evitar conflito com Bootstrap */

/* Mais Softwares: garantir textos brancos para melhor contraste */
#mais-softwares,
#mais-softwares a,
#mais-softwares p,
#mais-softwares h1,
#mais-softwares h2,
#mais-softwares h3,
#mais-softwares h4,
#mais-softwares h5,
#mais-softwares h6,
#mais-softwares .card-title,
#mais-softwares .card-text {
    color: #ffffff !important;
}

/* Softwares: cartas com fundo escuro e textos brancos */
#softwares .card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

#softwares .card-title,
#softwares .card-text {
    color: #ffffff !important;
}

/* (removido) grid/itens de softwares antigos não utilizados */

/* (removido) carrossel de iframes antigo não utilizado */

/* Estilos do Rodapé */
footer {
    background: linear-gradient(to bottom, #121212, #070f2b);
    color: #fff;
    padding: 40px 20px;
    font-family: Arial, sans-serif;
    border-top: none !important;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: none !important;
    font-size: 14px;
}

/* Conteúdo Principal */
main {
    flex: 1;
    margin-bottom: 110px;
    padding: 20px;
    width: 100%;
    margin-left: 0;
}

/* ===== customização do Bootstrap carousel / banner ===== */
#heroCarousel {
    position: relative;
}

#heroCarousel .carousel-item img {
    width: 100%;
    height: 520px;
    object-fit: cover;
    filter: brightness(0.45);
    backface-visibility: hidden
}

/* Robustez extra no carrossel para mobile */
#heroCarousel .carousel-inner {
    overflow: hidden;
}

#heroCarousel .carousel-item {
    position: relative;
}

#heroCarousel .carousel-item {
    display: none;
}

#heroCarousel .carousel-item.active,
#heroCarousel .carousel-item-next,
#heroCarousel .carousel-item-prev {
    display: block;
}

@media (max-width: 1024px) {
    #heroCarousel .carousel-item img {
        height: 380px;
    }
}

@media (max-width: 720px) {

    #heroCarousel .carousel-caption,
    #heroCarousel .banner-text {
        display: block !important;
        /* garante legenda visível no mobile */
        z-index: 30;
    }

    #heroCarousel .carousel-item img {
        height: 240px;
    }
}

/* Botões laterais do carrossel */
.carousel-control-prev,
.carousel-control-next {
    width: 60px;
    height: 60px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 1;
    background: rgba(33, 37, 41, 0.55);
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    background: rgba(13, 110, 253, 0.85);
}

.carousel-control-prev {
    left: 24px;
}

.carousel-control-next {
    right: 24px;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
    width: 2rem;
    height: 2rem;
}

/* Centraliza e destaca o texto do slide */
#heroCarousel .carousel-caption,
.banner-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 900px;
    color: #fff;
    text-align: center;
    text-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
    z-index: 20;
    padding: 0 12px;
}

#heroCarousel .carousel-caption h2 {
    font-size: clamp(1.5rem, 4vw, 2.8rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

#heroCarousel .carousel-caption p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    margin-bottom: 1.2rem;
    opacity: 0.95;
}

/* Indicadores do carrossel */
.carousel-indicators [data-bs-target] {
    background-color: #fff;
    opacity: 0.7;
}

.carousel-indicators .active {
    opacity: 1;
}

/* Espaço extra para o carrossel não ficar colado no menu */
.hero {
    margin-top: 0;
    padding-top: 0;
}

/* Destaque para resultado da busca */
.search-highlight {
    background: #ffe066;
    color: #212529 !important;
    border-radius: 4px;
    padding: 0 2px;
    font-weight: bold;
    box-shadow: 0 1px 6px #0002;
    transition: background 0.2s;
}

/* Deixe todo texto claro nas principais áreas */
/* Removido o forçar de cor clara em todo conteúdo para evitar look de 'box' fixo */

/* Ajuste para textos escuros em cards claros, se necessário, pode remover se não usar cards claros */
.card.bg-light,
.card.bg-white,
.softwares-destaque,
.softwares-destaque * {
    color: #212529 !important;
}

/* Reduz o espaçamento entre os cards da seção Softwares Livres */
#softwares .row.g-4 {
    --bs-gutter-x: 0.5rem !important;
    /* diminui o espaço horizontal */
    --bs-gutter-y: 1.2rem !important;
    /* mantém um pouco de espaço vertical */
}

/* Opcional: diminui a largura dos cards para caberem melhor lado a lado */
#softwares .card {
    width: 100%;
    min-width: 0;
    margin: 0 auto;
}

/* Banner/carrossel ocupa toda a largura no mobile (sem overflow) */
@media (max-width: 720px) {
    .hero {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    #heroCarousel {
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    #heroCarousel .carousel-item img {
        width: 100% !important;
        height: 260px !important;
        object-fit: cover;
        margin: 0;
        border-radius: 0;
    }

    .carousel-inner,
    .carousel-item {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Legenda estilo "faixa" inferior, alinhada à esquerda */
    #heroCarousel .carousel-caption,
    .banner-text {
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 12px !important;
        transform: none !important;
        text-align: left !important;
        width: auto !important;
        max-width: none !important;
        margin: 0 12px !important;
        padding: 10px 12px !important;
        background: linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.65));
        border-radius: 10px;
        display: block !important;
        z-index: 30;
    }

    #heroCarousel .carousel-caption h2 {
        font-size: 1.15rem !important;
        line-height: 1.3 !important;
        margin: 0 0 6px 0 !important;
    }

    #heroCarousel .carousel-caption p {
        font-size: 0.95rem !important;
        margin: 0 0 8px 0 !important;
    }
}

/* Ajustes adicionais de controles do carrossel no mobile */
@media (max-width: 720px) {

    .carousel-control-prev,
    .carousel-control-next {
        width: 44px;
        height: 44px;
        background: rgba(33, 37, 41, 0.55);
    }

    .carousel-control-prev {
        left: 12px;
    }

    .carousel-control-next {
        right: 12px;
    }

    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        width: 1.6rem;
        height: 1.6rem;
    }
}

/* Corrige alinhamento e largura de blocos principais no mobile (sem buracos laterais) */
@media (max-width: 720px) {

    html,
    body {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        padding: 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    /* Apenas conteúdo estrutural recebe respiração lateral */
    .container,
    main,
    footer,
    .blog-section,
    section,
    #softwares .row,
    #mais-softwares .row {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 12px !important;
        /* respiro lateral */
        padding-right: 12px !important;
        border-radius: 0 !important;
        box-sizing: border-box !important;
    }

    main {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .blog-section {
        padding: 24px 6px 18px 6px !important;
        margin-bottom: 24px !important;
    }

    .blog-title {
        font-size: 1.5rem !important;
    }

    .blog-text {
        font-size: 1rem !important;
    }

    .introducao-imagem img,
    .blog-img {
        border-radius: 0 !important;
    }

    footer,
    footer .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 0 !important;
    }

    footer .row,
    footer .col-12 {
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* Remove largura fixa do main em telas grandes para evitar conflito */
main {
    width: 100%;
    margin-left: 0;
}

/* ===== Cards de notícias (com imagem de fundo) ===== */
.news-card {
    position: relative;
    min-height: 200px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    display: flex;
    align-items: end;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .15);
    transition: transform .2s ease, box-shadow .2s ease;
}

/* ===== Sidebar: Links úteis com imagem e legenda ===== */
#sidebar .links-uteis .link-card {
    display: block;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px;
}

#sidebar .links-uteis .link-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

#sidebar .links-uteis .link-card .meta {
    display: block;
    margin-top: 8px;
}

#sidebar .links-uteis .link-card .meta a {
    color: #cfe2ff;
    text-decoration: none;
    font-weight: 600;
}

#sidebar .links-uteis .link-card .meta a:hover {
    color: #91c3ff;
}

#sidebar .links-uteis .link-card .meta .resumo {
    color: #adb5bd;
    margin: 6px 0 0 0;
}

@media (max-width: 720px) {
    #sidebar .links-uteis .link-card img {
        height: 140px;
    }
}

.news-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, .65) 0%, rgba(0, 0, 0, .25) 60%, rgba(0, 0, 0, 0) 100%);
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .25);
}

.news-card__content {
    position: relative;
    z-index: 1;
    color: #fff;
    padding: 16px;
}

@media (min-width: 992px) {
    .news-card {
        min-height: 220px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .news-card {
        transition: none;
    }
}

/* ===== Sidebar à direita ===== */
#sidebar .sidebar-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 16px;
}

#sidebar a {
    color: #cfe2ff;
}

#sidebar a:hover {
    color: #91c3ff;
}

/* Vídeos como cards (usando news-card) */
.video-card {
    min-height: 160px;
}

@media (min-width: 992px) {
    .video-card {
        min-height: 180px;
    }
}