/* ============================================== */
/* ESTILOS GENERALES Y ENCABEZADO */
/* ============================================== */

/* --- IMPORTAR FUENTES (Debe ir al inicio de todo) --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');

/* ============================================== */
/* ESTILOS GENERALES Y ENCABEZADO */
/* ============================================== */

body {
    font-family: 'Inter', -apple-system, sans-serif; /* <-- LÍNEA MODIFICADA */
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #0d1117;
    color: #F0F6FC;
}
    


header, main, footer {
    width: auto;
    margin: 0 auto;
}

header {
    background-color: #0d1117;
    color: #F0F6FC;
    text-align: center;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
        border:#36826B;

}

header h1 {
    margin: 0;
    padding: 0;
}

/* ============================================== */
/* ESTILOS DEL MENÚ (DESKTOP) */
/* ============================================== */
.navbar {
    margin-top: 0px;
    height: auto; /* CORRECTO: Altura automática */
    display: flex;
    border-radius: 20px;
    justify-content:center;/* CORRECTO: Logo a la izq, links a la der */
    align-items: center;
    background-color: #333;
    border-top: 1px solid #555;
    border-bottom: 1px solid #555;
    box-shadow: 0 2px 4px #36826B;


}

.logo img {
    width:400px;
    height: auto; /* Altura automática para mantener proporción */
    object-fit: contain;
    vertical-align: middle; /* Alinea mejor la imagen */
}

.nav-links {
    list-style: none;

    display: flex;
}

.nav-links li a {
    text-decoration: none;
    display: block;
    color: #F0F6FC;
    padding: 1rem;
    border-radius: 20px;
    transition: background-color 0.3s;
}

.nav-links li a:hover {
    background-color:#36826B;


}
/* ============================================== */
/* ESTILOS DEL BUSCADOR */
/* ============================================== */
.search-container {
    /* Quitamos 'max-width', 'margin: auto' y 'padding'.
      Tu <main> ya se encarga de centrar y dar padding.
      Esto solo añade espacio arriba y abajo.
    */
    margin-top: 30px;
    margin-bottom: 10px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    
}

.search-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 1.1em;
    border-radius: 20px;
}

#search-box {
    width: 100%;
    background-color: #333;
    color: #F0F6FC;
    padding: 12px;
    border: 1px solid #333;
    border-radius: 20px;
    box-sizing: border-box;
    font-size: 1em;
    box-shadow: 0 2px 4px #36826B;
    
}
#search-box:focus {
    /* 1. Quitamos el resplandor azul por defecto */
    outline: none;
    
    /* 2. Cambiamos el color del borde (la línea pegada) 
       a tu color de logo */
    border-color: #36826B;
    
    /* 3. Añadimos NUESTRO PROPIO resplandor (glow) 
       usando el color de tu logo con transparencia (0.5) */
    box-shadow: 0 0 0 3px rgba(54, 130, 107, 0.5);
}

/* Estilos para la tarjeta que envuelve la lista */
.post-list-card {
    background-color: #333;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 20px 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Modo oscuro para la tarjeta */
body.dark .post-list-card {
    background-color: #2b2b2b;
    border-color: #444;
}


/* ============================================== */
/* PAGINACIÓN CON CSS (¡LA MAGIA!) */
/* ============================================== */

/* ============================================== */
/* PAGINACIÓN CON CSS (¡LA MAGIA!) - CORREGIDO */
/* ============================================== */

/* 1. CORREGIDO: Apunta a los hijos (.post-preview) 
      dentro de .card-container (o .post-preview-card)
*/
.post-preview-card .post-preview:nth-child(n+11) {
    display: none;
}

/* 2. CORREGIDO: Cuando se busca, oculta los hijos 
      individuales (.post-preview)
*/
.post-list-container.is-searching .post-preview {
    display: none; 
}
/* ============================================== */
/* ESTILOS DEL BOTÓN "VOLVER ARRIBA" */
/* ============================================== */

#back-to-top-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    
    position: fixed; /* ¡La clave! Se queda fijo en la pantalla */
    bottom: 20px;
    right: 20px;
    
    width: 50px;
    height: 50px;
    
    background-color: #333;
    color: #F0F6FC;
    border: none;
    border-radius: 50%; /* Lo hace un círculo */
    cursor: pointer;
    font-size: 1.5em; /* Tamaño de la flecha */
    z-index: 1000; /* Se asegura que esté por encima de todo */

    /* Lo ocultamos por defecto */
    opacity: 0;
    visibility: hidden;
    
    /* Animación suave */
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

/* Esta es la clase que JS añadirá
  cuando el usuario haga scroll
*/
#back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

/* Efecto hover */
#back-to-top-btn:hover {
    background-color: #555;
}
/* ============================================== */
/* ESTILOS BARRAS ANIMADAS */
/* ============================================== */
#background-bars {
    padding:0px 2px    ; /* Padding ajustado */
    border-radius: 0px;
    /* Altura del contenedor de las barras */
    height: 100px; /* <-- ¡Ajusta esta altura como quieras! */
    
    display: flex;
    align-items: flex-end; 
    
    /* Color de fondo del contenedor (opcional) */
    background-color: #0d1117; 
    
    overflow: hidden; 
    
    /* Importante: lo centramos igual que el header/main */
    max-width: auto;
    margin: 2px auto;
}

.bar {
    flex-grow: 1; 
    height: 10%;  /* Altura inicial de la barra */
    
    /* Color de la barra */
    background-color: #333;
    
    border: 1px solid #F0F6FC; 
    
    /* Velocidad de la animación de altura */
    transition: height 2s ease-in-out;
}
/* ============================================== */
/* ESTILOS DEL BOTÓN DE HAMBURGUESA (DESKTOP) */
/* ¡¡ESTA ES LA SECCIÓN QUE MOVIMOS!! */
/* ============================================== */
.menu-toggle {
    display: none; /* Oculto por defecto en escritorio */
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.menu-toggle .bar {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #fff;
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

/* ============================================== */
/* ESTILOS DE POSTS Y OTROS */
/* ============================================== */
.post-preview-card {
    background-color: #0d1117;
    padding: 30px;
    border-radius: 20px;
    border: 1px solid #333;
    box-shadow: 0 2px 4px #36826B;
    margin: 20px auto;
}
/* ... (todos tus otros estilos como .post-meta, .read-more, .back-link, etc. van aquí) ... */
.post-preview-card h3 { margin-top: 0; color: #F0F6FC;     border-radius: 20px;
}
.post-meta { font-size: 0.9em; color: #fff;left: 10px;}
.read-more:hover { background-color: #003#fff; }
.post-content { left: 10px;background-color: #fff; padding: 30px; border-radius: 8px; border: 1px solid #ddd; }
.back-link { display: block; margin-top: 20px; color: #0056b3; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.post-preview-card h2 { margin-top: 0; text-align: center; }
.card-content{padding-bottom: 20px;padding-left: 20px;    transition: background-color 0.3s ease-in-out;    border-radius: 20px;
}
/* --- Estilo de Enlaces (Leer más) --- */
.card-content a,
.read-more { /* (Si usas esta clase) */
    color: #6BC7AB;
    text-decoration: none; /* (Opcional, para quitar el subrayado) */
    transition: color 0.3s ease;
}

/* (Opcional) Efecto hover */
.card-content a:hover,
.read-more:hover {
    color: #F0F6FC; /* Cambia a blanco al pasar el ratón */
}
.card-content:hover{background-color: #36826B;}

#contenido{
    padding-top: 20px;padding-left: 50px;   padding-right: 50px;  
    transition: background-color 0.3s ease-in-out;    
    border-radius: 20px;
    border-top: 1px solid #555;
    border-bottom: 1px solid #555;
    box-shadow: 0 2px 4px #36826B;
    margin: 30px auto;


}
/* ============================================== */
/* ESTILO DEL FORMULARIO DE CONTACTO */
/* ============================================== */
.form-container {
    background-color: #0d1117;
    padding: 30px;
    border-radius: 20px;
    border: 1px solid #333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 30px auto;
    
}
/* ... (todos tus estilos del formulario: .form-container h2, .form-group, .submit-button, etc.) ... */
.form-container h2 { margin-top: 0; text-align: center; }
.form-container p { text-align: center; margin-bottom: 25px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; }
.form-group input, .form-group textarea { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box; font-family: inherit; font-size: 1em; }
.submit-button { display: block; width: 100%; padding: 15px; background-color: #0056b3; color: #fff; border: none; border-radius: 5px; font-size: 1.1em; font-weight: bold; cursor: pointer; transition: background-color 0.3s; }
.submit-button:hover { background-color: #003d82; }


/* ============================================== */
/* ESTILOS MODO OSCURO */
/* ============================================== */
.switch { background: #343D5B; border-radius: 1000px; border: none; position: relative; cursor: pointer; display: flex; outline: none; width: 60px; padding: 3px; margin: 10px auto; }
.switch span { width: 24px; height: 24px; line-height: 24px; display: block; background: none; color: #fff; }
.switch::after { content: ""; display: block; width: 26px; height: 26px; position: absolute; background: #F1F1F1; top: 2px; left: 4px; border-radius: 100px; transition: .3s ease all; }
.switch.active { background: #0d83d1; }
.switch.active::after { left: 30px; }

body.dark { background-color: #1a1a1a; color: #e0e0e0; }
body.dark header { background-color: #222; color: #fff; }
body.dark .post-preview-card, body.dark .post-content { background-color: #2b2b2b; border-color: #444; box-shadow: 0 2px 4px rgba(0,0,0,0.4); }
body.dark .post-preview-card h3, body.dark .back-link { color: #58a6ff; }
body.dark .read-more { background-color: #238636; }
body.dark .read-more:hover { background-color: #2ea043; }
body.dark .form-container { background-color: #2b2b2b; border-color: #444; }
body.dark .form-group label { color: #e0e0e0; }
body.dark .form-group input, body.dark .form-group textarea { background-color: #3a3a3a; border-color: #555; color: #fff; }

/* ============================================== */
/* ESTILO DEL PIE DE PÁGINA */
/* ============================================== */
footer {
    text-align: center;
    margin-top: 40px;
    color: #777;
}

/* ============================================== */
/* ESTILOS RESPONSIVOS (PARA MÓVILES) - CORREGIDO */
/* ============================================== */
@media (max-width: 700px) {

    /* --- 1. NAVBAR (La barra del icono ☰) --- */
    .navbar {
        height: max-content;

        
        /* === PARA HACERLA FULL-WIDTH === */
        /* Asumiendo que el padding del body es 1rem */


        /* === PARA COMPENSAR EL MARGEN === */
        /* Añadimos padding para que no afecte el cálculo de ancho */
        padding-top: 15px;
        padding-bottom: 15px;        
        /* === ¡¡LO MANTENEMOS!! === */
        /* Como te gusta, centramos el contenido (el icono ☰) */
        justify-content: center; /* <-- ¡¡MANTENIDO!! */

        /* === ¡¡IMPORTANTE!! === */
        /* Quitamos los bordes redondeados para que se vea bien en full-width */
        border-radius: 0px;
    }

    /* --- OCULTAMOS EL LOGO EN MÓVIL --- */
    /* (Para que el icono ☰ se pueda centrar perfectamente) */
    .navbar .logo {
        display: none;
    }

    /* --- 2. ICONO HAMBURGUESA (☰) --- */
    .menu-toggle {
        display:flex; 
        /* ¡¡IMPORTANTE!! Quitamos el margen, 
           ya que justify-content: center se encarga de todo */
        margin-right: 0; 
    }

    /* --- 3. MENÚ DESPLEGABLE (El que te gusta) --- */
    .nav-links {
        display: none;
        flex-direction:column;
        position:absolute;
        
        /* ¡Correcto! (Para que esté encogido) */
        left:0px;  
        right: 0px; 
        
        top: 148px; /* Ajusta este valor */
        background-color: #333;
        text-align:center;
        box-shadow:  rgba(0,0,0,0.1); 
        border-radius: 0%;
        
        padding: 0px;
    }

    /* 4. CLASE QUE AÑADE JAVASCRIPT */
    .nav-links.active {
        display: flex; /* La mostramos */
        
    }

    .nav-links li {
        margin-left: 0;
        margin-top: 0;
        width: 100%;
    }

    /* --- 5. TEXTO DEL MENÚ (Inicio, Proyectos...) --- */
    .nav-links li a {
        padding: 15px 20px; 
        border-bottom: 1px solid #444;
    }

    .nav-links li:last-child a {
        border-bottom: none;
    }
}

/* --- Contenedor Principal (Hero) --- */
.hero-container {
    display:flex;
    padding-top: 300px;
    align-items: center; /* Centra verticalmente la imagen y el texto */
    gap: 3rem; /* Espacio entre la imagen y el texto */
    max-width: auto; /* Ancho máximo del componente */
    background-color: #0d1117; /* Fondo blanco para el "card" */
    padding: 1rem;
    margin-top: 30px;
    border-radius: 12px;
    border: 1px solid #333;
    box-shadow: 0 2px 4px #36826B;}

/* --- Imagen de Perfil --- */
.profile-img {
    width: 150px;
    height: 150px;
    border-radius: 50%; /* Esto la hace circular */
    object-fit: cover; /* Evita que la imagen se estire */
    flex-shrink: 0; /* Evita que la imagen se encoja */
}

/* --- Bloque de Texto --- */
.hero-text {
    display: flex;
    flex-direction: column;
}

/* --- Tipografía --- */
.hero-text h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0; /* Poco margen inferior */
    color: #F0F6FC;
}

.hero-text p {
    font-size: 1rem;
    color: #F0F6FC; /* Un gris más claro para el párrafo */
    margin: 0 0 1.5rem 0; /* Espacio antes de los iconos */
}

/* --- Iconos Sociales --- */
.social-icons {
    display: flex;
    gap: 1.5rem; /* Espacio entre iconos */
}

.social-icons a {
    text-decoration: none;
    color: #777; /* Color gris sutil para los iconos */
    font-size: 1.5rem; /* Tamaño del icono */
    transition: color 0.3s ease; /* Transición suave al pasar el ratón */
}

.social-icons a:hover {
    color: #000; /* Color más oscuro al pasar el ratón */
}

/* --- Diseño Responsivo (Para Móviles) --- */
@media (max-width: 700px) {


    .hero-container {
        flex-direction: column; /* Apila la imagen y el texto verticalmente */
        padding: 2rem;
        text-align: center; /* Centra el texto */
        gap: 1.5rem;
    }

    .hero-text h1 {
        font-size: 2rem; /* Título más pequeño en móviles */
    }

    .social-icons {
        justify-content: center; /* Centra los iconos */
    }
}