/* ==========================================================================
   DESIGN SYSTEM E CONFIGURAÇÕES GLOBAIS
   ========================================================================== */
:root {
    --cor-principal: #d90429; /* Vermelho principal da marca */
    --cor-fundo: #f0f2f5;      /* Um cinza muito claro para o fundo */
    --cor-texto: #050505;      /* Preto para textos */
    --cor-texto-secundario: #65676b;
    --cor-superficie: #ffffff; /* Branco para cards e header */
    --cor-borda: #ced0d4;
    --sombra-suave: 0 2px 4px rgba(0, 0, 0, 0.1);
    --raio-borda: 8px;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--cor-fundo);
    color: var(--cor-texto);
}

a {
    color: var(--cor-texto);
    text-decoration: none;
}
a:hover {
    color: var(--cor-principal);
}

/* ==========================================================================
   HEADER E NAVEGAÇÃO
   ========================================================================== */
.header-top-bar {
    background-color: var(--cor-principal); color: #fff;
    padding: 0.5rem 0; font-size: 0.85rem;
}
.social-icon-topbar { color: #fff; font-size: 1.1rem; }

.header-middle-bar .header-logo {
    max-height: 55px;
}
.hamburger-btn {
    background-color: var(--cor-principal); color: #fff;
    border: none; border-radius: 4px; padding: 0.3rem 0.8rem;
    font-size: 1.5rem; line-height: 1;
}

.main-navbar {
    border-top: 2px solid var(--cor-principal);
}
.main-navbar .nav-link {
    font-weight: 700; font-size: 0.9rem;
}

@media (max-width: 991.98px) {
    #mainNavDesktop {
        display: none;
    }
}

:root {
    /* Defina cores base para o gradiente de "novo" */
    --story-gradient: linear-gradient(45deg, #ff9a85 0%, #ff6c6c 50%, #ee3c80 100%);
    --cor-borda: #ccc; /* Cor de borda padrão para stories "não novos" */
    --cor-superficie: #fff; /* Cor do fundo (ajuste se a superfície não for branca) */
}

/* Animação de pulsação para o contorno de "Novo Story" */
@keyframes pulsateNewStory {
    0% { background: var(--story-gradient); box-shadow: 0 0 0 0 rgba(255, 68, 85, 0.5); }
    50% { box-shadow: 0 0 0 4px rgba(255, 68, 85, 0); }
    100% { background: var(--story-gradient); box-shadow: 0 0 0 0 rgba(255, 68, 85, 0.5); }
}

.stories-container {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 1rem 0;
    scrollbar-width: none; /* Firefox */
}
.stories-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, etc. */
}

.story-item {
    text-align: center;
    flex: 0 0 80px;
    text-decoration: none; /* Garante que o link não tenha sublinhado */
    color: inherit; /* Mantém a cor do texto do contêiner pai */
}

.story-image-wrapper {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin: 0 auto 5px auto;
    padding: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--cor-borda);
    /* Transição para a animação de hover */
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
}

/* Efeito de escala/zoom ao passar o mouse */
.story-item:hover .story-image-wrapper {
    transform: scale(1.08); /* Mais pronunciado */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.story-image-wrapper.new-story {
    /* Gradiente vibrante para "Novo" */
    background: var(--story-gradient);
    /* Aplica a animação de pulsação */
    animation: pulsateNewStory 3s infinite ease-out; 
    border: none; /* Remove a borda padrão para deixar o gradiente mais limpo */
}

.story-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    /* Borda interna branca para destacar a imagem dentro do wrapper/gradiente */
    border: 3px solid var(--cor-superficie); 
    transition: transform 0.3s ease;
}

/* Animação adicional na imagem ao passar o mouse */
.story-item:hover .story-image {
    transform: scale(0.95);
}

.story-item .title {
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Adiciona elipses se o texto for muito longo */
    display: block;
    max-width: 80px; /* Limita o título para evitar quebras de layout */
    margin: 0 auto;
}

/* ==========================================================================
   VISUALIZADOR DE STORIES (MODAL)
   ========================================================================== */
.story-viewer {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 2000; display: flex; justify-content: center; align-items: center;
}
.story-viewer-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.85); backdrop-filter: blur(5px);
}
.story-viewer-close {
    position: absolute; top: 20px; right: 20px; background: transparent; border: none;
    color: white; font-size: 2.5rem; line-height: 1; cursor: pointer; z-index: 2002;
}
.story-viewer-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.3); border: none; color: white;
    font-size: 2rem; cursor: pointer; z-index: 2002; padding: 10px;
    border-radius: 50%; width: 50px; height: 50px;
    display: flex; align-items: center; justify-content: center;
}
.story-viewer-nav.prev { left: 20px; }
.story-viewer-nav.next { right: 20px; }

.story-content {
    position: relative;
    width: 360px;
    height: 640px;
    max-width: 90vw;
    max-height: 85vh;
    background-color: #333;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.story-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000; /* Fica acima da imagem e abaixo do texto */
    background: linear-gradient(
        to top,           /* Gradiente de baixo para cima */
        rgba(0,0,0,0.85) 40%, /* Começa bem escuro nos 10% inferiores */
        rgba(0,0,0,0) 60%    /* Fica totalmente transparente a partir de 60% da altura */
    );
}
.story-image-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover;
}
.story-progress {
    position: absolute; top: 10px; left: 10px; right: 10px;
    display: flex; gap: 4px; height: 3px; z-index: 2003;
}
.progress-bar-container {
    flex: 1; background-color: rgba(255, 255, 255, 0.4); border-radius: 2px; overflow: hidden;
}
.progress-bar-fill { height: 100%; width: 0%; background-color: white; }

@keyframes fillProgress { from { width: 0%; } to { width: 100%; } }
.progress-bar-container.active .progress-bar-fill { animation: fillProgress 5s linear forwards; }
.story-content.paused .progress-bar-fill { animation-play-state: paused; }

.story-info {
    position: relative; z-index: 2001; color: white; text-align: center; padding: 20px;
    display: flex; flex-direction: column; justify-content: flex-end; height: 100%;
}
.story-info h2 { font-weight: 900; text-shadow: 2px 2px 5px rgba(0,0,0,0.5); margin-bottom: 20px; }
.story-read-more {
    background-color: white; color: black; padding: 12px 20px; border-radius: 30px;
    font-weight: 700; display: inline-block; align-self: center;
}

/* ==========================================================================
   IMAGENS, CARDS E LAYOUT GERAL
   ========================================================================== */
.img-container {
    position: relative; width: 100%; overflow: hidden;
    background-color: #e9ecef; border-radius: 8px;
}
.img-container.ratio-16-9 { aspect-ratio: 16 / 9; }
.img-container.ratio-4-3 { aspect-ratio: 4 / 3; }

.img-cover {
    width: 100%; height: 100%; object-fit: cover; object-position: center;
}

.img-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0.1));
    z-index: 1;
}

.card {
    border: none; transition: box-shadow 0.2s ease-in-out;
}
.card:hover {
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15) !important;
}

.categoria {
    display: inline-block; background-color: var(--cor-principal); color: #fff !important;
    padding: 4px 10px; font-size: 0.7rem; font-weight: 700;
    border-radius: 20px; text-transform: uppercase;
}

.featured-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 900; line-height: 1.2;
}
.post-card-title {
    font-size: 1.2rem; font-weight: 700;
}

/* ==========================================================================
   SIDEBAR E WIDGETS
   ========================================================================== */
.card-header .widget-title {
    border-bottom: none; padding-bottom: 0; font-size: 1.2rem;
}

.widget-mais-recentes .list-group-item-action:hover {
    background-color: #f8f9fa;
}
.widget-img-wrapper {
    position: relative; border-radius: var(--raio-borda); overflow: hidden;
}
.widget-post-img {
    width: 65px; height: 65px; object-fit: cover; flex-shrink: 0;
}
.widget-post-title {
    font-size: 1rem; font-weight: 700; line-height: 1.3; color: var(--cor-texto);
}
.widget-mais-recentes a:hover .widget-post-title {
    color: var(--cor-principal);
}

.widget-categorias .list-group-item {
    font-weight: 700; color: var(--cor-texto-secundario);
}
.widget-categorias .list-group-item-action:hover {
    background-color: var(--cor-principal); color: #fff;
}
.widget-categorias .list-group-item i {
    transition: transform 0.2s ease-in-out;
}
.widget-categorias .list-group-item-action:hover i {
    transform: translateX(5px);
}

/* ==========================================================================
   RODAPÉ
   ========================================================================== */
.main-footer {
    background-color: #1c1e21;
}
.main-footer .logo-img {
    filter: brightness(0) invert(1);
}
.footer-title {
    font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    padding-bottom: 10px; border-bottom: 2px solid var(--cor-principal);
    display: inline-block; color: #fff;
}
.footer-link {
    color: #adb5bd; transition: all 0.2s ease-in-out;
}
.footer-link:hover {
    color: #fff; padding-left: 5px;
}
.social-icon:hover {
    color: #fff; transform: translateY(-2px);
}

.offcanvas-nav-list .nav-link {
    font-size: 1.1rem; font-weight: 700;
    color: var(--cor-texto-secundario);
    padding: 0.75rem 0;
}
.offcanvas-nav-list .nav-link:hover,
.offcanvas-nav-list .nav-link.active {
    color: var(--cor-principal);
}
.offcanvas-footer-info .social-icon-offcanvas {
    color: var(--cor-texto-secundario);
}
.offcanvas-footer-info .social-icon-offcanvas:hover {
    color: var(--cor-principal);
}

/* CSS para o bloco de anúncio personalizado */

/* 1. MOBILE (Padrão para telas menores que 500px) */
.ad-horizontal-custom {
    width: 320px; /* Largura para mobile */
    height: 50px; /* Altura para mobile */
}

/* 2. TABLET / MOBILE GRANDE (Entre 500px e 800px) */
@media (min-width: 500px) {
    .ad-horizontal-custom {
        width: 468px; /* Banner Médio */
        height: 60px;
    }
}

/* 3. DESKTOP (Para telas de 800px ou mais) */
@media (min-width: 800px) {
    .ad-horizontal-custom {
        width: 728px; /* Leaderboard Grande */
        height: 90px;
    }
}

/* Garante que o anúncio não transborde, limitando o tamanho máximo do container */
.container.px-3 {
    max-width: 1200px; /* Limite o container principal, se desejar */
}
