/* ============================================================
   PAGE PROJETS · Styles spécifiques
   ============================================================ */

/* Bannière */
.projets-banner {
  position: relative;
  height: 40vh;
  min-height: 300px;
  background-size: cover;
  background-position: center 30%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-top: 80px;
}

.banner-content {
  position: relative;
  z-index: 2;
}

.banner-title {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: clamp(42px, 8vw, 96px);
  letter-spacing: -0.03em;
  color: white;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.banner-title em {
  font-style: italic;
  color: var(--pink);
  font-weight: 300;
}

/* Main */
.projets-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 60px 24px 100px;
}

/* Filtres */
.filters-section {
  margin-bottom: 48px;
  text-align: center;
}

.filter-group {
  margin-bottom: 32px;
}

.filter-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--ink-dim);
  margin-bottom: 16px;
  display: block;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.filter-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  padding: 8px 20px;
  border-radius: 99px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--ink-dim);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--pink);
  color: var(--pink);
}

.filter-btn.active {
  background: var(--pink);
  color: white;
  border-color: var(--pink);
}

/* Sections de catégorie */
.category-section {
  margin-bottom: 60px;
  text-align: left;
}

.category-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 24px;
  color: var(--pink);
  margin-bottom: 20px;
}

.category-definition {
  max-width: 720px;
  margin: -8px 0 24px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-dim);
  text-align: left;
}

@media (max-width: 600px) {
  .category-definition {
    font-size: 14px;
    margin-bottom: 20px;
  }
}

/* Grille projets */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 20px;
}

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

@media (max-width: 600px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* Carte projet */
.project-card {
  aspect-ratio: 1 / 1;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  position: relative;
  animation: fadeInUp 0.5s ease forwards;
  animation-delay: calc(var(--i, 0) * 0.05s);
  opacity: 0;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1;
  pointer-events: none;
  transition: background 0.3s;
}

.project-card:hover::before {
  background: rgba(0, 0, 0, 0.55);
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border-color: var(--pink);
}

.project-card-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.project-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 2;
}

.project-card:hover .project-card-overlay {
  opacity: 1;
}

.project-card-overlay span {
  color: white;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.2em;
}

.project-card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82), transparent);
  z-index: 3;
}

.project-card-category {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.68);
  letter-spacing: 0.14em;
  margin-bottom: 8px;
  display: inline-block;
  transition: color 0.3s;
}

.project-card:hover .project-card-category {
  color: rgba(255, 255, 255, 0.9);
}

.project-card-title {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 4px;
  color: white;
}

/* Modal projet */
.project-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: none;
}

.project-modal.open {
  display: flex;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.modal-container {
  position: relative;
  max-width: 1000px;
  width: 80%;
  max-height: 78vh;
  background: var(--bg-card);
  border-radius: 24px;
  overflow: auto;
  z-index: 1001;
  border: 1px solid var(--line);
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 20px;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--pink);
  transform: rotate(90deg);
}

.modal-content {
  display: grid;
  grid-template-columns: 55% 45%;
  gap: 0;
  height: 100%;
}

.modal-media {
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  min-height: 360px;
}

.modal-media img,
.modal-media video {
  max-width: 88%;
  max-height: 56vh;
  border-radius: 12px;
  object-fit: contain;
}

.modal-media iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.modal-info {
  padding: 32px;
  overflow-y: auto;
  background: var(--bg-card);
}

.modal-info h3 {
  font-family: 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.modal-info .modal-category {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--pink);
  letter-spacing: 0.2em;
  margin-bottom: 20px;
  display: inline-block;
}

.modal-info p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: 24px;
}

/* Mode image réduit + texte visible */
.project-modal.image-full-mode .modal-container {
  max-width: 70vw;
  width: 70vw;
  max-height: 72vh;
}

.project-modal.image-full-mode .modal-content {
  display: grid;
  grid-template-columns: 58% 42%;
  min-height: 65vh;
}

.project-modal.image-full-mode .modal-media {
  min-height: 60vh;
  padding: 18px;
}

.project-modal.image-full-mode .modal-media img {
  max-width: 78%;
  max-height: 58vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
}

.project-modal.image-full-mode .modal-info {
  display: block;
  padding: 32px;
  overflow-y: auto;
  background: var(--bg-card);
}

/* Responsive modal */
@media (max-width: 768px) {
  .modal-container {
    width: 90%;
    max-width: 90vw;
    max-height: 84vh;
  }

  .modal-content {
    grid-template-columns: 1fr;
  }

  .modal-media {
    min-height: 250px;
    padding: 16px;
  }

  .modal-media img,
  .modal-media video {
    max-width: 90%;
    max-height: 38vh;
  }

  .modal-info {
    padding: 24px;
  }

  .project-modal.image-full-mode .modal-container {
    width: 88%;
    max-width: 88vw;
    max-height: 82vh;
  }

  .project-modal.image-full-mode .modal-content {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .project-modal.image-full-mode .modal-media {
    min-height: 38vh;
    padding: 16px;
  }

  .project-modal.image-full-mode .modal-media img {
    max-width: 85%;
    max-height: 38vh;
  }

  .project-modal.image-full-mode .modal-info {
    display: block;
    padding: 24px;
  }
}

/* Animation fade pour les cartes */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.project-modal.open .project-card-info {
  background: none;
}

/* ============================================================
   PDF responsive dans la modale
   ============================================================ */

.modal-media iframe {
  width: 100%;
  min-height: 60vh;
  border: none;
  border-radius: 12px;
  background: white;
}

.pdf-mobile-help {
  display: none;
}

@media (max-width: 768px) {
  .project-modal.open {
    align-items: flex-start;
    padding: 12px;
    overflow-y: auto;
  }

  .modal-container {
    width: 100%;
    max-width: 100%;
    max-height: none;
    height: auto;
    border-radius: 18px;
  }

  .modal-content {
    display: flex;
    flex-direction: column;
  }

  .modal-media {
    width: 100%;
    min-height: auto;
    padding: 12px;
    display: block;
  }

  .modal-media iframe {
    width: 100%;
    height: 70vh;
    min-height: 500px;
  }

  .modal-info {
    padding: 20px;
  }

  .modal-info h3 {
    font-size: 22px;
  }

  .modal-info p {
    font-size: 15px;
  }

  .pdf-mobile-help {
    display: block;
    width: 100%;
    margin-bottom: 12px;
    text-align: center;
  }

  .pdf-mobile-help a {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--pink);
    color: white;
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
  }
}


/* ============================================================
   RESPONSIVE DESKTOP + PDF : modale plus confortable
   À placer à la fin du fichier pour écraser les anciens réglages
   ============================================================ */

/* Ordinateur / grands écrans */
@media (min-width: 769px) {
  .project-modal.open {
    padding: 32px;
  }

  .modal-container {
    width: min(92vw, 1380px);
    max-width: 1380px;
    height: min(86vh, 860px);
    max-height: 86vh;
    overflow: hidden;
  }

  .modal-content {
    height: 100%;
    display: grid;
    grid-template-columns: minmax(0, 64%) minmax(320px, 36%);
  }

  .modal-media {
    height: 100%;
    min-height: 0;
    padding: 18px;
    overflow: hidden;
  }

  .modal-info {
    height: 100%;
    overflow-y: auto;
    padding: 36px;
  }

  .modal-media iframe {
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 14px;
    background: white;
  }

  /* Cas spécial PDF : on donne plus de place au document */
  .project-modal.pdf-mode .modal-container {
    width: min(94vw, 1500px);
    max-width: 1500px;
    height: 88vh;
    max-height: 88vh;
  }

  .project-modal.pdf-mode .modal-content {
    grid-template-columns: minmax(0, 70%) minmax(300px, 30%);
  }

  .project-modal.pdf-mode .modal-media {
    align-items: stretch;
    justify-content: stretch;
    padding: 14px;
  }

  .project-modal.pdf-mode .modal-media iframe {
    height: calc(88vh - 28px);
  }

  .project-modal.pdf-mode .pdf-mobile-help {
    display: none;
  }

  /* Images / vidéos : taille plus équilibrée sur desktop */
  .modal-media img,
  .modal-media video {
    max-width: 100%;
    max-height: 78vh;
    object-fit: contain;
  }
}

/* Écrans moyens : évite que la colonne texte soit trop serrée */
@media (min-width: 769px) and (max-width: 1100px) {
  .modal-container {
    width: 94vw;
    height: 84vh;
  }

  .modal-content,
  .project-modal.pdf-mode .modal-content {
    grid-template-columns: minmax(0, 60%) minmax(280px, 40%);
  }

  .modal-info {
    padding: 28px;
  }
}

/* Téléphone : garde la version verticale et scrollable */
@media (max-width: 768px) {
  .project-modal.open {
    align-items: flex-start;
    padding: 12px;
    overflow-y: auto;
  }

  .modal-container,
  .project-modal.pdf-mode .modal-container {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
    border-radius: 18px;
    overflow: visible;
  }

  .modal-content,
  .project-modal.pdf-mode .modal-content {
    display: flex;
    flex-direction: column;
  }

  .modal-media,
  .project-modal.pdf-mode .modal-media {
    width: 100%;
    min-height: auto;
    padding: 12px;
    display: block;
  }

  .modal-media iframe,
  .project-modal.pdf-mode .modal-media iframe {
    width: 100%;
    height: 70vh;
    min-height: 500px;
    border-radius: 12px;
    background: white;
  }

  .modal-info {
    padding: 20px;
  }

  .modal-info h3 {
    font-size: 22px;
  }

  .modal-info p {
    font-size: 15px;
  }

  .pdf-mobile-help {
    display: block;
    width: 100%;
    margin-bottom: 12px;
    text-align: center;
  }

  .pdf-mobile-help a {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--pink);
    color: white;
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
  }
}
