/* -------------------- FONTS -------------------- */
@font-face {
  font-family: "Amiamie";
  src:
    url("fonts/amiamie/Amiamie-Regular.woff2") format("woff2"),
    url("fonts/amiamie/Amiamie-Regular.woff") format("woff");
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: "geist";
  src: url("fonts/geist/Geist-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
}

body {
  font-family: geist, sans-serif;
  font-weight: 500;
  margin: 0;
  padding: 0;
  color: #111;
  letter-spacing: 0.02rem;
  font-size: 0.8rem;
  overscroll-behavior-x: none;
}

/* HEADER */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: transparent;
  z-index: 10;
}

header h1 {
  font-size: 0.8rem;
  margin: 0;
  font-weight: 500;
}

/* Projects */
.project.is-hidden {
  display: none;
}

.project {
  background: white;
  border: none;
  box-shadow: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.main-image {
  width: 100%;
  height: auto;
  cursor: e-resize;
  display: block;
  object-fit: contain;
}

.project-meta {
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
}

.project-description {
  position: relative;
  max-height: 2.8rem;
  overflow: hidden;
  cursor: pointer;
}

.project-description p {
  margin: 0;
  line-height: 1.4;
}

.fade-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2rem;
  background: linear-gradient(to bottom, transparent, white);
  pointer-events: none;
  transition: opacity 0.3s;
}

.project-description.open {
  max-height: none;
}

.project-description.open .fade-overlay {
  opacity: 0;
}

/* Info button */
.info-button {
  cursor: help;
  transition: opacity 0.2s;
}
.info-button:hover {
  opacity: 0.7;
}

/* INFO section */
#info-section {
  position: relative;
  top: 4rem;
  width: 100%;
  color: #222;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: opacity 0.3s ease, max-height 0.3s ease;
}

#info-section.active {
  max-height: none;
  opacity: 1;
}

.info-content {
  max-width: 1200px;
  margin: auto;
  font-size: 0.8rem;
  line-height: 1.4;
  padding: 0 1.5rem;
}

/* LIGHTBOX */
#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.97);
  z-index: 100;
  display: none;
  overflow-y: auto;
  overflow-x: hidden;
}

#lightbox.open {
  display: block;
}

.lightbox-inner {
  width: 100%;
  max-width: 1420px;
  margin: auto;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.lightbox-inner img {
  max-width: 1420px;   /* limite desktop */
  width: 100%;         /* responsive */
  height: auto;
  max-height: 90vh;    /* évite de dépasser en hauteur */
  margin: auto;
  object-fit: contain;
  cursor: zoom-out;
}

/* Mobile margin fix */
@media (max-width: 700px) {
  .info-content {
    padding: 0 1.5rem;
  }
}

@media (max-width: 700px) {
  .lightbox-inner img {
    max-width: 100%;
    max-height: 85vh;
  }

  .lightbox-inner {
    padding: 1rem;
  }
}

/* Funky link */
.funky-link {
  color: #111;
  text-decoration: none;
  border-bottom: 2px dotted #eb2be1;
  transition: color 0.2s, border-color 0.2s;
}

.funky-link:hover {
  color: #eb2be1;
  border-color: #111;
}

/* Grid */
main {
  padding: 7rem 1.5rem 2rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  main {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  main {
    gap: 3rem;
    grid-template-columns: 1fr;
  }
   .lightbox-inner {
    width: 100vw;
    padding-left: 1.5rem;   /* même marge que main */
    padding-right: 1.5rem;
    box-sizing: border-box;
  }
   .lightbox-inner img {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }
}
