/* ============================================
   Estilos para Páginas de Artículos
   ============================================ */

/* === Breadcrumb === */
.breadcrumb {
    padding: 1.5rem 0;
    margin-bottom: 2rem;
}

.breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.breadcrumb li:not(:last-child)::after {
    content: "/";
    margin-left: 0.5rem;
    color: var(--border-color);
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* === Article Page === */
.article-page {
    padding: 2rem 0 4rem;
}

.article-content {
    background: white;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 3rem;
}

/* === Article Header === */
.article-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 2rem;
    margin-bottom: 3rem;
}

.article-header .article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.article-header .category {
    background: var(--primary-color);
    color: white;
    padding: 0.375rem 1rem;
    border-radius: 15px;
    font-weight: 600;
}

.article-header h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.article-lead {
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 2rem;
}

/* === Featured Image === */
.featured-image {
    margin: 2rem 0;
    border-radius: 8px;
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.featured-image figcaption {
    padding: 1rem;
    background: #f8f9fa;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
}

/* === Article Body === */
.article-body {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.article-body h2 {
    font-size: 1.875rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
}

.article-body h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.article-body p {
    margin-bottom: 1.5rem;
}

.article-body ul,
.article-body ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

.article-body a {
    color: var(--primary-color);
    text-decoration: underline;
    transition: var(--transition);
}

.article-body a:hover {
    color: var(--secondary-color);
}

.article-body strong {
    font-weight: 600;
    color: var(--text-primary);
}

.article-body em {
    font-style: italic;
}

/* === Code Blocks === */
.article-body pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
    position: relative;
}

.article-body code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.article-body p code {
    background: #f5f5f5;
    color: #e74c3c;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.9em;
}

/* Copy Code Button */
.copy-code-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: var(--transition);
}

.copy-code-btn:hover {
    background: var(--primary-color);
}

.copy-code-btn.copied {
    background: #27ae60;
}

/* === Alert Boxes === */
.alert {
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    border-left: 4px solid;
}

.alert-warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

.alert-danger {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.alert-success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

/* === Content Images === */
.content-image {
    margin: 2rem 0;
    text-align: center;
}

.content-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.content-image figcaption {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* === CTA Box === */
.cta-box {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 2.5rem;
    border-radius: 8px;
    text-align: center;
    margin: 3rem 0;
}

.cta-box h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.cta-box p {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

.btn-primary {
    display: inline-block;
    background: white;
    color: var(--primary-color);
    padding: 0.875rem 2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* === Article Footer === */
.article-footer {
    border-top: 2px solid var(--border-color);
    padding-top: 2rem;
    margin-top: 3rem;
}

/* Tags */
.article-tags {
    margin-bottom: 2rem;
}

.article-tags strong {
    color: var(--text-primary);
    margin-right: 0.5rem;
}

.tag {
    display: inline-block;
    background: #f0f0f0;
    color: var(--text-secondary);
    padding: 0.375rem 0.875rem;
    border-radius: 15px;
    text-decoration: none;
    font-size: 0.875rem;
    margin: 0.25rem;
    transition: var(--transition);
}

.tag:hover {
    background: var(--primary-color);
    color: white;
}

/* Share Buttons */
.share-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.share-buttons span {
    font-weight: 600;
    color: var(--text-primary);
}

.share-buttons button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.share-buttons button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* Author Bio */
.author-bio {
    display: flex;
    gap: 1.5rem;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.author-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

.author-info h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.author-info p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.author-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.author-link:hover {
    color: var(--secondary-color);
}

/* === Related Articles === */
.related-articles {
    margin-top: 3rem;
}

.related-articles h2 {
    font-size: 1.875rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

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

.related-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.related-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.related-card h3 {
    padding: 1rem 1rem 0.5rem;
    font-size: 1.125rem;
}

.related-card h3 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

.related-card h3 a:hover {
    color: var(--primary-color);
}

.related-card time {
    display: block;
    padding: 0 1rem 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* === Blockquote === */
.article-body blockquote {
    border-left: 4px solid var(--secondary-color);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-secondary);
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
}

.article-body blockquote p:last-child {
    margin-bottom: 0;
}

/* === Tables === */
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 1rem;
}

.article-body table th,
.article-body table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.article-body table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.article-body table tr:hover {
    background: #f8f9fa;
}

/* === Responsive === */
@media (max-width: 968px) {
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .article-content {
        padding: 2rem;
    }
    
    .article-header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    .article-content {
        padding: 1.5rem;
    }
    
    .article-header h1 {
        font-size: 1.75rem;
    }
    
    .article-body {
        font-size: 1rem;
    }
    
    .article-body h2 {
        font-size: 1.5rem;
    }
    
    .article-body h3 {
        font-size: 1.25rem;
    }
    
    .author-bio {
        flex-direction: column;
        text-align: center;
    }
    
    .author-avatar {
        margin: 0 auto;
    }
    
    .share-buttons {
        flex-wrap: wrap;
    }
}

/* === Print Styles === */
@media print {
    .main-header,
    .breadcrumb,
    .share-buttons,
    .cta-box,
    .related-articles,
    .main-footer {
        display: none;
    }
    
    .article-content {
        box-shadow: none;
        padding: 0;
    }
    
    .article-body {
        font-size: 12pt;
        line-height: 1.6;
    }
    
    .article-body a {
        text-decoration: none;
        color: black;
    }
    
    .article-body a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}
