:root {
    /* Premium Color Palette - Pure Luxury & High Contrast */
    --primary: #0a0a0b;
    --primary-light: #161618;
    --accent: #3b82f6; /* Sapphire Blue */
    --accent-glow: rgba(59, 130, 246, 0.4);
    --secondary: #f43f5e; /* Rose 500 */
    --success: #10b981;
    
    /* Neutral Tones */
    --bg-main: #fcfcfd;
    --bg-card: #ffffff;
    --text-main: #09090b;
    --text-muted: #71717a;
    --border-light: rgba(9, 9, 11, 0.06);
    
    /* Glassmorphism Defaults */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(9, 9, 11, 0.05);
    --glass-blur: blur(20px);
    
    /* Typography */
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-accent: 'Outfit', sans-serif;
    --font-serif: 'Lora', serif;
    
    /* Elevation & Shapes */
    --shadow-premium: 0 20px 40px -15px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 30px var(--accent-glow);
    --radius-premium: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-base: 0.4s var(--ease-out);
}

/* Dark Mode Override - Modern Onyx & Sapphire */
[data-theme="dark"] {
    --bg-main: #050506;
    --bg-card: #121214;
    --text-main: #fafafa;
    --text-muted: #88888d;
    --border-light: rgba(255, 255, 255, 0.05);
    --glass-bg: rgba(18, 18, 20, 0.9);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent: #60a5fa;
    --accent-glow: rgba(96, 165, 250, 0.3);
}

/* Base Styles & Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background-color var(--transition-base), color var(--transition-base);
}

.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--accent);
    color: white;
    padding: 1rem;
    z-index: 10000;
    transition: top 0.3s;
}

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

/* Typography Scale */
h1, h2, h3 { 
    font-family: var(--font-accent); 
    font-weight: 800; 
    letter-spacing: -0.02em; 
    line-height: 1.2; 
    text-wrap: balance; 
    text-wrap: pretty;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }

a { text-decoration: none; color: inherit; transition: var(--transition-base); padding: 8px; /* Touch target criteria */ }

/* --- HEADER (Glassmorphism & Interactive) --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    height: 80px;
    display: flex;
    align-items: center;
    transition: all 0.4s ease;
}

.site-header.scrolled {
    height: 65px;
    box-shadow: var(--shadow-premium);
}

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

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    z-index: 11;
}

.logo {
    display: flex;
    align-items: center;
    z-index: 10;
}

.logo a {
    font-family: var(--font-accent);
    font-size: 1.75rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: transform 0.3s var(--ease-out);
    padding: 0;
}

.logo a:hover { transform: scale(1.05); }

.logo img { max-height: 50px; width: auto; transition: transform 0.3s ease; }

.logo-dark { display: none; }

[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }

.logo-text {
    font-family: var(--font-accent);
    font-size: 1.75rem;
    font-weight: 900;
}

/* Navigation */
.nav-links { display: flex; gap: 1rem; list-style: none; align-items: center; }
.nav-link {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
    position: relative;
    padding: 0.5rem 0.75rem;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0.75rem;
    right: 0.75rem;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    border-radius: var(--radius-full);
}

.nav-link:hover::after { transform: scaleX(1); }

/* Theme Toggle */
.theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-main);
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- MOBILE DRAWER --- */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.nav-drawer {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: 100%;
    background: var(--bg-card);
    z-index: 2001;
    transition: all 0.4s var(--ease-out);
    display: flex;
    flex-direction: column;
    padding: 2rem;
    box-shadow: 20px 0 50px rgba(0,0,0,0.1);
}

.nav-drawer.active {
    left: 0;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.drawer-logo a { padding: 0; }

.nav-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
    padding: 8px;
}

.drawer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.drawer-link {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    display: block;
    padding: 0.5rem 0;
}

.drawer-footer {
    margin-top: auto;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- ARTICLE CARDS (Premium Elevate) --- */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.premium-card {
    background: var(--bg-card);
    border-radius: var(--radius-premium);
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: all 0.5s var(--ease-out);
    position: relative;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.8s ease backwards;
}

.premium-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-premium), 0 20px 40px -20px var(--accent-glow);
    border-color: var(--accent);
}

.card-img-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
}

.card-img-wrapper a { padding: 0; }

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--ease-out);
}

.premium-card:hover .card-img-wrapper img { transform: scale(1.1); }

.card-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--accent);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 2;
}

.card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.card-title { font-size: 1.25rem; margin-bottom: 0.75rem; color: var(--text-main); line-height: 1.3; }
.card-title a { padding: 0; }
.card-excerpt { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.5rem; flex: 1; }

.card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* --- SINGLE ARTICLE PAGE (Luxury Layout) --- */
.article-hero {
    margin-top: 2rem;
    margin-bottom: 3rem;
    text-align: center;
}

.article-main-title {
    margin: 1.5rem auto;
    max-width: 900px;
}

.article-header-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    margin-bottom: 2rem;
    color: var(--text-muted);
    font-weight: 500;
}

.article-featured-img {
    width: 100%;
    height: auto;
    max-height: 600px;
    border-radius: var(--radius-premium);
    object-fit: cover;
    box-shadow: var(--shadow-premium);
}

.article-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    padding: 0 1.5rem;
}

.article-content {
    font-family: var(--font-serif);
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    line-height: 1.8;
}

/* Elegante Drop Cap - Solo primer párrafo (Luxury Criteria) */
.article-content > p:first-of-type::first-letter {
    float: left;
    font-family: var(--font-accent);
    font-size: 4rem;
    line-height: 0.85;
    padding: 4px 8px 4px 0;
    margin-right: 0.5rem;
    font-weight: 900;
    color: var(--accent);
}

.premium-tag-link {
    background: var(--bg-card);
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    border: 1px solid var(--border-light);
    transition: all 0.3s var(--ease-out);
    display: inline-flex;
    align-items: center;
}

.premium-tag-link:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -10px var(--accent-glow);
}

/* Share Sidebar */
.share-bar-fixed {
    position: fixed;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 100;
}

.share-btn {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.share-btn:hover {
    transform: scale(1.15) rotate(5deg);
    color: white;
}

.share-btn.fb:hover { background: #3b5998; border-color: #3b5998; }
.share-btn.tw:hover { background: #000000; border-color: #000000; }
.share-btn.wa:hover { background: #25d366; border-color: #25d366; }
.share-btn.tg:hover { background: #0088cc; border-color: #0088cc; }
.share-btn.ds:hover { background: #5865f2; border-color: #5865f2; }
.share-btn.copy:hover { background: var(--accent); border-color: var(--accent); }

/* --- FOOTER --- */
.site-footer {
    background: var(--primary);
    color: white;
    padding: 5rem 0 2rem;
    margin-top: 5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-logo {
    font-family: var(--font-accent);
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    display: block;
    padding: 0;
}

.footer-desc { color: #94a3b8; max-width: 400px; margin-bottom: 2rem; }

.footer-column h3 { font-size: 1.1rem; margin-bottom: 1.5rem; color: white; text-transform: uppercase; letter-spacing: 0.1em; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 0.8rem; }
.footer-links a { color: #94a3b8; transition: color 0.3s; padding: 4px 0; }
.footer-links a:hover { color: var(--accent); }

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    color: #64748b;
    font-size: 0.9rem;
}

/* --- UTILS & ANIMATIONS --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.reading-progress-container { position: fixed; top: 0; left: 0; width: 100%; height: 4px; z-index: 1500; }
.reading-progress-bar { height: 100%; background: linear-gradient(to right, var(--accent), var(--secondary)); width: 0%; transition: width 0.1s linear; }

/* Responsive adjustments */
@media (max-width: 1024px) {
    .main-nav { display: none; }
    .nav-toggle { display: block; }
    
    .share-bar-fixed {
        position: fixed;
        bottom: 1.5rem;
        left: 50%;
        top: auto;
        transform: translateX(-50%);
        flex-direction: row;
        background: var(--glass-bg);
        backdrop-filter: var(--glass-blur);
        padding: 0.75rem;
        border-radius: 20px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        border: 1px solid var(--glass-border);
    }
    
    .footer-grid { grid-template-columns: 1fr; gap: 3rem; }
}

@media (max-width: 768px) {
    .site-header { height: 70px; }
    .articles-grid { grid-template-columns: 1fr; }
    .article-header-meta { flex-direction: column; gap: 0.5rem; align-items: center; }
}

/* UI Elements */
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.5rem; margin-top: 4rem; }
.page-link {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    font-weight: 700;
}

.page-link.active { background: var(--accent); color: white; border-color: var(--accent); }

/* --- LANGUAGE SELECTOR --- */
.lang-selector { position: relative; }
.lang-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-premium);
    cursor: pointer;
    font-weight: 600;
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-premium);
    box-shadow: var(--shadow-premium);
    width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 100;
}

.lang-selector:hover .lang-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-item { padding: 0.75rem 1rem; display: flex; align-items: center; gap: 0.8rem; transition: background 0.3s; }
.lang-item:hover { background: var(--bg-main); color: var(--accent); }
.lang-item img { border-radius: 2px; }
