/*
Theme Name: Nova XS - Tema Optimizado
Description: Tema WordPress ultra-optimizado para máxima velocidad y rendimiento. Incluye lazy loading, minificación automática, y optimizaciones avanzadas de Core Web Vitals.
Version: 1.0.0
Author: ProtonDigital
Text Domain: nova-xs
Domain Path: /languages
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* ==========================================================================
   RESET Y BASE STYLES
   ========================================================================== */

body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #333;
    background-color: #fff;
    overflow-x: hidden;
}

/* ==========================================================================
   TIPOGRAFÍA OPTIMIZADA
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: #007cba;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #005a87;
}

/* ==========================================================================
   LAYOUT PRINCIPAL
   ========================================================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.site-header {
    background: #00354c;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 1rem 0;
    gap: 50px;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.main-navigation a {
    font-weight: 500;
    font-size: 1.3em;
    padding: 0.5rem 0;
    color:#FFF;
}

/* Botón hamburguesa (oculto en escritorio) */
.menu-toggle {
    display: none;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem;
}
.menu-toggle-box { display: inline-flex; flex-direction: column; gap: 4px; }
.menu-toggle-bar { width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(2){ opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(1){ transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(3){ transform: translateY(-6px) rotate(-45deg); }

/* ==========================================================================
   CONTENIDO PRINCIPAL
   ========================================================================== */

.site-main {
    min-height: 60vh;
}

.content-area {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .content-area {
        grid-template-columns: 2fr 1fr;
    }
}

/* ==========================================================================
   POSTS Y ARTÍCULOS
   ========================================================================== */

.post {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

.post-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-content {
    padding: 1.5rem;
}

.post-title {
    margin-bottom: 1rem;
}

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

.post-excerpt {
    color: #555;
    line-height: 1.6;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */

.sidebar {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    height: fit-content;
}

.widget {
    margin-bottom: 2rem;
}

.widget:last-child {
    margin-bottom: 0;
}

.widget-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #333;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
    background: #333;
    color: #fff;
    padding: 2rem 0;
}

.footer-content {
    text-align: center;
}

/* ==========================================================================
   UTILIDADES
   ========================================================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 767px) {
    .header-content { flex-direction: row; justify-content: space-between; align-items: center; gap: 1rem; }
    .site-branding { margin-right: auto; }
    
    .main-navigation ul { flex-direction: column; gap: 1rem; text-align: center; }
    /* Mostrar el botón en móvil */
    .menu-toggle { display: inline-flex;         font-size: 24px; }
    /* Off-canvas desde la derecha */
    .main-navigation { position: fixed; top: 0; right: 0; bottom: 0; width: 80%; max-width: 320px; background: #00354c; box-shadow: -6px 0 20px rgba(0,0,0,0.15); transform: translateX(100%); transition: transform .3s ease; z-index: 1001; padding-top: 72px; }
    .main-navigation.menu-open { transform: translateX(0); }
    /* Overlay */
    .menu-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s ease; z-index: 1000; }
    .main-navigation.menu-open + .menu-overlay { opacity: 1; visibility: visible; }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
}

/* ==========================================================================
   OPTIMIZACIONES DE RENDIMIENTO
   ========================================================================== */

/* Preload de fuentes críticas */
@font-face {
    font-family: 'System Font';
    font-display: swap;
}

/* Optimización de imágenes */
img {
    max-width: 100%;
    height: auto;
    loading: lazy;
}

/* Animaciones optimizadas */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==========================================================================
   ACCESIBILIDAD
   ========================================================================== */

:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}
