/**
 * CSS: Seção de Notícias Automotivas
 * 
 * Grid responsivo de notícias via RSS
 * 
 * Autor: Dumont Web (https://dumontweb.com.br)
 * Versão: 1.0
 * Data: 09/12/2024
 */

/* ========================================
   SEÇÃO DE NOTÍCIAS
   ======================================== */

.autosul-news-section {
    margin: 40px 0;
    padding: 40px 20px;
    background: #f9fafb;
    border-radius: 16px;
}

.autosul-news-header {
    text-align: center;
    margin-bottom: 30px;
}

.autosul-news-header h2 {
    font-size: 28px;
    margin: 0 0 10px 0;
    color: #1f2937;
    font-weight: 700;
}

.autosul-news-subtitle {
    font-size: 16px;
    color: #6b7280;
    margin: 0;
}

/* ========================================
   GRID DE NOTÍCIAS
   ======================================== */

.autosul-noticias {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ========================================
   CARD DE NOTÍCIA
   ======================================== */

.noticia-item {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    border-left: 4px solid #0b57d0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.noticia-item:hover {
    box-shadow: 0 8px 20px rgba(11,87,208,0.15);
    transform: translateY(-4px);
    border-left-color: #667eea;
}

/* Thumbnail */
.noticia-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #e5e7eb;
}

.noticia-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.noticia-item:hover .noticia-thumb img {
    transform: scale(1.05);
}

/* Conteúdo */
.noticia-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.noticia-item h3 {
    font-size: 18px;
    line-height: 1.4;
    margin: 0 0 12px 0;
    font-weight: 600;
}

.noticia-item h3 a {
    color: #1f2937;
    text-decoration: none;
    transition: color 0.3s ease;
}

.noticia-item h3 a:hover {
    color: #0b57d0;
}

.noticia-desc {
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
    margin: 0 0 15px 0;
    flex: 1;
}

/* Meta */
.noticia-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.noticia-date {
    font-size: 12px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Link "Ler mais" */
.noticia-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0b57d0;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.noticia-link:hover {
    gap: 10px;
    color: #667eea;
}

/* ========================================
   ESTADO VAZIO
   ======================================== */

.autosul-news-empty {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    max-width: 500px;
    margin: 0 auto;
}

.autosul-news-empty p {
    font-size: 16px;
    color: #6b7280;
    margin: 0 0 20px 0;
}

.autosul-reload-btn {
    padding: 12px 24px;
    background: #0b57d0;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.autosul-reload-btn:hover {
    background: #0842a0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(11,87,208,0.3);
}

/* ========================================
   MODAL DE NOTÍCIA (ESTILO UOL)
   ======================================== */

/* Modal backdrop com scroll seguro */
.uol-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    align-items: flex-start;
    justify-content: center;
    z-index: 999999;
    padding: 20px;
    padding-top: 60px;
    overflow-y: auto;
}

.uol-modal-backdrop.active {
    display: flex;
}

.uol-modal {
    max-width: 900px;
    width: 100%;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    margin: auto;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Botão X no topo direito */
.uol-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.uol-modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Título */
.uol-modal-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    padding: 18px 50px 18px 20px;
    color: #000;
    line-height: 1.4;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* Imagem modal que não estoura */
.uol-modal-thumb {
    background: #f4f4f4;
}

.uol-modal-thumb img {
    width: 100%;
    height: auto;
    max-height: 60vh;
    object-fit: contain;
    display: block;
}

/* Corpo do modal COM SCROLL */
.uol-modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: 50vh;
}

.uol-modal-excerpt {
    font-size: 16px;
    line-height: 1.7;
    color: #222;
}

.uol-modal-excerpt p {
    margin-bottom: 15px;
}

.uol-modal-excerpt p:last-child {
    margin-bottom: 0;
}

/* Qualquer imagem dentro do modal fica fluida */
.uol-modal-excerpt img,
.uol-modal-excerpt figure img {
    max-width: 100% !important;
    height: auto !important;
    width: auto;
    display: block;
    margin: 10px auto;
}

.uol-modal-excerpt iframe,
.uol-modal-excerpt video {
    max-width: 100%;
}

/* Ações do modal */
.uol-modal-actions {
    padding: 16px 18px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: #f9fafb;
}

.uol-btn {
    appearance: none;
    border: none;
    background: #0b57d0;
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.uol-btn:hover {
    background: #0842a0;
    transform: translateY(-1px);
    color: #fff;
}

.uol-btn.secondary {
    background: #e9eef6;
    color: #0b57d0;
}

.uol-btn.secondary:hover {
    background: #d1dae8;
    color: #0b57d0;
}

/* ========================================
   RESPONSIVO
   ======================================== */

/* Tablet */
@media (max-width: 968px) {
    .autosul-news-section {
        padding: 30px 15px;
    }
    
    .autosul-news-header h2 {
        font-size: 24px;
    }
    
    .autosul-noticias {
        gap: 20px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .autosul-noticias {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .noticia-item h3 {
        font-size: 16px;
    }
    
    .noticia-desc {
        font-size: 13px;
    }
    
    .autosul-news-section {
        margin: 20px 0;
        padding: 20px 10px;
    }
}

/* Mobile pequeno */
@media (max-width: 480px) {
    .autosul-news-header h2 {
        font-size: 20px;
    }
    
    .noticia-content {
        padding: 15px;
    }
    
    .noticia-item h3 {
        font-size: 15px;
    }
    
    .uol-modal-backdrop {
        padding: 10px;
        padding-top: 80px;
    }
    
    .uol-modal {
        margin: 0;
    }
    
    .uol-modal-title {
        font-size: 18px;
        padding: 15px 45px 15px 15px;
    }
    
    .uol-modal-body {
        max-height: 45vh;
        padding: 15px;
    }
    
    .uol-modal-thumb img {
        max-height: 40vh;
    }
    
    .uol-modal-actions {
        flex-direction: column;
        gap: 8px;
        padding: 12px 15px;
    }
    
    .uol-btn {
        width: 100%;
        justify-content: center;
    }
}
