/* NOTA: Estas variables deben estar definidas en styles.css o menu.css
:root {
    --dom: #00FE83; 
    --acc1: #0556D2; 
    --acc2: #C1A0FD; 
    --texto: #111; 
}
*/

/* ------------------------------------------------ */
/* ---------- ESTILOS DE ARTÍCULO INDIVIDUAL ---------- */
/* ------------------------------------------------ */

.article-page {
    padding-top: 90px; 
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 60px;
}

/* --- Encabezado Centrado --- */
.article-header {
    max-width: 1000px;
    margin: 0 auto 30px auto;
    text-align: center;
}

.article-header .topic-tag {
    color: var(--acc1); /* Azul */
    font-weight: 700;
    text-transform: uppercase;
    font-size: 14px;
    margin-bottom: 10px;
    text-align: center;
    width: 100%;
}

.article-header .title {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    color: var(--texto);
}

.article-header .meta-info {
    font-size: 14px;
    color: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.article-header .meta-info span {
    font-weight: 600;
    text-transform: uppercase;
}
.article-header .meta-info span:not(:last-child)::after {
    content: "|";
    margin-left: 20px;
    color: rgba(0,0,0,0.2);
}

.article-header .summary {
    font-size: 18px;
    color: var(--texto);
    line-height: 1.6;
}

/* --- Imagen Central --- */
.image-placeholder.main-image {
    background-color: var(--sec);
    border-radius: 12px;
    height: 400px; 
    max-width: 900px; 
    margin: 0 auto 40px auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    /* Estilos internos solo para el placeholder */
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    color: rgba(0,0,0,0.4);
}

/* --- RECUAUDRO 1: Tip Destacado / Cita (Color Lila) --- */
.highlight-tip {
    max-width: 650px;
    margin: 40px auto;
    padding: 25px 40px;
    background-color: #fff;
    color: var(--texto);
    text-align: center;
    font-size: 18px;
    font-style: italic;
    font-weight: 600;
    border-radius: 10px;
    border: 3px solid var(--acc2); /* Borde fuerte con color Lila */
    box-shadow: 0 8px 15px rgba(0,0,0,0.1); /* Sombra más pronunciada */
}


/* --- Layout de Contenido (Cuerpo + Sidebar) --- */
.article-content-grid {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 50px;
    max-width: 1000px; 
    margin: 50px auto 70px auto;
    align-items: start; 
}

.content-body h2 {
    font-size: 32px;
    font-weight: 800;
    color: var(--acc1); /* Títulos h2 en color de acento azul */
    margin-top: 5px;
    margin-bottom: 20px;
    border-left: 4px solid var(--acc1); 
    padding-left: 15px;
}

.content-body h3 {
    font-size: 24px;
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--texto);
}

.content-body p {
    font-size: 17px;
    line-height: 1.7;
    margin-bottom: 25px;
    color: var(--texto);
    text-align: justify;
}


/* --- RECUAUDRO 2: Tabla de Contenidos (Sidebar) --- */
.sidebar-toc {
    position: sticky; 
    top: 100px; 
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--acc2);
    border-radius: 10px;
    padding: 18px 18px 0px 24px;
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.sidebar-toc .toc-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--acc1); /* Título en Color de Acento */
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 2px solid rgba(0,0,0,0.1); 
}

.sidebar-toc ul {
    list-style: none;
    padding: 0;
    max-width: 500px;
}

/* 🟢 Estilo Base del Ítem (para alinear el ícono y el texto) */
.sidebar-toc ul li {
    display: flex; /* Permite que el ícono y el texto se alineen */
    align-items: center;
    margin-bottom: 10px;
}

/* Estilos del Enlace (Texto Inactivo/Base) */
.sidebar-toc li a {
    font-size: 15px;
    line-height: 1.4;
    
    /* 1. TIPOGRAFÍA DELGADA para estado normal */
    font-weight: 100; 
    
    color: rgba(0,0,0,0.75); /* Gris sutil para inactivos */
    cursor: pointer;
    transition: color 0.2s, font-weight 0.2s;
    text-decoration: none; 
    display: block; 
    flex-grow: 1; /* Permite que el texto ocupe el espacio */
} /* <--- LLAVE DE CIERRE CORREGIDA */

/* 2. ESTADO HOVER: Tipografía un poco más gruesa */
.sidebar-toc li a:hover {
    color: var(--acc1); /* Color de Acento en hover */
    font-weight: 600; /* Grosor Intermedio para feedback */
}

/* 3. ESTADO ACTIVO: Tipografía en Negrita */
.sidebar-toc li a.active {
    color: var(--acc1); /* Color de Acento */
    font-weight: 700; /* Grosor más alto para el tema actual */
}


/* --- ÍCONOS DE PROGRESO (::before) --- */

/* Estilo Base del Ícono (Círculo Gris) */
.sidebar-toc li a::before {
    content: "\f058"; /* Círculo vacío */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900; 
    margin-right: 8px;
    font-size: 14px; /* Un poco más grande para mejor visibilidad */
    color: rgba(0,0,0,0.25); /* Gris claro/inactivo */
    transition: color 0.3s;
    flex-shrink: 0; /* Evita que el ícono se encoja */
}

/* Estilo para TEMA COMPLETADO o ACTIVO */
.sidebar-toc li a.completed::before,
.sidebar-toc li a.active::before {
    content: "\f058"; /* Check-Circle lleno (Palomita) */
    
    /* UNIFICADO: Usamos var(--acc1) o var(--dom) según tu preferencia */
    color: var(--dom); 
}



/* --- BOTONES DE NAVEGACIÓN --- */
.article-navigation {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    padding: 20px 0;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.btn-nav {
    display: flex;
    align-items: center;
    gap: 8px; /* Espacio entre el texto y la flecha */
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 14px;
    transition: background-color 0.2s, box-shadow 0.2s;
    border: 2px solid transparent; /* Borde de base */
}

.btn-nav .arrow {
    font-size: 18px;
    line-height: 1;
}

/* Botón Anterior (Estilo Lila/Secundario) */
.btn-nav.prev {
    background-color: var(--acc1);
    color: #fff;
    border-color: var(--acc1);
}

.btn-nav.prev:hover {
    background-color: var(--acc2); 
    border-color: var(--acc2);
    box-shadow: 0 4px 10px rgba(5, 86, 210, 0.4);
}

/* Botón Siguiente (Estilo Azul/Principal) */
.btn-nav.next {
    background-color: var(--acc1);
    color: #fff;
    border-color: var(--acc1);
}

.btn-nav.next:hover {
    background-color: var(--acc2); 
    border-color: var(--acc2);
    box-shadow: 0 4px 10px rgba(5, 86, 210, 0.4);
}

/* --- Estilo para la imagen dentro del Placeholder --- */
.image-placeholder.main-image img {
    /* 1. Ocupa el 100% del ancho y alto del contenedor (400px de altura) */
    width: 100%;
    height: 100%;
    
    /* 2. ✅ Ajuste clave: Recorta la imagen para llenar el contenedor manteniendo el aspecto. */
    object-fit: cover; 
    margin-top: 0px;
    /* 3. Asegura que la imagen herede los bordes redondeados del contenedor */
    border-radius: 12px;
    
    /* 4. Asegura que la imagen sea un elemento de bloque */
    display: block;
}

/* Estilo básico de la imagen flotante */
.img-flotante {
    /* Define un tamaño fijo para controlar el diseño */
    width: 400px; 
    height: 300px;
    
    /* Pequeño margen para separar la imagen del texto que la rodea */
    margin: 0 0 15px 15px; 
    
    /* Opcional: Estilo visual */
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Regla específica para alinearla a la derecha */
.img-flotante.derecha {
    /* ✅ Hacemos que la imagen flote a la derecha */
    float: right; 
    
    /* Ajusta el margen: Superior 0, Derecha 0, Inferior 15px, Izquierda 15px */
    margin: 15px 15px 0 15px; 
}


/* --- RESPONSIVE --- */
@media (max-width: 850px) {
    .article-content-grid {
        grid-template-columns: 1fr; 
        gap: 30px;
    }

    .article-page {
        padding-left: 20px; 
        padding-right: 20px;
    }
    
    .sidebar-toc {
        position: static; 
        order: -1; 
    }
    .article-navigation {
        justify-content: space-between;
    }

.img-flotante, 
    .img-flotante.derecha {
        float: none; /* Desactivar flotación */
        width: 100%; /* Ocupa todo el ancho disponible */
        height: auto;
        display: block;
        margin: 20px auto; 
    }

    .article-header {
        max-width: 100%;
        text-align: center;
    }
    .article-header .topic-tag {
        text-align: center;
    }


@media (max-width: 600px) {
    .article-header .meta-info {
        flex-direction: column;
        gap: 5px;
    }
    .article-header .meta-info span:after {
        content: none;
    }
    .image-placeholder.main-image {
        height: 250px;
    }
    .btn-nav {
        flex: 1;
        text-align: center;
        justify-content: center;
        padding: 10px 15px;
        margin: 0 5px;
    }
}

