/* ==========================================================================
   ARTICULO.CSS - Específico para la vista de lectura (Estilo Medium)
   ========================================================================== */

.articulo-contenedor {
    max-width: 740px;
    margin: 80px auto;
    padding: 0 20px;
    box-shadow: none;
    border: none;
}

.meta-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    font-family: var(--font-body);
}

.etiqueta {
    background: #f2f2f2;
    color: #292929;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: 0.2s;
    margin-bottom: 10px;
    width: fit-content;
}

.etiqueta:hover {
    background: #e5e5e5;
}

.meta-info span {
    color: #6b7280;
    font-size: 0.95rem;
}

.articulo-contenedor h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -2px;
    color: #000000;
    margin-bottom: 40px;
}

.imagen-portada {
    width: 100%;
    height: auto;
    margin-bottom: 50px;
}

.tabla-contenidos {
    margin: 40px 0;
    padding: 25px 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.tabla-contenidos strong {
    display: block;
    font-family: var(--font-titles);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6b7280;
    margin-bottom: 15px;
}

.tabla-contenidos ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tabla-contenidos li {
    margin-bottom: 10px;
}

.tabla-contenidos a {
    color: #292929;
    font-size: 1.1rem;
}

.tabla-contenidos a:hover {
    color: var(--primary);
}

.contenido {
    font-size: 1.3rem;
    color: #333333;
    line-height: 1.6;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.contenido p {
    margin-bottom: 35px;
}

.contenido h2 {
    font-size: 2.2rem;
    margin-top: 70px;
    margin-bottom: 25px;
    color: #000000;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.2;
}

.contenido h3 {
    font-size: 1.6rem;
    margin-top: 50px;
    margin-bottom: 20px;
    color: #292929;
    font-weight: 700;
}

.contenido a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-color: rgba(59, 130, 246, 0.3);
    text-underline-offset: 4px;
    transition: text-decoration-color 0.2s;
}

.contenido a:hover {
    text-decoration-color: var(--primary);
}

.contenido ul,
.contenido ol {
    padding-left: 20px;
    margin-bottom: 35px;
}

.contenido li {
    margin-bottom: 15px;
}

blockquote {
    margin: 50px 0;
    padding-left: 30px;
    border-left: 3px solid #292929;
    font-style: italic;
    font-size: 1.5rem;
    color: #292929;
    line-height: 1.4;
}

.contenido img {
    width: calc(100% + 100px);
    margin-left: -50px;
    border-radius: 0;
    margin-top: 20px;
    margin-bottom: 40px;
}

.articulos-relacionados h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2rem;
    color: #000;
}

@media (max-width: 768px) {
    .articulo-contenedor {
        margin: 20px auto;
        padding: 0 20px;
    }

    .meta-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .articulo-contenedor h1 {
        font-size: 2.2rem;
        letter-spacing: -1px;
    }

    .contenido {
        font-size: 1.15rem;
        line-height: 1.6;
    }

    .contenido h2 {
        font-size: 1.8rem;
        margin-top: 50px;
    }

    .contenido img {
        width: 100%;
        margin-left: 0;
    }
}

/* ==========================================================================
   BLOQUES DE CÓDIGO / PROMPTS (ESTILO TERMINAL)
   ========================================================================== */

/* Contenedor principal que envuelve el código */
.codigo-contenedor {
    margin: 40px 0;
    border-radius: 12px;
    background-color: #0f172a;
    /* Slate 900 - Oscuro profundo */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    /* Mantiene los bordes redondeados */
}

/* Barra superior (donde va el botón) */
.codigo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #1e293b;
    /* Slate 800 */
    padding: 10px 16px;
    border-bottom: 1px solid #334155;
}

.codigo-titulo {
    color: #94a3b8;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* El bloque de texto / código en sí */
.codigo-contenedor pre {
    margin: 0 !important;
    padding: 20px;
    overflow-x: auto;
    /* Scroll horizontal si la línea es muy larga */
    color: #e2e8f0;
    /* Texto claro */
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 1.05rem;
    line-height: 1.6;
    background: transparent;
    border: none;
}

/* Estilo para pequeños fragmentos de código en medio del texto */
.contenido p code,
.contenido li code {
    background-color: #f1f5f9;
    color: #db2777;
    /* Color rosa/rojo vibrante para destacar */
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 0.9em;
    font-family: 'Consolas', monospace;
}

/* --- BOTÓN DE COPIAR --- */
.btn-copiar {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-body);
}

.btn-copiar:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Estado activo (Cuando se hace clic) */
.btn-copiar.copiado {
    background: #10b981;
    /* Verde esmeralda de éxito */
    border-color: #10b981;
    color: #ffffff;
}

/* ==========================================================================
   TABLAS DE DATOS (ESTILO EDITORIAL PREMIUM)
   ========================================================================== */

.contenido table {
    width: 100%;
    border-collapse: collapse;
    margin: 45px 0;
    background-color: #ffffff;
    font-size: 1.15rem;
    /* Un poco más pequeño que el cuerpo de texto para dar densidad */
    border-radius: 10px;
    overflow: hidden;
    /* Fundamental para que el radius aplique a la cabecera */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    /* Sombra muy sutil */
}

/* Cabecera de la tabla */
.contenido thead {
    background-color: #f8fafc;
    /* Fondo gris/azulado extra suave */
    border-bottom: 2px solid #e2e8f0;
}

.contenido th {
    font-family: var(--font-titles);
    font-weight: 700;
    color: #0f172a;
    padding: 20px;
    text-align: left;
    /* Alineado a la izquierda para mejor lectura */
    line-height: 1.3;
}

/* Celdas de datos */
.contenido td {
    padding: 20px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    /* Líneas separadoras muy claras */
    vertical-align: top;
    /* Para que los textos largos queden alineados arriba */
    line-height: 1.5;
}

/* Sin borde en la última fila para que cierre limpio */
.contenido tbody tr:last-child td {
    border-bottom: none;
}

/* Efecto hover muy suave para guiar la vista en tablas anchas */
.contenido tbody tr:hover {
    background-color: #fbfbfc;
}

/* Destacar levemente la primera columna (Ej: "Memoria RAM", "GPU") */
.contenido tbody td:first-child {
    font-weight: 600;
    color: #1e293b;
    font-family: var(--font-body);
}

/* Responsive: Scroll horizontal en móviles para que no rompa la pantalla */
@media (max-width: 768px) {
    .contenido table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        /* Radio ligeramente menor en móvil */
    }

    .contenido th,
    .contenido td {
        padding: 15px;
        font-size: 1.05rem;
    }
}

/* ==========================================================================
   BOTONES DE COMPARTIR EN REDES SOCIALES
   ========================================================================== */

.bloque-compartir {
    margin: 60px 0 20px;
    padding-top: 40px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.bloque-compartir h3 {
    font-family: var(--font-titles);
    font-size: 1.1rem;
    color: #374151;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.botones-compartir {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-share {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff !important;
    text-decoration: none !important;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.btn-share:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

/* Colores de Marca */
.btn-x {
    background-color: #0f1419;
}

.btn-linkedin {
    background-color: #0a66c2;
}

.btn-facebook {
    background-color: #1877f2;
}

.btn-whatsapp {
    background-color: #25d366;
    color: #ffffff;
}

/* Responsive para móviles: Los botones ocupan todo el ancho */
@media (max-width: 480px) {
    .botones-compartir {
        flex-direction: column;
        gap: 10px;
    }

    .btn-share {
        width: 100%;
        justify-content: center;
    }
}
/* ==========================================================================
   MODO OSCURO (ESPECÍFICO PARA ARTÍCULOS)
   ========================================================================== */

/* Etiquetas de categoría en la cabecera del artículo */
[data-theme="dark"] .etiqueta {
    background-color: #1e293b !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .etiqueta:hover {
    background-color: #334155 !important;
}

/* Índice de contenidos (TOC) */
[data-theme="dark"] .tabla-contenidos {
    border-color: #334155 !important;
}

[data-theme="dark"] .tabla-contenidos strong {
    color: #94a3b8 !important;
}

[data-theme="dark"] .tabla-contenidos a {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .tabla-contenidos a:hover {
    color: var(--primary) !important;
}

/* Citas (Blockquotes) */
[data-theme="dark"] blockquote {
    color: #cbd5e1 !important;
    border-left-color: #475569 !important;
}

/* Bloque inferior de Compartir Redes Sociales */
[data-theme="dark"] .bloque-compartir {
    border-color: #334155 !important;
}

[data-theme="dark"] .bloque-compartir h3 {
    color: #f8fafc !important;
}

/* Fragmentos de código en línea (dentro de párrafos) */
[data-theme="dark"] .contenido p code,
[data-theme="dark"] .contenido li code {
    background-color: #1e293b !important;
    color: #f472b6 !important; /* Un rosa más claro para que brille en fondo oscuro */
}

/* ==========================================================================
   MODO OSCURO - REFUERZO PARA ARTÍCULOS
   ========================================================================== */

[data-theme="dark"] .articulo-contenedor h1,
[data-theme="dark"] .contenido h2,
[data-theme="dark"] .contenido h3,
[data-theme="dark"] .articulos-relacionados h2 {
    color: #f8fafc !important; /* Blanco Slate */
}

[data-theme="dark"] .contenido {
    color: #cbd5e1 !important; /* Gris claro para lectura */
}

/* Ajuste para las tablas dentro del contenido */
[data-theme="dark"] .contenido table {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] .contenido th {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .contenido td {
    border-bottom: 1px solid #334155 !important;
    color: #cbd5e1 !important;
}

/* El índice de contenidos (TOC) */
[data-theme="dark"] .tabla-contenidos {
    border-color: #334155 !important;
    background-color: rgba(30, 41, 59, 0.5) !important;
}

[data-theme="dark"] .tabla-contenidos a {
    color: #94a3b8 !important;
}

[data-theme="dark"] .tabla-contenidos a:hover {
    color: var(--primary) !important;
}

/* Bloques de código (aseguramos que no se vuelvan blancos) */
[data-theme="dark"] .codigo-contenedor {
    border: 1px solid #334155 !important;
}