/* Container full width */
.alignfull.project-block-list {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  box-sizing: border-box;
  overflow-x: clip;
}

.project-block-list {
  margin: 0;
  padding: 0;
}

/* ENTRY - desktop by default */
.project-entry-fullwidth {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  min-height: 500px;
  margin-bottom: 4rem;
  overflow: hidden;
  box-sizing: border-box;
  border-bottom: 12px solid #0d2035;
  padding-bottom: 4rem;
}

/* If reverse class present, invert on desktop */
.project-entry-fullwidth.reverse {
  flex-direction: row-reverse;
}

/* background alternance classes */
.project-entry-fullwidth.bg-light { background-color: #ffffff; }
.project-entry-fullwidth.bg-soft  { background-color: #f9f9f9; }

/* IMAGE BLOCK */
.project-image-half {
  flex: 1 1 50%;
  min-height: 300px;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

/* CONTENT BLOCK */
.project-content-half {
  flex: 1 1 50%;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  max-width: 50%;
}

/* header, title, logo ... (tes règles précédentes) */
.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.project-title-slogan { flex: 1; }
.project-title-slogan h2 { margin: 0; }
.project-slogan { font-style: italic; font-size: 1.1rem; color: #444; margin: 0.3rem 0 0 0; }

.project-logo img {
  max-width: 120px;
  max-height: 110px;
  object-fit: contain;
}

/* partners, videos, cards ... */
.project-partners-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  margin-bottom: 2rem;
}

.project-partner-card {
  background: #f5f5f5;
  border-radius: 6px;
  padding: 1rem;
  min-width: 180px;
  max-width: 240px;
  flex: 1 1 auto;
  box-sizing: border-box;
}

.project-partner-card strong { display:block; margin-bottom:0.25rem; }
.project-partner-card a { color:#0073aa; text-decoration:none; word-break:break-word; }
.project-partner-card a:hover { text-decoration:underline; }

.project-videos-grid { display:flex; flex-wrap:wrap; gap:1rem; margin-top:1rem; }
.video-card { flex: 1 1 160px; max-width:240px; }

/* utility for truncation */
.project-videos-grid a,
.project-partners-list a {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  max-width: 100%;
}

/* Section line */
.section-line { display:flex; align-items:center; gap:1rem; margin-bottom:1.5rem; flex-wrap:wrap; }
.section-line h4 { margin:0; font-size:1.2rem; min-width:80px; flex-shrink:0; }

/* ---------- RESPONSIVE : mobile/tablette ---------- */
/* seuil recommandé : 768px (modifiable) */
@media screen and (max-width: 768px) {

  /* stack image then content for EVERY entry */
  .project-entry-fullwidth {
    flex-direction: column !important; /* on force la pile vertical */
  }

  /* ensure image first, content after, even when .reverse present on desktop */
  .project-image-half  { order: 0; width: 100%; max-width: 100%; flex: 0 0 auto; min-height: 240px; }
  .project-content-half { order: 1; width: 100%; max-width: 100%; padding: 1rem 0.8rem; box-sizing: border-box; }

  .project-content-half h2 { font-size: 1.4rem; }

  .video-card { flex: 1 1 45%; max-width: 48%; } /* adapt buttons in two columns on narrow screens */
  .project-partner-card { min-width: 140px; max-width: calc(50% - 1rem); } 

  .project-entry-fullwidth { min-height: auto; padding-bottom: 2rem; border-bottom-width: 8px; }
}