/* =============================================
   Pages projet — styles réutilisables
   Chargé après style.css
   ============================================= */

/* =============================================
   Fil d'Ariane
   ============================================= */
.fil-ariane {
  background-color: var(--couleur-moyenne);
  border-bottom: 1px solid rgba(255, 197, 118, 0.1);
  padding: 0.875rem 0;
}

.fil-ariane__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-px);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.fil-ariane__lien {
  font-family: var(--font-corps);
  font-size: 0.875rem;
  color: var(--couleur-blanc-60);
  text-decoration: none;
  transition: color 250ms ease-out;
}

.fil-ariane__lien:hover {
  color: var(--couleur-or);
}

.fil-ariane__separateur {
  color: var(--couleur-or);
  font-size: 0.875rem;
  opacity: 0.7;
  user-select: none;
}

.fil-ariane__courant {
  font-family: var(--font-corps);
  font-size: 0.875rem;
  color: var(--couleur-blanc);
}

/* =============================================
   Hero projet
   ============================================= */
.projet-hero {
  background-color: var(--couleur-hero);
  padding: calc(var(--section-padding) * 0.75) 0 2.5rem;
  text-align: center;
}

.projet-hero__inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--container-px);
}

.projet-hero__categorie {
  font-family: var(--font-label);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--couleur-or);
  margin-bottom: 1.25rem;
  display: block;
}

.projet-hero__titre {
  font-family: var(--font-titre);
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--couleur-blanc);
  margin-bottom: 1.5rem;
}

.projet-hero__pitch {
  font-family: var(--font-corps);
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
  max-width: 680px;
  margin: 0 auto;
}

/* =============================================
   Image héro
   ============================================= */
.projet-jaquette {
  background-color: var(--couleur-foncee);
  padding: 2.5rem 0 4rem;
  display: flex;
  justify-content: center;
}

.projet-jaquette__img {
  max-width: 480px;
  width: 90%;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* =============================================
   Sections communes
   ============================================= */
.projet-section {
  padding: var(--section-padding) 0;
}

.projet-section--fonce {
  background-color: var(--couleur-foncee);
}

.projet-section--moyen {
  background-color: var(--couleur-moyenne);
}

.projet-section--video {
  padding: 1rem 0 4rem;
}

.projet-section__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-px);
}

.projet-section__titre {
  font-family: var(--font-titre);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--couleur-blanc);
  margin-bottom: 2rem;
}

.projet-section__texte {
  max-width: 720px;
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--couleur-blanc-60);
}

/* Variante "lead paragraph" pour la présentation */
.projet-section__texte--lead {
  max-width: 800px;
  font-size: 1.25rem;
  line-height: 1.75;
  margin: 0 auto;
  text-align: justify;
  text-justify: inter-word;
  hyphens: none;
  -webkit-hyphens: none;
}

.projet-section__texte em {
  font-style: italic;
  color: rgba(255, 255, 255, 0.8);
}

/* =============================================
   Sous-sections démarche — 2 colonnes
   ============================================= */
.projet-demarche {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.projet-demarche__item h3 {
  font-family: var(--font-titre);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--couleur-or);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.projet-demarche__item .projet-section__texte {
  max-width: none;
  font-size: 1rem;
  line-height: 1.75;
  text-align: justify;
  text-justify: inter-word;
  hyphens: none;
  -webkit-hyphens: none;
}

.projet-demarche__item .projet-section__texte + .projet-section__texte {
  margin-top: 0.875rem;
}

/* Intertitre en strong — section Présentation uniquement */
.projet-section__texte strong {
  color: var(--couleur-or);
  font-weight: 600;
}

/* =============================================
   Liste à puces projets (flèche dorée)
   Convention : paragraphes narratifs + .projet-liste pour les étapes techniques
   ============================================= */
.projet-liste {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.projet-liste li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--couleur-blanc-60);
  text-align: justify;
  hyphens: none;
  -webkit-hyphens: none;
}

.projet-liste li::before {
  content: "→";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--couleur-or);
  font-weight: 600;
}

/* =============================================
   Badges logiciels — même ADN visuel que .competence-card
   ============================================= */
.projet-logiciels-grille {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.projet-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  padding: 2rem 1.5rem;
  border: 1px solid var(--couleur-or-pale);
  transition: border-color var(--transition);
  cursor: default;
}

.projet-badge:hover {
  border-color: var(--couleur-or);
}

.projet-badge__logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 6px;
}

.projet-badge__nom {
  font-family: var(--font-titre);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--couleur-blanc);
  line-height: 1.3;
  transition: color var(--transition);
}

.projet-badge:hover .projet-badge__nom {
  color: var(--couleur-or);
}

/* =============================================
   Cartes de téléchargement
   ============================================= */
.projet-telechargements-grille {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.projet-dl-carte {
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--couleur-or-pale);
  padding: 1.5rem 1.25rem;
  text-decoration: none;
  position: relative;
  transition: border-color var(--transition);
}

.projet-dl-carte:hover {
  border-color: var(--couleur-or);
}

/* Icône download en haut à droite */
.projet-dl-carte::after {
  content: '';
  position: absolute;
  top: 0.75rem;
  right: 0.875rem;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 256 256'%3E%3Cpath d='M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34A8,8,0,0,0,82.34,109.66Z' fill='%23ffc576'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.7;
  transition: opacity 300ms ease-out;
}

.projet-dl-carte:hover::after {
  opacity: 1;
}

.projet-dl-carte__icone {
  flex-shrink: 0;
  color: var(--couleur-or);
  display: flex;
  align-items: center;
  font-size: 40px;
}

.projet-dl-carte__info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.projet-dl-carte__nom {
  font-family: var(--font-corps);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--couleur-blanc);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.projet-dl-carte__meta {
  font-family: var(--font-corps);
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--couleur-or);
  opacity: 0.8;
}

/* =============================================
   Navigation inter-projets
   ============================================= */
.projet-nav-inter {
  background-color: var(--couleur-moyenne);
  border-top: 1px solid rgba(255, 197, 118, 0.1);
  padding: 3rem 0;
}

.projet-nav-inter__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
}

.projet-nav-inter__precedent,
.projet-nav-inter__suivant {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-decoration: none;
}

.projet-nav-inter__suivant {
  text-align: right;
}

.projet-nav-inter__label {
  font-family: var(--font-label);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--couleur-or);
  transition: opacity 250ms ease-out;
}

.projet-nav-inter__nom {
  font-family: var(--font-corps);
  font-size: 0.9375rem;
  color: var(--couleur-blanc-60);
  transition: color 250ms ease-out;
}

.projet-nav-inter__precedent:hover .projet-nav-inter__nom,
.projet-nav-inter__suivant:hover .projet-nav-inter__nom {
  color: var(--couleur-blanc);
}

.projet-nav-inter__centre {
  text-align: center;
}

.projet-nav-inter__retour {
  font-family: var(--font-label);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--couleur-blanc);
  text-decoration: none;
  padding: 0.875rem 2rem;
  background-color: transparent;
  border: 1px solid var(--couleur-or);
  border-radius: 4px;
  display: inline-block;
  transition: background-color var(--transition), color var(--transition);
}

.projet-nav-inter__retour:hover {
  background-color: var(--couleur-or);
  color: var(--couleur-foncee);
}

.projet-nav-inter__vide {
  visibility: hidden;
  pointer-events: none;
}

/* =============================================
   Responsive
   ============================================= */
@media (min-width: 1024px) {
  .projet-hero__titre {
    white-space: nowrap;
  }
}

@media (max-width: 900px) {
  .projet-demarche {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .projet-demarche__item .projet-section__texte {
    max-width: none;
  }
}

@media (max-width: 768px) {
  .projet-logiciels-grille,
  .projet-telechargements-grille {
    grid-template-columns: 1fr;
  }

  .projet-nav-inter__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .projet-nav-inter__suivant {
    text-align: center;
  }

  .projet-nav-inter__precedent {
    order: 2;
  }

  .projet-nav-inter__centre {
    order: 1;
  }

  .projet-nav-inter__suivant {
    order: 3;
  }

  .projet-hero {
    padding: calc(var(--section-padding) * 0.6) 0 2rem;
  }
}

/* =============================================
   Diptyque des tomes
   ============================================= */
.projet-tome__grille {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.projet-tome__couverture {
  text-align: center;
}

.projet-tome__couverture img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.projet-tome__credit {
  font-family: var(--font-corps);
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  margin-top: 1rem;
}

.projet-tome__texte {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.projet-tome__titre {
  font-family: var(--font-titre);
  font-weight: 700;
  font-size: 2rem;
  color: var(--couleur-blanc);
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.projet-tome__texte .projet-section__texte {
  max-width: none;
  font-size: 1rem;
  line-height: 1.75;
  text-align: justify;
  text-justify: inter-word;
  hyphens: none;
  -webkit-hyphens: none;
}

/* Citation 4e de couverture */
.projet-tome__citation {
  border-left: 3px solid;
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 0.5rem 0;
  font-family: var(--font-titre);
  font-style: italic;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.projet-tome__citation p {
  margin: 0.25rem 0;
  text-align: center;
}

.projet-tome__citation-titre {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: block;
}

.projet-tome__citation--bleue {
  border-left-color: #8AB4D8;
  color: #B8D4EC;
}

.projet-tome__citation--verte {
  border-left-color: #6FA86F;
  color: #A0C8A0;
}

/* Bouton Wattpad */
.projet-tome__lien {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.75rem;
  background: transparent;
  border: 1px solid var(--couleur-or);
  border-radius: 4px;
  color: var(--couleur-or);
  text-decoration: none;
  font-family: var(--font-label);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.875rem;
  transition: background-color var(--transition), color var(--transition);
  margin-top: 0.5rem;
  align-self: flex-start;
}

.projet-tome__lien:hover {
  background-color: var(--couleur-or);
  color: var(--couleur-foncee);
}

/* Séparateur ornemental entre tomes */
.projet-separateur {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
  background-color: var(--couleur-foncee);
}

.projet-separateur::before,
.projet-separateur::after {
  content: '';
  flex: 0 0 80px;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255, 197, 118, 0.3), transparent);
}

.projet-separateur__ornement {
  color: var(--couleur-or);
  font-size: 1.25rem;
  margin: 0 1.5rem;
  opacity: 0.7;
}

@media (max-width: 900px) {
  .projet-tome__grille {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Tome 2 (inversé) : couverture remonte en premier sur mobile */
  .projet-tome--inverse .projet-tome__couverture {
    order: -1;
  }

  .projet-tome__titre {
    font-size: 1.625rem;
    text-align: center;
  }

  .projet-tome__lien {
    align-self: center;
  }
}

/* =============================================
   Image héro paysage (16:9 — e-learning)
   ============================================= */
.projet-jaquette__img--paysage {
  max-width: 720px;
}

/* Jaquette cliquable */
.projet-jaquette__lien {
  display: block;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.projet-jaquette__lien:hover {
  transform: scale(1.02);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* =============================================
   Vidéo YouTube embarquée
   ============================================= */
.projet-video__wrapper {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto 4rem;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.projet-video__wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.projet-video__playlist {
  display: block;
  width: fit-content;
  margin: 0 auto;
  padding: 0.875rem 1.75rem;
  background: transparent;
  border: 1px solid var(--couleur-or);
  border-radius: 4px;
  color: var(--couleur-or);
  text-decoration: none;
  font-family: var(--font-label);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.875rem;
  transition: background-color var(--transition), color var(--transition);
}

.projet-video__playlist:hover {
  background-color: var(--couleur-or);
  color: var(--couleur-foncee);
}

/* =============================================
   Volets de démarche (e-learning)
   ============================================= */
.projet-volet {
  max-width: 800px;
  margin: 0 auto 3rem;
}

.projet-volet:last-child {
  margin-bottom: 0;
}

.projet-volet h3 {
  font-family: var(--font-titre);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--couleur-blanc);
  margin-bottom: 0.5rem;
  line-height: 1.25;
}

.projet-volet__outils {
  font-family: var(--font-corps);
  font-size: 0.875rem;
  color: var(--couleur-or);
  font-style: italic;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.projet-volet p {
  font-family: var(--font-corps);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--couleur-blanc-60);
  text-align: justify;
  text-justify: inter-word;
  hyphens: none;
  -webkit-hyphens: none;
  margin-bottom: 0.875rem;
}

.projet-volet p:last-child {
  margin-bottom: 0;
}

/* Volets 2 colonnes (texte + image) */
.projet-volet--avec-image {
  max-width: 1000px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: stretch;
}

.projet-volet__figure {
  margin: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.projet-volet__figure img {
  width: 100%;
  object-fit: cover;
  flex: 1;
  min-height: 0;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  display: block;
}

/* Volet infographie rognée (ex: Scratch 3) — max-height + object-position: top */
.projet-volet--infographie .projet-volet__figure {
  height: auto;
  min-height: 0;
  align-self: start;
}

.projet-volet--infographie .projet-volet__figure img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
  object-position: top;
  flex: none;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  display: block;
}

/* Badge "Nouveau" inline dans une liste projet */
.projet-badge-nouveau {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.15em 0.6em;
  background: var(--couleur-or);
  color: var(--couleur-foncee);
  font-family: var(--font-label);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 4px;
  vertical-align: middle;
  white-space: nowrap;
}

/* Couverture de tome cliquable */
.projet-tome__couverture-lien {
  display: block;
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.projet-tome__couverture-lien:hover {
  transform: scale(1.02);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}

/* Image cliquable dans un volet figure */
.projet-volet__figure-lien {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.projet-volet__figure-lien:hover {
  transform: scale(1.02);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.45);
}

/* Volet image entière (ex: Virgule Numérique, Microlearning ÉLÉA) — proportions naturelles */
.projet-volet--infographie-entiere,
.projet-volet--image-entiere {
  align-items: start;
}

.projet-volet--infographie-entiere .projet-volet__figure,
.projet-volet--image-entiere .projet-volet__figure {
  height: auto;
}

.projet-volet--infographie-entiere .projet-volet__figure img,
.projet-volet--image-entiere .projet-volet__figure img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: initial;
  flex: none;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  display: block;
}

/* Bouton d'accès à une ressource externe */
.projet-ressource-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding: 0.875rem 2rem;
  background: transparent;
  border: 1px solid var(--couleur-or);
  border-radius: 4px;
  color: var(--couleur-or);
  text-decoration: none;
  font-family: var(--font-label);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.875rem;
  transition: background-color var(--transition), color var(--transition);
}

.projet-ressource-btn:hover {
  background-color: var(--couleur-or);
  color: var(--couleur-foncee);
}

.projet-volet__figure figcaption {
  flex-shrink: 0;
  font-family: var(--font-corps);
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  text-align: center;
  margin-top: 0.75rem;
}

/* Volet pleine largeur (texte centré + image sous le texte) */
.projet-volet--pleine {
  max-width: 1000px;
  margin: 0 auto 3rem;
}

.projet-volet--pleine .projet-volet__texte {
  max-width: 800px;
  margin: 0 auto 1.5rem;
}

.projet-volet__figure--large {
  margin: 0;
}

.projet-volet__figure--large img {
  width: 100%;
}

/* Volet image gauche : order explicite sur desktop (source : figure avant texte) */
.projet-volet--image-gauche .projet-volet__figure { order: 1; }
.projet-volet--image-gauche .projet-volet__texte  { order: 2; }

@media (max-width: 900px) {
  .projet-volet--avec-image {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: initial;
  }

  /* Image toujours en premier sur mobile, hauteurs réinitialisées */
  .projet-volet__figure {
    height: auto;
    min-height: initial;
    order: 1;
  }

  .projet-volet__figure img {
    height: auto;
    min-height: initial;
    object-fit: initial;
    flex: initial;
  }

  .projet-volet__texte { order: 2; }

  /* --image-gauche : source order naturel (figure déjà en premier), reset */
  .projet-volet--image-gauche .projet-volet__figure,
  .projet-volet--image-gauche .projet-volet__texte {
    order: initial;
  }
}
