/* 1. Variables y Reset */
:root {
    --primary: #2563eb;
    --dark: #1e293b;
    --light: #f8fafc;
    --accent: #38bdf8;
    --white: #ffffff;
    --shadow: 0 4px 15px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; } /* Evita problemas con anchos y paddings */

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background-color: var(--light);
    color: var(--dark);
    margin: 0;
    padding: 0; /* Quitamos padding aquí para usarlo en containers */
    line-height: 1.6;
}

/* 2. Layout Containers */
.container {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

header.main-header {
    background-image: url('img/marquesina.jpg'); /* Tu imagen */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    padding: 0; /* Quitamos el padding aquí para que el overlay controle el espacio */
    border-radius: 0 0 20px 20px;
    margin-bottom: 30px;
    overflow: hidden; /* Para que el redondeado funcione con la imagen */
    position: relative;
    min-height: 250px; /* Altura mínima del banner */
}

/* Capa oscura para que el texto se lea siempre bien (Overlay) */
.header-overlay2 {
    background: rgba(30, 41, 59, 0.6); /* Color --dark con transparencia */
    width: 100%;
    height: 100%;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1rem;
}

header2 h1 {
    font-size: 2.5rem;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5); /* Sombra al texto */
   background: rgba(30, 41, 59, 0.6); /* Color --dark con transparencia */
}

header2 p {
    font-size: 1.2rem;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}






.main-layout {
    display: grid;
    grid-template-columns: 1fr; /* Por defecto una columna (celulares) */
    gap: 30px;
}

/* 3. Artículos y Cards */
.grid-articulos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.card-img img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 20px;
    flex-grow: 1;
}

.card-content h3 {
    margin: 0 0 10px 0;
    color: var(--primary);
}

/* 4. Elementos de Interfaz */
.badge {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.btn-leer {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    transition: opacity 0.2s;
}

.btn-leer:hover {
    opacity: 0.9;
}

/* 5. Categorías Scroll (Mobile) */
.categorias-scroll {
    display: flex;
    overflow-x: auto;
    padding-bottom: 15px;
    gap: 10px;
    scrollbar-width: none; /* Oculta scroll en Firefox */
}

.categorias-scroll::-webkit-scrollbar { display: none; } /* Oculta en Chrome/Safari */

.chip {
    background: #e2e8f0;
    padding: 8px 18px;
    border-radius: 25px;
    text-decoration: none;
    color: #475569;
    font-weight: 500;
    white-space: nowrap;
}

.chip:hover { background: #cbd5e1; }

/* 6. Sidebar Widgets */
.sidebar .widget {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

@media (max-width: 768px) {
    header.main-header {
        min-height: 180px;
    }
    .header-overlay {
        min-height: 180px;
    }
    header h1 {
        font-size: 1.8rem;
    }
}

/* 7. MEDIA QUERIES (Adaptabilidad) */
@media (min-width: 992px) {
    .main-layout {
        grid-template-columns: 1fr 320px; /* Dos columnas en PC */
    }
}
/* 7. MEDIA QUERIES (Adaptabilidad) */
@media (min-width: 992px) {
    .category-nav {
        grid-template-columns: 1fr 320px; /* Dos columnas en PC */
    }
}
.search-form {
    display: flex;
    gap: 5px;
}
.search-form input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
}
.search-form button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
}
.btn-sidebar {
    display: block;
    padding: 12px;
    background: #f1f5f9;
    color: var(--dark);
    text-decoration: none;
    margin-bottom: 10px;
    border-radius: 8px;
    font-weight: 500;
    transition: background 0.2s;
}
.btn-sidebar:hover { background: #e2e8f0; }
.admin-btn { background: var(--dark) !important; color: white !important; }

/* Color para el chip seleccionado */
.chip.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

/* Ajuste para el contenedor de los chips */
.category-nav {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
    position: sticky; /* Opcional: para que el menú te siga al bajar */
    top: 0;
    z-index: 100;
}

.categorias-scroll {
    display: flex;
    align-items: center; /* Alinea los botones al centro verticalmente */
    padding: 15px 0;
    overflow-x: auto;
    gap: 12px;
}



/* desde aqui post*/


/* Estilos específicos para la página de lectura */


.meta-data {
    font-size: 1rem;
    color: #e2e8f0;
}

.meta-data span {
    margin: 0 10px;
}

.post-full-card {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-top: -60px; /* Sube la tarjeta sobre el header */
    position: relative;
    z-index: 10;
}

.breadcrumb {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 20px;
}

.contenido-completo {
    font-size: 1.2rem; /* Letra un poco más grande para leer mejor */
    line-height: 1.8;
    color: #334155;
}

/* Espacio para publicidad */
.ad-placeholder {
    background: #f1f5f9;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #cbd5e1;
    margin: 30px 0;
    color: #94a3b8;
}

.footer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.btn-volver { background: var(--dark); }
.btn-print { background: var(--accent); color: var(--dark); border: none; cursor: pointer; }

/* Adaptabilidad para móviles */
@media (max-width: 768px) {
    .post-full-card {
        padding: 20px;
        margin-top: 0;
        border-radius: 0;
    }
    .header-content-post h1 {
        font-size: 1.8rem;
    }
}


/* Sección de sugerencias */
/* Sección de sugerencias compacta */
.articulos-similares {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.articulos-similares h3 {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    margin-bottom: 15px;
}

.lista-sugerencias {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Se adapta a 2 o 3 columnas según el ancho */
    gap: 15px;
}

.mini-card-sugerencia {
    display: flex; /* Pone imagen y texto en línea */
    align-items: center;
    text-decoration: none;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
    padding: 8px;
}

.mini-card-sugerencia:hover {
    border-color: var(--primary);
    background: var(--light);
    transform: translateX(5px);
}

.mini-img {
    width: 60px; /* Tamaño fijo pequeño */
    height: 60px;
    flex-shrink: 0; /* Evita que la imagen se aplaste */
    margin-right: 12px;
}

.mini-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.mini-info h4 {
    font-size: 0.85rem;
    margin: 0;
    color: var(--dark);
    line-height: 1.2;
}

.mini-info small {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: bold;
}


/* BUSCADOR */

.no-results {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
    color: #64748b;
}

.no-results i {
    color: var(--accent);
    margin-bottom: 20px;
}

.no-results h3 {
    color: var(--dark);
    margin-bottom: 10px;
}






/* marquesinaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa */
/* Forzamos la marquesina fija de fondo para todos los posts */
.header-post {
    background-image: url('img/marquesina2.jpg') !important;
    background-size: cover;
    background-position: center;
    min-height: 200px !important; /* Un poco más alto para que luzca */
}

/* Alineamos el contenido a la izquierda y abajo (estilo Facebook) */
.header-post .header-overlay {
    display: flex;
    align-items: flex-end; /* Lo baja al borde inferior */
    justify-content: flex-start; /* Lo pega a la izquierda */
    text-align: left;
    padding-bottom: 80px; /* Espacio para que no choque con la tarjeta de abajo */
}

.header-profile-container {
    display: flex;
    align-items: center;
    gap: 25px;
}

/* Estilo de la "Foto de Perfil" del Post */
.post-avatar {
    width: 160px;
    height: 160px;
    flex-shrink: 0;
    border: 5px solid var(--white);
    border-radius: 15px; /* Bordes redondeados suaves */
    overflow: hidden;
    background: var(--dark);
    box-shadow: var(--shadow);
}

.post-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Recorta la imagen sin deformarla */
}

/* Ajustes de texto para que no se pierda */
.post-head-text h1 {
    font-size: 2.5rem;
    margin: 5px 0;
    line-height: 1.1;
}

/* RESPONSIVE: En celulares la foto arriba y el texto abajo */
@media (max-width: 768px) {
    .header-profile-container {
        flex-direction: column;
        text-align: center;
    }
    .header-post .header-overlay {
        justify-content: center;
        align-items: center;
        padding-bottom: 20px;
    }
    .post-avatar {
        width: 120px;
        height: 120px;
    }
    .post-head-text h1 {
        font-size: 1.8rem;
    }
}