:root {
    --bg-color: #fdfbf7;
    --text-color: #2c2c2c;
    --accent-color: #c9a227;
    --accent-hover: #b08d1f;
    --link-color: #2B5A7B;
    --border-color: #e6e2d8;
    --post-bg: #fffef9;
    --font-serif: 'Georgia', 'Times New Roman', serif;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --shadow-soft: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-hover: 0 8px 24px rgba(0,0,0,0.1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    /* Transiciones */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ============================================
   MEJORAS RESPONSIVE Y ACCESIBILIDAD
   ============================================ */

/* Layout principal más robusto con Grid */
@media (min-width: 900px) {
    .container {
        display: grid;
        grid-template-columns: 200px 1fr;
        gap: 2rem;
        align-items: start;
    }

    .site-header {
        grid-column: 1 / -1;
    }

    .site-main {
        grid-column: 1 / -1;
    }

    .site-footer {
        grid-column: 1 / -1;
    }
}

/* Navegación mejorada para móvil */
@media (max-width: 600px) {
    .site-header .container {
        flex-wrap: wrap;
        justify-content: center;
    }

    .main-nav {
        display: flex;
        gap: 1rem;
        margin-top: 0.5rem;
    }

    .main-nav a {
        margin: 0;
        padding: 0.5rem 0.75rem;
        border-radius: var(--radius-sm);
        background: var(--bg-color);
        transition: background 0.2s;
    }

    .main-nav a:hover {
        background: var(--border-color);
        color: var(--text-color);
    }
}

/* Mejor focus para accesibilidad */
a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Mejor spacing general */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    font-size: 16px;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)' opacity='0.015'/%3E%3C/svg%3E");
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Skip link (accesibilidad) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-color);
    color: #fff;
    padding: 8px 16px;
    z-index: 100;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
}

/* Header */
.site-header {
    background: var(--post-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

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

.logo a {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-color);
    text-decoration: none;
}

.logo a:hover {
    color: var(--accent-color);
}

.main-nav a {
    margin-left: 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
}

.main-nav a:hover {
    color: var(--accent-color);
}

/* Main */
.site-main {
    padding: 2rem 0;
}

/* Hero */
.hero {
    text-align: center;
    padding: 3rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.hero h1 {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.hero .subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 1rem;
}

.btn-primary {
    display: inline-block;
    background: var(--accent-color);
    color: #fff;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    margin-top: 1rem;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

/* Posts grid */
.featured-posts h2,
.about-preview h2 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.post-card {
    background: var(--post-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-color);
}

.post-card time {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.5rem;
}

.post-card h3 {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    flex-grow: 1;
}

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

.post-card h3 a:hover {
    color: var(--accent-color);
}

.post-card p {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.read-more {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: auto;
    display: inline-block;
}

.read-more:hover {
    text-decoration: underline;
}

/* About preview */
.about-preview {
    background: var(--post-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-soft);
    transition: box-shadow 0.2s ease;
}

.about-preview:hover {
    box-shadow: var(--shadow-hover);
}

.about-preview p {
    margin-bottom: 1rem;
}

.btn-secondary {
    display: inline-block;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    margin-top: 1rem;
    transition: all 0.2s ease;
    background: transparent;
}

.btn-secondary:hover {
    background: var(--accent-color);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(201, 162, 39, 0.2);
}

/* Blog post */
.blog-post {
    background: var(--post-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-soft);
}

.post-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.post-header h1 {
    font-family: var(--font-serif);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.post-meta {
    font-size: 0.9rem;
    color: #666;
}

.post-meta .tag {
    background: var(--border-color);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    margin-left: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-color);
}

.post-content {
    max-width: 700px;
}

.post-content h2 {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    margin: 2rem 0 1rem;
    color: var(--text-color);
    scroll-margin-top: 2rem;
}

.post-content h3 {
    font-size: 1.3rem;
    margin: 1.5rem 0 0.75rem;
    scroll-margin-top: 2rem;
}

.post-content p {
    margin-bottom: 1.2rem;
}

.post-content ul,
.post-content ol {
    margin: 0 0 1.2rem 1.5rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.post-content th,
.post-content td {
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    text-align: left;
}

.post-content th {
    background: var(--bg-color);
    font-weight: 600;
}

.post-content strong {
    color: #222;
}

.post-content em {
    font-style: italic;
    color: #555;
}

.post-content a {
    color: var(--link-color);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-content a:hover {
    color: var(--accent-color);
}

/* Like button */
.post-cta {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.like-button {
    background: none;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
    margin-left: 0.5rem;
}

.like-button:hover {
    background: var(--accent-color);
    color: #fff;
}

.like-button.liked {
    background: var(--accent-color);
    color: #fff;
}

.like-count-container {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.like-count {
    font-weight: bold;
    color: var(--accent-color);
}

/* Footer */
.site-footer {
    background: var(--post-bg);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin-top: 3rem;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

.site-footer a {
    color: var(--link-color);
    text-decoration: none;
    margin: 0 0.5rem;
}

.site-footer a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* ============================================
   MEJORAS ADICIONALES DE RESPONSIVE
   ============================================ */

/* Tablets pequeñas y móviles grandes */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .hero .subtitle { font-size: 1.1rem; }
    .posts-grid { gap: 1.5rem; }
    .post-card { padding: 1.25rem; }
    .blog-post { padding: 1.5rem; }
}

/* Muy pequeño (teléfonos antiguos) */
@media (max-width: 400px) {
    .container { padding: 0 15px; }
    .main-nav { gap: 0.5rem; }
    .main-nav a { padding: 0.4rem 0.6rem; font-size: 0.9rem; }
    .hero h1 { font-size: 1.75rem; }
}

/* Alto contraste para accesibilidad (opcional) */
@media (prefers-contrast: high) {
    :root {
        --text-color: #000;
        --bg-color: #fff;
        --accent-color: #000;
        --border-color: #333;
    }
}

/* Reducir animaciones para who prefieren menos movimiento */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   TRANSICIONES Y MICROINTERACCIONES
   ============================================ */

/* Transiciones globales suaves */
* {
    transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-normal), box-shadow var(--transition-normal);
}

/* Animación de entrada para elementos */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Aplicar animación de entrada a elementos principales */
.post-card,
.blog-post,
.about-preview,
.hero > * {
    animation: fade-in-up 0.6s ease-out forwards;
    animation-delay: calc(var(--animation-order, 0) * 0.1s);
}

/* Establecer orden de animación para stagger effect */
.posts-grid .post-card:nth-child(1) { --animation-order: 0; }
.posts-grid .post-card:nth-child(2) { --animation-order: 1; }
.posts-grid .post-card:nth-child(3) { --animation-order: 2; }

/* Hover más elaborado en tarjetas */
.post-card {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
    will-change: transform, box-shadow;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover), 0 12px 32px rgba(0,0,0,0.15);
}

/* Enlaces con subrayado animado */
.post-content a {
    position: relative;
    text-decoration: none;
    background-image: linear-gradient(var(--link-color), var(--link-color));
    background-position: 0% 100%;
    background-repeat: no-repeat;
    background-size: 0% 2px;
    transition: background-size var(--transition-normal), color var(--transition-fast);
}

.post-content a:hover {
    background-size: 100% 2px;
    color: var(--accent-color);
}

/* Botones con mejor feedback */
.btn-primary,
.btn-secondary {
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-bounce), box-shadow var(--transition-normal), background-color var(--transition-fast);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(201, 162, 39, 0.4);
}

.btn-primary:active {
    transform: translateY(1px) scale(0.98);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 162, 39, 0.2);
}

/* Like button con microinteracción */
.like-button {
    position: relative;
    overflow: hidden;
    transition: all var(--transition-bounce), transform var(--transition-normal);
}

.like-button:hover {
    transform: scale(1.05);
}

.like-button:active {
    transform: scale(0.95);
}

.like-button.liked {
    animation: pulse 0.4s var(--transition-bounce);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Scroll reveal - elementos aparecen al hacer scroll */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Focus states mejorados con animación */
a:focus-visible,
button:focus-visible {
    animation: focus-pulse 0.3s ease-out;
    box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.3);
}

@keyframes focus-pulse {
    from { box-shadow: 0 0 0 0 rgba(201, 162, 39, 0.5); }
    to { box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.3); }
}

/* Efecto ripple en botones (opcional, minimalista) */
.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:active::after {
    width: 200px;
    height: 200px;
    opacity: 0;
}

/* Header con backdrop blur sutil */
.site-header {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(255, 254, 249, 0.95);
    transition: background var(--transition-normal);
}

.site-header.scrolled {
    box-shadow: 0 2px 20px rgba(0,0,0,0.05);
}
