@font-face {
    font-family: 'IBM Plex Sans';
    src: url('../fonts/IBMPlexSans-Light.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

html, body {
    height: 100%;
    margin: 0;
}

html {
    scroll-behavior: smooth;
}

a:visited {
    color: #002FFF;; /* evita el lila predeterminado */
}

.layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #F6F6F6;
    font-family: "IBM Plex Sans", sans-serif;
    color:#002FFF;
}

header {
    padding: 0 2%;
    display:flex;
    flex: 0 0 2%;
    justify-content:space-between;
}

.hidden {
  display: none;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2%;
  position: relative;
  height: 60px;
  z-index: 1000;
  color: #002FFF; /* color del + inicial */
}

/* cursor cuando pasas sobre el + */
#menu-toggle {
  cursor: pointer;
  font-size: 2rem;
  user-select: none;
  transition: transform 0.3s, color 0.3s;
  color: #002FFF; /* + visible sobre fondo claro */
  position: relative; /* relativo al header */
  z-index: 1010; 
  margin-top:1.25rem;
}

/* cambiar + a X al abrir */
#menu-toggle.open {
  color: #fff;       /* X blanca */
}

/* barra desplegable */
#menu {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5rem;
  background-color: #002FFF;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-size: clamp(1.1rem, 2vw, 3rem);
  transform: translateY(-100%); /* empieza arriba */
  opacity: 0;                  /* invisible al inicio */
  transition: transform 0.9s ease, opacity 0.9s ease;
  z-index: 1000;
}

#menu.show {
  transform: translateY(0); /* baja a su posición */
  opacity: 1;               /* se vuelve visible */
}

#menu ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  padding: 0;
  margin: 0;
}

#menu li a {
  color: #fff;
  text-decoration: none;
}

#menu li a:hover {
  text-decoration: underline;
}

/* cambiar + a X cuando se abre */
#menu-toggle.open {
  color: #fff;
}

.lang:hover{
  text-decoration: underline;
  cursor:pointer;
}

.intro{
    font-size: clamp(1.1rem, 2.2vw, 3.4rem);
    padding:1% 3%;
    line-height: clamp(1.7rem, 3.1vw, 3.6rem);
    flex:1;
  }

p {
    margin-top: 0;
}
.intro p {
    margin-top: 0;
    margin-bottom: 0.9rem;
}
.highlight {
    background-color: #002FFF;
    padding: 0 0.3em;
    color:#fff;
    border-radius:8px;
}

#img-follow {
    position: fixed;
    pointer-events: none; /* no interfiere con clics */
    z-index: 999;
    display: none;
}

#img-follow img {
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  grid-auto-rows: auto; /* se adapta al contenido */
  padding:2%;
  gap:1.5rem;
  font-family: "IBM Plex Sans", sans-serif;
  color:#002FFF;
  line-height:2rem;
}

.project {
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content:space-around;
  text-align: center;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: bold;
}

.project img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  transition: transform 0.3s ease;
}

.description{
    font-size: 1rem;
  font-weight: bold;
}

/* efecto zoom suave */
.project:hover img {
  transform: scale(1.05);
}
.project h3 {
  font-size: 1.1rem;
  margin: 0;
}

.project .title {
  position: absolute;
  inset: 0; /* ocupa todo el contenedor */
  background: rgba(0, 47, 255, 0.8); /* azul semitransparente */
  color: white;
  display: flex;
  flex-direction:column;
  align-items: center;
  justify-content: space-around;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 6px; /* igual que la imagen */
  text-align: center;
  padding: 1rem;
}

/* al pasar el ratón aparece overlay + título */
.project:hover .title {
  opacity: 1;
}

.cv{
    font-size: clamp(1rem, 1.4vw, 1.8rem);
    padding:1% 2%;
    line-height: clamp(1.5rem, 2.2vw, 2.4rem);
    flex:1;
}

.cv summary {
  cursor: pointer;
  list-style: none;
  outline: none;
  font-weight: bold;
  margin-bottom: 0.5rem;
  font-size: clamp(1.4rem, 1.9vw, 2.4rem);
  position:relative;
}


.cv summary::-webkit-details-marker {
  display: none; /* quita el triangulito en Chrome/Safari */
}

/* Un pequeño efecto para el highlight */
.cv summary .highlight {
  background-color: transparent;
  color: #002FFF;
  padding: 0.1em 0.3em;
  border-radius: 6px;
  transition: background-color 0.25s ease, color 0.25s ease;
}


.cv summary:hover .highlight {
  background-color: #001FCC;
  color: #fff;
}

/* Espaciado del contenido */
.cv p {
  margin: 0 0 1rem 0;
  padding: 0 0.8em;
}

.cv details[open] summary {
  background-color: transparent;
  color: #002FFF;
}

.cv details[open] summary .highlight {
  background-color: #002FFF;
  color: #fff;
}

.cv summary {
  padding: 0.3em 0.5em;
  transition: background-color 0.25s ease, color 0.25s ease;
}

@media (max-width: 768px) {

  .hover-img {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4em; 
    touch-action: manipulation;
  }

  .ghost-thumb {
    width: 48px;
    height: 32px;
    flex-shrink: 0;

    background-size: cover;
    background-position: center;
    border-radius: 4px;
    margin-left: -0.2em;
  transform: translateY(0.1em);
  pointer-events: auto; 
  }

  #img-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#img-overlay img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 8px;
}

}
