/* ========================================
   TECNONEWS - Diseño Minimalista y Profesional
   ======================================== */

:root {
    /* Colores minimalistas */
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    
    /* Texto */
    --text-900: #0f172a;
    --text-700: #334155;
    --text-500: #64748b;
    --text-400: #94a3b8;
    --text-white: #ffffff;
    
    /* Fondos */
    --bg-white: #ffffff;
    --bg-gray-50: #f8fafc;
    --bg-gray-100: #f1f5f9;
    
    /* Bordes */
    --border: #e2e8f0;
    
    /* Sombras sutiles */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    
    /* Espaciado */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    
    /* Tipografía */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SF Mono", Monaco, Consolas, monospace;
    
    /* Radios */
    --radius: 0.5rem;
    --radius-sm: 0.375rem;
    
    /* Transiciones */
    --transition: all 0.2s ease;
}

/* ========================================
   RESET
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-900);
    background: var(--bg-white);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ========================================
   TIPOGRAFÍA
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-900);
    margin-bottom: var(--space-4);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: var(--space-4);
    color: var(--text-700);
}

/* ========================================
   LAYOUT
   ======================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

main {
    padding: var(--space-10) 0;
    min-height: calc(100vh - 200px);
}

/* ========================================
   HEADER
   ======================================== */
.header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
    padding: var(--space-4) 0;
    flex-wrap: wrap;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-900);
    letter-spacing: -0.02em;
}

.logo a:hover {
    color: var(--primary);
}

.nav {
    display: flex;
    gap: var(--space-1);
    align-items: center;
    flex-wrap: wrap;
}

.nav a {
    color: var(--text-700);
    font-weight: 500;
    font-size: 0.9375rem;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav a:hover {
    color: var(--primary);
    background: var(--bg-gray-50);
}

.search-form {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

.search-form input {
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    width: 200px;
    transition: var(--transition);
    background: var(--bg-white);
}

.search-form input:focus {
    outline: none;
    border-color: var(--primary);
    width: 250px;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-form button {
    padding: var(--space-2) var(--space-5);
    background: var(--primary);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: var(--transition);
}

.search-form button:hover {
    background: var(--primary-dark);
}

/* ========================================
   HERO SECTION (Simple)
   ======================================== */
.hero-section {
    background: var(--bg-gray-50);
    padding: var(--space-12) 0;
    margin-bottom: var(--space-10);
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.hero-section h1 {
    font-size: 2.75rem;
    margin-bottom: var(--space-4);
    color: var(--text-900);
}

.hero-section p {
    font-size: 1.125rem;
    color: var(--text-700);
    max-width: 700px;
    margin: 0 auto var(--space-6);
}

.btn-primary {
    display: inline-block;
    padding: var(--space-3) var(--space-6);
    background: var(--primary);
    color: var(--text-white);
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: var(--text-white);
}

/* ========================================
   FEATURED POST
   ======================================== */
.featured-post {
    margin: var(--space-10) 0;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.featured-post > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.featured-post img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-post > div > div:last-child {
    padding: var(--space-8);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-post h2 {
    font-size: 1.875rem;
    margin-bottom: var(--space-4);
}

.featured-post h2 a {
    color: var(--text-900);
}

.featured-post h2 a:hover {
    color: var(--primary);
}

/* ========================================
   POSTS GRID
   ======================================== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-6);
    margin: var(--space-10) 0;
}

.post-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.post-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.post-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-card-content {
    padding: var(--space-5);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card h2 {
    font-size: 1.25rem;
    margin-bottom: var(--space-3);
    line-height: 1.3;
}

.post-card h2 a {
    color: var(--text-900);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card h2 a:hover {
    color: var(--primary);
}

.post-card p {
    color: var(--text-700);
    font-size: 0.9375rem;
    margin-bottom: var(--space-4);
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
}

.post-meta {
    display: flex;
    gap: var(--space-3);
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-500);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.post-meta time {
    color: var(--text-500);
}

.post-meta a {
    color: var(--primary);
    font-weight: 500;
}

.post-meta a:hover {
    color: var(--primary-dark);
}

/* ========================================
   POST SINGLE
   ======================================== */
.post-single {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-white);
    padding: var(--space-10);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.featured-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: var(--space-8);
}

.post-header {
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--border);
}

.post-header h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: var(--space-4);
}

.post-content {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--text-700);
}

.post-content h2 {
    font-size: 1.875rem;
    margin-top: var(--space-10);
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border);
}

.post-content h3 {
    font-size: 1.5rem;
    margin-top: var(--space-8);
    margin-bottom: var(--space-4);
}

.post-content p {
    margin-bottom: var(--space-5);
}

.post-content ul,
.post-content ol {
    margin: var(--space-5) 0;
    padding-left: var(--space-8);
}

.post-content li {
    margin-bottom: var(--space-2);
}

.post-content a {
    color: var(--primary);
    text-decoration: underline;
}

.post-content a:hover {
    color: var(--primary-dark);
}

.post-content img {
    border-radius: var(--radius);
    margin: var(--space-8) 0;
}

.post-content code {
    background: var(--bg-gray-50);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: #dc2626;
}

.post-content pre {
    background: var(--text-900);
    color: #e5e7eb;
    padding: var(--space-5);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: var(--space-8) 0;
}

.post-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.post-content blockquote {
    border-left: 3px solid var(--primary);
    padding-left: var(--space-6);
    margin: var(--space-8) 0;
    color: var(--text-700);
    font-style: italic;
    background: var(--bg-gray-50);
    padding: var(--space-5) var(--space-6);
    border-radius: var(--radius-sm);
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-8) 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.post-content table th,
.post-content table td {
    padding: var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.post-content table th {
    background: var(--bg-gray-50);
    font-weight: 600;
}

.post-content table tr:hover {
    background: var(--bg-gray-50);
}

/* ========================================
   TOC
   ======================================== */
.toc {
    background: var(--bg-gray-50);
    padding: var(--space-6);
    border-radius: var(--radius);
    margin: var(--space-10) 0;
    border: 1px solid var(--border);
}

.toc h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-4);
}

.toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc li {
    margin: var(--space-3) 0;
}

.toc li.level-2 {
    font-weight: 600;
}

.toc li.level-3 {
    padding-left: var(--space-6);
    font-size: 0.9375rem;
}

.toc a {
    color: var(--text-700);
    transition: var(--transition);
}

.toc a:hover {
    color: var(--primary);
}

/* ========================================
   PAGINACIÓN
   ======================================== */
.pagination {
    display: flex;
    gap: var(--space-2);
    justify-content: center;
    margin: var(--space-12) 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: var(--space-3) var(--space-5);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-700);
    font-weight: 500;
    min-width: 40px;
    text-align: center;
    transition: var(--transition);
    background: var(--bg-white);
}

.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-gray-50);
}

.pagination .current {
    background: var(--primary);
    color: var(--text-white);
    border-color: var(--primary);
}

/* ========================================
   AD SENSE
   ======================================== */
.adsense-slot {
    margin: var(--space-10) 0;
    text-align: center;
    min-height: 100px;
    padding: var(--space-6);
    background: var(--bg-gray-50);
    border-radius: var(--radius);
    border: 1px dashed var(--border);
}

/* ========================================
   RELATED POSTS
   ======================================== */
.related-posts {
    margin-top: var(--space-12);
    padding-top: var(--space-10);
    border-top: 1px solid var(--border);
}

.related-posts h2 {
    font-size: 1.875rem;
    margin-bottom: var(--space-8);
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    background: var(--text-900);
    color: var(--text-white);
    padding: var(--space-10) 0;
    margin-top: var(--space-12);
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-6);
}

.footer p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0;
}

.footer nav {
    display: flex;
    gap: var(--space-6);
}

.footer a {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    transition: var(--transition);
}

.footer a:hover {
    color: var(--text-white);
}

/* ========================================
   HEADERS DE CATEGORÍA/TAG
   ======================================== */
.category-header,
.tag-header,
.search-header {
    margin-bottom: var(--space-10);
    padding: var(--space-8);
    background: var(--bg-gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
}

.category-header h1,
.tag-header h1,
.search-header h1 {
    font-size: 2.25rem;
    margin-bottom: var(--space-3);
}

.category-header p,
.tag-header p,
.search-header p {
    margin-bottom: 0;
    font-size: 1.125rem;
    color: var(--text-700);
}

/* ========================================
   ERROR PAGES
   ======================================== */
.error-page {
    text-align: center;
    padding: var(--space-12) 0;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.error-page h1 {
    font-size: 6rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: var(--space-4);
    line-height: 1;
}

.error-page p {
    font-size: 1.25rem;
    margin-bottom: var(--space-8);
    color: var(--text-700);
}

.error-page a {
    display: inline-block;
    padding: var(--space-4) var(--space-8);
    background: var(--primary);
    color: var(--text-white);
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: var(--transition);
}

.error-page a:hover {
    background: var(--primary-dark);
    color: var(--text-white);
}

/* ========================================
   BREADCRUMBS
   ======================================== */
.breadcrumbs {
    font-size: 0.9375rem;
    color: var(--text-500);
    margin-bottom: var(--space-8);
    padding: var(--space-4) 0;
}

.breadcrumbs a {
    color: var(--text-700);
    font-weight: 500;
}

.breadcrumbs a:hover {
    color: var(--primary);
}

.breadcrumbs a::after {
    content: ' → ';
    color: var(--text-400);
    margin: 0 var(--space-2);
    font-weight: 400;
}

.breadcrumbs a:last-child::after {
    display: none;
}

.breadcrumbs span {
    color: var(--text-500);
    font-weight: 500;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-4);
    }
    
    .header-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .nav {
        justify-content: center;
        gap: var(--space-2);
    }
    
    .search-form {
        width: 100%;
    }
    
    .search-form input {
        flex: 1;
        width: 100%;
    }
    
    .search-form input:focus {
        width: 100%;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
        gap: var(--space-5);
    }
    
    .post-single {
        padding: var(--space-6);
    }
    
    .post-header h1 {
        font-size: 2rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    
    .category-header h1,
    .tag-header h1,
    .search-header h1 {
        font-size: 1.875rem;
    }
    
    .error-page h1 {
        font-size: 4rem;
    }
    
    main {
        padding: var(--space-8) 0;
    }
    
    .footer .container {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 2.25rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .featured-post > div {
        grid-template-columns: 1fr !important;
    }
    
    .featured-post > div > div:first-child {
        height: 250px !important;
    }
}

@media (max-width: 480px) {
    .post-header h1 {
        font-size: 1.75rem;
    }
    
    .error-page h1 {
        font-size: 3rem;
    }
    
    .hero-section {
        padding: var(--space-8) 0;
    }
    
    .hero-section h1 {
        font-size: 1.875rem;
    }
}
