/*
Theme Name: DigiHub
Theme URI: https://websitedinamico.com
Author: WebsiteDinámico
Author URI: https://websitedinamico.com
Description: Tema premium para WebsiteDinámico - Recursos, Apps y Herramientas Digitales. Optimizado para Core Web Vitals, SEO y accesibilidad.
Version: 1.0.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: websitedinamico
Domain Path: /languages
Tags: blog, portfolio, custom-colors, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, block-styles, wide-blocks, accessibility-ready
Requires at least: 6.0
Requires PHP: 7.4

This theme is built for WebsiteDinámico with focus on performance,
security, and modern design patterns.
*/

/* =====================================================
   CRITICAL CSS - Above the fold optimizations
   Full stylesheets loaded via enqueue.php
===================================================== */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -moz-tab-size: 4;
    tab-size: 4;
}

body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Critical Layout */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: var(--text-white);
    padding: 8px 16px;
    z-index: 100000;
    text-decoration: none;
    font-weight: 600;
    border-radius: 0 0 var(--radius-sm) 0;
}

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

/* Critical Header Styles */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    transition: all var(--dur-normal) var(--ease-smooth);
}

.site-header.scrolled {
    background: var(--bg-primary);
    box-shadow: var(--shadow-md);
}

/* Dark mode header */
[data-theme="dark"] .site-header {
    background: var(--glass-bg);
    border-bottom-color: var(--glass-border);
}

[data-theme="dark"] .site-header.scrolled {
    background: var(--bg-dark);
}

/* Critical Navigation */
.main-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.site-logo {
    font-family: var(--font-secondary);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--space-xl);
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color var(--dur-fast) var(--ease-smooth);
    position: relative;
    display: block;
    padding: 0.5rem 0;
}

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

.nav-menu .current-menu-item > a,
.nav-menu .current_page_item > a {
    color: var(--primary);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--dur-normal) var(--ease-smooth);
}

.nav-menu a:hover::after,
.nav-menu a:focus::after {
    width: 100%;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: auto;
    color: var(--text-primary);
    transition: color var(--dur-fast);
}

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

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    margin: 5px 0;
    transition: all var(--dur-normal) var(--ease-smooth);
}

/* Critical Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 72px;
    position: relative;
    overflow: hidden;
    background-color: var(--bg-primary);
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    margin-bottom: var(--space-lg);
    border: 1px solid var(--glass-border);
}

.hero-title {
    font-family: var(--font-secondary);
    font-size: var(--text-hero);
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    letter-spacing: -0.02em;
}

.hero-title span {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    max-width: 540px;
    margin-bottom: var(--space-xl);
    line-height: 1.7;
}

/* Critical Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-weight: 600;
    font-size: var(--text-sm);
    border-radius: var(--radius-lg);
    transition: all var(--dur-normal) var(--ease-smooth);
    cursor: pointer;
    border: none;
    text-decoration: none;
    line-height: 1.5;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--text-white);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.5);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--text-white);
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #10b981);
    z-index: 9999;
    transition: width 0.1s linear;
}

/* Critical Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.8s ease forwards;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Critical Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        background: rgba(255,255,255,0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    [data-theme="dark"] .nav-menu {
        background: rgba(15,23,42,0.98);
    }
}

/* ─────────────────── FOOTER STYLES ─────────────────── */

.site-footer {
    background: var(--bg-primary);
    color: var(--text-primary);
    margin-top: auto;
}

.footer-main {
    padding: 4rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .site-footer {
    background: var(--bg-dark);
    color: var(--text-white);
}

[data-theme="dark"] .footer-main {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

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

@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.footer-brand {
    max-width: 300px;
}

.footer-brand__name {
    font-family: var(--font-secondary);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 1rem;
}

.footer-description {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.footer-social {
    display: flex;
    gap: 0.75rem;
}

.footer-social__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-white);
    transition: all 0.2s ease;
}

.footer-social__link:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}

.footer-menu-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-menu__title {
    font-family: var(--font-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-white);
    margin-bottom: 0.5rem;
}

.footer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-menu a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.footer-bottom {
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-bottom__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}

.footer-legal {
    display: flex;
    gap: 1rem;
}

.footer-legal a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.footer-legal a:hover {
    color: var(--primary);
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

/* Print Styles */
@media print {
    .site-header,
    .reading-progress,
    .whatsapp-float,
    .cookie-notice {
        display: none !important;
    }
}