
/* ===========================
   LAYOUT GENERAL
   =========================== */

.post-container {
    max-width: 1200px;
    margin: 40px auto 80px;
    padding: 0 50px;
    box-sizing: border-box;
}

.post-layout {
    display: flex;
    gap: 50px;
    align-items: flex-start;
}

/* Columna principal */
.post-main {
    flex: 3;
    min-width: 0;
}

/* Sidebar derecha */
.post-sidebar {
    flex: 1.2;
    position: sticky;
    top: 100px;
}

/* --- Botón de Retorno (ESTILO BOTÓN VERDE) --- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    background-color: #71b13d; /* Verde corporativo */
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 30px;
    padding: 10px 24px;
    border-radius: 8px; /* Bordes suaves */
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(113, 177, 61, 0.2);
}

.back-link:hover {
    background-color: #5a8f2f; /* Verde más oscuro */
    color: #ffffff;
    transform: translateY(-2px); /* Efecto de elevación */
    box-shadow: 0 6px 12px rgba(113, 177, 61, 0.3);
}

.back-link svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2.5;
}

/* --- Encabezado del Post --- */
.post-header {
    text-align: left;
    margin-bottom: 30px;
}

.post-title {
    font-size: 2.7rem; 
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 15px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.post-meta {
    font-size: 1.05rem;
    color: #6b7280;
    font-weight: 500;
}

/* --- Imagen de Portada --- */
.post-cover-image {
    width: 100%;
    /* Altura reducida considerablemente */
    max-height: 250px; 
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 40px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* --- Cuerpo del Contenido --- */
.post-body {
    line-height: 1.8;
    color: #374151; /* Gris oscuro base */
    font-size: 1.15rem;
    padding-top: 10px;
}

.post-body h1 { font-size: 1.8em; margin-top: 1.5em; margin-bottom: 0.5em; font-weight: 700; color: #111827; }
.post-body h2 { font-size: 1.5em; margin-top: 1.4em; margin-bottom: 0.5em; font-weight: 700; color: #1f2937; }
.post-body h3 { font-size: 1.3em; margin-top: 1.3em; margin-bottom: 0.5em; font-weight: 600; color: #374151; }
.post-body h4 { font-size: 1.15em; font-weight: 600; }
.post-body p { margin-bottom: 1.6rem; }

/* CAMBIO IMPORTANTE: Links normales 
   Se eliminó el estilo de botón. Ahora son texto verde subrayado.
*/
.post-body a {
    color: #71b13d; /* Verde corporativo */
    text-decoration: underline;
    font-weight: 600;
    background-color: transparent;
    padding: 0;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    display: inline; /* Fluye con el texto */
    transition: color 0.2s;
}
.post-body a:hover {
    color: #5a8f2f;
    background-color: transparent;
    transform: none;
}

.post-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 30px auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Tablas */
.post-body table { width: 100%; border-collapse: collapse; margin: 25px 0; font-size: 0.95em; }
.post-body th, .post-body td { border: 1px solid #e5e7eb; padding: 14px; text-align: left; }
.post-body th { background-color: #f9fafb; font-weight: 600; }

/* CAMBIO IMPORTANTE: Corrección de estilos "basura" del editor 
   Esto soluciona que el texto aparezca blanco o con fondos extraños.
*/
.post-body, .post-body * { 
    font-family: inherit; 
}

/* Fuerza fondo transparente en elementos que no sean imágenes para quitar resaltados blancos */
.post-body *:not(img) {
    background-color: transparent !important; 
}

/* Fuerza el color del texto a heredar del padre, ignorando 'color: white' inline */
.post-body [style*="color"] { 
    color: inherit !important; 
}
.post-body [style*="background"] { 
    background-color: transparent !important; 
}
.post-body [style*="font-size"] { 
    font-size: inherit !important; 
}


/* --- Sidebar --- */
.sidebar-box {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #f3f4f6;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    padding: 30px 24px;
}
.sidebar-title {
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #9ca3af;
    margin-bottom: 12px;
}
.sidebar-divider {
    height: 3px;
    width: 50px;
    background: #71b13d;
    border-radius: 999px;
    margin-bottom: 25px;
}
.sidebar-list { list-style: none; margin: 0; padding: 0; }
.sidebar-item { border-bottom: 1px solid #f3f4f6; padding: 18px 0; }
.sidebar-item:last-child { border-bottom: none; padding-bottom: 0; }
.sidebar-item:first-child { padding-top: 0; }

.sidebar-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: transform 0.2s ease;
}
.sidebar-link:hover { transform: translateX(5px); }

.sidebar-thumb {
    width: 85px;
    height: 85px;
    object-fit: cover;
    border-radius: 12px;
    background-color: #f3f4f6;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.sidebar-content-wrapper { flex: 1; display: flex; flex-direction: column; padding-top: 2px; }
.sidebar-post-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sidebar-link:hover .sidebar-post-title { color: #71b13d; }
.sidebar-date { font-size: 0.85rem; color: #9ca3af; font-weight: 500; }

/* ===========================
   MEDIA QUERIES
   =========================== */

/* Pantallas Grandes (>1600px) */
@media (min-width: 1600px) {
    .post-container { max-width: 1400px; padding: 0 60px; }
    .post-title { font-size: 3rem; }
    .post-body { font-size: 1.25rem; }
    .post-cover-image { max-height: 320px; } /* Proporcionalmente más chica */
}

/* Laptop Grande (1440px - 1599px) */
@media (max-width: 1599px) and (min-width: 1440px) {
    .post-container { padding: 0 55px; }
    .post-title { font-size: 2.6rem; }
}

/* Laptops 14" (1366px - 1439px) */
@media (max-width: 1439px) and (min-width: 1200px) {
    .post-container {
        max-width: 1100px; 
        margin: 30px auto 60px;
        padding: 0 50px; 
    }
    .post-layout { gap: 40px; }
    .post-title { font-size: 2.3rem; }
    .post-body { font-size: 1.12rem; }
    .sidebar-post-title { font-size: 0.95rem; }
}

/* Tablets Landscape / Laptops pequeñas */
@media (max-width: 1199px) and (min-width: 992px) {
    .post-container { max-width: 960px; padding: 0 45px; }
    .post-layout { gap: 30px; }
    .post-title { font-size: 2.1rem; }
    .post-body { font-size: 1.05rem; }
}

/* Tablets Portrait */
@media (max-width: 991px) and (min-width: 768px) {
    .post-container { max-width: 720px; padding: 0 40px; }
    .post-layout { flex-direction: column; gap: 40px; }
    .post-sidebar { width: 100%; margin-top: 20px; }
    .post-title { font-size: 2rem; }
}

/* MÓVIL (≤ 767px) */
@media (max-width: 767px) {
    .post-container {
        width: 100%;
        margin: 20px auto 40px;
        padding: 0 25px; 
    }
    .post-layout { flex-direction: column; gap: 30px; }
    
    .post-title { font-size: 1.9rem; margin-bottom: 10px; }
    .post-meta { font-size: 0.95rem; }
    
    /* En móvil un poco más pequeña */
    .post-cover-image {
        max-height: 200px; 
        margin-bottom: 25px;
    }

    .post-body { font-size: 1.1rem; line-height: 1.7; }
    .post-body p { margin-bottom: 1.4rem; }
    
    /* En móvil los links fluyen normal */
    .post-body a { display: inline; text-align: left; margin: 0; }

    .sidebar-box { padding: 25px 20px; background: #fafafa; border: none; }
    .sidebar-thumb { width: 70px; height: 70px; }
    
    /* Botón de regreso full width en móvil */
    .back-link {
        width: 100%;
        justify-content: center;
        box-sizing: border-box;
    }
}
