/* ========== Optimisation du CSS Projets ========== */

/* ---------------------------------
----------- Grille de présentation
---------------------------------- */
.projet-grid {
  padding: 0 5vw;
  display: grid;
  /* 3 colonnes égales */
  grid-template-columns: repeat(3, 1fr); 
  /* On définit des zones pour placer nos blocs précisément */
  grid-template-areas: 
    "p1 p2 p3"
    "p4 p5 p3"
    "p4 p6 p7";
  grid-auto-rows: 200px; /* Taille augmentée comme demandé */
  gap: 20px;
  max-width: 1200px;
  margin: 30px auto;
}

/* Placement des blocs spécifiques selon ton schéma */
.projet-grid-item:nth-child(1) { grid-area: p1; }
.projet-grid-item:nth-child(2) { grid-area: p2; }
.projet-grid-item:nth-child(3) { grid-area: p3; } /* Le 3 prend 2 lignes à droite */
.projet-grid-item:nth-child(4) { grid-area: p4; } /* Le 4 prend 2 lignes à gauche */
.projet-grid-item:nth-child(5) { grid-area: p5; }
.projet-grid-item:nth-child(6) { grid-area: p6; }
.projet-grid-item:nth-child(7) { grid-area: p7; }

.projet-grid-item {
  background-color: var(--color-2);
  padding: 15px;
  border-radius: 10px;
  display: flex;
  position: relative; /* INDISPENSABLE pour le badge */
  overflow: hidden; /* Évite que les images dépassent */
}

.projet-grid-item:nth-child(3) img, 
.projet-grid-item:nth-child(4) img {
  height: 100%;
  width: auto;
  object-fit: cover;
}

.projet-grid-item:hover {
  transform: translateY(-5px);
  transition: transform 0.3s ease;
}

.projet-grid-item:not(:hover) {
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.projet-grid-item a {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.projet-grid-item a div.project-thumbnail {
    width: 100%;
    height: 75%; /* On garde la zone pour le titre en dessous */
    overflow: hidden; /* Coupe ce qui dépasse si besoin */
    display: flex;
    justify-content: center;
    align-items: center;
}

.projet-grid-item a div.project-thumbnail img {
    /* Largeur et hauteur automatiques sur le conteneur */
    width: 100%;
    height: 100%;
    
    /* LA propriété magique : */
    object-fit: contain; 
    
    /* Optionnel : centre l'image sur le sujet principal */
    object-position: center; 
}

.projet-grid > div:nth-child(10n+4) a div img, .projet-grid > div:nth-child(10n+5) a div img {
  width: 105%;
  height: 12vw;
}

.projet-grid-item a div.project-info {
    width: 100%;
    height: 25%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.projet-grid-item a div.project-info h3 {
    font-size: 25px !important;
    font-weight: bold;
    margin: 0;
    color: black;
	text-align: center;
}

/* ---------------------------------
----------- Vue détaillée
---------------------------------- */

/* ------- Header ------- */

.header-content {
    background-color: var(--color-4);
    color: var(--color-2);
    border-radius: var(--border-radius);
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 20px;
}

.projets-back-button {
  height: 30px;
  width: 30px;
  background-image: url(../img/back_arrow.svg);
  background-size: 12px;
  background-repeat: no-repeat;
  background-position: center;
  filter: var(--filter-blanc);
  border: 1px solid black;
  border-radius: 999px;
  margin-right: 5%;
}

.projets-back-button:hover {
	filter: none;
	transition: .5s;
}

.header-content div {
  width: 60%;
}

.header-content div.header-image {
  width: 30%;
  display: flex;
  justify-content: center;
  align-items: center;
	filter: var(--filter-blanc);
}

.header-image img {
	width: 80%;
}

/* ------- Main ------- */

.main-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-top: 20px;
}

.content-column {
    width: 60%;
}

.content-column section, .sidebar-column > div {
    background-color: var(--color-2);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    color: var(--color-1);
}

.content-column section h2 {
    font-size: 25px;
    font-weight: bold;
    margin: 0;
    color: black;
    border-bottom: 2px solid var(--color-4);
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.content-column section h3 {
    font-size: 20px;
    font-weight: bold;
    margin: 0;
    color: black;
    margin-bottom: 10px;
}

.content-column section#role-processus ul li{
  margin-left: 20px;
}

.content-column section#role-processus ul{
  background-color: #6b096b50;
  border-left: 4px solid var(--color-3);
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 0 4px 4px 0;
}

.content-column section#role-processus ul li {
  line-height: 30px;
}

.content-column section.galerie img {
    width: 100px;
    height: auto;
    margin-right: 10px;
}

/* ------- Sidebar ------- */

.sidebar-column {
    width: 30%;
}

.sidebar-column div h3 {
  font-size: 20px;
    font-weight: bold;
    margin: 0;
    color: black;
    border-bottom: 2px solid var(--color-4);
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.kpi-item {
  background-color: var(--color-4); /* Teal */
  color: white;
  padding: 15px;
  border-radius: 6px;
  text-align: center;
	display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.kpi-item.alt-color {
    background-color: var(--color-3); /* Darker Teal */
}

.sidebar-column div#outil ul li {
  margin-left: 15px;
  padding-left: 5px;
}

.sidebar-column div#outil ul li::marker {
  content: "★"; /* Utiliser un autre caractère, comme une étoile */
  font-size: 20px;
  color: var(--color-4);
}

.sidebar-column div#ressource ul li {
  background-color: antiquewhite;
  padding: 5px 15px;
  margin-bottom: 15px;
  border-radius: 5px;
}

.sidebar-column div#ressource ul li:hover {
  transform: translateY(-5px);
  transition: transform 0.3s ease;
}

.sidebar-column div#ressource ul li:not(:hover) {
  transform: translateY(0);
  transition: transform 0.3s ease;
}

.sidebar-column div#ressource ul li a {
  color: var(--color-3) !important;
}

.sidebar-column div#ressource ul li::marker {
  color: var(--color-2);
}

/* ----- Responsive adjustments ----- */

@media (max-width: 768px) {
	.projets-back-button {
		align-self: flex-start;
  		margin-bottom: 20px;
	}
    .header-section {
        flex-direction: column;
        text-align: center;
    }
    .header-content {
        padding: 20px;
		flex-direction: column;
    }
	.header-content div {
		width: 100%;
	}
    .header-image {
		width: 100% !important;
        margin-left: 0;
        margin-top: 20px; /* Add space if image is below text */
    }
    .header-image img {
        width: 100%; /* Full width on small screens */
    }
    .main-container {
        flex-direction: column-reverse;
    }
    .content-column {
        width: 100%;
    }
    .sidebar-column {
        width: 100%;
    }
}

@media (max-width: 950px) {
	.projet-grid-item a div.project-thumbnail img {
		width: 88px;
  		height: 61%;
	}
	.projet-grid {
		grid-template-columns: repeat(3, 1fr);
	}
	.projet-grid > div:nth-child(10n+4), .projet-grid > div:nth-child(10n+5) {
	  grid-row: span 1;
	}
	.projet-grid > div:nth-child(9n+3), .projet-grid > div:nth-child(9n+4) {
	  grid-row: span 2;
	}
	.projet-grid > div:nth-child(10n+4) a div img, .projet-grid > div:nth-child(10n+5) a div img {
	  width: 88px;
  		height: 61%;
	}
	.projet-grid > div:nth-child(9n+3) a div img, .projet-grid > div:nth-child(9n+4) a div img {
	  width: 80%;
		height: 50%;
	}
}
@media (max-width: 550px) {
	.projet-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.projet-grid > div:nth-child(9n+3), .projet-grid > div:nth-child(9n+4) {
	  grid-row: span 1;
	}
	.projet-grid > div:nth-child(9n+3) a div img, .projet-grid > div:nth-child(9n+4) a div img {
	  width: 88px;
		height: 61%;
	}
}
@media (min-width: 1650px) {
	.projet-grid > div:nth-child(10n+4) a div img, .projet-grid > div:nth-child(10n+5) a div img {
	  width: 85%;
	  height: 9vw;
}
}