/* =========================================================
   HELIØS — Feuille de style principale
   ---------------------------------------------------------
   1. Variables (couleurs, polices, espacements)
   2. Base / remise à zéro
   3. Thèmes (sombre / clair)
   4. En-tête et navigation
   5. Page Accueil
   6. Page Réalisations (grille)
   7. Page Projet
   8. Page À propos
   9. Page Contact
   10. Utilitaires
   ========================================================= */


/* ---------- 1. Variables ---------- */
:root {
  --noir: #000;
  --blanc: #fff;
  --gris-fond: #141414;        /* fond des images pas encore chargées */

  --police-titre: "Cormorant SC", "Times New Roman", serif;  /* logo + menu */
  --police-texte: "Jost", "Helvetica Neue", Arial, sans-serif;

  --hauteur-entete: 110px;
  --marge: clamp(16px, 3vw, 48px);
  --espace-grille: 20px;
}


/* ---------- 2. Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--police-texte);
  font-weight: 300;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, video, iframe { display: block; max-width: 100%; }

img { background: var(--gris-fond); }   /* bloc gris si l'image manque */

a { color: inherit; text-decoration: none; }


/* ---------- 3. Thèmes ---------- */
.theme-sombre { background: var(--noir);  color: var(--blanc); }
.theme-clair  { background: var(--blanc); color: var(--noir);  }


/* ---------- 4. En-tête et navigation ---------- */
.entete {
  position: relative;
  z-index: 10;
  height: var(--hauteur-entete);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 var(--marge);
}

/* En-tête posé par-dessus le hero (page d'accueil) */
.entete--transparent {
  position: absolute;
  inset: 0 0 auto 0;
  color: var(--blanc);
}

.logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--police-titre);
  font-weight: 400;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  letter-spacing: 0.02em;
  line-height: 1;
}

.nav {
  display: flex;
  gap: clamp(20px, 2.5vw, 52px);
}

.nav a {
  font-family: var(--police-titre);
  font-size: clamp(1.1rem, 1.5vw, 1.6rem);
  letter-spacing: 0.04em;
  transition: opacity 0.2s;
}

.nav a:hover { opacity: 0.6; }

/* Bouton menu mobile (caché sur ordinateur) */
.menu-bouton {
  display: none;
  background: none;
  border: 0;
  padding: 10px;
  cursor: pointer;
  color: inherit;
}

.menu-bouton span {
  display: block;
  width: 26px;
  height: 1.5px;
  margin: 6px 0;
  background: currentColor;
  transition: transform 0.3s;
}

@media (max-width: 768px) {
  :root { --hauteur-entete: 80px; }

  .menu-bouton { display: block; }

  .nav {
    position: fixed;
    inset: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    background: var(--noir);
    color: var(--blanc);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
  }

  .nav a { font-size: 2rem; }

  .menu-ouvert { overflow: hidden; }   /* bloque le défilement derrière le menu */
  .menu-ouvert .nav { opacity: 1; visibility: visible; }
  .menu-ouvert .menu-bouton { position: relative; z-index: 11; color: var(--blanc); }
  .menu-ouvert .menu-bouton span:first-child { transform: translateY(3.75px) rotate(45deg); }
  .menu-ouvert .menu-bouton span:last-child  { transform: translateY(-3.75px) rotate(-45deg); }
}


/* ---------- 5. Page Accueil ---------- */
.hero {
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.hero {
  background: var(--gris-fond) url("../images/accueil.jpg") center / cover no-repeat;
}

@media (max-width: 768px) and (orientation: portrait) {
  .hero { background-image: url("../images/accueil-mobile.jpg"); }
}

.hero__media {
  width: 100%;
  height: 100%;
  object-fit: cover;   /* la vidéo remplit l'écran, quitte à rogner les bords */
}


/* ---------- 6. Page Réalisations ---------- */
.contenu {
  padding: clamp(24px, 8vh, 120px) var(--espace-grille) 80px;
}

.grille {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--espace-grille);
}

.carte {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.carte img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease, filter 0.4s;
}

.carte__titre {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--police-texte);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(1.4rem, 2vw, 2.2rem);
  text-transform: uppercase;
  line-height: 1.15;
  opacity: 0;
  transition: opacity 0.4s;
}

.carte:hover img,
.carte:focus-visible img { transform: scale(1.04); filter: brightness(0.7); }

.carte:hover .carte__titre,
.carte:focus-visible .carte__titre { opacity: 1; }

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

/* Écrans tactiles (téléphone, tablette) : pas de survol possible,
   donc titre toujours visible et image légèrement assombrie. */
@media (hover: none) {
  .carte__titre { opacity: 1; }
  .carte img { filter: brightness(0.7); }
}


/* ---------- 7. Page Projet ---------- */

/* Bouton « ← Réalisations », aligné sur le bord gauche de la vidéo / photo */
.projet__retour {
  display: flex;
  align-items: center;
  gap: 0.5em;
  width: fit-content;
  margin: 0 0 24px max(0px, calc((100% - 1240px) / 2));
  font-family: var(--police-titre);
  font-size: clamp(1rem, 1.3vw, 1.3rem);
  letter-spacing: 0.04em;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.projet__retour span { transition: transform 0.2s; }

.projet__retour:hover,
.projet__retour:focus-visible { opacity: 1; }

.projet__retour:hover span { transform: translateX(-4px); }  /* la flèche glisse vers la gauche */

.projet__infos {
  margin: 0 0 40px;
  text-align: center;
  font-size: clamp(1.1rem, 1.6vw, 1.75rem);
  line-height: 1.4;
}

.projet__infos div { display: block; }
.projet__infos dt,
.projet__infos dd { display: inline; margin: 0; }
.projet__infos dt::after { content: " : "; }

/* Texte de présentation du projet, juste sous les crédits (ou seul s'il n'y a pas de crédits) */
.projet__texte {
  max-width: 760px;
  margin: 0 auto 40px;
  text-align: center;
  font-weight: 300;
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  line-height: 1.6;
  opacity: 0.85;
}

.projet__infos + .projet__texte { margin-top: -16px; }   /* se rapproche des crédits au-dessus */

.projet__video {
  max-width: 1240px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  /* La vignette du projet (indiquée dans le HTML) s'affiche en attendant la vidéo */
  background: var(--gris-fond) center / cover no-repeat;
}

/* Grande photo à la place de la vidéo (projets sans vidéo) : même cadre 16:9 */
.projet__photo {
  max-width: 1240px;
  margin: 0 auto;
}

.projet__photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* Projets tournés au format cinéma (2,40:1) : on garde ce format au lieu du 16:9.
   À utiliser en ajoutant la classe « projet--cinemascope » sur <main>. */
.projet--cinemascope .projet__photo img,
.projet--cinemascope .projet__galerie img { aspect-ratio: 2.4 / 1; }

/* Lien de repli vers YouTube (page ouverte en local, voir main.js) */
.projet__video-lien {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  font-size: clamp(1rem, 2vw, 1.5rem);
  letter-spacing: 0.05em;
}

/* Tant que le lien vidéo n'est pas renseigné (src vide), on masque le lecteur */
.projet__video iframe[src=""] { visibility: hidden; }

/* Galerie d'images sous la vidéo : 3 côte à côte, empilées sur téléphone */
.projet__galerie {
  max-width: 1240px;
  margin: var(--espace-grille) auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--espace-grille);
}

.projet__galerie img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

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

.projet__video iframe {
  width: 100%;
  height: 100%;
  border: 0;
}


/* ---------- 8. Page À propos ---------- */
.a-propos {
  min-height: calc(100vh - var(--hauteur-entete));
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: var(--marge);
  padding: 40px var(--marge) 0 clamp(16px, 7vw, 134px);
}

.a-propos__texte {
  font-family: "Helvetica Neue", Arial, sans-serif;  /* proche de la maquette */
  font-weight: 700;
  font-style: italic;
  font-size: clamp(1rem, 1.3vw, 1.4rem);
  line-height: 1.4;
  max-width: 52ch;
}

.a-propos__texte p { margin: 0 0 1.4em; }

.a-propos__portrait {
  margin: 0;
  align-self: end;
  justify-self: start;
}

/* Grands écrans : décale le portrait vers la gauche, plus près du texte
   (≈ 115 px sur un écran de 1440 px). Pour ajuster : changer -8vw.
   En dessous de 1200 px, pas de décalage, sinon le portrait toucherait le texte. */
@media (min-width: 1200px) {
  .a-propos__portrait { margin-left: clamp(-120px, -8vw, 0px); }
}

.a-propos__portrait img {
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  object-fit: contain;
  background: none;
  /* Le fondu est déjà dans l'image ; « multiply » fond son blanc dans celui de la page */
  mix-blend-mode: multiply;
}

/* Très grands écrans (27 pouces, 35 pouces ultra-larges…) : sans limite, le texte reste
   collé à gauche et le portrait part à l'autre bout de l'écran, avec un grand vide entre les deux.
   On garde donc la composition groupée au centre (1760 px de large au maximum),
   avec un texte et un portrait un peu plus grands. */
@media (min-width: 1800px) {
  .a-propos {
    max-width: 1760px;
    margin: 0 auto;
    padding-left: var(--marge);
  }
  .a-propos__texte { font-size: clamp(1.4rem, 1vw, 1.7rem); }
  .a-propos__portrait img { max-width: 800px; }
}

@media (max-width: 900px) {
  .a-propos {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 24px var(--marge) 0;
  }
  .a-propos__texte { max-width: none; }
  .a-propos__portrait { justify-self: center; }
  .a-propos__portrait img { max-width: 420px; max-height: 60vh; margin: 0 auto; }
}


/* ---------- 9. Page Contact ---------- */
.contact {
  min-height: calc(100vh - var(--hauteur-entete) - 120px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-left: var(--marge);
  padding-right: var(--marge);
}

.contact__intro {
  margin: 0 0 clamp(32px, 5vh, 48px);
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  opacity: 0.7;
}

/* Liste alignée à gauche (icônes en colonne), le bloc reste centré dans la page */
.contact__liste {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 22px;
  text-align: left;
}

.contact__liste a {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: clamp(1rem, 1.3vw, 1.25rem);   /* taille du texte des coordonnées */
  font-weight: 300;
  overflow-wrap: anywhere;   /* l'adresse e-mail ne déborde pas sur petit écran */
  transition: opacity 0.2s;
}

.contact__liste a:hover,
.contact__liste a:focus-visible { opacity: 0.6; }

.contact__icone {
  flex: none;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}


/* ---------- 9 bis. Pied de page ----------
   Discret, mais utile au référencement local (nom, ville, contact). */
.pied {
  padding: 32px var(--marge);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: 0.85rem;
  opacity: 0.6;
}

.pied a:hover { text-decoration: underline; }

.pied address { font-style: normal; }

@media (max-width: 600px) {
  .pied { flex-direction: column; text-align: center; }
}


/* ---------- 10. Utilitaires ---------- */
/* Texte lu par les lecteurs d'écran et Google, mais invisible à l'écran */
.visuellement-cache {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
