/* 
   BLOG MOBILE OPTIMIZADO - Fortinix
   Versión: 1.0
*/

/* MENÚ MÓVIL OPTIMIZADO PARA BLOG */
#blogMobileHeader {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(5, 10, 20, 0.98);
    backdrop-filter: blur(10px);
    z-index: 9999;
    border-bottom: 1px solid rgba(0, 157, 255, 0.1);
    height: 70px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

#blogMobileHeader .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 100%;
    max-width: 100%;
}

#blogMobileHeader .logo-container img {
    height: 40px;
    width: auto;
    transition: transform 0.3s ease;
}

#blogMobileHeader .logo-container img:hover {
    transform: scale(1.05);
}

#blogMobileMenuBtn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

#blogMobileMenuBtn:hover {
    background: rgba(0, 157, 255, 0.1);
}

#blogMobileMenuBtn:active {
    transform: scale(0.95);
}

#blogMobileMenuBtn span {
    display: block;
    width: 25px;
    height: 3px;
    background: #FFFFFF;
    margin: 5px auto;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 2px;
}

#blogMobileMenuBtn.open span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
    background: #ED267A;
}

#blogMobileMenuBtn.open span:nth-child(2) {
    opacity: 0;
}

#blogMobileMenuBtn.open span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
    background: #ED267A;
}

#blogMobileMenuPanel {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    height: calc(100vh - 70px);
    background: rgba(5, 10, 20, 0.98);
    backdrop-filter: blur(15px);
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 9998;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#blogMobileMenuPanel.open {
    transform: translateX(0);
}

#blogMobileMenuPanel ul {
    list-style: none;
    padding: 30px 0;
    margin: 0;
}

#blogMobileMenuPanel li {
    margin: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#blogMobileMenuPanel li:last-child {
    border-bottom: none;
}

#blogMobileMenuPanel a {
    display: flex;
    align-items: center;
    padding: 18px 30px;
    color: #FFFFFF;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

#blogMobileMenuPanel a:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(0, 157, 255, 0.1), transparent);
    transition: width 0.3s ease;
    z-index: -1;
}

#blogMobileMenuPanel a:hover:before {
    width: 100%;
}

#blogMobileMenuPanel a:hover {
    border-left-color: #009DFF;
    transform: translateX(10px);
    color: #009DFF;
}

#blogMobileMenuPanel a.active {
    background: rgba(237, 38, 122, 0.1);
    border-left-color: #ED267A;
    color: #ED267A;
    font-weight: 600;
}

#blogMobileMenuPanel a.highlight-btn {
    background: rgba(237, 38, 122, 0.1);
    border-left-color: #ED267A;
    color: #ED267A;
    font-weight: 600;
    position: relative;
}

#blogMobileMenuPanel a.highlight-btn:after {
    content: '📝';
    margin-left: auto;
    font-size: 1.2rem;
}

/* OPTIMIZACIONES MÓVIL PARA BLOG */

/* Mostrar solo en móvil */
@media (max-width: 992px) {
    #blogMobileHeader {
        display: block;
    }
    
    .header {
        display: none !important;
    }
    
    .mobile-menu {
        display: none !important;
    }
    
    /* Ajustar padding superior del hero */
    .blog-hero {
        padding-top: 100px !important;
    }
    
    /* Ajustar artículos individuales */
    .article-container {
        margin-top: 100px !important;
        padding: 1.5rem !important;
        margin-left: 1rem !important;
        margin-right: 1rem !important;
    }
    
    /* Optimizar títulos para móvil */
    .blog-hero .section-title {
        font-size: 2.2rem !important;
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
    }
    
    .blog-hero .section-subtitle {
        font-size: 1rem !important;
        margin-bottom: 2rem !important;
    }
    
    /* Optimizar estadísticas del hero */
    .hero-stats {
        flex-direction: column !important;
        gap: 20px !important;
        margin-top: 2rem !important;
    }
    
    .stat-item {
        text-align: center;
    }
    
    /* Grid de artículos en una columna en móvil */
    .blog-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        margin-bottom: 2rem !important;
    }
    
    /* Tarjetas de blog optimizadas */
    .blog-card {
        margin-bottom: 1.5rem;
    }
    
    .blog-content {
        padding: 1.5rem !important;
    }
    
    .blog-title {
        font-size: 1.3rem !important;
        line-height: 1.3 !important;
        margin-bottom: 1rem !important;
    }
    
    .blog-excerpt {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
        margin-bottom: 1.5rem !important;
    }
    
    /* Botones de acción en columna */
    .blog-actions {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .blog-link.primary,
    .blog-link.secondary {
        text-align: center !important;
        justify-content: center !important;
        padding: 12px 20px !important;
    }
    
    /* CTA cards optimizadas */
    .cta-content {
        min-height: auto !important;
        padding: 2rem 1rem !important;
    }
    
    .cta-card .blog-title {
        font-size: 1.4rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* Newsletter optimizado */
    .newsletter {
        padding: 3rem 0 !important;
    }
    
    .newsletter .section-title {
        font-size: 2rem !important;
        margin-bottom: 1rem !important;
    }
    
    .newsletter-form {
        flex-direction: column !important;
        gap: 15px !important;
        max-width: 100% !important;
    }
    
    .newsletter-form input,
    .newsletter-form button {
        width: 100% !important;
        border-radius: 25px !important;
    }
    
    /* Footer optimizado */
    .footer-bottom {
        flex-direction: column !important;
        gap: 15px !important;
        text-align: center !important;
    }
    
    .footer-social {
        justify-content: center !important;
    }
}

/* Ajustes específicos para tablets */
@media (min-width: 768px) and (max-width: 992px) {
    #blogMobileHeader .container {
        padding: 0 40px;
    }
    
    #blogMobileMenuPanel a {
        font-size: 1.2rem;
        padding: 20px 40px;
    }
    
    .blog-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 30px !important;
    }
    
    .blog-hero .section-title {
        font-size: 2.8rem !important;
    }
    
    .hero-stats {
        flex-direction: row !important;
        justify-content: center !important;
    }
}

/* Ajustes para pantallas pequeñas */
@media (max-width: 480px) {
    #blogMobileHeader {
        height: 65px;
    }
    
    #blogMobileHeader .container {
        padding: 0 15px;
    }
    
    #blogMobileHeader .logo-container img {
        height: 35px;
    }
    
    #blogMobileMenuPanel {
        top: 65px;
        height: calc(100vh - 65px);
    }
    
    #blogMobileMenuPanel a {
        padding: 16px 20px;
        font-size: 1rem;
    }
    
    .blog-hero {
        padding-top: 90px !important;
    }
    
    .blog-hero .section-title {
        font-size: 1.8rem !important;
    }
    
    .article-container {
        margin-top: 90px !important;
        padding: 1rem !important;
        margin-left: 0.5rem !important;
        margin-right: 0.5rem !important;
    }
    
    .article-title {
        font-size: 1.8rem !important;
        line-height: 1.2 !important;
    }
    
    .article-content h2 {
        font-size: 1.4rem !important;
        margin-top: 2rem !important;
        margin-bottom: 1rem !important;
    }
    
    .article-content h3 {
        font-size: 1.2rem !important;
        margin-top: 1.5rem !important;
        margin-bottom: 0.8rem !important;
    }
    
    .article-meta {
        flex-direction: column !important;
        gap: 8px !important;
        text-align: center !important;
    }
    
    .cta-buttons {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .article-nav {
        flex-direction: column !important;
        gap: 15px !important;
        text-align: center !important;
    }
}

/* Prevenir scroll del body cuando el menú está abierto */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Mejorar performance en dispositivos móviles */
@media (max-width: 992px) {
    * {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    #blogMobileMenuPanel {
        will-change: transform;
    }
    
    #blogMobileMenuBtn span {
        will-change: transform, opacity;
    }
}

/* Mejorar accesibilidad táctil */
@media (pointer: coarse) {
    #blogMobileMenuPanel a {
        padding: 20px 30px;
        font-size: 1.1rem;
    }
    
    .blog-link {
        padding: 14px 20px !important;
        font-size: 1rem !important;
    }
    
    .cta-btn {
        padding: 14px 24px !important;
        font-size: 1rem !important;
    }
}

/* Dark mode optimization */
@media (prefers-color-scheme: dark) {
    #blogMobileHeader {
        background: rgba(0, 0, 0, 0.98);
        border-bottom-color: rgba(0, 157, 255, 0.2);
    }
    
    #blogMobileMenuPanel {
        background: rgba(0, 0, 0, 0.98);
    }
}

/* Animaciones para entrada del menú */
@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

#blogMobileMenuPanel.open {
    animation: slideInFromLeft 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Efecto de carga para elementos del blog */
.blog-card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.blog-card:nth-child(1) { animation-delay: 0.1s; }
.blog-card:nth-child(2) { animation-delay: 0.2s; }
.blog-card:nth-child(3) { animation-delay: 0.3s; }
.blog-card:nth-child(4) { animation-delay: 0.4s; }
.blog-card:nth-child(5) { animation-delay: 0.5s; }
.blog-card:nth-child(6) { animation-delay: 0.6s; }

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

/* Optimización de tipografía en móvil */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        line-height: 1.5;
    }
    
    .blog-card p,
    .article-content p {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    .blog-meta {
        font-size: 0.8rem;
    }
    
    .blog-category {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
}
/* ASEGURAR CONSISTENCY CON HIGHLIGHT-NAV EN MÓVIL */
@media (max-width: 992px) {
    #blogMobileMenuPanel .highlight-nav {
        background: linear-gradient(90deg, rgba(237, 38, 122, 0.15), rgba(237, 38, 122, 0.05)) !important;
        border-left-color: #ED267A !important;
        border-right: 3px solid #ED267A !important;
        color: #ED267A !important;
        font-weight: 700 !important;
        position: relative !important;
        border-radius: 0 25px 25px 0 !important;
        margin-right: 10px !important;
        box-shadow: 0 2px 8px rgba(237, 38, 122, 0.2) !important;
    }

    #blogMobileMenuPanel .highlight-nav:after {
        content: '🧮' !important;
        margin-left: auto !important;
        font-size: 1.3rem !important;
        animation: bounce 2s infinite !important;
    }

    #blogMobileMenuPanel .highlight-nav:hover {
        background: linear-gradient(90deg, rgba(237, 38, 122, 0.3), rgba(237, 38, 122, 0.1)) !important;
        transform: translateX(15px) scale(1.02) !important;
        box-shadow: 0 4px 15px rgba(237, 38, 122, 0.4) !important;
        border-right-width: 5px !important;
    }

    @keyframes bounce {
        0%, 20%, 50%, 80%, 100% {
            transform: translateY(0);
        }
        40% {
            transform: translateY(-3px);
        }
        60% {
            transform: translateY(-2px);
        }
    }
}