/* --- ESTRUTURA GERAL (Vale para todos) --- */
.tnw-wrapper {
    margin-bottom: 50px;
    width: 100%;
    box-sizing: border-box;
}

/* Cabeçalho com Logo e Linha */
.tnw-header {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    position: relative;
}

.tnw-logo-icon {
    height: 35px;
    width: auto;
    margin-right: 12px;
}

.tnw-title {
    font-size: 28px;
    font-weight: 800;
    text-transform: uppercase;
    color: #273564; /* AZUL TRIBUNA */
    margin: 0;
    padding-right: 20px;
    white-space: nowrap;
    position: relative;
    z-index: 2;
    background: #fff;
}

.tnw-header-line {
    flex-grow: 1;
    height: 4px;
    background-color: #273564;
    border-radius: 2px;
    opacity: 0.3;
}

/* Container de Posts */
.tnw-posts-container {
    display: grid;
    gap: 30px;
}

/* Tipografia Comum */
.tnw-date {
    font-size: 13px;
    color: #888;
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.tnw-post-title {
    margin: 0;
    line-height: 1.3;
}
.tnw-post-title a {
    text-decoration: none;
    color: #273564;
    transition: color 0.2s;
}
.tnw-post-title a:hover {
    color: #000;
}

/* =========================================
   LAYOUT 1: GRID CARDS (CORRIGIDO - 16:9 Seguro)
   ========================================= */
.layout-1 .tnw-posts-container {
    /* Cards grandes */
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

.layout-1 .tnw-item {
    display: flex;
    flex-direction: column;
}

.layout-1 .tnw-thumb-wrap {
    position: relative;
    width: 100%;
    /* O SEGREDO DO 16:9 SEM ASPECT-RATIO: */
    height: 0;
    padding-bottom: 56.25%; /* Isso cria a proporção exata de 16:9 */
    
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(39, 53, 100, 0.1);
}

.layout-1 .tnw-thumb-wrap img {
    position: absolute; /* Necessário para a técnica funcionar */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.layout-1 .tnw-item:hover img {
    transform: scale(1.08);
}

.layout-1 .tnw-cat-tag {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background-color: #273564;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: 6px;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
    z-index: 2;
}

.layout-1 .tnw-post-title {
    font-size: 22px;
    font-weight: 800;
}

/* =========================================
   LAYOUT 2: LISTA HORIZONTAL
   ========================================= */
.layout-2 .tnw-posts-container {
    grid-template-columns: 1fr;
    gap: 25px;
}

.layout-2 .tnw-item {
    display: flex;
    align-items: flex-start;
    background: #fff;
    border-bottom: 1px solid #eee;
    padding-bottom: 25px;
}

.layout-2 .tnw-thumb-wrap {
    width: 280px; /* Largura fixa */
    height: 180px; /* Altura fixa */
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    margin-right: 25px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    position: relative; /* Segurança */
}

.layout-2 .tnw-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.layout-2 .tnw-content {
    flex-grow: 1;
    padding-top: 10px;
}

.layout-2 .tnw-cat-text {
    display: inline-block;
    font-size: 12px;
    color: #fff;
    background: #273564;
    font-weight: bold;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.layout-2 .tnw-post-title {
    font-size: 24px;
    font-weight: 800;
}

/* =========================================
   LAYOUT 3: HERO OVERLAY
   ========================================= */
.layout-3 .tnw-posts-container {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

.layout-3 .tnw-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    height: 400px; /* Altura fixa funciona bem aqui */
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.layout-3 .tnw-thumb-wrap {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
}

.layout-3 .tnw-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.layout-3 .tnw-item:hover .tnw-thumb-wrap img {
    transform: scale(1.1);
}

/* Gradiente Azul */
.layout-3 .tnw-item::after {
    content: "";
    position: absolute;
    bottom: 0; left: 0; width: 100%; height: 80%;
    background: linear-gradient(to top, #273564e6 0%, transparent 100%);
    z-index: 2;
}

.layout-3 .tnw-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    z-index: 3;
    box-sizing: border-box;
}

.layout-3 .tnw-cat-tag {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #fff;
    color: #273564;
    font-size: 12px;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    z-index: 3;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.layout-3 .tnw-date {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
}

.layout-3 .tnw-post-title a {
    color: #fff;
    font-size: 26px;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}
.layout-3 .tnw-post-title a:hover {
     color: #ddd;
}

/* --- RESPONSIVIDADE --- */
@media (max-width: 1024px) {
    .layout-2 .tnw-thumb-wrap {
        width: 220px;
        height: 150px;
    }
     .layout-2 .tnw-post-title {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .tnw-title {
        font-size: 22px;
    }

    /* Força 1 coluna grande no celular */
    .layout-1 .tnw-posts-container,
    .layout-3 .tnw-posts-container {
        grid-template-columns: 1fr;
    }
    
    .layout-1 .tnw-post-title {
        font-size: 20px;
    }

    /* Layout 2 vira vertical no celular */
    .layout-2 .tnw-item {
        flex-direction: column;
    }
    .layout-2 .tnw-thumb-wrap {
        width: 100%;
        height: 220px;
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .layout-3 .tnw-item {
        height: 300px;
    }
    .layout-3 .tnw-post-title a {
        font-size: 20px;
    }
}