/* ==========================================================================
   GRID DE 5 COLUNAS POR LINHA (Padrão Bootstrap 5)
   ========================================================================== */

.col-5s {
    flex: 0 0 auto;
    width: 20%;
}

@media (min-width: 576px) {
    .col-sm-5s {
        flex: 0 0 auto;
        width: 20%;
    }
}

@media (min-width: 768px) {
    .col-md-5s {
        flex: 0 0 auto;
        width: 20%;
    }
}

@media (min-width: 992px) {
    .col-lg-5s {
        flex: 0 0 auto;
        width: 20%;
    }
}

@media (min-width: 1200px) {
    .col-xl-5s {
        flex: 0 0 auto;
        width: 20%;
    }
}

@media (min-width: 1400px) {
    .col-xxl-5s {
        flex: 0 0 auto;
        width: 20%;
    }
}


/* =========================================================
   GRID PRINCIPAL DE NOTÍCIAS (1 + 9 = 10 POR BLOCO)
   ========================================================= */
.postagens {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px 24px;
}

.noticia {
    display: flex;
    flex-direction: column;
}

/* Wrapper da imagem + etiqueta de categoria no topo esquerdo */
.noticia .foto-wrapper {
    position: relative;
    margin-bottom: 10px;
}

.noticia .categoria {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
}

.noticia .categoria a {
    display: inline-block;
    background-color: #f39c12; /* Cor padrão (pode variar por classe da categoria) */
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    padding: 3px 10px;
    letter-spacing: 0.3px;
}

/* Cores por classe de categoria (igual ao Tokyo 3 original) */
.noticia.desenho-animado .categoria a { background-color: #0d6efd; }
.noticia.eventos .categoria a         { background-color: #28a745; }
.noticia.animes .categoria a          { background-color: #dc3545; }
.noticia.games .categoria a           { background-color: #6f42c1; }
.noticia.mangas .categoria a          { background-color: #fd7e14; }
.noticia.filmes .categoria a          { background-color: #f39c12; }

/* Proporção 16:9 nas fotos */
.noticia .foto {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: #111;
}

.noticia .foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.noticia:hover .foto img {
    transform: scale(1.03);
}

/* Tipografia do Card */
.noticia .conteudo-card {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.noticia h2 {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 8px 0;
}

.noticia h2 a {
    color: #222;
    text-decoration: none;
}

.noticia h2 a:hover {
    color: #dc3545;
}

.noticia .resumo {
    font-size: 13px;
    line-height: 1.45;
    color: #666;
    margin-bottom: 10px;
}

.noticia .assinatura {
    font-size: 11px;
    font-style: italic;
    color: #e67e22;
    margin-top: auto;
}

.noticia .assinatura a {
    color: #e67e22;
    text-decoration: none;
}

.noticia .assinatura a:hover {
    text-decoration: underline;
}

/* =========================================================
   DESTAQUE A CADA 10 POSTAGENS (1º, 11º, 21º...) -> SPAN 3
   ========================================================= */
@media (min-width: 992px) {
    .postagens .noticia:nth-child(7n + 1) {
        grid-column: span 3;
        display: grid;
        grid-template-columns: 2fr 1fr; /* Foto ocupa largura de 2 colunas; texto ocupa a 3ª */
        gap: 24px;
        align-items: start;
        padding-bottom: 12px;
        border-bottom: 1px solid #eee;
    }

    .postagens .noticia:nth-child(7n + 1) .foto-wrapper {
        margin-bottom: 0;
    }

    .postagens .noticia:nth-child(7n + 1) h2 {
        font-size: 22px;
        line-height: 1.25;
        margin-top: 4px;
    }

    .postagens .noticia:nth-child(7n + 1) .resumo {
        font-size: 14px;
        line-height: 1.55;
    }
}

/* =========================================================
   RESPONSIVIDADE (TABLET E MOBILE)
   ========================================================= */
@media (max-width: 991.98px) {
    .postagens {
        grid-template-columns: repeat(2, 1fr);
    }

    .postagens .noticia:nth-child(7n + 1) {
        grid-column: span 2;
    }
}

@media (max-width: 575.98px) {
    .postagens {
        grid-template-columns: 1fr;
    }

    .postagens .noticia:nth-child(7n + 1) {
        grid-column: span 1;
    }
}

/* =========================================================
   PÁGINA INTERNA DA NOTÍCIA
   ========================================================= */
.noticia-interna-wrapper .categoria a {
    background-color: #f39c12;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.noticia-interna-wrapper.desenho-animado .categoria a { background-color: #0d6efd; }
.noticia-interna-wrapper.eventos .categoria a         { background-color: #28a745; }
.noticia-interna-wrapper.animes .categoria a          { background-color: #dc3545; }
.noticia-interna-wrapper.games .categoria a           { background-color: #6f42c1; }
.noticia-interna-wrapper.mangas .categoria a          { background-color: #fd7e14; }
.noticia-interna-wrapper.filmes .categoria a          { background-color: #f39c12; }

.noticia-interna-wrapper .postagem img,
.noticia-interna-wrapper .postagem iframe,
.noticia-interna-wrapper .postagem video {
    max-width: 100%;
    height: auto;
}

.noticia-interna-wrapper .postagem p {
    margin-bottom: 1.15rem;
}

/* ==========================================================================
   CORES POR CATEGORIA (Capa, Categorias e Postagem Interna)
   ========================================================================== */

:root {
    --cat-color: #dc3200; /* Cor padrão (fallback) */
}

/* Mapeamento das cores de cada categoria (funciona em <article class="noticia {slug}"> e <section class="{slug}">) */
.animes          { --cat-color: #dc3200; }
.filmes          { --cat-color: #eb9600; }
.desenho-animado { --cat-color: #0041eb; }
.games           { --cat-color: #f5c300; }
.mangas          { --cat-color: #a09b9b; }
.ilustracoes     { --cat-color: #8750c8; }
.eventos         { --cat-color: #6eb43c; }
.action-figure   { --cat-color: #b43c8c; }

/* --- Aplicação nos Cards (Capa, Listagem de Categoria, Busca e Infinity Scroll) --- */
article.noticia .categoria a,
article.noticia .foto {
    background-color: var(--cat-color);
}

/* --- Aplicação na Postagem Interna (noticias/ver.php) --- */
section.noticiaCompleta .categoria a,
.noticiaCompleta .categoria a,
.noticiaCompleta h3.categoria a,
.noticiaCompleta::before,
.noticiaCompleta .fotoGrande,
.noticiaCompleta .fotoGrande .imagem,
.noticiaCompleta .animacoes,
.noticiaCompleta .animacoesVimeo {
    background-color: var(--cat-color);
}

.noticiaCompleta #complementar,
#complementar {
    border-left-color: var(--cat-color);
}

/* Ajuste de contraste no texto quando o fundo for claro (Games / Mangás) */
article.games .categoria a,
section.games .categoria a {
    color: #ffffff;
}

.ratio-16x9 {
    aspect-ratio: 16 / 9;
}