/* =========================================
   VARIABLES Y CONFIGURACIÓN
   ========================================= */
:root {
    --primary: #1a1a1a;       /* Negro suave para textos */
    --accent: #d32f2f;        /* Rojo prensa para detalles */
    --bg-body: #f4f7f6;       /* Fondo grisáceo muy claro */
    --bg-card: #ffffff;
    --border: #e0e0e0;
    --shadow: 0 10px 20px rgba(0,0,0,0.05);
    --transition: all 0.3s ease;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-body);
    color: var(--primary);
    line-height: 1.6;
}

/* =========================================
   CONTENEDOR PRINCIPAL
   ========================================= */
main {
    max-width: 850px;
    margin: 40px auto;
    padding: 40px;
    background-color: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 40px;
    letter-spacing: -1px;
    text-transform: uppercase;
    border-bottom: 4px solid var(--accent);
    display: table;
    margin-left: auto;
    margin-right: auto;
    padding-bottom: 5px;
}

/* =========================================
   LISTADO DE NOTICIAS
   ========================================= */
.listados {
    list-style: none;
    padding: 0;
    margin: 0;
}

.listados li {
    border-bottom: 1px solid var(--border);
    padding: 25px 0;
    transition: var(--transition);
}

.listados li:last-child { border-bottom: none; }

/* Efecto al pasar el ratón por la noticia */
.listados li:hover {
    background-color: #fafafa;
}

/* Estructura con Foto */
.listados li.confoto {
    display: grid;
    grid-template-columns: 180px 1fr; /* Imagen más grande y clara */
    gap: 20px;
    align-items: center;
}

/* Estructura sin Foto */
.listados li.sinfoto {
    padding-left: 15px;
    border-left: 4px solid var(--border);
}

.listados li.sinfoto:hover {
    border-left-color: var(--accent);
}

/* Títulos de las noticias (Hacemos que parezcan links) */
.listados li h2 {
    margin: 0 0 10px 0;
    font-size: 1.4rem;
    line-height: 1.2;
    color: var(--primary);
    cursor: pointer;
}

.listados li h2:hover {
    color: var(--accent);
    text-decoration: underline;
}

.listados li p {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
    /* Limitamos a 3 líneas para que no rompa el diseño */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;  
    overflow: hidden;
}

/* =========================================
   IMÁGENES
   ========================================= */
.listados li.confoto div:first-child {
    width: 180px;
    height: 120px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.listados li img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.listados li:hover img {
    transform: scale(1.1);
}

/* =========================================
   DISEÑO DEL MODAL (JQUERY UI)
   ========================================= */
/* Personalización de la ventana de diálogo */
.ui-dialog {
    padding: 0 !important;
    border: none !important;
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3) !important;
}

.ui-dialog-titlebar {
    background: var(--primary) !important;
    color: white !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 15px 20px !important;
}

.ui-dialog-content {
    padding: 30px !important;
    font-size: 1.1rem;
    line-height: 1.8;
}

.ui-dialog-buttonpane {
    background: #f9f9f9 !important;
    border-top: 1px solid var(--border) !important;
}

/* Botón cerrar del modal */
.ui-button {
    border-radius: 6px !important;
    font-weight: bold !important;
}

/* =========================================
   RESPONSIVIDAD
   ========================================= */
@media (max-width: 650px) {
    main { margin: 10px; padding: 20px; }
    
    .listados li.confoto {
        grid-template-columns: 1fr;
    }
    
    .listados li.confoto div:first-child {
        width: 100%;
        height: 200px;
    }
    
    h1 { font-size: 1.8rem; }
}