/* ==========================================================================
   ESTILOS DE LA SECCIÓN DE NOTICIAS / BLOG XYLO
   ========================================================================== */

/* Botón flotante para administradores (oculto por defecto) */
.btn-crear-admin {
    display: inline-block;
    background-color: var(--color-acento-purpura, #bb86fc);
    color: #000;
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.btn-crear-admin:hover {
    background-color: #d0a8ff;
    transform: scale(1.02);
}

/* --- CONTENEDOR GRID --- */
.grid-noticias-xylo {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 25px;
    padding-bottom: 40px;
}

/* --- TARJETA PRINCIPAL --- */
.tarjeta-xylo-blog {
    background-color: var(--color-fondo-tarjeta, #1a1a24);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tarjeta-xylo-blog:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
    border-color: rgba(187, 134, 252, 0.4); /* Brillo púrpura sutil */
}

/* --- IMAGEN Y ETIQUETA --- */
.xylo-blog-img-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.xylo-blog-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.tarjeta-xylo-blog:hover .xylo-blog-img-wrapper img {
    transform: scale(1.05);
}

.xylo-badge-categoria {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(26, 26, 36, 0.85); /* Fondo oscuro semitransparente */
    backdrop-filter: blur(4px);
    color: var(--color-acento-purpura, #bb86fc);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(187, 134, 252, 0.2);
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

/* --- CONTENIDO DE TEXTO --- */
.xylo-blog-contenido {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.xylo-blog-titulo {
    font-size: 1.25rem;
    color: #ffffff;
    margin: 0 0 10px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Corta el texto largo con puntos suspensivos */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.xylo-blog-resumen {
    font-size: 0.9rem;
    color: var(--color-texto-secundario, #b3b3b3);
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- PIE DE TARJETA --- */
.xylo-blog-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: auto;
}

.xylo-autor-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.xylo-autor-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--color-acento-purpura, #bb86fc);
}

.xylo-autor-nombre {
    font-size: 0.85rem;
    color: #e0e0e0;
    font-weight: 600;
}

.xylo-blog-fecha {
    font-size: 0.8rem;
    color: var(--color-texto-secundario, #888);
}
/* ==========================================================================
   ESTILOS PARA LA PÁGINA DE LECTURA DE ARTÍCULO (articulo.html)
   ========================================================================== */

.nav-volver-articulo {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 10;
}

.btn-volver-xylo {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s, transform 0.2s;
    backdrop-filter: blur(5px);
}

.btn-volver-xylo:hover {
    background: rgba(187, 134, 252, 0.3); /* Morado Xylo */
    border-color: rgba(187, 134, 252, 0.6);
    transform: translateX(-5px);
}

/* HERO IMAGE (Cabecera) */
.articulo-hero {
    position: relative;
    width: 100%;
    height: 50vh; /* Ocupa la mitad de la pantalla de alto */
    min-height: 400px;
    background-color: #111;
    background-size: cover;
    background-position: center;
    border-radius: 0 0 24px 24px;
    margin-top: -70px; /* Para que suba y quede detrás de la flecha de volver */
    display: flex;
    align-items: flex-end; /* Texto abajo */
}

/* Degradado oscuro para poder leer el texto sobre la imagen */
.articulo-hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, rgba(18, 18, 18, 1) 0%, rgba(18, 18, 18, 0.7) 40%, rgba(18, 18, 18, 0.2) 100%);
    border-radius: 0 0 24px 24px;
}

.articulo-hero-info {
    position: relative;
    z-index: 2;
    padding: 40px 5%;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.articulo-hero-info .xylo-badge-categoria {
    position: relative; /* Quita el absolute de las tarjetas */
    top: 0; left: 0;
    display: inline-flex;
    margin-bottom: 15px;
    font-size: 0.85rem;
    padding: 8px 16px;
}

.articulo-titulo-principal {
    font-size: clamp(2rem, 5vw, 3.5rem); /* Se adapta al celular o PC */
    color: #fff;
    line-height: 1.2;
    margin: 0 0 20px 0;
    font-family: 'FuenteTitulos', sans-serif;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.articulo-meta {
    display: flex;
    align-items: center;
}

/* ÁREA DE TEXTO LECTURA */
.articulo-cuerpo {
    max-width: 750px; /* Óptimo para lectura (65-75 caracteres por línea) */
    margin: 0 auto;
    padding: 40px 20px;
    color: #d1d1d1;
    font-size: 1.15rem;
    line-height: 1.8;
}

.articulo-resumen-destacado {
    font-size: 1.3rem;
    color: var(--color-acento-purpura, #bb86fc);
    font-weight: 500;
    line-height: 1.6;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Estilos dinámicos para el HTML que venga del backend */
.articulo-texto-html h2 {
    color: #fff;
    font-size: 2rem;
    margin: 40px 0 20px 0;
    font-family: 'FuenteTitulos', sans-serif;
}

.articulo-texto-html h3 {
    color: #fff;
    font-size: 1.5rem;
    margin: 30px 0 15px 0;
}

.articulo-texto-html p {
    margin-bottom: 25px;
}

.articulo-texto-html img {
    max-width: 100%;
    border-radius: 12px;
    margin: 30px 0;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.articulo-texto-html blockquote {
    border-left: 4px solid var(--color-acento-purpura, #bb86fc);
    background: rgba(187, 134, 252, 0.05);
    margin: 30px 0;
    padding: 20px 30px;
    font-style: italic;
    font-size: 1.25rem;
    color: #e0e0e0;
    border-radius: 0 12px 12px 0;
}

/* FOOTER ACCIONES */
.articulo-footer-acciones {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.acciones-sociales {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.btn-compartir {
    background: transparent;
    border: 1px solid var(--color-acento-purpura);
    color: var(--color-acento-purpura);
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-compartir:hover {
    background: var(--color-acento-purpura);
    color: #000;
}

/* Responsive */
@media (max-width: 768px) {
    .articulo-hero { height: auto; padding-top: 80px; }
    .articulo-titulo-principal { font-size: 2rem; }
    .articulo-cuerpo { padding: 30px 15px; font-size: 1.05rem; }
}

@media (max-width: 560px) {
    .grid-noticias-xylo {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .xylo-blog-contenido {
        padding: 16px;
    }

    .xylo-blog-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .nav-volver-articulo {
        padding: 12px;
    }

    .articulo-hero {
        min-height: 280px;
        margin-top: -52px;
    }

    .articulo-hero-info {
        padding: 24px 16px;
    }

    .articulo-resumen-destacado {
        font-size: 1.05rem;
        margin-bottom: 24px;
    }

    .articulo-texto-html h2 {
        font-size: 1.45rem;
        margin: 26px 0 14px;
    }

    .articulo-texto-html blockquote {
        padding: 14px 16px;
        font-size: 1rem;
    }
}