/* Reset básico */
html {
    box-sizing: border-box;
    overflow-y: scroll;  /* asegura scrollbar para todas las páginas */
}
*, *::before, *::after {
  box-sizing: inherit;
  margin: 0;
  padding: 0;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
/* Track (fondo) completamente transparente */
::-webkit-scrollbar-track {A
    background: transparent !important;
}
/* Thumb (barra) semitransparente */
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 4px;
}
/* Hover un poco más visible */
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
}


body {
    font-family: Arial, sans-serif;
    background: #2a0000; /* transición más suave que negro puro */
}

.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Menú lateral */
.side-menu {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100%;
    background: #222;
    color: white;
    padding: 20px;
    transition: left 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.side-menu.open {
    left: 0;
}

/* Imagen de perfil */
.profile-section {
    text-align: center;
    margin-bottom: 20px;
}

.profile-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
}

.profile-subtitle {
    margin-top: 10px;
    font-size: 16px;
    color: #ccc;
    text-align: center;
}

/* Iconos grandes - efecto escala de grises */
.social-icons-large {
    display: flex;
    justify-content: space-around;
    margin: 15px 0;
}

.icon-large {
    width: 36px;
    height: 36px;
    filter: grayscale(20%);
    opacity: 0.8;
    transition: filter 0.3s ease, transform 0.2s ease, opacity 0.2s ease;
    cursor: pointer;
}

.icon-large:hover {
    filter: grayscale(0%);
    transform: scale(1.12);
    opacity: 1;
}

/* Iconos pequeños */
.social-icons-small {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px; /* separación vertical entre enlaces */
    margin-bottom: 0;
}

.social-icons-small a {
    display: flex;
    align-items: center;
    gap: 6px; /* espacio entre icono y texto */
    color: #d4af37; /* dorado */
    text-decoration: none;
    font-weight: normal;
    letter-spacing: 0.3px;
    transition: color 0.25s ease, filter 0.25s ease;
}

.social-icons-small a:hover {
    color: #f5d97c; /* dorado más claro */
    font-weight: normal;
    filter: brightness(1.1);
}

.icon-small {
    width: 20px;
    height: 20px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    margin-right: 10px;
}

.social-icons-small a:hover .icon-small {
    opacity: 1;
}


/* INICIO Emojis */
.emoji-favourite::before {
    content: "⭐";
    margin-right: 0.3em;
} /* ✨   🕵️   🪧   🌐   🔱    🎯  📝  🪙  ✨*/
.emoji-academic::before {
    content: "🎓";
    margin-right: 0.3em;
}
.emoji-industry::before {
    content: "💼";
    margin-right: 0.3em;
}
.emoji-link::before {
    content: "🔗";
    margin-right: 0.3em;
}
.emoji-language::before {
    content: "🌐";
    margin-right: 0.3em;
}

/* Opcional: hacer que todos los emojis tengan un tamaño consistente */
.site-section h2 .emoji-academic,
.site-section h2 .emoji-industry {
    font-size: 1.2em;
    vertical-align: middle;
}
/* FIN Emojis */



/* ============================= */
/* Inicio Encabezado             */
/* ============================= */

/* HEADER como Grid de 2 filas */
.main-header {
    display: grid;
    grid-template-columns: auto 1fr auto; /* fila 1: izquierda | centro | derecha */
    grid-template-rows: auto auto;        /* fila 1 y fila 2 */
    align-items: center;

    position: fixed; 
    top: 0;
    z-index: 500;

    padding: 15px 20px;

    /* TRANSICIONES unificadas (ANTES: dos bloques separados) */
    transition: height 0.3s ease, padding 0.3s ease, transform 0.3s ease;

    background-image:
        linear-gradient(rgba(0,0,0,0.33), rgba(0,0,0,0.33)),
        radial-gradient(circle, rgba(0,0,0,0) 40%, rgba(0,0,0,0.7) 100%),
        url("/images/background.jpg");
    background-size: 100% 100%, 100% 100%, auto;
    background-repeat: no-repeat, no-repeat, repeat;
    background-position: center, center, top left;
    
    width: 100%;
    /*height: auto; /* se ajusta al contenido */
    height: 125px; /* altura estable, igual al margen de content */
}

.content{
    margin-top: 125px; /* igual a la altura del header */
}

/* Estado shrink general */
#main-header.shrink {
    height: 80px; /* 20% menos */
    /*transform: scaleY(0.85);  /* lo dejaste comentado, lo respeto */
    transform-origin: top;
}

/* ===== Tipografía base del header ===== */

.header-content {
    grid-column: 2;
    grid-row: 1;

    justify-self: center;
    text-align: center;
    padding-top: 0; /* elimina empuje vertical */
    padding-bottom: 7px;
    margin-top: -15px;
}

.header-content h1,
.header-content h2 {
    font-family: "EB Garamond", serif;
    font-weight: 500; /* grosor de 400, 500, 600, o 700 */
    letter-spacing: 0.5px; /* opcional */
    color: #d4af37; /* Dorado clásico */
    text-shadow: 2px 2px 5px rgba(0,0,0,0.6);
}

/* Tamaño normal (desktop) */
.header-content h1 {
    font-size: 2.38rem; /* 38px */
}
.header-content h2 {
    font-size: 1.38rem; /* 22px */
    margin-top: 5px;
}

/* h2 colapsable (desaparece en shrink sin ocupar espacio) */
.header-content h2 {
    max-height: 40px;   /* ajusta según tu h2 real */
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.25s ease;
}

#main-header.shrink .header-content h2 {
    opacity: 0;
    max-height: 0;
    pointer-events: none;
}

/* IMPORTANTE:
   Esta regla aplica solo a desktop/tablet.
   La dejo ANTES de los media queries móviles para que no pise a mobile. */
#main-header.shrink .header-content h1 {
    font-size: 1.9rem;
}

/* ===== Tablets y pantallas medianas ===== */
@media (max-width: 900px) {
    .main-header {
        height: 115px;
    }
    .content {
        margin-top: 115px;
    }
    #main-header.shrink {
        height: 70px; /* 20% menos */
    }

    .header-content {
        padding-bottom: 5px;
        margin-top: -12px;
    }    
    .header-content h1 {
        font-size: 1.9rem;
    }
    .header-content h2 {
        font-size: 1.3rem;
    }

    /* Ajuste fino de h1 en shrink para tablet (si quieres diferenciarlo) */
    #main-header.shrink .header-content h1 {
        font-size: 1.6rem;
    }
}

/* ===== Celulares ===== */
@media (max-width: 600px) {
    .main-header {
        height: 95px;
    }
    .content {
        margin-top: 95px;
    }
    #main-header.shrink {
        height: 70px; 
    }

    .header-content {
        padding-bottom: 10px;
        margin-top: -12px;
    }    
    .header-content h1 {
        font-size: 1.30rem;
    }
    .header-content h2 {
        font-size: 1.05rem;
    }

    /* OVERRIDE explícito para móviles:
       evita que el h1 crezca al hacer scroll */
    #main-header.shrink .header-content h1 {
        font-size: 1.20rem;
        margin-bottom: -12px;
    }
}
/* Desktop y tablet */
@media (min-width: 601px) {

    #main-header.shrink {
        transition: transform 0.3s ease;
    }
}





/* Selector de idioma */
/* SELECTOR — dentro del grid */
.language-select {
    grid-column: 3;
    grid-row: 1;

    justify-self: end;

    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,0.35);
    padding: 6px 10px;
    border-radius: 6px;
    backdrop-filter: blur(3px);
}
.translate-icon {
    font-size: 18px;
    color: #d4af37; /* Dorado */
    opacity: 0.9;
}
.language-select select {
    background: transparent;
    border: none;
    color: #d4af37;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    appearance: none;
}
.language-select select option {
    background: #410000;
    color: #e6e6e6;
}
@media (max-width: 600px) {
    .language-select {
        flex-direction: column;   /* emoji arriba, select abajo */
        align-items: center;      /* centrado vertical */
        gap: 2px;                 /* menos espacio entre emoji y select */
        padding: 4px 0px;         /* más compacto */
        margin-right: -20px;      /* alineado al nuevo padding */
        margin-top: -15px;
    }
    .language-select select {
        width: 54px;              /* más angosto */
        padding: 2px 0;           /* compacto */
        text-align-last: center;  /* centra el texto visible */
        font-size: 11px;
    }
}


/* OTROS AJUSTES FINALES */
/* SUBIR elementos del header en shrink (solo móviles) */
@media (max-width: 600px) {
    #main-header.shrink .header-content {
        margin-top: -20px; /* ajustable */
    }

    #main-header.shrink .language-select {
        margin-top: -17px; /* ajustable */
    }
}
@media (max-width: 600px) {
    #main-header.shrink {
        padding-top: 8px;   /* antes 15px → reduces ~7px */
        padding-bottom: 0px;
    }
    .nav-bar {
    font-size: 0.9rem;
    padding: 4px 0;
    margin-top: -10px;
    }
}



/* NAV-BAR — fila 2 del grid */
.nav-bar {
    grid-column: 1 / -1;
    grid-row: 2;

    display: flex;
    justify-content: center;
    gap: 25px;

    background-image: url("/images/border5.png");
    background-repeat: repeat;
    padding: 8px 0;

    /* neutralizar padding del header */
    margin-left: -20px;
    margin-right: -20px;
    margin-bottom: -15px;
    width: calc(100% + 40px);
}
.nav-bar a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}
/* Versión por defecto: solo se ve el texto largo */
nav a.menu-sites .short {
    display: none;
}
nav a.menu-sites .full {
    display: inline;
}
/* En pantallas pequeñas: solo se ve el texto corto */
@media screen and (max-width: 800px) {
    nav a.menu-sites .full {
        display: none;
    }
    nav a.menu-sites .short {
        display: inline;
    }
}
@media (max-width: 600px) {
    .nav-bar {
        gap: 15px;
    }
}




/* Botón hamburguesa */
/* Hamburguesa de layout (solo empuja, no se ve ni se clickea) */
.hamburger {
    grid-column: 1;
    grid-row: 1;

    width: 44px;
    height: 44px;

    /* invisible pero ocupa espacio */
    color: transparent;
    background: transparent;
    border: none;
    pointer-events: none;
}
/* Hamburguesa flotante, visible y por encima de todo */
.hamburger-float {
    position: fixed; /* ahora sigue al header */
    top: 30px;
    left: 20px;
    z-index: 3000;

    font-size: 30px;
    line-height: 1;
    color: white;
    background: transparent;
    border: none;
    cursor: pointer;

    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;

    text-shadow: 0 0 6px rgba(255, 215, 0, 0.4);
}
.hamburger-float:hover {
    transform: scale(1.1);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
}
@media (max-width: 600px) {
    .hamburger {
        margin-left: -20px; /* antes 20px */
        width: 39px;
        height: 44px;
    }
    .hamburger-float {
        left: 0px; /* antes 20px */
        top: 14px;  /* opcional */
    }
}

#hamburger-float.shrink {
    transform: translateY(-20px); 
    transition: transform 0.3s ease;
}
@media (max-width: 600px) {
    #main-header.shrink .hamburger {
        height: 37px; /* antes 44px → reduces ~7px */
    }
    #hamburger-float.shrink {
        transform: translateY(-13px); 
    }
}


/* DEBUG: Visualizar el grid del header (lo dejo tal cual lo tenías) 
.main-header {
    outline: 3px solid rgba(0, 200, 255, 0.7);
    background-color: rgba(0, 200, 255, 0.1);
}
.main-header > * {
    outline: 2px dashed rgba(255, 255, 0, 0.7);
    background-color: rgba(255, 255, 0, 0.1);
} */

/* ============================= */
/* FIN Encabezado                */
/* ============================= */



/* ============================= */
/* INICIO Contenido principal    */
/* ============================= */

.content {
    position: relative; /* necesario para el pseudo-elemento */

    padding: 20px;
    padding-bottom: 73px; /* igual a la altura de degradado */

    background-color: #410000; 
    color: #e6e6e6;

    flex: 1; /* empuja el footer hacia abajo */

    letter-spacing: 0.5px; /* entre 0.3 y 1.0 */
    font-size: 15px;
    line-height: 1.5; /* interlineado */
    column-count: 1;
    column-gap: 2rem; /* separación entre columnas */
}

.content::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 97px; /* altura degradado (60–120px) */

    background: linear-gradient(
        to bottom,
        rgba(65, 0, 0, 0) 0%,
        rgba(40, 0, 0, 0.5) 50%,
        rgba(15, 0, 0, 0.85) 80%,
        #000 100%
    );

    pointer-events: none; /* no bloquea clicks */
}

/* Activar 2 columnas solo si hay espacio */
@media (min-width: 900px) {
    .columns-2 {
        column-count: 2;
    }
}


/* Enlaces de contenido */
.content a {
    color: #d4af37; /* Dorado */
    text-decoration: none;
    font-weight: normal;
    transition: color 0.25s ease, filter 0.25s ease;
    
    word-wrap: break-word;      /* soporte antiguo */
    overflow-wrap: anywhere;    /* estándar moderno */
    word-break: break-word;     /* fallback */
    
    break-inside: avoid;        /* evitar que un enlace quede partido entre columnas */
}

.content a:hover {
    color: #f5d97c; /* más claro */
    filter: brightness(1.25);
}


.content h2 {
    text-align: left;
}

/* Evitar que imágenes o títulos se corten entre columnas */
.content img,
.content h1,
.content h2,
.content h3 {
    break-inside: avoid;
}

/* Mejora estética de párrafos en Content */
.content p {
    margin-bottom: 1.2em;
}
.site-section {
    margin-top: 2rem;
}
.site-section ul {
    margin-top: 0.8rem;
}


/* Figura bloque */
.figure-block {
    break-inside: avoid;   /* evita que se corte entre columnas */
    page-break-inside: avoid;
    display: flex;
    flex-direction: column;   /* apila imágenes y caption */
    align-items: center;      /* centra el contenido */
    margin-bottom: 1.5rem;
}
/* Contenedor de las subfiguras */
.figure-images {
    display: flex;
    justify-content: center;   /* centra el conjunto */
    align-items: center;
    flex-wrap: wrap;           /* permite apilar si no caben */
    gap: 0;                    /* evita separación horizontal */
}
.figure-images img {
    display: block;
    margin: 0;
    max-width: 100%;
}
.caption {
    color: #bbbbbb;
    display: block;
    font-size: small;
    padding: 1em 12px;
    text-align: center;
}

/* Figura flotante */
.figure-float {
    float: left;
    clear: left;           /* opcional pero útil */
    display: block;
    margin: 0 1em 1em 0;
    width: auto;           /* shrink natural */
}

.figure-float img {
    display: block;   /* impide que la imagen flote */
    height: auto;
    max-width: 100%;
}
/* Solo para la caption dentro de figuras flotantes */
.figure-float .caption {
    display: block;
    font-size: small;
    color: #bbbbbb;
    text-align: center;
    padding: 0.5em 0;     /* sin padding horizontal */
}

/* Clase genérica para fotos responsivas */
.Photo {
    width: 100%;        
    max-width: 291px;   /* límite superior opcional */
    height: auto;
    display: block;
}
/* Contenedor que permite flotar la imagen */
.Photo-container {
    float: left;       /* o right, según lo que pongas en el HTML */
    margin: 0 1em 1em 0; /* padding/margen alrededor de la foto */
    width: auto;         
    max-width: 100%;         /* no más del X% de la columna */
}
/* En pantallas pequeñas: cancelar el float */
@media (max-width: 600px) {
    .Photo-container {
        float: left;
        margin: 0 auto 1em auto;
        width: auto;   
        max-width: 44%;         /* no más del X% de la columna */
    }
}

/* ============================= */
/* FIN Contenido principal       */
/* ============================= */


.bottom-fade {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px; /* ajustable */
    pointer-events: none;
    z-index: 9999;

    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.4) 40%,
        rgba(0, 0, 0, 0.75) 70%,
        #000 100%
    );
}

/* Pie de página */
.footer {
    background: #000;
    color: white;
    text-align: center;
    padding: 15px 0;
    /* border-top: 1px solid rgba(255,255,255,0.06); /* línea sutil elegante */
    z-index: 10000; /* mayor que el bottom-fade overlay */
}
.footer nav {
    margin-top: 8px;
}
.footer a {
    color: #d4af37;
    text-decoration: none;
    margin: 0 8px;
    font-size: 0.9rem;
}
.footer a:hover {
    color: #f5d97c;
}


/* ============================= */
/* INICIO Formulario             */
/* ============================= */

/* Formulario */
.contact-form {
    display: flex;
    flex-direction: column;
}

.contact-form h3 {
    margin-bottom: 10px;
}

.contact-form label {
    margin-top: 10px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    border-radius: 5px;
    border: none;
}

.contact-form button {
    margin-top: 15px;
    padding: 10px;
    background: #444;
    color: white;
    border: none;
    cursor: pointer;
}

/* FORM Contenedor de alertas */
#formStatus {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.95rem;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.35s ease;
}
/* Tipos de alerta */
.alert-success {
    background: #e6ffed;
    color: #0a7a2f;
    border: 1px solid #8de4a1;
}
.alert-error {
    background: #ffecec;
    color: #a30000;
    border: 1px solid #ff9d9d;
}
.alert-info {
    background: #eaf4ff;
    color: #005a9e;
    border: 1px solid #9cc9ff;
}
/* Mostrar alerta */
.alert-show {
    opacity: 1;
    transform: translateY(0);
}

/* ============================= */
/* FIN Formulario                */
/* ============================= */