/*
Theme Name: Eneko Ops Portfolio V3
Author: Eneko Ortega
Description: Tema Ops Dark Mode con Logos Reales + Background Custom
Version: 3.2
*/

/* --- VARIABLES --- */
:root {
    --bg-main: #0B1120;       /* Fondo principal */
    --card-bg: #1E293B;       /* Fondo tarjeta */
    --card-border: #334155;   /* Borde sutil */
    --accent: #3B82F6;        /* Azul vibrante */
    --text-white: #F8FAFC;
    --text-muted: #94A3B8;
    --font-main: 'Inter', sans-serif;
}
html {
    scroll-behavior: smooth;
}
/* --- RESET & BODY CON EFECTO GRID --- */
body {
    background-color: var(--bg-main);
    color: var(--text-white);
    font-family: var(--font-main);
    margin: 0; 
    line-height: 1.6;
    position: relative;
    min-height: 100vh;
}

/* Patrón de cuadrícula técnica */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
}

/* Luz ambiental superior */
body::after {
    content: "";
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 500px;
    background: radial-gradient(circle at 50% -20%, rgba(59, 130, 246, 0.15), transparent 70%);
    z-index: -1;
    pointer-events: none;
}

h1, h2, h3 { margin: 0; font-weight: 700; color: #fff; }
a { text-decoration: none; color: inherit; transition: color 0.2s; }
a:hover { color: var(--accent); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* --- HEADER GLASSMORPHISM --- */
.site-header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    z-index: 1000;
    background: rgba(11, 17, 32, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.site-logo a {
    font-family: 'Fira Code', monospace;
    font-weight: 700;
    font-size: 1.2rem;
    color: #fff;
    letter-spacing: -0.5px;
}

/* Menú generado por WordPress */
.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-menu li {
    margin-left: 25px;
    position: relative;
}

.nav-menu a {
    font-size: 0.95rem;
    font-weight: 500;
    color: #94A3B8;
    display: block;
}

.nav-menu a:hover { color: #fff; }

/* Botón Contacto (Clase .nav-btn) */
.nav-menu li.nav-btn a {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6 !important;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    margin-left: 10px;
}
.nav-menu li.nav-btn a:hover {
    background: #3B82F6;
    color: #fff !important;
}

/* --- HERO SECTION --- */
.hero-section {
    padding: 140px 0 100px;
    background: 
        linear-gradient(to right, rgba(2, 6, 23, 0.9), rgba(30, 58, 138, 0.7)),
        url(./images/background4.png) no-repeat center center;
    background-size: cover;
    border-bottom: 1px solid var(--card-border);
    position: relative;
}

.hero-title { 
    font-size: 3.5rem; 
    line-height: 1.1; 
    margin-bottom: 20px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-subtitle { font-size: 1.25rem; color: var(--text-muted); max-width: 600px; margin-bottom: 30px; }
.hero-btn { 
    display: inline-block;
    background-color: var(--accent); 
    color: white; 
    padding: 12px 28px; 
    border-radius: 6px; 
    font-weight: 600; 
}
.hero-btn:hover { background-color: #2563eb; }

/* --- SECCIONES COMUNES --- */
.section-container { padding: 60px 0; }
.section-heading {
    font-size: 1.5rem; margin-bottom: 50px;
    border-left: 4px solid var(--accent); padding-left: 15px;
    color: var(--text-white);
}

/* --- TOOLKIT GRID --- */
.grid-toolkit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}
.tech-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.tech-card:hover { 
    transform: translateY(-5px); 
    border-color: var(--accent);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}
.card-logos {
    display: flex; justify-content: center; align-items: center;
    gap: 15px; margin-bottom: 20px; height: 50px; flex-wrap: wrap;
}
.card-logos img { max-height: 40px; width: auto; object-fit: contain; }
.tech-info h3 { font-size: 1.1rem; margin-bottom: 5px; color: #fff; }
.tech-info p { font-size: 0.9rem; color: var(--text-muted); margin: 0; }

/* --- PROJECTS GRID  --- */
.grid-projects {
    display: grid;
    /* Columnas automáticas pero con un ancho mínimo de 300px */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    /* IMPORTANTE: Esto asegura que las filas tengan la altura correcta */
    grid-auto-rows: auto; 
    align-items: stretch; 
}

.project-card {
    /* Fondo con degradado sutil */
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 30px;
    
    /* Flexbox para empujar el footer siempre abajo */
    display: flex;
    flex-direction: column;
    
    /* IMPORTANTE: Altura 100% para llenar la celda del grid, pero sin limitar el crecimiento */
    height: 100%; 
    min-height: 350px; /* Altura mínima estética */
    box-sizing: border-box; /* Asegura que el padding no rompa el tamaño */
    
    position: relative;
    overflow: hidden; /* Recorta cualquier cosa que se salga rara, por seguridad */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Efecto Hover */
.project-card:hover { 
    transform: translateY(-7px); 
    border-color: #3B82F6; 
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    z-index: 10; /* Asegura que al flotar quede por encima de todo */
}

/* Icono Flotante */
.project-icon-wrapper {
    position: absolute;
    top: 25px; right: 25px;
    width: 45px; height: 45px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: #60A5FA;
}
.project-icon-wrapper svg { width: 24px; height: 24px; }

/* Contenido interno */
.project-content {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Ocupa todo el espacio disponible */
    height: 100%;
}

.project-card h3 { 
    font-size: 1.4rem; 
    margin-bottom: 15px; 
    line-height: 1.3;
    padding-right: 50px; 
    color: #fff;
}

.project-excerpt { 
    font-size: 1rem; 
    color: #94A3B8;
    margin-bottom: 25px; 
    font-weight: 300;
    /* Si el texto es larguísimo, esto evita que rompa el diseño */
    overflow-wrap: break-word; 
}

/* Footer siempre al final */
.project-footer {
    margin-top: auto; /* Empuja este bloque al fondo de la tarjeta */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #334155;
    padding-top: 20px;
}

/* ... (resto de estilos de tags y enlaces igual) ... */
.project-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
    background-color: #1e293b; border: 1px solid #334155;
    color: #94A3B8; padding: 4px 10px; border-radius: 6px; 
    font-size: 0.75rem; font-weight: 500;
}
.read-more-link { font-size: 0.9rem; font-weight: 600; color: #3B82F6; display: flex; align-items: center; transition: margin-right 0.2s; }
.project-card:hover .read-more-link { color: #60A5FA; margin-right: -5px; }

/* --- FOOTER --- */
.site-footer {
    border-top: 1px solid #1E293B;
    padding: 40px 0;
    margin-top: 60px;
    background: #020617;
    font-size: 0.9rem;
    color: #64748B;
}
.footer-content { display: flex; justify-content: space-between; align-items: center; }
.footer-right a { margin-left: 20px; color: #94A3B8; }
.footer-right a:hover { color: #3B82F6; text-decoration: underline; }

/* --- TIMELINE EXPERIENCE --- */
.timeline {
    position: relative;
    padding-left: 30px; /* Espacio para la línea */
}

/* La línea vertical */
.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #334155;
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
}

/* El punto azul */
.timeline-dot {
    position: absolute;
    left: -35px; /* Ajuste para centrarlo en la línea */
    top: 25px;   /* Alineado con la tarjeta */
    width: 12px;
    height: 12px;
    background: #3B82F6;
    border-radius: 50%;
    border: 4px solid #0B1120; /* Borde oscuro para efecto recorte */
    box-shadow: 0 0 0 1px #3B82F6; /* Brillo exterior */
}

.timeline-date {
    font-size: 0.85rem;
    font-family: 'Fira Code', monospace;
    color: #94A3B8;
    margin-bottom: 10px;
    display: block;
}

/* Ajuste móvil para que la línea no moleste */
@media (max-width: 600px) {
    .timeline { padding-left: 20px; }
    .timeline-dot { left: -26px; }
}

/* --- CONTACT PAGE --- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr; /* Izquierda más estrecha, Derecha más ancha */
    gap: 30px;
}

@media (max-width: 768px) {
    .contact-grid { grid-template-columns: 1fr; }
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}
.contact-item .icon {
    font-size: 1.5rem;
    background: rgba(255,255,255,0.05);
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
}
.contact-item strong { color: #fff; display: block; }

/* Estilos para Inputs (para cuando pongas el formulario real) */
.custom-input, 
.wpcf7-form-control-wrap input, 
.wpcf7-form-control-wrap textarea {
    width: 100%;
    background: #0B1120;
    border: 1px solid #334155;
    padding: 12px;
    border-radius: 6px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box; /* Vital para que no se salga */
}
.custom-input:focus,
.wpcf7-form-control-wrap input:focus,
.wpcf7-form-control-wrap textarea:focus {
    outline: none;
    border-color: #3B82F6;
}
/* --- SINGLE PROJECT LAYOUT --- */
.single-project-layout {
    display: grid;
    grid-template-columns: 2fr 1fr; /* 2 partes contenido, 1 parte sidebar */
    gap: 50px;
}

@media (max-width: 900px) {
    .single-project-layout { grid-template-columns: 1fr; }
    .project-sidebar { order: -1; margin-bottom: 40px; } /* En móvil, ponemos los datos arriba */
    .mobile-meta { display: block !important; }
}

/* Estilos del contenido */
.entry-content {
    font-size: 1.1rem;
    color: #cbd5e1; /* Texto gris claro muy legible */
    line-height: 1.8;
}

.entry-content h2 { margin-top: 40px; margin-bottom: 20px; font-size: 1.8rem; color: #fff; }
.entry-content h3 { margin-top: 30px; margin-bottom: 15px; font-size: 1.4rem; color: #fff; }
.entry-content p { margin-bottom: 20px; }
.entry-content ul { margin-bottom: 20px; padding-left: 20px; }
.entry-content li { margin-bottom: 10px; }

/* Sidebar Metadatos */
.meta-item { margin-bottom: 20px; }
.meta-item strong { display: block; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; color: #64748B; margin-bottom: 5px; }
.meta-item span { font-size: 1rem; color: #fff; }

.sidebar-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 5px; }

/* --- MEJORA UX: STICKY SIDEBAR --- */
/* Solo se aplica si la pantalla es grande (escritorio) */
@media (min-width: 900px) {
    .project-sidebar {
        /* Esto hace que la barra se quede fija al hacer scroll */
        position: -webkit-sticky; /* Safari */
        position: sticky;
        top: 100px; /* Se detiene a 100px del techo (debajo del header) */
        height: fit-content; /* Necesario para que calcule bien el final */
    }
}

/* --- ESTILOS MÓVILES (RESPONSIVE MENU) --- */

/* Por defecto (Escritorio), el botón hamburguesa está oculto */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    z-index: 1100; /* Por encima de todo */
}

.menu-toggle .bar {
    width: 25px;
    height: 3px;
    background-color: #fff;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* MEDIDA DE CORTE: 768px (Tablets y Móviles) */
@media (max-width: 768px) {
    
    /* Mostrar el botón hamburguesa */
    .menu-toggle {
        display: flex; 
    }

    /* Transformar el botón en una 'X' al abrirse */
    .menu-toggle.open .bar:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
    .menu-toggle.open .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.open .bar:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

    /* El menú de navegación (Contenedor) */
    .site-nav {
        position: absolute;
        top: 70px; /* Justo debajo del header */
        left: 0;
        width: 100%;
        background-color: #0B1120; /* Fondo oscuro sólido */
        border-bottom: 1px solid #334155;
        padding: 20px 0;
        
        /* Oculto por defecto en móvil */
        display: none; 
        flex-direction: column;
        align-items: center;
        box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    }

    /* Cuando añadimos la clase 'active' con JS, se muestra */
    .site-nav.active {
        display: flex;
    }

    /* Ajustar la lista de enlaces */
    .nav-menu {
        flex-direction: column;
        width: 100%;
    }

    .nav-menu li {
        margin: 0;
        width: 100%;
        text-align: center;
    }

    .nav-menu a {
        padding: 15px 0;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        display: block;
    }

    /* Ajuste especial para el botón de contacto en móvil */
    .nav-menu li.nav-btn a {
        margin: 20px auto; /* Centrado */
        display: inline-block;
        width: auto;
    }
}