/* ========================================
   Tec2029 - CSS Principal
   ======================================== */

/* Variables */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #10b981;
    --dark: #1a1a2e;
    --dark-light: #16213e;
    --gray-900: #111827;
    --gray-700: #374151;
    --gray-500: #6b7280;
    --gray-300: #d1d5db;
    --gray-100: #f3f4f6;
    --white: #ffffff;
    --error: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', Consolas, monospace;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--gray-700);
    background: var(--gray-100);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   Header
   ======================================== */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-300);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    text-decoration: none;
}

.logo-icon {
    font-size: 2rem;
}

.nav-menu {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-menu a {
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-menu a:hover {
    color: var(--primary);
}

/* ========================================
   Article Container
   ======================================== */
.article-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

/* ========================================
   Article Cover
   ======================================== */
.article-cover {
    margin: 30px auto 0;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    max-width: 900px;
}

.article-cover img {
    width: 100%;
    height: auto;
    display: block;
}

/* ========================================
   Article Header
   ======================================== */
.article-header {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%);
    color: var(--white);
    padding: 50px 30px;
    text-align: center;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    margin: 0 -20px;
}

.article-header h1 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 25px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    opacity: 0.95;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--white);
}

/* ========================================
   Table of Contents
   ======================================== */
.toc-container {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px 25px;
    margin: 30px 0;
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow);
}

.toc-header {
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--dark);
    font-size: 1.1rem;
}

.toc-container ul {
    list-style: none;
    padding-left: 0;
}

.toc-container li {
    padding: 5px 0;
}

.toc-container a {
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

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

/* ========================================
   Article Content
   ======================================== */
.article-content {
    background: var(--white);
    padding: 40px;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    box-shadow: var(--shadow);
    margin: 0 -20px;
}

.article-summary {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left: 4px solid var(--primary);
    padding: 20px 25px;
    border-radius: var(--radius);
    margin-bottom: 30px;
    font-size: 1.1rem;
    color: var(--gray-900);
}

/* Typography */
.article-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gray-100);
}

.article-content h3 {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--dark);
    margin: 30px 0 15px;
}

.article-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    margin: 20px 0 10px;
}

.article-content p {
    margin-bottom: 20px;
    color: var(--gray-700);
}

.article-content a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.article-content a:hover {
    border-bottom-color: var(--primary);
}

/* Lists */
.article-content ul,
.article-content ol {
    margin: 20px 0;
    padding-left: 25px;
}

.article-content li {
    margin-bottom: 10px;
}

.article-content ul li::marker {
    color: var(--primary);
}

/* Blockquote */
.article-content blockquote {
    border-left: 4px solid var(--primary);
    background: var(--gray-100);
    padding: 20px 25px;
    margin: 25px 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
}

/* Code */
.article-content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--error);
}

.article-content pre {
    background: var(--dark);
    color: var(--gray-100);
    padding: 20px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 25px 0;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* FAQ */
.article-content details {
    background: var(--gray-100);
    border-radius: var(--radius);
    margin: 15px 0;
    overflow: hidden;
}

.article-content summary {
    padding: 15px 20px;
    font-weight: 600;
    cursor: pointer;
    background: var(--gray-100);
    transition: background 0.2s;
}

.article-content summary:hover {
    background: var(--gray-300);
}

.article-content details[open] summary {
    background: var(--primary);
    color: var(--white);
}

.article-content details p {
    padding: 15px 20px;
    margin: 0;
}

/* Tables */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.article-content th {
    background: var(--dark);
    color: var(--white);
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.article-content td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--gray-300);
}

.article-content tr:nth-child(even) {
    background: var(--gray-100);
}

/* Images */
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 20px 0;
}

/* ========================================
   Article Footer
   ======================================== */
.article-tags {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-300);
}

.tag {
    display: inline-block;
    background: var(--gray-100);
    color: var(--gray-700);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin: 5px 5px 5px 0;
    text-decoration: none;
    transition: all 0.2s;
}

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

/* Share Buttons */
.share-buttons {
    margin-top: 30px;
    padding: 20px;
    background: var(--gray-100);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

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

.share-btn {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--white);
    transition: transform 0.2s, opacity 0.2s;
}

.share-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.share-twitter { background: #1da1f2; }
.share-linkedin { background: #0077b5; }
.share-whatsapp { background: #25d366; }

/* Disclaimer */
.article-disclaimer {
    margin-top: 40px;
    padding: 20px;
    background: var(--gray-100);
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--gray-500);
    text-align: center;
    font-style: italic;
}

/* ========================================
   Author Box
   ======================================== */
.author-box {
    display: flex;
    gap: 20px;
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius-lg);
    margin-top: 40px;
    box-shadow: var(--shadow);
}

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

.author-info h4 {
    font-size: 0.85rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.author-info p {
    margin: 5px 0;
}

.author-info strong {
    font-size: 1.1rem;
    color: var(--dark);
}

/* ========================================
   Related Articles
   ======================================== */
.related-articles {
    margin-top: 50px;
}

.related-articles h3 {
    font-size: 1.5rem;
    color: var(--dark);
    margin-bottom: 20px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.related-item {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.related-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

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

.related-item h4 {
    padding: 15px 15px 5px;
    font-size: 0.95rem;
    color: var(--dark);
    line-height: 1.4;
}

.related-item span {
    display: block;
    padding: 0 15px 15px;
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
    background: var(--dark);
    color: var(--gray-300);
    padding: 50px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    color: var(--white);
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 8px;
}

.footer-section a {
    color: var(--gray-300);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--gray-700);
    font-size: 0.9rem;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .article-header {
        padding: 30px 20px;
    }
    
    .article-content {
        padding: 25px 20px;
    }
    
    .article-meta {
        gap: 15px;
        font-size: 0.85rem;
    }
    
    .author-box {
        flex-direction: column;
        text-align: center;
    }
    
    .author-avatar {
        margin: 0 auto;
    }
    
    .share-buttons {
        justify-content: center;
    }
}

/* ========================================
   Utility Classes
   ======================================== */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--gray-500); }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
