/*
Theme Name: Mon Portfolio
Theme URI: 
Author: [Ton nom]
Author URI: 
Description: Thème sur mesure pour un portfolio de scénographe-designer. Sobre, clair, mise en avant des images.
Version: 0.1
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: monportfolio
*/

/* =========================================================
   0. POLICES LOCALES  —  Compagnon (Velvetyne, licence OFL)
   ========================================================= */
@font-face {
  font-family: "Compagnon";
  src: url("assets/fonts/Compagnon-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Compagnon";
  src: url("assets/fonts/Compagnon-Roman.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Compagnon";
  src: url("assets/fonts/Compagnon-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Compagnon";
  src: url("assets/fonts/Compagnon-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Compagnon";
  src: url("assets/fonts/Compagnon-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* =========================================================
   1. TOKENS  —  palette, typographie, espacements
   ========================================================= */
:root {
  /* Couleurs : blanc franc, noir dense — l'image porte la couleur */
  --bg:        #FFFFFF;
  --ink:       #111111;
  --muted:     #8A8A8A;
  --line:      #E4E4E4;
  --accent:    #111111;   /* pas de couleur d'accent : le contraste suffit */

  /* Typographie — charte Aubin Cazenave */
  --font-display: "Poppins", system-ui, sans-serif;              /* titres, nom */
  --font-body:    "Poppins", system-ui, sans-serif;              /* corps de texte */
  --font-mono:    "Compagnon", "Courier New", monospace;         /* labels, nav, légendes */

  /* Échelle typographique fluide */
  --fs-xs:  0.76rem;
  --fs-sm:  0.85rem;
  --fs-base: 0.95rem;
  --fs-lg:  clamp(1.1rem, 0.95rem + 0.6vw, 1.35rem);
  --fs-xl:  clamp(0.96rem, 0.66rem + 1.2vw, 1.56rem);  /* -40 % */
  --fs-2xl: clamp(1.32rem, 0.84rem + 2.04vw, 2.4rem);  /* -40 % */

  /* Rythme */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6.5rem;

  --maxw: 1440px;
  --pad:  clamp(0.875rem, 2.8vw, 2.8rem); /* -30 % */
}

/* =========================================================
   2. RESET & BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  font-weight: 300; /* Poppins Light */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

h1, h2, h3 {
  font-family: var(--font-display); /* Poppins */
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--ink); /* noir */
  margin: 0 0 var(--space-3);
}

h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }

p { margin: 0 0 var(--space-3); }

/* Lien dans le corps de texte : soulignement discret à l'accent */
.site-content a:not(.btn):not(.nav-link) {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 100% 1px;
  transition: background-size 0.25s ease;
}
.site-content a:not(.btn):not(.nav-link):hover {
  background-size: 100% 2px;
}

/* Accessibilité : focus visible net */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Petite étiquette utilitaire (labels, métadonnées) — mono Compagnon */
.label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* =========================================================
   3. LAYOUT
   ========================================================= */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.site-content {
  min-height: 60vh;
  padding-block: var(--space-6);
}

/* Saut au contenu (accessibilité clavier) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  z-index: 1000;
}
.skip-link:focus { left: var(--space-2); top: var(--space-2); }

/* =========================================================
   4. HEADER  —  planète + catégories centrées, sans filet
   ========================================================= */
.site-header {
  background: var(--bg);
  padding-top: 1.25rem;    /* marges resserrées */
  padding-bottom: 1.25rem;
}

/* Vignette « planète / échelles », en noir et blanc */
.site-header__emblem {
  display: block;
  width: clamp(132px, 14.4vw, 204px); /* +20 % */
  margin: 0 auto 0.75rem;             /* moins d'écart sous le logo */
}
.site-header__emblem img {
  width: 100%;
  height: auto;
  display: block;
}

/* Navigation par catégories, centrée */
.cat-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2) var(--space-4);
  margin: 0;
  padding: 0;
}
.cat-nav a {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  position: relative;
  padding-bottom: 3px;
  transition: color 0.2s ease;
}
.cat-nav a:hover,
.cat-nav .is-current a { color: var(--ink); }
.cat-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.cat-nav a:hover::after,
.cat-nav .is-current a::after { transform: scaleX(1); }

/* =========================================================
   5. FOOTER  —  bandeau négatif (noir 95 %), textes blancs
   ========================================================= */
.site-footer {
  background: #111111;
  color: #FFFFFF;
  padding-block: 3.2rem; /* -20 % */
  margin-top: var(--space-5);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  justify-content: space-between;
  align-items: flex-start;
}
.site-footer__col {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

/* Monogramme en négatif (blanc sur noir) */
.site-footer__monogram {
  width: 54px;
  margin-bottom: var(--space-2);
}
.site-footer__monogram img {
  width: 100%;
  height: auto;
  display: block;
  filter: invert(1);
}

.site-footer__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  color: #FFFFFF;
  margin: 0;
}
.site-footer__meta {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.72);
  margin: 0;
}
.site-footer__meta--light { color: rgba(255, 255, 255, 0.5); }

/* Signature de la charte : « toutes échelles confondues » */
.site-footer__baseline {
  font-family: var(--font-mono);
  font-size: var(--fs-base);
  color: #FFFFFF;
  margin: var(--space-2) 0 0;
}
.site-footer__baseline em { font-style: italic; }

.site-footer .label { color: rgba(255, 255, 255, 0.5); }

.site-footer__col a {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.9);
  width: max-content;
  transition: color 0.2s ease;
}
.site-footer__col a:hover { color: rgba(255, 255, 255, 0.55); }
.site-footer__legal {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.5);
}
a.site-footer__legal {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a.site-footer__legal:hover { color: rgba(255, 255, 255, 0.85); }

/* =========================================================
   6. CONTENU  —  textes, en-têtes de section
   ========================================================= */
.lead {
  font-size: var(--fs-lg);
  max-width: 60ch;
  color: var(--ink);
}
.entry { max-width: 66ch; }
/* Sur une fiche projet, le contenu occupe toute la colonne centrée. */
.single-projet .entry { max-width: none; }
.container--narrow { max-width: 820px; }

/* En-tête de section (catégorie, page) */
.section-head {
  margin-bottom: var(--space-5);
}
.section-head .label { display: block; margin-bottom: var(--space-1); }

/* =========================================================
   6b. PAGE D'ACCUEIL  —  image paysage plein cadre
   ========================================================= */
.home .site-content { padding-block: 0; } /* héros au ras de l'en-tête */

.hero-full {
  width: 100%;
  height: clamp(420px, 84vh, 940px);
  overflow: hidden;
  background: var(--line);
}
.hero-full img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* =========================================================
   6c. GRILLE DE PROJETS  —  vignettes portrait, resserrées
   ========================================================= */
.projet-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4) var(--space-2);
}
.projet-card__media {
  overflow: hidden;
  background: var(--line);
  aspect-ratio: 3 / 4; /* format portrait, comme le site de référence */
}
.projet-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0, 0, 1);
}
.projet-card a:hover .projet-card__media img { transform: scale(1.03); }
.projet-card__title {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: var(--space-1) 0 0;
  transition: color 0.2s ease;
}
.projet-card a:hover .projet-card__title { color: var(--ink); }

/* =========================================================
   6d. FICHE PROJET
   ========================================================= */
.single-projet .site-content { padding-top: 0; } /* image au ras de l'en-tête */

.project__hero {
  margin: 0;
  width: 100%;
  height: clamp(360px, 78vh, 900px);
  overflow: hidden;
  background: var(--line);
}
.project__hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.project__intro {
  padding-top: var(--space-5);
  margin-bottom: var(--space-4);
}
.project__intro .label { display: block; margin-bottom: var(--space-1); }
.project__body {
  font-size: 1.05rem;
  font-weight: 300;   /* Poppins Light */
  line-height: 1.75;
  text-align: left;
  color: #2A2A2A;     /* gris très foncé : adoucit le Light sans perdre en lisibilité */
  max-width: none;
}

/* Le contenu de la fiche est centré : les marges blanches
   sont identiques à gauche et à droite. */
.single-projet .container {
  max-width: 1260px; /* bandeaux latéraux réduits de ~30 % */
}
/* N'entrave pas les images en pleine largeur. */
.single-projet .site-content { overflow-x: clip; }
.project__back {
  margin-top: var(--space-5);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
}
.project__back a {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--muted);
  transition: color 0.2s ease;
}
.project__back a:hover { color: var(--accent); }

/* =========================================================
   7. RESPONSIVE
   ========================================================= */
@media (max-width: 720px) {
  .cat-nav ul { gap: var(--space-2) var(--space-3); }
  .site-footer__inner { flex-direction: column; }
  .hero-full { height: 60vh; }
  .project__hero { height: 55vh; }
}

/* =========================================================
   8. MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* =========================================================
   9. PAGE À PROPOS
   ========================================================= */
.about { padding-bottom: var(--space-4); }

.about__label {
  display: block;
  margin-bottom: var(--space-5);
}

.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-5) var(--space-6);
  align-items: start;
}

/* --- Colonne de gauche : texte + image --- */
.about__text {
  max-width: 46ch;
  color: var(--muted);
  font-size: var(--fs-base);
  font-weight: 300; /* Poppins Light */
  line-height: 1.75;
}
.about__text p { margin: 0 0 var(--space-3); }

/* La signature « toutes échelles confondues » en Compagnon italique.
   Dans l'éditeur WordPress, mets simplement le passage en italique. */
.about__text em {
  font-family: var(--font-mono);
  font-style: italic;
  color: var(--muted);
}

.about__figure {
  margin: var(--space-4) 0 0;
  max-width: 560px;
}
.about__figure img {
  width: 100%;
  height: auto;
  display: block;
}

/* --- Colonne de droite : informations, alignées à droite --- */
.about__aside {
  text-align: right;
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--muted);
}
.about__aside p { margin: 0; }

.about__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-base);
  color: var(--ink);
}
.about__birth {
  color: var(--muted);
  margin-bottom: var(--space-4) !important;
}
.about__birth em { font-style: italic; }

.about__block { margin-bottom: var(--space-4); }
.about__heading {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--space-1) !important;
}

/* --- Références : 3 colonnes distinctes --- */
.about__refs {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-5);
}

.ref-col__title {
  font-family: var(--font-display); /* Poppins */
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--ink);
  margin: 0 0 var(--space-2);
  padding-bottom: var(--space-1);
  border-bottom: 1px solid var(--line);
}

.ref-col__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ref-col__list li {
  font-family: var(--font-mono);
  font-weight: 500; /* Compagnon Medium */
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--ink);
  padding: 3px 0;
}

@media (max-width: 860px) {
  .about__refs { grid-template-columns: 1fr; gap: var(--space-4); }
}

@media (max-width: 860px) {
  .about__grid { grid-template-columns: 1fr; gap: var(--space-5); }
  .about__aside { text-align: left; }
  .about__figure { max-width: 100%; }
}

/* =========================================================
   11. VISIONNEUSE D'IMAGES (lightbox)
   ========================================================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(17, 17, 17, 0.95);
  padding: clamp(1rem, 4vw, 3rem);
}
.lightbox.is-open { display: flex; }

.lightbox__img {
  max-width: 92vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Bouton de fermeture */
.lightbox__close {
  position: absolute;
  top: clamp(0.75rem, 2vw, 1.5rem);
  right: clamp(0.75rem, 2vw, 1.5rem);
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: #FFFFFF;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}
.lightbox__close:hover { opacity: 1; }

/* Flèches de navigation */
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border: none;
  background: transparent;
  color: #FFFFFF;
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s ease;
}
.lightbox__nav:hover { opacity: 1; }
.lightbox__nav--prev { left: clamp(0.25rem, 1.5vw, 1.25rem); }
.lightbox__nav--next { right: clamp(0.25rem, 1.5vw, 1.25rem); }

/* Curseur « loupe » sur les images cliquables */
.project__body img,
.project__hero img { cursor: zoom-in; }

/* =========================================================
   12. STYLES COMPAGNON  —  sélectionnables dans l'éditeur
   Dans l'éditeur : sélectionne le bloc, puis dans la colonne
   de droite, onglet « Bloc » > section « Styles ».
   ========================================================= */

/* Base commune aux cinq styles */
.is-style-compagnon-light,
.is-style-compagnon-roman,
.is-style-compagnon-medium,
.is-style-compagnon-bold,
.is-style-compagnon-italic {
  font-family: var(--font-mono); /* Compagnon */
  letter-spacing: 0.01em;
}

.is-style-compagnon-light  { font-weight: 300 !important; font-style: normal; }
.is-style-compagnon-roman  { font-weight: 400 !important; font-style: normal; }
.is-style-compagnon-medium { font-weight: 500 !important; font-style: normal; }
.is-style-compagnon-bold   { font-weight: 700 !important; font-style: normal; }
.is-style-compagnon-italic { font-weight: 400 !important; font-style: italic; }

/* Un titre en Compagnon garde une taille lisible :
   la chasse fixe est plus large, on compense légèrement. */
h1.is-style-compagnon-light,
h1.is-style-compagnon-roman,
h1.is-style-compagnon-medium,
h1.is-style-compagnon-bold,
h1.is-style-compagnon-italic,
h2.is-style-compagnon-light,
h2.is-style-compagnon-roman,
h2.is-style-compagnon-medium,
h2.is-style-compagnon-bold,
h2.is-style-compagnon-italic,
h3.is-style-compagnon-light,
h3.is-style-compagnon-roman,
h3.is-style-compagnon-medium,
h3.is-style-compagnon-bold,
h3.is-style-compagnon-italic {
  letter-spacing: 0;
  line-height: 1.3;
}

/* =========================================================
   14. LARGEURS D'IMAGES DANS UN PROJET
   Trois options dans l'éditeur (bloc Image > Aligner) :
   - normale        : largeur de la colonne de texte (comme les galeries)
   - large          : déborde légèrement
   - pleine largeur : bord à bord de l'écran
   ========================================================= */

/* Par défaut, une image seule occupe toute la colonne,
   comme les galeries — plus de vignette centrée étriquée. */
.project__body img,
.project__body .wp-block-image {
  width: 100%;
  max-width: 100%;
  height: auto;
}
.project__body figure { margin-inline: 0; }

.project__body .wp-block-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Alignement « large » : déborde de la colonne de texte. */
.project__body .alignwide {
  width: calc(100% + 2 * var(--pad));
  max-width: calc(100vw - 2rem);
  margin-left: calc(-1 * var(--pad));
  margin-right: calc(-1 * var(--pad));
}

/* Alignement « pleine largeur » : bord à bord de l'écran. */
.project__body .alignfull {
  position: relative;
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
.project__body .alignfull img {
  width: 100%;
  height: auto;
}

/* Légende sous une image, en Compagnon discret. */
.project__body figcaption,
.project__body .wp-element-caption {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-top: var(--space-1);
  text-align: left;
}

/* Galeries : conserve le comportement en colonnes. */
.project__body .wp-block-gallery { width: 100%; }
