* {
  box-sizing: border-box;
}

body {
  font-family: "Montserrat";
  background-color: #e2eaff;
  color: #101632dd;
}

body,
div,
ul,
nav,
header,
footer,
a,
li,
label {
  margin: 0;
  padding: 0;
}

/* ------------------HEADER SECCION------------------*/

.header {
  background-color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  container-type: inline-size;
  container-name: header;
  position: relative; /* Añadido para mejor control de posicionamiento */
  font-size: 20px;
  text-align: center;
}

/* .header__open-nav-button {
  color: #48e;
  font-size: 3rem;
  font-weight: 600;
  position: absolute;
  right: 10px;
  z-index: 3; 
} */

/* Modifica ligeramente tu CSS existente */
.header__open-nav-button {
  background: none;
  border: none;
  cursor: pointer;
  color: #48e;
  font-size: 3rem;
  font-weight: 600;
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 3;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Estado cuando el menú está abierto */
.header__nav--open {
  display: flex !important;
}

.header__checkbox {
  display: none;
}

.header__nav {
  display: none;
  background-color: #fff;
  position: absolute;
  height: 100vh;
  width: 100vw;
  top: 0;
  left: 0; /* Asegura que empiece desde la izquierda */
  z-index: 2;
}

.header__nav-list {
  display: flex;
  flex-direction: column;
  /* height: 40vh; */
  margin: auto;
  margin-top: 30vh;
  margin-bottom: 20vh;
  /* justify-content: space-evenly; */
  justify-content: center;
  gap: 1rem;
}

.header__checkbox:checked ~ .header__nav {
  display: flex;
}

.header__logo {
  max-width: 100%;
  width: 64px;
  margin: 10px 20px;
  position: relative; /* Asegura que el logo esté por encima */
  z-index: 3;
}

.header__nav-item {
  list-style: none;
}

.header__nav-item a {
  color: #48e;
  text-decoration: none;
}

.header__nav-item :is(:hover, :active) {
  text-decoration: underline;
}

/* ------------------HEADER QUERIES------------------*/

@container header (min-width: 680px) {
  .header__nav {
    /* display: flex !important; */ /* Añadido !important para forzar el estilo */
    position: static;
    height: auto;
    width: auto;
    background-color: transparent;
    z-index: auto;
    display: block !important; /* Asegura que el menú se muestre en desktop */
  }

  .header__nav-list {
    flex-direction: row;
    height: auto;
    width: auto;
    gap: 20px;
    margin: 0; /* Reset del margen */
  }

  .header__open-nav-button {
    display: none !important; /* Forzar ocultar el botón */
  }

  .header__logo {
    z-index: auto; /* Reset del z-index */
  }

  .header__nav--open {
    display: block !important;
  }
}

/* Fallback con media query por si el container query no funciona */
@media screen and (min-width: 680px) {
  .header__nav {
    display: block;
    position: static;
    height: auto;
    width: auto;
    background-color: transparent;
    justify-content: space-between;
  }

  .header__nav-list {
    flex-direction: row;
    height: auto;
    width: auto;
    gap: 20px;
    margin-right: 40px; /* Añadido margen derecho para separar del logo */
  }

  .header__open-nav-button {
    display: none;
  }
}

/*------------------HEADER ENDS------------------*/

/*------------------PROFILE SECCION------------------*/

.profile {
  container-name: profile;
  container-type: inline-size;
}

.profile__wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-color: #fff;
  max-width: 1400px;
  font-size: 18px;
}

.profile__data-container {
  max-width: 600px;
  padding: 12px;
}

.profile__img-container {
  max-height: 500px;
  overflow: hidden;
}

.profile__img {
  max-width: 100%;
  width: 720px;
}

h1 {
  color: #26a;
  font-size: 1.5em;
}

h2 {
  color: #48e;
}

.profile__description {
  text-align: center;
}

.profile__experience {
  display: flex;
  list-style: none;
  flex-direction: column;
}

.profile__description-text {
  font-size: 1em;
}

/*------------------PROFILE QUERIES------------------*/

@container profile (min-width:600px) {
  .profile__wrapper {
    justify-content: center;
  }

  .profile__data-container {
    max-width: 720px;
    margin: 12px;
  }

  h1 {
    align-items: center;
    justify-content: center;
  }
}

@container profile (min-width:720px) {
  .profile__wrapper {
    flex-direction: row;
    padding: 20px;
    background-color: transparent;
    height: 90vh;
    margin: auto;
    font-size: 18px;
  }

  .profile__data-container {
    background-color: #fff;
    display: flex;
    align-items: center;
    border-radius: 0px 25px 25px 0px;
    box-shadow: 0px 0px 9px #0002;
    max-width: 600px;
    margin: 0;
  }

  h1 {
    margin-top: 0;
    font-size: 1.5em;
    text-wrap: balance;
  }

  .profile__data {
    max-width: 620px;
  }

  .profile__img-container {
    max-height: initial;
    border-radius: 25px 0px 0px 25px;
  }

  .profile__img {
    height: 100%;
    object-fit: cover;
    width: 620px;
  }
}

/*------------------PROFILE ENDS------------------*/

/*------------------EXPERIENCE SECCION------------------*/

.experience {
  container-name: experience;
  container-type: inline-size;
  margin-bottom: 20px;
}

.certificate__title-experience {
  text-align: center;
  font-size: 1.75em;
  color: #26a;
  padding: 0;
  margin: 0;
}

.experience__wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-color: #fff;
  max-width: 1400px;
  font-size: 17px;
}

.experience__description-title {
  font-size: 1.25em;
}

.experience__data-container {
  padding: 12px;
  text-align: center; /* Centra el texto horizontalmente */
}

.experience__data-container-right {
  padding: 12px;
  text-align: center; /* Centra el texto horizontalmente */
}

/*------------------EXPERIENCE QUERIES------------------*/

@container experience (min-width: 600px) {
  .experience__wrapper {
    justify-content: center;
  }
}

/* Container query para tablets (720px - 1199px) */
@container experience (min-width: 720px) and (max-width: 1199px) {
  .experience__wrapper {
    flex-direction: row;
    padding: 20px;
    background-color: transparent;
    margin: auto;
    gap: 20px;
  }

  .experience__data-container {
    background-color: #fff;
    /* display: flex; */
    align-items: center;
    border-radius: 25px;
    box-shadow: 0px 0px 9px #0002;
    max-width: 50%;
    flex: 1;
  }

  .experience__data-container-right {
    background-color: #fff;
    /* display: flex; */
    align-items: center;
    border-radius: 25px;
    box-shadow: 0px 0px 9px #0002;
    max-width: 50%;
    flex: 1;
  }

  .experience__data {
    max-width: 100%;
    padding: 20px;
  }

  .experience__description h2 {
    font-size: 1.2rem;
  }

  .experience__skills-container {
    text-align: left;
  }
}

/* Container query para desktop grande (1200px en adelante) */
@container experience (min-width: 1200px) {
  .experience__wrapper {
    flex-direction: row;
    padding: 20px;
    background-color: transparent;
    height: 90vh;
    margin: auto;
    gap: 0;
  }

  .experience__data-container {
    background-color: #fff;
    /*     display: flex; */
    align-items: center;
    border-radius: 0px 25px 25px 0px;
    box-shadow: 0px 0px 9px #0002;
    max-width: 615px;
    flex: 1;
  }

  .experience__data-container-right {
    background-color: #fff;
    /*     display: flex; */
    align-items: center;
    border-radius: 25px 0px 0px 25px;
    box-shadow: 0px 0px 9px #0002;
    max-width: 615px;
    flex: 1;
  }

  h1 {
    margin-top: 0;
    font-size: 4rem;
    text-wrap: balance;
  }

  .experience__data {
    max-width: 620px;
    padding: 20px;
  }

  .experience__description h2 {
    font-size: 1.3rem;
  }

  .experience__skills-container {
    text-align: left;
  }
}

/* Fallback con media query para navegadores que no soporten container queries */
@media screen and (min-width: 720px) and (max-width: 1199px) {
  .experience__wrapper {
    flex-direction: row;
    padding: 20px;
    gap: 20px;
  }

  .experience__data-container,
  .experience__data-container-right {
    max-width: 50%;
    border-radius: 25px;
  }
}

@media screen and (min-width: 1200px) {
  .experience__wrapper {
    flex-direction: row;
    height: 90vh;
  }

  .experience__data-container {
    border-radius: 0px 25px 25px 0px;
  }

  .experience__data-container-right {
    border-radius: 25px 0px 0px 25px;
  }
}

/*------------------EXPERIENCE ENDS------------------*/

/*------------------CERTIFICATES SECCION------------------*/

.certificate {
  background-color: #18233f;
  color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  text-align: center;
  container-name: certificates;
  container-type: inline-size;
  justify-content: flex-start;
  gap: 20px;
  padding: 40px 0;
}

.certificate__title {
  font-size: 1.75em;
  margin: 20px auto;
  max-width: 1300px;
  margin-left: auto;
  margin-right: auto;
  color: #fff;
  padding: 0 12px;
}

.certificate__container {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 1300px;
  margin: 0 auto;
  width: 100%;
  gap: 20px;
  padding: 12px;
}

.downloadable__certificates {
  background-image:
    linear-gradient(#0009, #0009), url("Seguridad-informatica.jpg");
  background-position: center;
  background-size: cover;
  display: grid;
  place-content: center;
  /* Eliminamos altura fija para que sea flexible */
  /* min-height: 88px; */ /* Altura mínima para mantener consistencia */
  height: 88px; /* Altura fija para igualdad */
}

.downloadable__certificates:hover {
  opacity: 0.74;
  outline: 2px solid #fff6;
}

.downloadable__certificates-title {
  color: #fff;
  margin: 0;
  padding: 20px;
  font-size: 1.2rem;
}

.certificate__link {
  text-decoration: none;
  color: inherit;
  display: block;
  width: 100%;
  height: 100%;
}

.certificate__link:hover {
  cursor: pointer;
}

/*------------------CERTIFICATES QUERIES------------------*/
@container certificates (min-width: 81.25rem) {
  .certificate__container {
    grid-template-columns: 1fr 1fr;
  }

  .downloadable__certificates {
    min-height: 140px;
  }
}

/*------------------CERTIFICATES ENDS------------------*/

/*------------------PROJECTS SECCION------------------*/

.projects {
  background-color: #18233f;
  color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  text-align: center;
  container-name: projects;
  container-type: inline-size;
  justify-content: space-evenly;
}

.certificate__inner {
  max-width: 1300px;
  margin: 0 auto;
  width: 100%;
}

.projects__title {
  font-size: 1.75em;
  margin-bottom: 0;
  color: #fff;
}

.projects__container {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: 1fr;
  min-height: 40vh;
  max-width: 1300px;
  margin: auto;
  width: 100%;
  gap: 12px;
  padding: 12px;
  min-height: 80vh;
}

.projects__project {
  background-image:
    linear-gradient(#0009, #0009), url("Seguridad-informatica.jpg");
  background-position: center;
  background-size: cover;
  display: grid;
  place-content: center;
}

.projects__project:hover {
  opacity: 0.74;
  outline: 2px solid #fff6;
}

.projects__project-name {
  color: #fff;
  font-size: 1.2em;
}

/* Hace que el enlace ocupe toda la tarjeta del proyecto */
.projects__project-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
  /* min-height: 200px; */
  display: grid;
  place-content: center;
}

/* Hereda el efecto hover que ya tenías en .projects__project */
/* .projects__project-link:hover {
    opacity: 0.74;
    outline: 2px solid #fff6;
} */

/*------------------PROJECTS QUERIES------------------*/

@container projects (min-width: 56.25rem) {
  .projects__container {
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  }

  .projects__project:first-child {
    grid-column: span 2;
  }

  .projects__project:nth-child(6) {
    grid-column: span 2;
  }
}

@container projects (min-width: 81.25rem) {
  .projects__container {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }

  .projects__project:first-child {
    grid-column: span 2;
    grid-row: span 2;
  }

  .projects__project:nth-child(6) {
    grid-column: span 4;
  }
}

/*------------------PROJECTS ENDS------------------*/

/* -----------------------------FOOTER STYLES (VERSIÓN INTERMEDIA)----------------------------- */

footer {
  background: linear-gradient(to bottom, #1e2d52 0%, #16203b 100%);
  color: #fffd;
  padding: 0;
  text-align: center;
  font-size: 0.9em;
  position: relative;
  margin-top: 0;
}

.footer-container {
  position: relative;
  width: 100%;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.8em;
  padding: 2em 1.5em;
  max-width: 1400px;
  margin: 0 auto;
}

.footer-name {
  font-size: 1.2em;
  list-style: none;
  font-weight: 600;
  color: #fffd;
  padding: 0.25em 0;
  text-transform: uppercase;
  margin: 0 0 0.35em 0;
  letter-spacing: 1px;
}

.footer-avatar {
  width: 4.5em;
  height: 4.5em;
  border-radius: 9999px;
  object-fit: cover;
  margin: 0.5em auto;
  display: block;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.footer-section {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 320px;
}

.footer-section p {
  font-size: 0.9em;
  line-height: 1.5;
  margin: 0;
  opacity: 0.9;
}

.contact-label {
  font-size: 0.85em;
  margin: 0.65em 0 0.3em 0 !important;
  font-weight: normal;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.contact-email {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9em;
  word-break: break-all;
  margin: 0.4em auto;
  text-align: center;
}

.footer-link {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1em;
  margin: 0.65em 0;
}

.footer-link a {
  color: #fffd;
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 0.9em;
  opacity: 0.85;
}

.footer-link a:hover {
  color: #fffd;
  opacity: 1;
  transform: translateY(-2px);
}

.footer-icon {
  width: 1.1em;
  height: 1.1em;
  stroke: currentColor;
}

.footer-copyright {
  text-align: center;
  padding: 1.2em 0 1.2em 0;
  font-size: 0.75em;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 0.5em;
  opacity: 0.7;
}

/* -----------------------------FOOTER QUERIES----------------------------- */

@media (min-width: 640px) {
  .footer-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2em;
    padding: 2.2em 2em;
  }

  .footer-section {
    max-width: none;
  }
}

@media (min-width: 1024px) {
  .footer-content {
    gap: 3em;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5em 2em;
  }

  .footer-avatar {
    width: 5em;
    height: 5em;
  }

  .footer-name {
    font-size: 1.3em;
  }
}

/* -----------------------------FOOTER ENDS----------------------------- */
