@import url('https://fonts.googleapis.com/css2?family=Titillium+Web:wght@400;600;700;900&display=swap');

/* =========================================
   GLOBAL BLOG STYLES & RESETS
   ========================================= */

/* Tipografía global para el blog */
* {
    font-family: 'Titillium Web', sans-serif;
    box-sizing: border-box;
}

/* 
   RESET DE MÁRGENES Y PADDING
   Importante: Sobrescribimos estilos globales para asegurar que el blog 
   ocupe el 100% del ancho y no tenga márgenes extraños heredados.
   NOTA: Dejamos que 'style.css' maneje el padding-left para el banner lateral floating-nav.
*/
html,
body {
    margin: 0 !important;
    width: 100% !important;
    overflow-x: hidden;
}

/* 
   FONDO GLOBAL DEL BLOG
   - Imagen de fondo fija (efecto parallax)
   - Superposición blanca (overlay) al 75% para mejorar la legibilidad del texto
*/
body {
    background: linear-gradient(rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.75)), url('../../images/Wallpaper calendario/jiu-jitsu-tenerife-gracie-barra-contacto.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
}

/* 
   DIVISOR DE SECCIÓN ANIMADO
   - Línea fina de gradiente que se mueve constantemente
   - Separa visualmente las secciones principales
*/
.section-divider {
    position: relative;
    height: 4px;
    width: 100%;
    margin: 0;
    background: linear-gradient(90deg, #000 0%, #cc0000 50%, #007bff 100%);
    background-size: 200% 100%;
    animation: gradientMove 4s linear infinite;
    z-index: 100;
}

@keyframes gradientMove {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: 0% 0;
    }
}

/* 
   ANIMACIONES DE ENTRADA (Keyframes)
   - Acciones suaves para títulos y elementos al cargar la página
*/
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   INDEX PAGE STYLES (Estilos de la página principal del blog)
   ========================================= */

/* 
   HERO BANNER - TRUE FULL WIDTH
   - Ocupa todo el ancho disponible
   - Centra el contenido (título y subtítulo) vertical y horizontalmente
   - Imagen oscura con texto blanco para alto contraste
*/
.blog-hero {
    background: linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.55)), url('../../images/Multimedia/BannerMultimedia.webp');
    background-size: cover;
    background-position: center;
    height: 350px;
    width: 100%;
    position: relative;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
}

.blog-hero h1 {
    font-size: 4rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 15px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4);
    animation: fadeInDown 0.8s ease-out;
}

.blog-hero p {
    font-size: 1.3rem;
    letter-spacing: 3px;
    opacity: 0.95;
    text-transform: uppercase;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* 
   CONTENEDOR PRINCIPAL
   - Limita el ancho máximo para lectura cómoda en pantallas grandes
   - Márgenes y padding ajustados para "respirar"
*/
.blog-container {
    max-width: 1300px;
    margin: 0 auto 60px;
    padding: 50px 30px;
    position: relative;
    z-index: 2;
}

/* 
   GRID DE ARTÍCULOS
   - Diseño responsivo automático con repeat(auto-fill)
   - Tarjetas mínimas de 380px de ancho
*/
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 35px;
}

/* 
   TARJETAS DE POSTS (Premium Cards)
   - Efecto Glassmorphism (fondo blanco semitransparente + blur)
   - Bordes redondeados y sombras suaves para elevación
*/
.post-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.post-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3), 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Imagen de portada de la tarjeta con superposición */
.post-image {
    height: 240px;
    background-size: cover;
    background-position: center;
    background-color: #ddd;
    position: relative;
    overflow: hidden;
}

.post-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.4) 100%);
}

/* Contenido textual de la tarjeta */
.post-content {
    padding: 30px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Badge/Etiqueta de Fecha */
.post-date {
    display: inline-block;
    background: linear-gradient(135deg, #D32F2F, #b71c1c);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 15px;
    width: fit-content;
    box-shadow: 0 3px 10px rgba(211, 47, 47, 0.3);
}

.post-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 15px;
    color: #1e293b;
    line-height: 1.35;
    transition: color 0.3s;
}

.post-card:hover .post-title {
    color: #205FA6;
}

.post-excerpt {
    color: #64748b;
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 20px;
    flex-grow: 1;
}

/* Botón 'Leer Más' con gradiente */
.read-more {
    color: white;
    background: linear-gradient(135deg, #205FA6, #1a4a7a);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(32, 95, 166, 0.3);
}

.read-more:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 20px rgba(32, 95, 166, 0.4);
}

.read-more i {
    transition: transform 0.3s;
}

.post-card:hover .read-more i {
    transform: translateX(5px);
}

/* Estado Vacío (si no hay posts) */
.empty-state {
    background: rgba(255, 255, 255, 0.95);
    padding: 60px;
    border-radius: 20px;
    grid-column: 1/-1;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.empty-state h2 {
    color: #205FA6;
    margin-bottom: 15px;
}

/* =========================================
   POST PAGE STYLES (Estilos de la página de artículo individual)
   ========================================= */

/* Header del Artículo */
.post-header {
    height: 400px;
    background-size: cover;
    background-position: center;
    width: 100%;
    position: relative;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.post-header>div {
    position: relative;
    z-index: 2;
}

/* Badge de Categoría/Fecha en cabecera */
.post-meta-top {
    display: inline-block;
    background: linear-gradient(135deg, #D32F2F, #b71c1c);
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 10px 20px;
    border-radius: 30px;
    margin-bottom: 25px;
    box-shadow: 0 5px 20px rgba(211, 47, 47, 0.4);
    animation: fadeInDown 0.8s ease-out;
}

.post-title-main {
    font-size: 3.5rem;
    font-weight: 900;
    max-width: 900px;
    line-height: 1.2;
    margin: 0 auto 20px;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* 
   CUERPO DEL ARTÍCULO (Article Body)
   - Contenedor central flotante con efecto cristal
   - Tipografía optimizada para lectura larga
*/
.article-body {
    max-width: 850px;
    margin: 50px auto 60px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 60px 70px;
    border-radius: 25px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25), 0 10px 25px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
    line-height: 1.9;
    font-size: 1.15rem;
    color: #334155;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.article-body h2 {
    color: #205FA6;
    font-size: 1.8rem;
    margin-top: 45px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #D32F2F;
    display: inline-block;
}

.article-body h3 {
    color: #1e293b;
    font-size: 1.4rem;
    margin-top: 35px;
    margin-bottom: 15px;
}

.article-body p {
    margin-bottom: 20px;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
    margin: 35px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.article-body blockquote {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    border-left: 5px solid #205FA6;
    padding: 25px 30px;
    margin: 30px 0;
    border-radius: 0 15px 15px 0;
    font-style: italic;
    color: #475569;
}

/* Botón Volver */
.back-to-blog {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0 auto;
    padding: 15px 30px;
    background: linear-gradient(135deg, #205FA6, #1a4a7a);
    color: white;
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 30px;
    box-shadow: 0 8px 25px rgba(32, 95, 166, 0.35);
    transition: all 0.3s ease;
}

.back-to-blog:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(32, 95, 166, 0.45);
}

.back-to-blog i {
    font-size: 1.1rem;
}

hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, #cbd5e1, transparent);
    margin: 50px 0;
}

/* =========================================
   RESPONSIVE DESIGN (Móviles y Tablets)
   ========================================= */

@media (max-width: 768px) {

    /* --- Index: Ajustes para móviles --- */

    .blog-hero h1 {
        font-size: 2.5rem;
        letter-spacing: 2px;
    }

    .blog-hero p {
        font-size: 1rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-container {
        padding: 0 15px;
    }

    /* --- Post: Ajustes para móviles --- */

    .post-title-main {
        font-size: 2rem;
    }

    .post-meta-top {
        font-size: 0.75rem;
        padding: 8px 16px;
    }

    /* 
       FIX LAYOUT MÓVIL: 
       Ajustamos el article-body para que no se solape con el banner fijo superior.
       - Padding reducido para ganar espacio en pantalla pequeña.
       - Margen superior 0 para eliminar huecos visuales no deseados.
    */
    .article-body {
        padding: 30px 25px;
        margin: 0 15px 40px;
        border-radius: 20px;
    }

    .article-body h2 {
        font-size: 1.4rem;
    }
}