/**
 * Tribuna News Layouts - Estilos Profissionais
 * Inspirado em NY Times, Folha de SP, The Guardian
 */

/* ========================================
   ESTILOS GLOBAIS
   ======================================== */
.tn-item, .tn-list-item, .tn-featured-item, .tn-magazine-item, .tn-card {
    transition: all 0.3s ease;
}

.tn-item:hover, .tn-list-item:hover, .tn-featured-item:hover, .tn-magazine-item:hover, .tn-card:hover {
    transform: translateY(-2px);
}

.tn-thumb {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
}

.tn-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.tn-item:hover .tn-thumb img,
.tn-list-item:hover .tn-thumb img,
.tn-card:hover .tn-thumb img {
    transform: scale(1.05);
}

/* Proporções de imagem */
.tn-ratio-1-1 { padding-top: 100%; }
.tn-ratio-4-3 { padding-top: 75%; }
.tn-ratio-16-9 { padding-top: 56.25%; }
.tn-ratio-21-9 { padding-top: 42.85%; }

.tn-ratio-1-1 img, .tn-ratio-4-3 img, .tn-ratio-16-9 img, .tn-ratio-21-9 img {
    position: absolute;
    top: 0;
    left: 0;
}

.tn-title {
    margin: 10px 0;
    font-family: "Georgia", "Times New Roman", serif;
    font-weight: 700;
    line-height: 1.3;
    color: #111;
}

.tn-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.tn-title a:hover {
    color: #0066cc;
}

.tn-cat {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    color: #cc0000;
}

.tn-cat a {
    color: inherit;
    text-decoration: none;
}

.tn-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin: 10px 0;
}

.tn-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

.tn-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.tn-meta i {
    font-size: 14px;
}

/* ========================================
   LAYOUT 1: NEWS GRID
   ======================================== */
.tn-grid {
    display: grid;
}

.tn-grid .tn-item {
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tn-grid .tn-content {
    padding: 15px;
}

.tn-grid .tn-title {
    font-size: 18px;
}

/* Responsivo */
@media (max-width: 1024px) {
    .tn-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .tn-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ========================================
   LAYOUT 2: NEWS FEATURED
   Estilo Folha de SP - 1 grande + pequenos
   ======================================== */
.tn-featured {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.tn-featured-main {
    grid-row: span 2;
}

.tn-featured-main .tn-title {
    font-size: 32px;
}

.tn-featured-secondary .tn-title {
    font-size: 18px;
}

.tn-featured-main .tn-content {
    padding: 20px 0;
}

.tn-featured-secondary {
    display: flex;
    gap: 15px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.tn-featured-secondary .tn-thumb {
    flex: 0 0 120px;
    width: 120px;
    height: 120px;
}

.tn-featured-secondary .tn-content {
    flex: 1;
}

@media (max-width: 768px) {
    .tn-featured {
        grid-template-columns: 1fr;
    }
    
    .tn-featured-main {
        grid-row: span 1;
    }
    
    .tn-featured-main .tn-title {
        font-size: 24px;
    }
}

/* ========================================
   LAYOUT 3: NEWS LIST
   Lista vertical compacta
   ======================================== */
.tn-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tn-list-item {
    display: flex;
    gap: 15px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.tn-list-item:last-child {
    border-bottom: none;
}

.tn-list.tn-thumb-left .tn-thumb {
    order: 1;
}

.tn-list.tn-thumb-right .tn-thumb {
    order: 2;
}

.tn-list .tn-thumb {
    flex: 0 0 150px;
    width: 150px;
    height: 150px;
    border-radius: 4px;
}

.tn-list .tn-content {
    flex: 1;
}

.tn-list .tn-title {
    font-size: 20px;
}

@media (max-width: 768px) {
    .tn-list .tn-thumb {
        flex: 0 0 100px;
        width: 100px;
        height: 100px;
    }
    
    .tn-list .tn-title {
        font-size: 16px;
    }
}

/* ========================================
   LAYOUT 4: NEWS MAGAZINE
   Layout revista - 1 hero + grid
   ======================================== */
.tn-magazine {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.tn-magazine-hero {
    grid-column: span 2;
    grid-row: span 2;
}

.tn-magazine-hero .tn-title {
    font-size: 28px;
}

.tn-magazine-item .tn-title {
    font-size: 16px;
}

.tn-magazine-item .tn-content {
    padding: 15px 0;
}

@media (max-width: 1024px) {
    .tn-magazine {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tn-magazine-hero {
        grid-column: span 2;
        grid-row: span 1;
    }
}

@media (max-width: 768px) {
    .tn-magazine {
        grid-template-columns: 1fr;
    }
    
    .tn-magazine-hero {
        grid-column: span 1;
    }
}

/* ========================================
   LAYOUT 5: NEWS HERO
   Banner hero fullwidth
   ======================================== */
.tn-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
}

.tn-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.tn-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.8) 100%);
}

.tn-hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 40px;
    color: #fff;
}

.tn-hero-content.tn-align-left { text-align: left; margin-right: auto; }
.tn-hero-content.tn-align-center { text-align: center; margin: 0 auto; }
.tn-hero-content.tn-align-right { text-align: right; margin-left: auto; }

.tn-hero .tn-cat {
    color: #ffd700;
}

.tn-hero .tn-title {
    font-size: 48px;
    color: #fff;
    margin: 15px 0;
}

.tn-hero .tn-title a {
    color: #fff;
}

.tn-hero .tn-excerpt {
    font-size: 18px;
    color: rgba(255,255,255,0.9);
}

.tn-hero .tn-meta {
    color: rgba(255,255,255,0.8);
}

@media (max-width: 768px) {
    .tn-hero .tn-title {
        font-size: 28px;
    }
    
    .tn-hero .tn-excerpt {
        font-size: 14px;
    }
    
    .tn-hero-content {
        padding: 20px;
    }
}

/* ========================================
   LAYOUT 6: NEWS TICKER
   Ticker horizontal
   ======================================== */
.tn-ticker {
    display: flex;
    align-items: center;
    background: #111;
    color: #fff;
    border-radius: 4px;
    overflow: hidden;
}

.tn-ticker-label {
    flex: 0 0 auto;
    padding: 12px 20px;
    background: #cc0000;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 1px;
}

.tn-ticker-content {
    flex: 1;
    overflow: hidden;
    padding: 0 20px;
}

.tn-ticker-items {
    display: flex;
    white-space: nowrap;
}

.tn-ticker-item {
    display: inline-block;
    padding: 12px 30px;
    border-right: 1px solid rgba(255,255,255,0.2);
}

.tn-ticker-item a {
    color: #fff;
    text-decoration: none;
    transition: color 0.2s;
}

.tn-ticker-item a:hover {
    color: #ffd700;
}

/* ========================================
   LAYOUT 7: NEWS CARDS
   Cards modernos
   ======================================== */
.tn-cards {
    display: grid;
}

.tn-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Estilo Elevado */
.tn-cards-elevated .tn-card {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.tn-cards-elevated .tn-card:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

/* Estilo Bordado */
.tn-cards-bordered .tn-card {
    border: 2px solid #eee;
}

.tn-cards-bordered .tn-card:hover {
    border-color: #0066cc;
}

/* Estilo Plano */
.tn-cards-flat .tn-card {
    background: transparent;
}

.tn-card .tn-content {
    padding: 20px;
}

.tn-card .tn-title {
    font-size: 20px;
}

@media (max-width: 1024px) {
    .tn-cards {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .tn-cards {
        grid-template-columns: 1fr !important;
    }
}

/* ========================================
   UTILIDADES
   ======================================== */
.tn-read-more {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: #0066cc;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.2s;
}

.tn-read-more:hover {
    background: #0052a3;
}

/* Sem posts */
.tn-no-posts {
    padding: 40px;
    text-align: center;
    color: #999;
    font-size: 16px;
}
