/* ==========================================================
   Nina MEYSSONNIER — portfolio
   Couleurs et typographie reprises du site Wix d'origine
   ========================================================== */

@font-face {
  font-family: "EB Garamond";
  src: url("../fonts/EBGaramond.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("../fonts/EBGaramond-Italic.woff2") format("woff2");
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Averia Serif Libre";
  src: url("../fonts/AveriaSerifLibre-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Averia Serif Libre";
  src: url("../fonts/AveriaSerifLibre-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --vert: #245614;
  --vert-fonce: #1a4010;
  --or: #c9ae6a;
  --brique: #a4533a;      /* page active du menu + séparateurs */
  --encre: #141414;
  --gris: #5c5c5c;
  --fond: #ffffff;
  --largeur: 1180px;
  --texte: 760px;
  --titres: "Averia Serif Libre", Georgia, serif;   /* police de mise en valeur */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "EB Garamond", Garamond, "Times New Roman", serif;
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--encre);
  background: var(--fond);
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--vert); }
a:hover { color: var(--brique); }

h1, h2, h3 { font-weight: 400; line-height: 1.2; margin: 0; text-wrap: balance; }

/* Police de mise en valeur : titres, logo, menu, rubriques */
h1, h2, h3, h4, .logo, .menu a, .tuiles span, .bouton, .bouton-blanc { font-family: var(--titres); }
p { margin: 0 0 1em; text-wrap: pretty; }

.conteneur { width: min(100% - 2.5rem, var(--largeur)); margin-inline: auto; }
.etroit { width: min(100% - 2.5rem, var(--texte)); margin-inline: auto; }

.lien-evitement {
  position: absolute; left: -999px; top: 0;
  background: var(--vert); color: #fff; padding: .5rem 1rem;
}
.lien-evitement:focus { left: 1rem; z-index: 10; }

/* ---------- En-tête ---------- */
.entete {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .75rem 2rem;
  padding: 2rem 0 1.5rem;
}
.logo {
  font-size: 1.35rem; color: var(--vert); text-decoration: none; white-space: nowrap;
}
.logo strong { font-weight: 700; }
.menu ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; align-items: center;
}
.menu li + li { border-left: 1.5px solid var(--brique); }
.menu a {
  display: block; padding: .1rem 1rem; font-size: 1.1rem;
  color: var(--vert); text-decoration: none;
}
.menu li:last-child a { padding-right: 0; }
.menu a:hover, .menu a[aria-current="page"] { color: var(--brique); }

/* Choix de la langue */
.langues { display: flex; align-items: center; gap: .15rem; font-family: var(--titres); font-size: .85rem; }
.langues a {
  color: var(--gris); text-decoration: none; padding: .15rem .4rem; border-radius: 3px;
  letter-spacing: .05em;
}
.langues a:hover { color: var(--brique); }
.langues a[aria-current] { color: #fff; background: var(--vert); }

/* ---------- Accueil : bannière ---------- */
.banniere {
  position: relative; overflow: hidden;
  background:
    radial-gradient(ellipse at 0% 0%, #dfe7da 0%, rgba(223,231,218,0) 30%),
    radial-gradient(ellipse at 100% 100%, #c9d6c3 0%, rgba(201,214,195,0) 28%),
    radial-gradient(circle at 25% 80%, #1e4d0f 0%, rgba(30,77,15,0) 35%),
    radial-gradient(circle at 75% 45%, #2a5f17 0%, rgba(42,95,23,0) 40%),
    linear-gradient(120deg, #6f9a5f 0%, #3e7030 22%, #2b5e1a 50%, #3c6e2e 80%, #9ab88d 100%);
  color: #fff; text-align: center;
  padding: clamp(2rem, 4.5vw, 3.25rem) 1.25rem;
  width: 100%;
}
.banniere h1 {
  font-size: clamp(2.1rem, 5.5vw, 4.2rem); font-weight: 400; letter-spacing: .02em;
}
.banniere img {
  width: clamp(110px, 14vw, 190px); margin: clamp(.8rem, 2vw, 1.4rem) auto 0;
}

.accroche {
  font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.6; text-align: justify;
  padding: 2.25rem 0 2.5rem;
}

/* ---------- Bandeau topographique ---------- */
.topo {
  background: var(--vert) url("../images/deco/topo.jpg") center / cover no-repeat;
  color: #fff; text-align: center;
  padding: 1.1rem 1rem;
  min-height: 56px;
}
.topo h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); text-shadow: 0 1px 6px rgba(0,0,0,.35); }

/* ---------- Accueil : trois tuiles ---------- */
.tuiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  border-bottom: 1.5px solid var(--encre);
}
.tuiles a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem;
  padding: 2.25rem 1rem; min-height: 170px;
  color: var(--encre); text-decoration: none; font-size: 1.15rem;
  border-left: 1.5px solid var(--encre);
  transition: background .2s;
}
.tuiles a:first-child { border-left: 0; }
.tuiles a:hover { background: #f3f6f1; color: var(--vert); }
.tuiles svg { width: 72px; height: 42px; stroke-width: 3; }

/* ---------- Accueil : À propos + CV ---------- */
.apropos {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.apropos-visuel {
  background: var(--vert) url("../images/deco/topo.jpg") 30% center / cover no-repeat;
  color: #fff; padding: 5rem clamp(1.5rem, 8vw, 9rem);
}
.apropos-visuel > div { position: sticky; top: 2rem; }
.apropos-visuel h2 { font-size: clamp(2.2rem, 4vw, 3.2rem); }
.apropos-visuel hr { width: 50px; border: 0; border-top: 4px solid #fff; margin: 1.6rem 0; }
.bouton-blanc {
  display: inline-block; background: #fff; color: var(--vert);
  padding: .4rem 1rem; font-size: 1.2rem; text-decoration: none;
}
.bouton-blanc:hover { color: var(--brique); }

.parcours { padding: 2.5rem clamp(1.25rem, 3.5vw, 3rem) 3rem; max-width: 820px; }
.parcours h3.rubrique { color: var(--vert); font-size: 1.6rem; margin: 0 0 1.4rem; }
.parcours h3.rubrique:not(:first-child) { margin-top: 3.5rem; }
.poste { margin-bottom: 1.8rem; }
.poste h4 { font-size: 1.25rem; font-weight: 700; line-height: 1.3; margin: 0 0 .3rem; }
.poste .quand { font-style: italic; color: var(--gris); font-size: 1rem; margin-bottom: .4rem; }
.poste p { font-size: 1.15rem; line-height: 1.5; margin: 0; }
.poste strong { font-weight: 700; }

.competences {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem 2rem;
  margin-top: 3.5rem;
}
.competences h3 { color: var(--gris); font-size: 1.35rem; margin-bottom: 1rem; }
.competences ul { list-style: none; margin: 0; padding: 0; font-size: 1.15rem; line-height: 1.55; }

/* ---------- Titres de page ---------- */
.titre-page {
  text-align: center; color: var(--vert);
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  padding: 1rem 0 1.8rem;
}

.encart {
  background: var(--vert); color: #fff;
  padding: clamp(1.6rem, 3.5vw, 2.5rem) 0;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem); line-height: 1.6;
}
.encart p:last-child { margin-bottom: 0; }
.encart.dans-conteneur { padding-inline: 0; }
.encart .etroit { width: min(100% - 2.5rem, 1100px); text-align: justify; }

/* ---------- Fiches (cartes, projets) ---------- */
.fiche { padding: 3.5rem 0 3rem; border-bottom: 1.5px solid var(--encre); }
.fiche:last-of-type { border-bottom: 0; }
.fiche figure { margin: 0 auto 2rem; max-width: 1000px; }
.fiche figure.cadre img { border: 1.5px solid var(--vert); }
.fiche h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin-bottom: 1.2rem; }
.fiche .texte { max-width: 1000px; margin-inline: auto; font-size: 1.1rem; }
.fiche .texte .contexte { font-style: italic; }
.fiche .actions { text-align: center; margin-top: 1.8rem; }


.bouton {
  display: inline-block; background: var(--vert); color: #fff;
  padding: .45rem 1.3rem; font-size: 1.05rem; letter-spacing: .08em;
  text-decoration: none; transition: background .2s;
}
.bouton:hover { background: var(--vert-fonce); color: #fff; }
.bouton:focus-visible, .bouton-blanc:focus-visible, a:focus-visible { outline: 3px solid var(--or); outline-offset: 3px; }

/* ---------- Page « Mes cartes » : carte et texte sur le même écran ---------- */
.fiche.carte { padding: 2.25rem 0; }
.fiche.carte > .conteneur { --h-carte: min(80vh, 760px); }
.fiche.carte figure { margin: 0; max-width: none; display: flex; justify-content: center; align-items: center; }
.fiche.carte figure img { width: auto; max-height: var(--h-carte); }
.fiche.carte .texte { max-width: none; margin-inline: 0; font-size: 1.02rem; line-height: 1.55; }
.fiche.carte h2 { font-size: clamp(1.25rem, 1.9vw, 1.6rem); margin-bottom: .8rem; }
.fiche.carte p { margin-bottom: .7em; }
.fiche.carte .actions { text-align: left; margin-top: 1.1rem; }
/* Texte justifié pour former des blocs réguliers (ordinateur et téléphone) */
.fiche.carte .texte p:not(.actions):not(.contexte):not(:has(> .contexte)) { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.fiche.carte .bouton { font-size: .95rem; padding: .4rem 1.1rem; }

@media (min-width: 861px) {
  .fiche.carte > .conteneur {
    display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 2.5rem; align-items: center;
  }
}

/* Cartes interactives */
/* Section « Cartes interactives » : cartes plus petites */
.fiche.carte.compacte > .conteneur { --h-carte: min(62vh, 560px); max-width: 980px; }
.fiche.carte.compacte .interactive { width: 100%; max-width: 480px; margin-inline: auto; }
@media (min-width: 861px) {
  .fiche.carte.compacte > .conteneur { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.interactive iframe { display: block; width: 100%; border: 0; }
.interactive iframe.video-yt { aspect-ratio: 16 / 9; height: auto; }
.interactive iframe.podcast { height: 352px; border-radius: 12px; }
.interactive iframe.hauteur-fixe { height: var(--h-carte); }

/* Carrousel : chaque carte garde son format, sans être recadrée */
.carrousel-piste {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.carrousel-piste::-webkit-scrollbar { display: none; }
.carrousel-piste > figure { flex: 0 0 100%; height: var(--h-carte); scroll-snap-align: center; }
.carrousel-piste img { max-height: 100%; }
.carrousel-commandes {
  display: flex; justify-content: center; align-items: center; gap: 1rem;
  margin-top: .6rem; font-family: var(--titres); color: var(--gris); font-size: .95rem;
}
.carrousel button {
  width: 2.1rem; height: 2.1rem; border: 0; border-radius: 50%;
  background: var(--vert); color: #fff; font-size: 1.3rem; line-height: 1; cursor: pointer;
  transition: background .2s, opacity .2s;
}
.carrousel button:hover { background: var(--vert-fonce); }
.carrousel button:disabled { opacity: .3; cursor: default; }
.carrousel button:focus-visible, .carrousel-piste:focus-visible { outline: 3px solid var(--or); outline-offset: 3px; }
.carrousel.seule .carrousel-commandes { display: none; }

/* Image pas encore ajoutée : le cadre disparaît, le texte reste */
figure.manquante { display: none; }

/* Plusieurs cartes pour un même projet */
.galerie { display: grid; gap: 1.5rem; max-width: 1000px; margin: 0 auto 2rem; }
.galerie figure { margin: 0; }
.galerie.deux { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }

/* ---------- Articles (même format que les fiches) ---------- */
.article { padding: 2.25rem 0; border-bottom: 1.5px solid var(--encre); text-align: center; }
.article:last-of-type { border-bottom: 0; }
.article > .conteneur { max-width: 820px; }
.article h2 { font-size: clamp(1.25rem, 1.9vw, 1.6rem); margin-bottom: .5rem; }
.article .support { font-size: 1.02rem; margin: 0; }
.article .date { font-size: 1.02rem; font-style: italic; color: var(--gris); margin: .2rem 0 0; }
.article .date:empty { display: none; }
.article .bouton { font-size: .95rem; padding: .4rem 1.1rem; margin-top: 1.1rem; }
.article figure { margin: 1.6rem 0 0; display: flex; justify-content: center; }
.article figure img { width: auto; max-height: min(80vh, 760px); }


/* ---------- Pied de page ---------- */
.pied { border-top: 1.5px solid var(--encre); margin-top: 0; }
.pied-grille {
  display: grid; grid-template-columns: 1fr 1.4fr 1fr; align-items: center; gap: 2rem;
  padding: 2.5rem 0 2rem;
}
.pied nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; font-size: 1.05rem; }
.pied nav a { color: var(--encre); text-decoration: none; }
.pied nav a:hover { color: var(--brique); }
.contact { text-align: center; }
.contact h2 { font-size: 1.4rem; letter-spacing: .2em; margin-bottom: .8rem; }
.contact ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; font-size: 1.1rem; font-weight: 700; }
.contact a { color: var(--encre); }
.contact a:hover { color: var(--brique); }
.pied-globe { justify-self: end; width: min(110px, 100%); }
.mentions { text-align: center; font-size: .85rem; color: var(--gris); padding: 0 0 1.5rem; }

/* ---------- Apparition au défilement ---------- */
/* La classe .js est ajoutée par js/apparition.js : sans JavaScript, tout reste visible */
.js .apparait {
  opacity: 0; transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}
.js .apparait.visible { opacity: 1; transform: none; }
.js .tuiles a.apparait { transition: opacity .7s ease, transform .7s ease, background .2s; }
.js .tuiles a:nth-child(2) { transition-delay: .12s, .12s, 0s; }
.js .tuiles a:nth-child(3) { transition-delay: .24s, .24s, 0s; }
@media (prefers-reduced-motion: reduce) {
  .js .apparait { opacity: 1; transform: none; transition: none; }
}

/* ---------- Écrans étroits ---------- */
@media (max-width: 860px) {
  /* En-tête mobile : nom + langues sur une ligne, menu en 3 onglets égaux dessous */
  .entete {
    display: grid; grid-template-columns: 1fr auto; align-items: center;
    gap: .9rem 1rem; padding: 1.1rem 0 .4rem;
  }
  .logo { font-size: 1.2rem; }
  .langues { grid-column: 2; grid-row: 1; }
  .menu { grid-column: 1 / -1; border-block: 1px solid #dfe5dc; }
  .menu ul { display: grid; grid-template-columns: repeat(3, 1fr); }
  .menu li + li { border-left: 1px solid #dfe5dc; }
  .menu a, .menu li:last-child a {
    display: flex; align-items: center; justify-content: center; text-align: center;
    min-height: 3rem; padding: .45rem .35rem; font-size: .95rem; line-height: 1.2;
  }
  .menu a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--brique); }
  .apropos { grid-template-columns: 1fr; }
  .apropos-visuel { padding: 3rem 1.5rem; text-align: center; }
  .apropos-visuel hr { margin-inline: auto; }
  /* Accueil : les 3 tuiles côte à côte, en petit */
  .tuiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tuiles a {
    min-height: 0; padding: 1.2rem .3rem; gap: .35rem;
    font-size: .88rem; line-height: 1.2; text-align: center;
  }
  .tuiles svg { width: 44px; height: 26px; }
  .pied-grille { grid-template-columns: 1fr; text-align: center; }
  .pied-globe { justify-self: center; }
  .accroche, .encart .etroit { text-align: left; }
  .bouton { font-size: 1rem; }
  .fiche.carte { padding: 1.5rem 0; }
  .fiche.carte > .conteneur, .fiche.carte.compacte > .conteneur { --h-carte: 52vh; }
  .fiche.carte .conteneur > figure, .fiche.carte .carrousel, .fiche.carte .interactive { margin-bottom: 1rem; }
  .fiche.carte .texte { font-size: .97rem; }
  .fiche.carte h2, .article h2 { font-size: 1.2rem; }
  .article { padding: 1.5rem 0; }
  .article .support, .article .date { font-size: .97rem; }
}


