/* ==========================================================================
   1. VARIABLES Y FUENTES (Paleta Miradas.mx)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Merriweather:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    /* Colores del Logo */
    --brand-blue: #17437D;
    --brand-red: #A22731;
    
    /* Colores de Interfaz */
    --text-main: #222222;
    --text-light: #555555;
    --bg-body: #F7F9FA;
    --bg-card: #FFFFFF;
    --border-color: #EAEAEA;
    
    /* Tipografías */
    --font-ui: 'Inter', sans-serif;
    --font-editorial: 'Merriweather', serif;
}

/* ==========================================================================
   2. RESET Y ESTILOS BASE
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-ui);
    color: var(--text-main);
    background-color: var(--bg-body);
    line-height: 1.6;
}

a {
    color: var(--brand-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--brand-red);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   3. CABECERA (Header)
   ========================================================================== */
.site-header {
    background-color: var(--bg-card);
    border-bottom: 2px solid var(--brand-blue);
    padding: 20px 0;
    margin-bottom: 40px;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo img {
    max-height: 50px; /* Ajusta el tamaño de tu logo aquí */
}

.site-nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

.site-nav a {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    color: var(--text-main);
}

.site-nav a:hover {
    color: var(--brand-red);
}

/* ==========================================================================
   4. CUADRÍCULA DE PORTADA (Editorial Grid)
   ========================================================================== */
.magazine-grid {
    display: grid;
    /* Usamos 12 columnas para tener máxima flexibilidad matemática */
    grid-template-columns: repeat(12, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* En celulares, todas las notas ocupan el 100% (12 columnas) */
    grid-column: span 12; 
}

/* --- DISEÑO DE ESCRITORIO (Mosaico) --- */
@media (min-width: 768px) {
    
    /* Por defecto, las notas ocuparán 4 columnas (Es decir, 3 por fila) */
    .post-card {
        grid-column: span 4;
    }

    /* 1. Nota Principal (Hero): Ocupa las 12 columnas */
    .post-card.post-card-featured {
        grid-column: span 12;
        flex-direction: row;
        align-items: center;
        border-bottom: 3px solid var(--brand-blue);
    }
    
    .post-card.post-card-featured .post-card-image-link {
        flex: 0 0 60%;
    }
    
    .post-card.post-card-featured .post-card-content {
        padding: 40px;
    }
    
    .post-card.post-card-featured .post-card-title {
        font-size: 2.2rem;
    }

    /* 2. Notas 2 y 3 (Secundarias): Ocupan 6 columnas cada una (Mitad y mitad) */
    .post-card:nth-child(2),
    .post-card:nth-child(3) {
        grid-column: span 6;
    }
    
    .post-card:nth-child(2) .post-card-title,
    .post-card:nth-child(3) .post-card-title {
        font-size: 1.5rem;
    }

    /* 3. Notas 4, 5 y 6: Se quedan con el estilo por defecto (3 por fila) */
    
    /* 4. Nota 7: Rompe la monotonía siendo una franja horizontal (8 columnas) */
    .post-card:nth-child(7) {
        grid-column: span 8;
        flex-direction: row; /* Imagen a la izquierda, texto a la derecha */
        align-items: center;
    }
    
    .post-card:nth-child(7) .post-card-image-link {
        flex: 0 0 50%;
    }

    /* 5. Nota 8: Actúa como barra lateral de la nota 7 (4 columnas) */
    .post-card:nth-child(8) {
        grid-column: span 4;
    }
}

/* --- ESTILOS INTERNOS DE LA TARJETA --- */
.post-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 16 / 9;
}

.post-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-card-tag {
    color: var(--brand-red);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.post-card-title {
    font-size: 1.25rem;
    margin-bottom: 10px;
    line-height: 1.3;
}

.post-card-title a {
    color: var(--text-main);
}

.post-card-title a:hover {
    color: var(--brand-blue);
}

.post-card-excerpt {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 20px;
    flex-grow: 1;
}

.post-card-meta {
    font-size: 0.85rem;
    color: #999;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
}
/* ==========================================================================
   5. ARTÍCULO INDIVIDUAL (Post view)
   ========================================================================== */
.article-container {
    max-width: 800px;
    margin: 0 auto 60px;
    background: var(--bg-card);
    padding: 40px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.article-header {
    text-align: center;
    margin-bottom: 30px;
}

.article-tag {
    display: inline-block;
    background-color: var(--brand-red);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.article-tag:hover {
    background-color: var(--brand-blue);
    color: white;
}

.article-title {
    font-size: 2.5rem;
    color: var(--brand-blue);
    line-height: 1.2;
    margin-bottom: 15px;
}

.article-excerpt {
    font-size: 1.2rem;
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 20px;
}

.article-meta {
    font-size: 0.9rem;
    color: #777;
}

.article-image {
    margin: 0 -40px 30px; /* Para que la imagen sobresalga del padding */
}

.article-image figcaption {
    text-align: center;
    font-size: 0.8rem;
    color: #888;
    padding: 10px;
}

/* Tipografía Editorial para el cuerpo del texto */
.article-content {
    font-family: var(--font-editorial);
    font-size: 1.1rem;
    line-height: 1.8;
    color: #111;
}

.article-content p {
    margin-bottom: 1.5em;
}

.article-content h2, .article-content h3 {
    font-family: var(--font-ui);
    color: var(--brand-blue);
    margin: 1.5em 0 0.5em;
}

/* ==========================================================================
   6. FOOTER
   ========================================================================== */
.site-footer {
    background-color: var(--brand-blue);
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
}

/* ==========================================================================
   7. GHOST KOENIG EDITOR (Estilos requeridos para imágenes)
   ========================================================================== */
.kg-width-wide {
    position: relative;
    width: 100vw;
    max-width: 1040px; /* Un poco más ancho que el texto */
    left: 50%;
    transform: translateX(-50%);
}

.kg-width-full {
    position: relative;
    width: 100vw;
    max-width: 100vw; /* De orilla a orilla de la pantalla */
    left: 50%;
    transform: translateX(-50%);
}

.kg-width-wide img,
.kg-width-full img {
    width: 100%;
    height: auto;
}

/* ==========================================================================
   8. DISEÑO DEL ARTÍCULO (post.hbs)
   ========================================================================== */
.article {
    /* Mantenemos un ancho máximo para que la lectura no canse la vista */
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

.article-header {
    text-align: center;
    margin-bottom: 40px;
}

.article-tag {
    color: var(--brand-red);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.article-title {
    font-size: 2.8rem;
    color: var(--brand-blue);
    line-height: 1.2;
    margin-bottom: 20px;
}

.article-excerpt {
    font-size: 1.3rem;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 20px;
}

.article-meta {
    font-size: 0.9rem;
    color: #888;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    margin-top: 20px;
}

.article-image {
    margin: 0 0 40px 0;
}

.article-image img {
    width: 100%;
    border-radius: 4px;
    object-fit: cover;
}

.article-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-main);
}

.article-content p {
    margin-bottom: 1.5em;
}

.article-content h2, 
.article-content h3 {
    color: var(--brand-blue);
    margin-top: 2em;
    margin-bottom: 1em;
}

.article-tag {
    background-color: var(--brand-red); /* Fondo rojo institucional */
    color: #ffffff !important; /* Texto blanco forzado para que siempre contraste */
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
    padding: 4px 12px; /* Da el volumen de la píldora */
    border-radius: 20px; /* Bordes redondeados */
    transition: background-color 0.3s ease; /* Transición suave al pasar el mouse */
}

/* Efecto hover: Cambia a azul institucional */
.article-tag:hover {
    background-color: var(--brand-blue);
    color: #ffffff !important;
}

/* Ajustes para móviles */
@media (max-width: 768px) {
    .article-title {
        font-size: 2rem;
    }
    .article {
        padding: 20px 15px 40px;
    }
}

/* ==========================================================================
   9. ADORNOS EDITORIALES (Fuente original)
   ========================================================================== */
.article-content .nota-fuente {
    font-size: 1.05rem;
    color: #666666; /* Un gris sutil para no robar atención al título */
    font-style: italic;
    border-bottom: 1px solid var(--border-color); /* Una línea sutil de separación */
    padding-bottom: 15px;
    margin-top: -10px;
    margin-bottom: 25px;
}

.article-content .nota-fuente strong {
    color: var(--brand-blue); /* Tu azul institucional */
    font-weight: 700;
    font-style: normal; /* Para que el nombre resalte recto, no en cursiva */
    letter-spacing: 0.3px;
}

/* ==========================================================================
   10. BOTONES DE COMPARTIR
   ========================================================================== */
.share-container {
    display: flex;
    margin: 20px 0 30px 0;
    justify-content: flex-end; /* Alinea el botón a la derecha */
}

.share-btn.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center; /* Centra el ícono dentro del círculo */
    background-color: #25D366; 
    color: #ffffff !important;
    width: 44px;  /* Ancho fijo para formar el círculo */
    height: 44px; /* Alto fijo para formar el círculo */
    border-radius: 50%; /* Hace que sea completamente redondo */
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 6px rgba(37, 211, 102, 0.2);
}

.share-btn.whatsapp-btn:hover {
    background-color: #128C7E; 
    transform: translateY(-2px); 
    box-shadow: 0 6px 12px rgba(37, 211, 102, 0.3);
}

.share-btn.whatsapp-btn svg {
    width: 24px; /* Ajustamos el tamaño del SVG */
    height: 24px;
    fill: currentColor; 
    /* Eliminamos el margin-right que tenía antes porque ya no hay texto */
}