/* =============================================
   CORRUPLESA - Estilos del Blog
   Incluye: Hero, Grid de tarjetas, Layout artículo, TOC, Responsive
   ============================================= */

/* === HERO DEL BLOG === */
.blog-hero {
    background: linear-gradient(135deg, var(--dark-blue) 0%, var(--section-blue) 60%, #0a2a4a 100%);
    padding: 140px 10% 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(0, 229, 255, 0.06) 0%, transparent 60%);
    pointer-events: none;
}

.blog-hero-tag {
    display: inline-block;
    background: rgba(0, 229, 255, 0.15);
    color: var(--primary);
    border: 1px solid rgba(0, 229, 255, 0.35);
    padding: 6px 18px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.blog-hero h1 {
    color: white;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    line-height: 1.15;
    margin: 0 0 16px;
}

.blog-hero h1 span {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.blog-hero p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.05rem;
    max-width: 580px;
    margin: 0 auto;
    line-height: 1.7;
}

/* === BREADCRUMB === */
.breadcrumb-bar {
    background: #f7f9fc;
    padding: 12px 10%;
    border-bottom: 1px solid #e8edf2;
}

.breadcrumb-bar nav {
    font-size: 13px;
    color: #888;
}

.breadcrumb-bar a {
    color: var(--section-blue);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb-bar a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.breadcrumb-bar span {
    margin: 0 8px;
    color: #bbb;
}

/* === GRID DE TARJETAS (listado blog) === */
.blog-listing {
    padding: 70px 10%;
    background: #f7f9fc;
}

.blog-listing-header {
    text-align: center;
    margin-bottom: 50px;
}

.blog-listing-header h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--dark-blue);
    font-weight: 900;
    margin-bottom: 10px;
}

.blog-listing-header p {
    color: #666;
    font-size: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

/* === TARJETA DE ARTÍCULO === */
.blog-card {
    background: white;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid #e4eaf2;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s, transform 0.3s;
}

.blog-card:hover {
    box-shadow: 0 14px 50px rgba(0, 26, 51, 0.12);
    transform: translateY(-5px);
}

.blog-card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    background: linear-gradient(135deg, var(--dark-blue), var(--section-blue));
}

.blog-card-img-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--dark-blue) 0%, var(--section-blue) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.blog-card-body {
    padding: 24px 26px 28px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-card-category {
    display: inline-block;
    background: rgba(0, 229, 255, 0.1);
    color: var(--section-blue);
    border: 1px solid rgba(0, 229, 255, 0.3);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 12px;
    align-self: flex-start;
}

.blog-card h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--dark-blue);
    line-height: 1.35;
    margin: 0 0 10px;
}

.blog-card p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.55;
    margin: 0 0 20px;
    flex: 1;
}

.blog-card-meta {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 16px;
}

.blog-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--section-blue);
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    border-bottom: 2px solid rgba(0, 229, 255, 0.4);
    padding-bottom: 2px;
    transition: color 0.2s, border-color 0.2s;
    align-self: flex-start;
}

.blog-card-link:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* === LAYOUT DE ARTÍCULO === */
.article-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 48px;
    padding: 60px 10%;
    max-width: 1200px;
    margin: 0 auto;
    align-items: start;
}

/* Contenido principal */
.article-content {
    min-width: 0;
}

.article-content h1 {
    font-size: clamp(1.7rem, 3.5vw, 2.4rem);
    color: var(--dark-blue);
    font-weight: 900;
    line-height: 1.2;
    margin: 0 0 16px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e8edf2;
    font-size: 13px;
    color: #888;
}

.article-category-tag {
    display: inline-block;
    background: rgba(0, 229, 255, 0.1);
    color: var(--section-blue);
    border: 1px solid rgba(0, 229, 255, 0.3);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.article-content h2 {
    font-size: 1.45rem;
    color: var(--dark-blue);
    font-weight: 800;
    margin: 44px 0 16px;
    padding-top: 12px;
    border-top: 2px solid #edf1f7;
}

.article-content h3 {
    font-size: 1.15rem;
    color: var(--section-blue);
    font-weight: 700;
    margin: 28px 0 12px;
}

.article-content p {
    color: #444;
    font-size: 1.02rem;
    line-height: 1.75;
    margin-bottom: 18px;
}

.article-content ul,
.article-content ol {
    padding-left: 20px;
    margin-bottom: 20px;
}

.article-content li {
    color: #444;
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 8px;
}

.article-content strong {
    color: var(--dark-blue);
    font-weight: 700;
}

/* Tabla de datos */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 28px 0;
    font-size: 0.95rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 26, 51, 0.07);
}

.data-table th {
    background: var(--dark-blue);
    color: white;
    padding: 14px 18px;
    text-align: left;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 12px 18px;
    border-bottom: 1px solid #edf1f7;
    color: #444;
}

.data-table tr:nth-child(even) td {
    background: #f7f9fc;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Caja de dato destacado */
.info-box {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.06), rgba(0, 210, 106, 0.06));
    border-left: 4px solid var(--primary);
    border-radius: 0 12px 12px 0;
    padding: 20px 24px;
    margin: 28px 0;
}

.info-box p {
    margin: 0;
    color: var(--dark-blue);
    font-size: 0.98rem;
    line-height: 1.6;
}

.info-box strong {
    color: var(--section-blue);
}

/* Tabla de contenidos (TOC) en artículo */
.toc-inline {
    background: #f0f7ff;
    border: 1px solid #dde8f5;
    border-radius: 14px;
    padding: 24px 28px;
    margin: 0 0 40px;
}

.toc-inline h4 {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--dark-blue);
    margin: 0 0 14px;
}

.toc-inline ol {
    padding-left: 18px;
    margin: 0;
}

.toc-inline li {
    margin-bottom: 6px;
}

.toc-inline a {
    color: var(--section-blue);
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.toc-inline a:hover {
    color: var(--primary);
}

/* === SIDEBAR === */
.article-sidebar {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-card {
    background: white;
    border-radius: 16px;
    padding: 28px 24px;
    border: 1px solid #e4eaf2;
    box-shadow: 0 4px 20px rgba(0, 26, 51, 0.05);
}

.sidebar-card h4 {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--primary);
    margin: 0 0 14px;
}

.sidebar-card p {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 18px;
}

.sidebar-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #25D366;
    color: white;
    font-weight: 700;
    font-size: 14px;
    padding: 13px 20px;
    border-radius: 50px;
    text-decoration: none;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
    margin-bottom: 10px;
}

.sidebar-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.45);
}

.sidebar-cta-btn.secondary {
    background: var(--dark-blue);
    box-shadow: 0 6px 20px rgba(0, 26, 51, 0.2);
}

.sidebar-cta-btn.secondary:hover {
    box-shadow: 0 10px 30px rgba(0, 26, 51, 0.3);
}

.sidebar-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-links li {
    border-bottom: 1px solid #f0f4f8;
    margin-bottom: 0;
}

.sidebar-links li:last-child {
    border-bottom: none;
}

.sidebar-links a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    color: var(--dark-blue);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s, padding-left 0.2s;
}

.sidebar-links a:hover {
    color: var(--primary);
    padding-left: 6px;
}

.sidebar-links .arrow {
    color: var(--primary);
    font-size: 16px;
    margin-left: auto;
}

/* === ARTÍCULOS RELACIONADOS === */
.related-posts {
    background: #f7f9fc;
    padding: 60px 10%;
    border-top: 1px solid #e8edf2;
}

.related-posts h2 {
    font-size: 1.4rem;
    color: var(--dark-blue);
    font-weight: 800;
    margin-bottom: 32px;
    text-align: center;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* === CTA FINAL DEL ARTÍCULO === */
.article-cta-section {
    background: linear-gradient(135deg, var(--dark-blue) 0%, var(--section-blue) 100%);
    padding: 60px 10%;
    text-align: center;
}

.article-cta-section h2 {
    color: white;
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 900;
    margin-bottom: 12px;
}

.article-cta-section p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.98rem;
    max-width: 500px;
    margin: 0 auto 30px;
    line-height: 1.6;
}

.article-cta-btns {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-btn-green {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #25D366;
    color: white;
    font-weight: 700;
    font-size: 15px;
    padding: 14px 32px;
    border-radius: 50px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.35);
}

.cta-btn-green:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 35px rgba(37, 211, 102, 0.5);
}

.cta-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--primary);
    font-weight: 700;
    font-size: 15px;
    padding: 13px 32px;
    border-radius: 50px;
    border: 2px solid rgba(0, 229, 255, 0.5);
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.cta-btn-outline:hover {
    background: rgba(0, 229, 255, 0.1);
    border-color: var(--primary);
    transform: translateY(-3px);
}

/* === RESPONSIVE: 900px === */
@media (max-width: 900px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .article-wrapper {
        grid-template-columns: 1fr;
        padding: 50px 6%;
    }

    .article-sidebar {
        position: static;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .blog-hero {
        padding: 120px 6% 60px;
    }

    .blog-listing {
        padding: 50px 6%;
    }
}

/* === RESPONSIVE: 600px === */
@media (max-width: 600px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .article-wrapper {
        padding: 40px 5%;
        gap: 32px;
    }

    .article-cta-btns {
        flex-direction: column;
        align-items: center;
    }

    .cta-btn-green,
    .cta-btn-outline {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    .blog-hero {
        padding: 110px 5% 50px;
    }

    .blog-listing {
        padding: 40px 5%;
    }

    .related-posts {
        padding: 50px 5%;
    }

    .article-cta-section {
        padding: 50px 5%;
    }
}

/* === RESPONSIVE: 480px === */
@media (max-width: 480px) {
    .blog-hero h1 {
        font-size: 1.7rem;
    }

    .article-content h1 {
        font-size: 1.5rem;
    }

    .data-table {
        font-size: 0.85rem;
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }
}

/* === WhatsApp Chat Widget === */
.wa-chat-wrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    font-family: "Inter", "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    z-index: 999;
}

/* WhatsApp Bubble (Chat preview) */
.wa-bubble {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    animation: slideUp 0.3s ease;
}

.wa-bubble.visible {
    opacity: 1;
    visibility: visible;
}

@keyframes slideUp {
    from {
        transform: translateY(10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.wa-bubble-header {
    background: linear-gradient(135deg, #25D366 0%, #20BA5F 100%);
    color: white;
    padding: 16px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wa-header-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
}

.wa-header-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.wa-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.wa-close:hover {
    transform: scale(1.2);
}

.wa-bubble-body {
    padding: 16px;
    background: white;
    border-radius: 0 0 12px 12px;
}

.wa-msg-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wa-msg-container strong {
    color: #075E54;
    font-size: 0.95rem;
}

.wa-msg-container p {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

/* WhatsApp Main Button */
.wa-btn {
    position: relative;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25D366 0%, #20BA5F 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    color: white;
    text-decoration: none;
    font-size: 32px;
}

.wa-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.6);
}

.wa-btn:active {
    transform: scale(0.95);
}

.wa-btn svg {
    width: 32px;
    height: 32px;
    fill: white;
}

.wa-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #FF6B6B;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 480px) {
    .wa-chat-wrapper {
        bottom: 15px;
        right: 15px;
    }

    .wa-btn {
        width: 56px;
        height: 56px;
    }

    .wa-btn svg {
        width: 28px;
        height: 28px;
    }

    .wa-bubble {
        width: 280px;
        bottom: 70px;
    }
}

@media (max-width: 360px) {
    .wa-bubble {
        width: 260px;
        font-size: 0.9rem;
    }

    .wa-msg-container p {
        font-size: 0.85rem;
    }
}
