:root {
    --primary-color: #5836be;
    --secondary-color: #2dc4ad;
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #f4f8fb;
    --white: #ffffff;
}

body {
    background-color: var(--white);
    color: var(--text-dark);
    font-family: 'Poppins', sans-serif;
}

.container {
    max-width: 1400px;
    /* Ajustado para mejor lectura */
    width: 90%;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 1366px) {
    .container {
        max-width: 1200px;
        width: 92%;
    }
}



/* --- Header --- */
.blog-header {
    background: linear-gradient(123.79deg, rgba(250, 255, 254, 0) 50.71%, rgba(255, 255, 255, 0.2) 52.17%),
        linear-gradient(280.42deg, rgba(59, 188, 168, 0.176) 13.12%, rgba(255, 251, 251, 0.2) 45.24%),
        linear-gradient(101.84deg, rgba(59, 188, 168, 0.582) 18.18%, rgba(238, 249, 247, 0.6) 46.15%),
        rgba(57, 181, 162, 0.1);
    text-align: center;
    height: 500px;
    padding: 100px 20px 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.blog-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(59, 188, 168, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(46, 26, 95, 0.15) 0%, transparent 50%);
    animation: gradientPulse 6s ease-in-out infinite;
}

@keyframes gradientPulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

.blog-header h1 {
    color: #421D9D;
    font-size: 6.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    position: relative;
    z-index: 10;
    animation: fadeInDown 0.8s forwards, titleFloat 3s ease-in-out 0.8s infinite;
}

@keyframes titleEntry {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes titleFloat {

    0%,
    100% {
        transform: translateY(0) scale(1);
        text-shadow: 0 4px 12px rgba(46, 26, 95, 0.1);
    }

    50% {
        transform: translateY(-5px) scale(1.02);
        text-shadow: 0 6px 16px rgba(46, 26, 95, 0.15);
    }
}

.blog-header h1::after {
    content: '';
    display: block;
    width: 120px;
    height: 6px;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    margin: 18px auto 0;
    border-radius: 999px;
    animation: underlineExpand 0.6s ease-out 0.3s both;
}

@keyframes underlineExpand {
    0% {
        width: 0;
        opacity: 0;
    }

    100% {
        width: 120px;
        opacity: 1;
    }
}

.blog-header p {
    color: var(--text-dark);
    font-size: 1.4rem;
    font-weight: 500;
    position: relative;
    z-index: 10;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Formas geométricas sutiles combinadas */
.blob {
    position: absolute;
    z-index: 1;
    opacity: 0.08;
}

/* 1. Partículas flotantes */
.blob-1 {
    width: 8px;
    height: 8px;
    background: #3BBCA8;
    border-radius: 50%;
    top: 20%;
    left: 10%;
    animation: particle 25s linear infinite;
}

.blob-2 {
    width: 6px;
    height: 6px;
    background: #2E1A5F;
    border-radius: 50%;
    top: 60%;
    right: 15%;
    animation: particle 30s linear infinite 5s;
}

/* 2. Líneas diagonales */
.blob-3 {
    width: 150px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #3BBCA8, transparent);
    top: 30%;
    left: -150px;
    animation: raySlide 12s ease-in-out infinite;
}

.blob-4 {
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #2E1A5F, transparent);
    bottom: 40%;
    right: -200px;
    animation: raySlide 15s ease-in-out infinite 3s;
}

/* 3. Iconos médicos (símbolos + simples) */
.blob-7 {
    width: 30px;
    height: 30px;
    top: 25%;
    left: 30%;
    font-size: 24px;
    color: #3BBCA8;
    animation: iconFloat 20s ease-in-out infinite;
}

.blob-8 {
    width: 30px;
    height: 30px;
    bottom: 30%;
    right: 25%;
    font-size: 24px;
    color: #2E1A5F;
    animation: iconFloat 22s ease-in-out infinite 4s;
}

/* 5. Hexágonos/triángulos fijos */
.blob-11 {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3BBCA8 0%, transparent 100%);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    top: 40%;
    left: 20%;
}

.blob-12 {
    width: 50px;
    height: 50px;
    background: linear-gradient(225deg, #2E1A5F 0%, transparent 100%);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    bottom: 35%;
    right: 35%;
}

/* 7. Ondas suaves */
.blob-13 {
    width: 300px;
    height: 100px;
    background: radial-gradient(ellipse at center, rgba(59, 188, 168, 0.15), transparent);
    border-radius: 50%;
    top: 10%;
    left: -50px;
    animation: wave 14s ease-in-out infinite;
}

.blob-14 {
    width: 250px;
    height: 80px;
    background: radial-gradient(ellipse at center, rgba(46, 26, 95, 0.12), transparent);
    border-radius: 50%;
    bottom: 15%;
    right: -50px;
    animation: wave 16s ease-in-out infinite 4s;
}

/* Animaciones */
@keyframes particle {

    0%,
    100% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(20px, -30px);
    }

    50% {
        transform: translate(-10px, -60px);
    }

    75% {
        transform: translate(15px, -40px);
    }
}

@keyframes raySlide {

    0%,
    100% {
        transform: translateX(0);
        opacity: 0;
    }

    50% {
        transform: translateX(calc(100vw + 200px));
        opacity: 1;
    }
}

@keyframes iconFloat {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    33% {
        transform: translateY(-20px) rotate(10deg);
    }

    66% {
        transform: translateY(-10px) rotate(-10deg);
    }
}

@keyframes wave {

    0%,
    100% {
        transform: translateX(0) scaleY(1);
    }

    50% {
        transform: translateX(30px) scaleY(1.3);
    }
}

/* Responsive para móvil */
@media (max-width: 768px) {
    .blog-header {
        height: 300px;
        padding: 50px 20px 30px;
    }

    .blog-header h1 {
        font-size: 3rem;
    }

    .blog-header p {
        font-size: 1.2rem;
    }
}

/* --- DESTACADO (Featured) --- */
.featured-post {
    background-color: var(--bg-light);
    border-radius: 20px;
    margin: 40px 0;
    display: flex;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    /* Quitamos subrayado del link */
    transition: transform 0.3s ease;
    position: relative;
}

.featured-post::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(59, 188, 168, 0.35), rgba(88, 54, 190, 0.25));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.featured-post:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(46, 26, 95, 0.1);
}

.featured-post:hover::before {
    opacity: 1;
}

.featured-image {
    flex: 1.2;
    min-height: 350px;
    overflow: hidden;
    /* Importante para el zoom */
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* Efecto Zoom en Destacado */
.featured-post:hover .featured-image img {
    transform: scale(1.05);
}

.featured-content {
    flex: 1;
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-content h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin: 15px 0;
    line-height: 1.2;
}

.featured-content p {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

/* Botón especial del destacado */
.featured-btn-icon {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: bold;
    color: var(--secondary-color);
}

.featured-btn-icon .icon-circle {
    width: 45px;
    height: 45px;
    background: var(--secondary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.featured-post:hover .icon-circle {
    transform: translateX(10px);
    /* La flecha se mueve a la derecha */
}

/* --- GRID Y TARJETAS --- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.card {
    border: 1px solid #f0f0f0;
    border-radius: 20px;
    overflow: hidden;
    background: white;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    height: 100%;
    opacity: 0;
    transform: translateY(30px);
    animation: cardSlideUp 0.6s ease-out forwards;
}

@keyframes cardSlideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card:nth-child(1) {
    animation-delay: 0.1s;
}

.card:nth-child(2) {
    animation-delay: 0.2s;
}

.card:nth-child(3) {
    animation-delay: 0.3s;
}

.card:nth-child(4) {
    animation-delay: 0.4s;
}

.card:nth-child(5) {
    animation-delay: 0.5s;
}

.card:nth-child(6) {
    animation-delay: 0.6s;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(59, 188, 168, 0.5), rgba(88, 54, 190, 0.4));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(59, 188, 168, 0.1) 50%, transparent 70%);
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

/* ANIMACIÓN HOVER TARJETA */
.card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 40px rgba(46, 26, 95, 0.15);
    border-color: transparent;
}

.card:hover::after {
    opacity: 1;
    left: 100%;
}

.card:hover::before {
    opacity: 1;
}

/* Delays para animaciones */
.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

.card-img-wrapper {
    height: 220px;
    overflow: hidden;
    position: relative;
}

.card-img-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(46, 26, 95, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.card:hover .card-img-wrapper::after {
    opacity: 1;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Zoom en imagen al pasar mouse */
.card:hover .card-img {
    transform: scale(1.15) rotate(2deg);
}

.card-body {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-body h3 {
    color: var(--primary-color);
    margin: 15px 0 10px;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    position: relative;
    display: inline-block;
}

.card-body h3::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #3BBCA8, #2E1A5F);
    transition: width 0.4s ease;
}

.card:hover .card-body h3::after {
    width: 100%;
}

.card-body p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
    /* Empuja el footer hacia abajo */
}

/* --- BADGES (Etiquetas) --- */
.badge {
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    margin-right: 10px;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.badge:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 188, 168, 0.4);
}

.badge-primary {
    background-color: var(--secondary-color);
}

.badge-gray {
    background-color: #94a3b8;
}

.badge-teal {
    background-color: var(--secondary-color);
}

.badge-blue {
    background-color: #60a5fa;
}

.badge-accent {
    background-color: #f97316;
}

.date {
    color: #999;
    font-size: 0.85rem;
    font-weight: 500;
}

/* --- EL NUEVO BOTÓN ÍCONO --- */
.card-footer {
    display: flex;
    justify-content: flex-end;
    /* Alineado a la derecha */
    margin-top: auto;
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f3f4f6;
    /* Gris muy suave inicial */
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* Animación del botón al hacer hover en LA TARJETA */
.card:hover .card-icon {
    background-color: var(--secondary-color);
    /* Se vuelve Turquesa */
    color: white;
    /* Flecha blanca */
    transform: rotate(-45deg) scale(1.15);
    /* Efecto moderno de inclinación */
    box-shadow: 0 6px 20px rgba(59, 188, 168, 0.4);
}

/* WhatsApp */
.whatsapp-float {
    position: fixed;
    right: 30px;
    bottom: 30px;
    background-color: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    cursor: pointer;
    z-index: 100;
    transition: transform 0.3s;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    }

    50% {
        box-shadow: 0 4px 25px rgba(37, 211, 102, 0.7);
    }
}

.whatsapp-float:hover {
    transform: scale(1.15) rotate(5deg);
}

/* Responsive tablet */
@media (max-width: 1024px) {
    .blog-header {
        height: 380px;
        padding: 80px 20px 50px;
    }

    .blog-header h1 {
        font-size: 4.2rem;
    }

    .featured-content {
        padding: 35px;
    }

    .card-img-wrapper {
        height: 200px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .featured-post {
        flex-direction: column;
    }

    .featured-image {
        height: 250px;
    }

    .featured-content {
        padding: 30px;
    }
}

/* Utilidad para ocultar el texto completo en la tarjeta pequeña */
.hidden {
    display: none;
}

/* ==========================================
   ESTILOS DEL MODAL (TARJETA FLOTANTE)
   ========================================== */

/* Fondo oscuro (Overlay) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    /* Fondo negro semitransparente */
    backdrop-filter: blur(5px);
    /* Efecto borroso elegante */
    z-index: 2000;
    /* Encima de todo */
    display: none;
    /* Oculto por defecto */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Cuando está activo */
.modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* La Tarjeta Blanca */
.modal-content {
    background: white;
    width: 90%;
    max-width: 800px;
    /* Ancho máximo de lectura */
    max-height: 90vh;
    /* No más alto que la pantalla */
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow-y: auto;
    /* Scroll interno si es muy largo */
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
    /* Efecto Zoom In */
}

/* Botón X de cerrar */
.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    background: white;
    border: none;
    font-size: 2rem;
    color: #333;
    cursor: pointer;
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.close-modal:hover {
    background: #ff4d4d;
    color: white;
}

/* Imagen del Modal */
.modal-header-img {
    position: relative;
    height: 300px;
    width: 100%;
}

.modal-header-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Badge flotante en el modal */
.badge-overlay {
    position: absolute;
    bottom: 20px;
    left: 30px;
    font-size: 0.9rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Contenido del Texto */
.modal-body-content {
    padding: 40px;
}

.modal-meta {
    color: #888;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.modal-content h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 25px;
    line-height: 1.2;
}

/* Estilos para el texto del artículo */
.prose {
    color: #4a5568;
    line-height: 1.8;
    font-size: 1.05rem;
}

.prose h4 {
    color: var(--primary-color);
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.prose ul,
.prose ol {
    margin-left: 20px;
    margin-bottom: 20px;
}

.prose li {
    margin-bottom: 8px;
}

/* Botón inferior cerrar */
.modal-footer-btn {
    margin-top: 40px;
    text-align: center;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.close-modal-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.close-modal-btn:hover {
    background-color: #4a2da0;
}

/* Responsive del modal */
@media (max-width: 768px) {
    .modal-header-img {
        height: 200px;
    }

    .modal-content h2 {
        font-size: 1.5rem;
    }
}

/* --- BOTÓN VOLVER AL BLOG COMPLETO --- */
.back-to-blog-btn {
    background: linear-gradient(135deg, var(--secondary-color), #3ba89f);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 188, 168, 0.3);
}

.back-to-blog-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(59, 188, 168, 0.5);
    background: linear-gradient(135deg, #35b8a8, #2da899);
}

.modal-body-content {
    padding: 25px;
}
