/**
 * Article Styles - PrecisionTex
 * Estilos para artículos individuales del blog
 */

/* ===== ARTICLE HEADER ===== */
.article-header {
    background: linear-gradient(135deg, #1a472a 0%, #2d5a3f 50%, #1f3d2a 100%);
    padding: 60px 0 80px;
    color: white;
    position: relative;
    overflow: hidden;
}

.article-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.article-header .container {
    position: relative;
    z-index: 1;
}

.article-header .breadcrumb {
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.9rem;
}

.article-header .breadcrumb a,
.article-header .breadcrumb span {
    color: rgba(255, 255, 255, 0.75);
}

.article-header .breadcrumb a:hover {
    color: white;
}

.article-header-content {
    max-width: 800px;
}

.article-category {
    display: inline-block;
    background: linear-gradient(135deg, #82B440 0%, #6b9935 100%);
    color: white;
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(130, 180, 64, 0.4);
}

.article-header h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 24px;
    color: white;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.article-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.article-meta .meta-icon {
    font-size: 1.1rem;
}

/* ===== ARTICLE HERO ===== */
.article-hero {
    margin-top: -40px;
    position: relative;
    z-index: 10;
    padding-bottom: 40px;
}

.article-hero-image {
    max-width: 900px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.article-hero-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* ===== ARTICLE SECTION ===== */
.article-section {
    background: #f8fafc;
    padding: 60px 0;
}

/* ===== ARTICLE CONTAINER ===== */
.article-container {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 1024px) {
    .article-container {
        grid-template-columns: 1fr;
    }
}

/* ===== ARTICLE CONTENT ===== */
.article-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

@media (max-width: 768px) {
    .article-content {
        padding: 24px;
    }
}

/* Typography */
.article-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1F2937;
    margin: 40px 0 20px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.article-content h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.article-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1F2937;
    margin: 28px 0 12px;
}

.article-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1F2937;
    margin: 20px 0 10px;
}

.article-content p {
    font-size: 1.05rem;
    line-height: 1.85;
    color: #374151;
    margin-bottom: 20px;
}

.article-content strong {
    color: #1F2937;
    font-weight: 600;
}

.article-content a {
    color: #82B440;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.article-content a:hover {
    color: #6b9935;
}

/* Lists */
.article-content ul,
.article-content ol {
    margin: 20px 0;
    padding-left: 28px;
}

.article-content li {
    font-size: 1.05rem;
    line-height: 1.75;
    color: #374151;
    margin-bottom: 10px;
}

.article-content ul li {
    list-style-type: disc;
}

.article-content ol li {
    list-style-type: decimal;
}

/* Blockquote */
.article-content blockquote {
    border-left: 4px solid #82B440;
    background: #f3f4f6;
    padding: 20px 24px;
    margin: 28px 0;
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: #4B5563;
}

.article-content blockquote p {
    margin-bottom: 0;
}

/* Tables */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 28px 0;
    font-size: 0.95rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.article-content th,
.article-content td {
    border: 1px solid #e5e7eb;
    padding: 14px 18px;
    text-align: left;
}

.article-content th {
    background: linear-gradient(135deg, #82B440 0%, #6b9935 100%);
    color: white;
    font-weight: 600;
}

.article-content tr:nth-child(even) {
    background: #f9fafb;
}

.article-content tr:hover {
    background: #f3f4f6;
}

/* Images */
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 20px 0;
}

.article-content figure {
    margin: 28px 0;
}

.article-content figcaption {
    text-align: center;
    font-size: 0.9rem;
    color: #6B7280;
    margin-top: 10px;
}

/* Code */
.article-content code {
    background: #f3f4f6;
    padding: 3px 8px;
    border-radius: 6px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    color: #1F2937;
}

.article-content pre {
    background: #1f2937;
    color: #e5e7eb;
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 20px 0;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Key Stats Box */
.article-content .key-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    background: linear-gradient(135deg, #82B440 0%, #5a8a2d 100%);
    padding: 28px;
    border-radius: 16px;
    margin: 28px 0;
    color: white;
    box-shadow: 0 8px 25px rgba(130, 180, 64, 0.3);
}

.article-content .key-stats .stat {
    text-align: center;
}

.article-content .key-stats .stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    display: block;
    line-height: 1.2;
}

.article-content .key-stats .stat-label {
    font-size: 0.9rem;
    opacity: 0.95;
    margin-top: 4px;
}

/* Info Box */
.article-content .info-box {
    background: #f9fafb;
    border-left: 4px solid #82B440;
    padding: 20px;
    border-radius: 0 12px 12px 0;
    margin: 28px 0;
}

.article-content .info-box p {
    margin-bottom: 0;
}

.article-content .info-box.warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.article-content .info-box.success {
    border-left-color: #10b981;
    background: #ecfdf5;
}

/* ===== ARTICLE TAGS ===== */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding-top: 24px;
    margin-top: 36px;
    border-top: 1px solid #e5e7eb;
}

.article-tags .tags-label {
    font-weight: 600;
    color: #1F2937;
    margin-right: 6px;
}

.article-tags .tag {
    background: #f1f5f9;
    color: #4B5563;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.article-tags .tag:hover {
    background: #82B440;
    color: white;
    border-color: #82B440;
}

/* ===== ARTICLE SHARE ===== */
.article-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.share-label {
    font-weight: 600;
    color: #1F2937;
}

.share-buttons {
    display: flex;
    gap: 10px;
}

.share-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    transition: transform 0.3s, box-shadow 0.3s;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.share-linkedin {
    background: #0077b5;
}

.share-twitter {
    background: #1da1f2;
}

.share-email {
    background: #82B440;
}

/* ===== TABLE OF CONTENTS ===== */
.article-toc {
    background: #f3f4f6;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 28px;
}

.article-toc h4 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 12px;
    color: #1F2937;
}

.article-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-toc li {
    margin-bottom: 8px;
}

.article-toc a {
    color: #4B5563;
    text-decoration: none;
    font-size: 0.95rem;
    display: block;
    padding: 6px 0;
    transition: color 0.2s;
}

.article-toc a:hover {
    color: #82B440;
}

.article-toc li ul {
    padding-left: 20px;
    margin-top: 8px;
}

/* ===== RELATED ARTICLES SECTION ===== */
.related-articles-section {
    background: #ffffff;
    padding: 60px 0;
}

.related-articles-section .section-title {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 40px;
}

/* ===== ARTICLE CTA ===== */
.article-cta {
    background: linear-gradient(135deg, #82B440 0%, #5a8a2d 100%);
    padding: 80px 0;
    text-align: center;
    color: white;
}

.article-cta h2 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    margin-bottom: 16px;
    color: white;
}

.article-cta p {
    font-size: 1.1rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto 32px;
}
/* ===== Mobile Fixes para Articulos ===== */
@media (max-width: 768px) {
    /* Forzar que todo el contenido respete el ancho */
    .article-section,
    .article-content,
    .article-content * {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Quebrar palabras largas y URLs para evitar desbordes */
    .article-content p,
    .article-content h1,
    .article-content h2,
    .article-content h3,
    .article-content h4,
    .article-content li,
    .article-content blockquote {
        overflow-wrap: anywhere;
        word-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
    }

    /* Reducir padding interno del articulo en moviles pequenos */
    .article-content {
        padding: 20px;
    }

    /* Tablas - hacerlas scrollables horizontalmente en lugar de romper layout */
    .article-content table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        font-size: 0.85rem;
    }

    .article-content th,
    .article-content td {
        padding: 10px 12px;
        white-space: normal;
    }

    /* Codigo - permitir scroll horizontal */
    .article-content pre {
        overflow-x: auto;
        font-size: 0.85rem;
        padding: 16px;
    }

    .article-content code {
        word-break: break-all;
    }

    /* Key stats: ajustar minimo a 140px para que entren mejor */
    .article-content .key-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
        padding: 20px;
    }

    .article-content .key-stats .stat-value {
        font-size: 1.6rem;
    }

    /* Header del articulo: reducir padding */
    .article-header {
        padding: 40px 0 60px;
    }

    /* Hero image: quitar margen negativo agresivo */
    .article-hero {
        margin-top: -30px;
        padding-bottom: 30px;
    }

    /* Contenedor de articulo */
    .article-section {
        padding: 30px 0;
    }

    /* Breadcrumb: permitir wrap */
    .article-header .breadcrumb {
        font-size: 0.8rem;
        gap: 6px;
    }

    /* Meta del articulo */
    .article-meta {
        gap: 12px;
    }

    .article-meta .meta-item {
        font-size: 0.85rem;
    }

    /* Tags y Share: layout vertical */
    .article-tags,
    .article-share {
        gap: 8px;
    }

    /* Imagenes en el articulo: respetar ancho */
    .article-content img,
    .article-content figure {
        max-width: 100%;
        height: auto;
    }

    /* TOC */
    .article-toc {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .article-content {
        padding: 16px;
    }

    .article-content .key-stats {
        grid-template-columns: 1fr;
    }

    .article-header {
        padding: 30px 0 50px;
    }

    .article-content h2 {
        font-size: 1.35rem;
        margin: 28px 0 14px;
    }

    .article-content h3 {
        font-size: 1.15rem;
    }

    .article-content p {
        font-size: 1rem;
        line-height: 1.7;
    }
}
