/* ==========================================================================
   TEMA REVISTA TECH NEWS - ESTILO EDITORIAL TECH MODERNO
   Base estrutural oficial da rede com identidade própria tecnológica
   ========================================================================== */

/* Estilo geral do corpo da página */
body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
}

/* Links nos títulos dos artigos */
article h3 a,
.card-title a {
    color: #0f172a;
    text-decoration: none;
    transition: color 0.2s ease;
}
article h3 a:hover,
.card-title a:hover {
    color: #0284c7;
}

/* ================================================= */
/* == OTIMIZAÇÃO EXCLUSIVA PARA TABLETS E MÓVEIS (<= 991px) == */
/* ================================================= */
/* O PC (Desktop >= 992px) utiliza a largura, gutters e margens originais do Bootstrap.
   Estas regras eliminam as bordas laterais vazias e diminuem a distância central no tablet/mobile */
@media (max-width: 991px) {
    /* 1. Ocupa praticamente 100% da largura útil da tela eliminando bordas laterais vazias */
    .container,
    .container-sm,
    .container-md,
    .container-lg,
    .container-fluid {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    /* 2. Reduz o espaçamento superior e o vão central entre a coluna de notícias e a sidebar */
    .container.mt-4 {
        margin-top: 0.75rem !important;
    }

    .main-content-row,
    .container > .row {
        --bs-gutter-x: 6px !important;
        --bs-gutter-y: 12px !important;
        margin-left: -3px !important;
        margin-right: -3px !important;
    }

    .main-content-row > *,
    .container > .row > * {
        padding-left: 3px !important;
        padding-right: 3px !important;
    }

    /* 3. Proporção balanceada no tablet: Notícia ampla e sidebar proporcional */
    @media (min-width: 768px) {
        .main-content-row > .col-md-8 {
            flex: 0 0 68% !important;
            max-width: 68% !important;
            width: 68% !important;
        }
        .main-content-row > .col-md-4 {
            flex: 0 0 32% !important;
            max-width: 32% !important;
            width: 32% !important;
        }
    }

    /* Títulos dos widgets na sidebar em linha única elegante */
    .col-md-4 h4 {
        font-size: 0.98rem !important;
        white-space: nowrap !important;
    }

    /* 4. Reduz o padding interno do artigo para o conteúdo preencher muito mais a tela */
    .single-post,
    article.single-post,
    .single-post.p-md-4,
    .single-post.p-3 {
        padding: 12px 14px !important;
        border-radius: 8px !important;
    }

    .single-post .entry-title {
        font-size: 1.7rem !important;
        line-height: 1.25 !important;
        margin-bottom: 0.6rem !important;
    }

    .single-post .lead {
        font-size: 0.95rem !important;
        margin-bottom: 0.6rem !important;
    }

    .single-post .post-content {
        font-size: 0.98rem !important;
        line-height: 1.65 !important;
    }

    /* 5. Otimiza padding dos cards da sidebar no tablet */
    .col-md-4 > .bg-white,
    .col-md-4 > .weather-widget-new,
    .sidebar-category-widget {
        padding: 10px 12px !important;
        margin-bottom: 12px !important;
        border-radius: 8px !important;
    }

    .weather-widget-new .current-temp-value {
        font-size: 1.85rem !important;
    }

    .mini-forecast-wrapper {
        gap: 4px !important;
    }

    /* 6. Cards horizontais na listagem */
    .post-card-horizontal .card-body {
        padding: 0.75rem 0.9rem !important;
    }
}

/* ================================================= */
/* == TOP BAR TECH                                == */
/* ================================================= */
.top-bar {
    background-color: #0f172a;
    color: #cbd5e1;
    font-size: 0.8rem;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.top-bar a {
    color: inherit;
    text-decoration: none;
}
.top-bar a:hover {
    color: #38bdf8;
}

/* ================================================= */
/* == CABEÇALHO / LOGO TECH                        == */
/* ================================================= */
.container > header {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}

.tech-main-logo {
    font-size: 3.4rem;
    line-height: 1.1;
    margin-bottom: 0;
    display: inline-flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 6px;
    flex-wrap: wrap;
}

.tech-main-logo .logo-revista {
    font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #0f172a;
    font-size: 0.82em;
    margin-right: 0;
}

.tech-main-logo .logo-tech-news {
    font-family: 'Dancing Script', 'Kaushan Script', cursive;
    font-weight: 700;
    font-size: 1.25em;
    background: linear-gradient(135deg, #0284c7 0%, #2563eb 50%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    padding-right: 6px;
    letter-spacing: -0.5px;
    filter: drop-shadow(0 2px 8px rgba(2, 132, 199, 0.22));
}

@media (max-width: 768px) {
    .tech-main-logo {
        font-size: 2.2rem;
        gap: 4px;
        justify-content: center;
    }
}

.header-title-link,
.header-title-link:hover {
    text-decoration: none;
    color: inherit;
}

.header-title-link:hover .tech-main-logo {
    color: #0284c7;
}

.header-subtitle {
    font-family: 'Plus Jakarta Sans', sans-serif;
    letter-spacing: 0.5px;
    font-size: 0.82rem;
    color: #64748b;
}

/* Botões Tech */
.btn-primary {
    background-color: #0284c7;
    border-color: #0284c7;
    font-weight: 600;
}
.btn-primary:hover {
    background-color: #0369a1;
    border-color: #0369a1;
}

.btn-outline-primary {
    color: #0284c7;
    border-color: #0284c7;
    font-weight: 600;
}
.btn-outline-primary:hover {
    background-color: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
}

.badge.bg-primary {
    background-color: #0284c7 !important;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ================================================= */
/* == BARRA DE NAVEGAÇÃO STICKY                   == */
/* ================================================= */
.main-menu-bar-wrapper {
    background-color: #1e293b;
    padding: 0.15rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.main-menu-bar .nav-link {
    color: #f1f5f9;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.86rem;
    letter-spacing: 0.4px;
    padding: 0.45rem 1.1rem;
    transition: color 0.2s ease-in-out;
}

.main-menu-bar .nav-link:not(.active):hover {
    color: #38bdf8;
}

.main-menu-bar .nav-link.active {
    color: #38bdf8;
    font-weight: 700;
    background-color: transparent;
}

/* Dropdown Hover em Desktop */
@media (min-width: 992px) {
    .dropdown .dropdown-menu {
        display: none;
        margin-top: 0;
        border-radius: 6px;
        box-shadow: 0 8px 20px rgba(0,0,0,0.12);
        border: 1px solid #e2e8f0;
    }
    .dropdown:hover > .dropdown-menu {
        display: block;
    }
    .dropdown:hover > .nav-link {
        color: #38bdf8;
    }
}

.main-menu-bar .dropdown-toggle::after {
    display: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ================================================= */
/* == BARRA NEWS TICKER                           == */
/* ================================================= */
.news-ticker-bar {
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 7px 0;
    font-size: 0.84rem;
}

.news-ticker-swiper .swiper-slide {
    width: auto;
}

.news-ticker-swiper a {
    color: #334155;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}
.news-ticker-swiper a:hover {
    color: #0284c7;
}

/* ================================================= */
/* == GRADE DE NOTÍCIAS EM DESTAQUE (ESTILO G1)   == */
/* ================================================= */
.featured-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
    height: 480px;
}

@media (max-width: 991px) {
    .featured-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 12px;
        height: auto;
    }
    .featured-item-large {
        grid-column: 1 / 2 !important;
        grid-row: 1 / 2 !important;
        height: 280px;
    }
    .featured-item-small-top,
    .featured-item-small-bottom {
        grid-column: 1 / 2 !important;
        grid-row: auto !important;
        height: 190px;
    }
}

.featured-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.featured-item-large {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
}

.featured-item-small-top {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
}

.featured-item-small-bottom {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
}

.featured-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.featured-item:hover img {
    transform: scale(1.04);
}

.featured-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 75%;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.92) 0%, rgba(15, 23, 42, 0.4) 60%, transparent 100%);
    z-index: 1;
}

.featured-item-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.25rem;
    z-index: 2;
}

.featured-item-content .featured-category {
    background-color: #0284c7;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
}

.featured-item-content .featured-title {
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.25;
    margin-top: 6px;
    margin-bottom: 0;
    transition: color 0.2s ease;
}

.featured-item:hover .featured-title {
    color: #38bdf8;
}

.featured-item-small-top .featured-title,
.featured-item-small-bottom .featured-title {
    font-size: 1.05rem;
}

/* ================================================= */
/* == CARD DE NOTÍCIA HORIZONTAL                  == */
/* ================================================= */
.post-card-horizontal {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1.25rem;
}

.post-card-horizontal:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
    border-color: #cbd5e1;
}

.post-image-container {
    overflow: hidden;
    min-height: 160px;
}

.post-image-container .card-img-left {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-image-container:hover .card-img-left {
    transform: scale(1.05);
}

.post-card-horizontal .card-body {
    padding: 1rem 1.25rem;
}

.post-card-horizontal .card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.35rem;
}

.post-card-horizontal .card-text {
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.45;
}

/* ================================================= */
/* == SIDEBAR                                     == */
/* ================================================= */
.sidebar-post-image {
    width: 65px;
    height: 65px;
    object-fit: cover;
    flex-shrink: 0;
}

.sidebar-post-title {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
    color: #1e293b;
    transition: color 0.2s ease;
}

.list-group-item:hover .sidebar-post-title {
    color: #0284c7;
}

/* Indicadores Financeiros / Tech */
/* PADRÃO DESKTOP (PC >= 992px): Grade 2x2 com cards compactos originais */
.finance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.finance-widget {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 10px;
    text-align: center;
}

.finance-widget .name {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}

.finance-widget .value {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 2px 0;
}

.variation {
    font-size: 0.72rem;
    font-weight: 700;
}
.variation-positive {
    color: #10b981;
}
.variation-negative {
    color: #ef4444;
}

/* EXCLUSIVO PARA TABLETS E DISPOSITIVOS MÓVEIS (<= 991px): 4 indicadores um abaixo do outro com anatomia proporcional */
@media (max-width: 991px) {
    .finance-grid {
        display: flex;
        flex-direction: column;
        gap: 7px;
    }

    .finance-widget {
        display: grid !important;
        grid-template-areas:
            "name variation"
            "value value" !important;
        grid-template-columns: 1fr auto !important;
        align-items: center !important;
        padding: 7px 11px !important;
        border-radius: 6px;
        background-color: #f8fafc;
        border: 1px solid #e2e8f0;
        text-align: left !important;
    }

    .finance-val-wrap {
        display: contents !important;
    }

    .finance-widget .name {
        grid-area: name;
        font-size: 0.72rem !important;
        font-weight: 700 !important;
        color: #64748b !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        margin: 0 !important;
        line-height: 1.2 !important;
    }

    .finance-widget .variation {
        grid-area: variation;
        font-size: 0.74rem !important;
        font-weight: 700 !important;
        text-align: right !important;
        margin: 0 !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
    }

    .finance-widget .value {
        grid-area: value;
        font-family: 'Outfit', sans-serif !important;
        font-size: 1rem !important;
        font-weight: 700 !important;
        color: #0f172a !important;
        line-height: 1.25 !important;
        margin-top: 2px !important;
        margin-bottom: 0 !important;
        white-space: nowrap !important;
    }
}

/* ================================================= */
/* == WIDGETS DE CATEGORIAS NA SIDEBAR            == */
/* ================================================= */
.sidebar-category-widget {
    background-color: #ffffff;
}

.sidebar-category-header h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.3px;
}

/* PADRÃO DESKTOP (PC >= 992px): Miniatura 65x65 à esquerda e texto à direita original */
@media (min-width: 992px) {
    .sidebar-post-link {
        display: flex !important;
        align-items: center;
    }
    .sidebar-post-thumb-wrapper {
        width: 65px;
        height: 65px;
        flex-shrink: 0;
        margin-right: 0.75rem;
        border-radius: 4px;
        overflow: hidden;
    }
    .sidebar-post-cover-img {
        width: 65px;
        height: 65px;
        object-fit: cover;
    }
    .sidebar-post-title-content {
        font-size: 0.88rem;
        font-weight: 600;
        line-height: 1.35;
        color: #1e293b;
        transition: color 0.2s ease;
    }
    .sidebar-post-item:hover .sidebar-post-title-content {
        color: #0284c7;
    }
}

/* EXCLUSIVO PARA TABLETS E DISPOSITIVOS MÓVEIS (<= 991px): Imagem maior no topo e texto abaixo */
@media (max-width: 991px) {
    .sidebar-post-link {
        display: block !important;
    }
    .sidebar-post-thumb-wrapper {
        width: 100%;
        height: 145px;
        margin-bottom: 0.5rem;
        border-radius: 6px;
        overflow: hidden;
        background-color: #0f172a;
    }
    .sidebar-post-cover-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }
    .sidebar-post-item:hover .sidebar-post-cover-img {
        transform: scale(1.04);
    }
    .sidebar-post-title-content {
        font-size: 0.82rem;
        font-weight: 600;
        line-height: 1.35;
        color: #1e293b;
        display: block;
    }
    .sidebar-post-item:hover .sidebar-post-title-content {
        color: #0284c7;
    }
    .sidebar-btn-view-all {
        font-size: 0.8rem;
        border-radius: 6px;
    }
}

/* Weather Widget */
.weather-widget-new {
    color: #ffffff;
}
.weather-widget-new.day {
    background: linear-gradient(135deg, #0284c7, #0369a1);
}
.weather-widget-new.night {
    background: linear-gradient(135deg, #0f172a, #1e293b);
}
.current-temp-value {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
}
.current-temp-desc {
    font-size: 0.85rem;
    opacity: 0.9;
}
.mini-forecast-wrapper {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    scrollbar-width: none;
}
.mini-forecast-wrapper::-webkit-scrollbar {
    display: none;
}
.mini-forecast-item {
    font-size: 0.75rem;
    text-align: center;
    flex-shrink: 0;
    min-width: 38px;
}

/* ================================================= */
/* == ARTIGO / SINGLE POST                        == */
/* ================================================= */
.single-post .entry-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #0f172a;
    line-height: 1.25;
}

.single-post .post-content {
    color: #334155;
    font-size: 1.05rem;
    line-height: 1.8;
}

.single-post .post-content h2 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: #0f172a;
    margin-top: 1.8rem;
    margin-bottom: 0.8rem;
}

.single-post .post-content a {
    color: #0284c7;
    text-decoration: underline;
}

/* ================================================= */
/* == RODAPÉ                                      == */
/* ================================================= */
.site-footer {
    background-color: #0f172a;
    color: #94a3b8;
    padding: 3rem 0 2rem 0;
    margin-top: 3.5rem;
}

.footer-title {
    font-size: 1.7rem;
    text-decoration: none;
    letter-spacing: -0.5px;
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
}
.footer-title .logo-revista {
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    letter-spacing: 2px;
    color: #ffffff;
}
.footer-title .logo-tech-news {
    font-family: 'Dancing Script', 'Kaushan Script', cursive;
    font-weight: 700;
    font-size: 1.15em;
    background: linear-gradient(135deg, #38bdf8 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}
.footer-title:hover {
    color: #38bdf8;
}

.footer-links {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}
.footer-links:hover {
    color: #38bdf8;
}
