/*
    styles.css — Base styles, theming, layout, and utilities
    Minimalista, elegante, con sorpresas sutiles.
*/

/* 1) Reset moderno y variables (modo claro fijo - Minimalista Profesional) */
:root {
    --bg: #ffffff;
    --bg-elev: #ffffff;
    --fg: #1a1a1a;
    --muted: #666666;
    --border: #e0e0e0;
    
    /* Colores primarios profesionales y sutiles */
    --accent: #2c3e50; /* azul gris oscuro */
    --accent-2: #34495e; /* gris azulado más claro */
    --accent-3: #3498db; /* azul profesional */
    --accent-4: #16a085; /* verde azulado */
    --accent-5: #2980b9; /* azul profundo */
    
    /* Colores funcionales */
    --success: #27ae60;
    --warning: #e67e22;
    --error: #e74c3c;
    
    /* Sombras sutiles */
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 20px rgba(0,0,0,0.12);
    --shadow-hover: 0 12px 30px rgba(0,0,0,0.15);
    
    --radius: 8px;
    --container: 1120px;
    --gap: clamp(16px, 2vw, 28px);
    --font-sans: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, 'Apple Color Emoji','Segoe UI Emoji';
    
    /* Tipografía fluida */
    --fs-1: clamp(2rem, 3.2vw, 3.2rem);
    --fs-2: clamp(1.6rem, 2.4vw, 2.2rem);
    --fs-3: clamp(1.1rem, 1.2vw, 1.2rem);
    --fs-4: 0.95rem;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html {
    font-size: 16px;
    scrollbar-gutter: stable both-edges;
}
body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--fg);
    background: var(--bg);
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

img, picture, video, canvas { display: block; max-width: 100%; }
img { height: auto; }

/* 2) Layout y contenedor */
.container {
    width: min(100% - 2rem, var(--container));
    margin-inline: auto;
}

.site-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 50%, #f9f9f9 100%);
}

/* 3) Cabecera: sticky + glassmorphism */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: saturate(140%) blur(8px);
    -webkit-backdrop-filter: saturate(140%) blur(8px);
    background: color-mix(in oklab, var(--bg-elev) 86%, transparent);
    border-bottom: 1px solid var(--border);
}

.nav {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: var(--gap);
    padding: 14px 0;
}

.logo {
    font-weight: 700;
    letter-spacing: -0.02em;
    font-size: 1.1rem;
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.logo:hover {
    opacity: 0.8;
}

/* Logo de imagen (Customizer) */
.custom-logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}
.custom-logo {
    height: 32px; /* Desktop base */
    width: auto !important; /* Mantener proporción */
    max-width: none; /* Evita que la regla global img{max-width:100%} achique el logo y distorsione al fijar altura */
}

/* Aumentar ligeramente el logo en pantallas pequeñas para mejorar legibilidad */
@media (max-width: 1024px) {
    .custom-logo { height: 36px; }
}
@media (max-width: 640px) {
    .custom-logo { height: 44px; }
}

/* Header responsive: logo arriba; menú y búsqueda en la misma línea debajo, sin overflow */
@media (max-width: 640px) {
    .nav {
        grid-template-columns: 1fr auto; /* menú flexible + búsqueda auto */
        grid-auto-rows: auto;
        align-items: center;
        gap: 10px;
        padding: 10px 0;
    }

    /* El logo ocupa toda la fila superior */
    .nav > .custom-logo-link,
    .nav > .logo {
        grid-column: 1 / -1;
    }

    .nav-links {
        width: auto;
        flex-wrap: wrap;
        gap: 10px;
    }

    .search-form {
        width: clamp(140px, 42vw, 220px);
        justify-self: end;
    }
}

.nav-links {
    list-style: none;
    display: flex;
    gap: clamp(14px, 2vw, 22px);
    margin: 0;
    padding: 0;
}
.nav-links a {
    text-decoration: none;
    color: var(--muted);
    font-weight: 500;
    padding: 8px 10px;
    border-radius: 4px;
    transition: all 0.25s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-3);
    border-radius: 1px;
    transition: width 0.3s ease;
}

.nav-links a[aria-current="page"],
.nav-links .current-menu-item > a,
.nav-links .current_page_item > a,
.nav-links .current-menu-ancestor > a,
.nav-links .current_page_ancestor > a,
.nav-links a:hover {
    color: var(--accent);
    background: rgba(52, 73, 94, 0.05);
}

.nav-links a[aria-current="page"]::after,
.nav-links .current-menu-item > a::after,
.nav-links .current_page_item > a::after,
.nav-links .current-menu-ancestor > a::after,
.nav-links .current_page_ancestor > a::after,
.nav-links a:hover::after {
    width: 100%;
}

/* (Se elimina el botón de tema: dark mode off) */

/* Búsqueda */
.search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 12px;
    transition: all 0.3s ease;
    width: clamp(120px, 18vw, 220px);
    max-width: 100%;
}

.search-form:focus-within {
    box-shadow: 0 0 0 2px rgba(52, 73, 94, 0.1);
    border-color: var(--accent);
}

.search-form input {
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.9rem;
    color: var(--fg);
    width: 100%;
    min-width: 0;
    font-family: inherit;
}

.search-form input::placeholder {
    color: #999;
}

.search-form button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    position: relative;
}

.search-form button:before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    top: 2px;
    left: 0;
}

.search-form button:after {
    content: '';
    position: absolute;
    width: 2px;
    height: 6px;
    background: var(--accent);
    transform: rotate(-45deg);
    bottom: 0;
    right: 0;
}

.search-form button:hover {
    opacity: 0.7;
}

/* (Se elimina el botón de tema: dark mode off) */

/* 5) Main */
.site-main {
    padding-block: clamp(24px, 4vw, 56px);
    flex: 1 0 auto;
}

/* 6) Footer */
.site-footer {
    border-top: 1px solid #e0e0e0;
    background: #fafafa;
    margin-top: auto;
}

.site-footer .container {
    padding: 10px 0;
    text-align: center;
}

.site-footer p {
    color: var(--muted);
    margin: 0;
    font-size: clamp(0.78rem, 2.1vw, var(--fs-4));
}

.navigation.pagination {
    margin-top: 40px;
}

.navigation.pagination .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.navigation.pagination ul {
    list-style: none;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 0;
    margin: 0;
}

.navigation.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.25s ease;
}

.navigation.pagination .page-numbers:hover {
    border-color: var(--accent-3);
    color: var(--accent);
    transform: translateY(-2px);
}

.navigation.pagination .page-numbers.current {
    background: var(--accent-3);
    color: #fff;
    border-color: var(--accent-3);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.25);
}

/* 7) Utilidades */
.chip {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-3);
    background: #f0f4f8;
    border: 1px solid #d0dce6;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.25s ease;
    letter-spacing: 0.3px;
    width: fit-content;
}

.chip:hover {
    background: #e8eff7;
    border-color: var(--accent-3);
}

.section-header {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.section-header h2 {
    margin: 0;
    font-size: var(--fs-2);
    letter-spacing: -0.02em;
    color: var(--accent);
}

.section-accent {
    height: 3px;
    width: 60px;
    background: var(--accent-3);
    border-radius: 2px;
    opacity: 1;
}

/* 8) Botones */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    text-align: center;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: var(--accent-3);
    color: white;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.btn-primary:hover {
    background: #2980b9;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

/* 9) Links accesibles */
:focus-visible {
    outline: 2px solid color-mix(in oklab, var(--accent) 80%, #fff 20%);
    outline-offset: 2px;
}

/* Accesibilidad: helper para texto solo para lectores de pantalla */
.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;}
