/* Base styles */
body {
  margin: 0;
  padding: 0;
  font-family: "consolas", sans-serif;
  font-weight: 400;
  font-style: normal;
  background-color: #070109;
  color: #ffffff;
}

/* Header & Hero styles */
header {
  width: 100%;
  overflow: hidden;
}

header picture {
  display: block;
  max-width: 100%;
}

header picture img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 40vh;
  object-fit: cover;
}

/* Exposition title section */
.expo-title h2 {
  font-size: 1.2rem;
  margin-bottom: 0;
  margin-top: 0;
}

.expo-details {
  display: flex;
  margin-top: 1.5rem;
  flex-direction: column;
  align-items: flex-start;
  margin: 0 12.5%;
}

.expo-details p {
  margin: 0.3rem 0;
}

.venue {
  margin-top: 1rem;
  font-weight: bold;
}

/* Student cards section */
#liste-eleves {
  display: flex;
  flex-direction: column;
  padding: 0 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

.participants-title {
  text-align: center;
  color: #9792df;
  margin-top: 4rem;
  font-size: 1.3rem;
}

/* Student card */
.carte {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  margin-bottom: 2rem;
  color: #fff;
  background-color: transparent;
  text-decoration: none;
  position: relative;
  border-radius: 0.5rem;
  overflow: hidden;
}

/* Fixed image container with consistent dimensions */
.carte .image-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 100%; /* Creates a perfect square */
  overflow: hidden;
}

.carte img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* This will crop the image to fit the container */
  object-position: center; /* Centers the image */
}

/* Apply the consistent approach to all images, even those without a container */
.carte > img {
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  position: relative;
  object-fit: cover;
}

.carte .image-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, #a38ce8, #5c4f82);
  mix-blend-mode: soft-light;
  z-index: 1;
  pointer-events: none;
}

.texte {
  padding-top: 1rem;
  margin-left: 0;
}

.titre-eleve {
  margin: 0;
  font-size: 1.2rem;
  color: #eab2c4;
}

.texte-citation {
  font-size: 0.9rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  color: #ccc;
}

.portfolio-link {
  display: flex;
  align-items: center;
  color: #fff;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.portfolio-link svg {
  margin-right: 0.5rem;
}

/* Footer */
footer {
  background: #070109;
  color: #ffffff;
  padding: 2rem 1rem;
  text-align: center;
  border-top: 1px solid rgba(151, 146, 223, 0.3);
}

.footer-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-section {
  margin: 0 auto;
}

.footer-section:nth-of-type(3) p {
  margin: 0.5rem;
}

.tim,
.m9 {
  max-width: 150px;
  margin: 0 auto 1rem;
}

.social-links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.footer-section a {
  color: #ccc;
  text-decoration: none;
}

.footer-section a:hover {
  color: #fff;
}

.site-college {
  display: flex;
  justify-content: center;
  flex-direction: row;
}

.site-college svg {
  margin-right: 0.5rem;
}

.credits {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: #999;
}

/* Media queries for larger screens */
@media (min-width: 768px) {
  header {
    display: flex;
    flex-direction: row;
    justify-content: center;
  }
  .expo-details {
    align-items: flex-start;
  }
  #liste-eleves {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0 2rem;
  }

  .carte {
    flex: 0 0 calc(50% - 2rem); /* Fixed width at 50% minus margins */
    margin: 1rem;
    flex-direction: row;
    height: 16rem;
  }

  .carte .image-container {
    flex: 0 0 45%;
    height: 100%;
    padding-bottom: 0;
    position: relative;
  }

  /* Update the direct img selector for cards that don't use the container */
  .carte > img {
    flex: 0 0 40%;
    height: 100%;
    padding-bottom: 0;
    position: relative;
  }

  .texte {
    flex: 1;
    margin-left: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 0;
  }

  .footer-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    text-align: left;
    max-width: 1200px;
    margin: 0 auto;
  }

  .social-links {
    align-items: flex-start;
  }

  .site-college {
    justify-content: flex-start;
    margin: 0.5rem;
  }
}

/* Overlay styles */
.overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
  width: 100%;
  opacity: 0;
  transition: 0.5s ease;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.texte-overlay {
  color: white;
  font-size: 1rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.carte:hover .overlay {
  opacity: 1;
}
