/* ===== Styles propres aux pages projet ===== */
body .pjt,
body .nx {
  font-family: var(--sw);
  font-weight: 400;
  letter-spacing: .03em
}

.pj {
  padding-top: 110px
}

.back {
  display: inline-block;
  text-decoration: none;
  font-size: 15px;
  margin-bottom: 3vh;
  border-bottom: 2px solid var(--blue)
}

.back:hover {
  color: var(--blue)
}

.pjt {
  margin: 0;
  font-size: clamp(56px, 16vw, 260px);
  line-height: .82
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 3vh 0 0
}

.tags span {
  border: 2px solid var(--ink);
  padding: 5px 16px;
  font-size: 14px
}

.meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  border-top: 2px solid var(--ink);
  margin-top: 5vh;
  padding-top: 14px
}

.meta dt {
  color: var(--mute);
  font-size: 13px
}

.meta dd {
  margin: 4px 0 0;
  font-size: 16px
}

.ph1 {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  color: var(--t, #0C0C0C);
  background: var(--b);
  overflow: hidden;
  font-size: 13px
}

.ph1::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle, var(--d) 38%, transparent 41%) 0 0/14px 14px;
  mix-blend-mode: multiply;
  -webkit-mask-image: linear-gradient(var(--a, 200deg), #000, transparent 70%);
  mask-image: linear-gradient(var(--a, 200deg), #000, transparent 70%)
}

.ph1 img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1
}

.cover {
  aspect-ratio: 16/9;
  margin-top: 5vh
}

.txt {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 3fr;
  gap: 20px;
  border-top: 2px solid var(--ink);
  padding: 18px 0 28px;
  margin-top: 6vh
}

.txt h2 {
  position: sticky;
  top: 76px;
  align-self: start;
  margin: 0;
  font-size: clamp(26px, 3vw, 40px);
  line-height: .9
}

.txt p {
  margin: 0 0 1em;
  max-width: 60ch;
  font-size: 19px
}

.txt p:first-of-type {
  font-size: clamp(22px, 2.6vw, 34px);
  line-height: 1.2;
  letter-spacing: -.02em
}

.gal {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: clamp(60px, 9vw, 120px);
  gap: 14px;
  margin-top: 5vh
}

.gal .ph1 {
  grid-column: span var(--c);
  grid-row: span var(--r)
}

.band2 {
  background: var(--blue);
  color: #fff;
  margin: 8vh calc(-1*clamp(18px, 3.5vw, 48px)) 0;
  padding: 8vh clamp(18px, 3.5vw, 48px)
}

.band2 p {
  margin: 0;
  font-size: clamp(28px, 5vw, 72px);
  line-height: .95;
  max-width: 16ch
}

.band2 small {
  display: block;
  margin-top: 22px;
  font-size: 14px;
  opacity: .8
}

.nx {
  display: block;
  text-decoration: none;
  margin-top: 8vh;
  border-top: 2px solid var(--ink);
  padding-top: 14px
}

.nx small {
  display: block;
  font-family: var(--ac);
  font-size: 14px;
  letter-spacing: 0;
  color: var(--mute)
}

.nx b {
  display: block;
  font-weight: 400;
  font-size: clamp(40px, 9vw, 150px);
  line-height: .85;
  transition: color .2s, transform .35s;
  transform-origin: left bottom
}

.nx:hover b {
  color: var(--blue);
  transform: scale(1.03)
}

@media(max-width:780px) {
  .meta {
    grid-template-columns: 1fr 1fr
  }

  .txt {
    grid-template-columns: 1fr
  }

  .txt h2 {
    position: static
  }

  .gal {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 90px
  }

  .gal .ph1 {
    grid-column: span 1;
    grid-row: span var(--m, 2)
  }

  .gal .full {
    grid-column: span 2
  }
}

/* La flèche reste au-dessus du titre (fix Safari) */
.back {
  position: relative;
  z-index: 20;
  padding: 6px 2px;
  margin-bottom: 4vh
}

.pjt {
  position: relative;
  z-index: 1
}

/* Photo + vidéo côte à côte (page Addams) */
.duo {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 14px;
  margin-top: 5vh
}

.duo .ph1:first-child {
  aspect-ratio: 3/4
}

.duo .ph1 video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  background: #0C0C0C
}

@media (max-width: 760px) {
  .duo {
    grid-template-columns: 1fr
  }

  .duo .vid {
    aspect-ratio: 9/16
  }
}

/*MOS-START*/
/* Galerie : les images gardent leurs proportions */
.mos {
  display: grid;
  grid-template-columns: repeat(var(--n, 2), 1fr);
  gap: 14px;
  margin-top: 6vh;
  align-items: start
}

.mos figure {
  margin: 0;
  overflow: hidden;
  max-width: var(--mw, none);
  width: 100%
}

.mos .full {
  grid-column: 1 / -1;
  justify-self: center
}

.mos img,
.mos video {
  display: block;
  width: 100%;
  height: auto
}

.mos.uni figure {
  aspect-ratio: var(--ar)
}

.mos.uni img,
.mos.uni video {
  height: 100%;
  object-fit: cover
}

@media (max-width: 760px) {
  .mos {
    grid-template-columns: repeat(var(--nm, 1), 1fr);
    gap: 10px
  }
}

.band2 p a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: .12em;
  text-decoration-thickness: 3px
}

.pjt.lg {
  font-size: clamp(44px, 10vw, 150px)
}

.intro {
  max-width: 760px;
  margin: 4vh 0 0;
  font-size: 18px;
  line-height: 1.5
}

.txt p a,
footer a {
  text-underline-offset: 4px
}

.txt p {
  max-width: 62ch
}
/*MOS-END*/

/* Pages légales : texte courant homogène */
.legal .txt p,
.legal .txt p:first-of-type {
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: 0;
  max-width: 70ch
}

/* Images pleine largeur : jamais recadrées */
.mos.uni .full {
  aspect-ratio: auto
}

.mos.uni .full img,
.mos.uni .full video {
  height: auto;
  object-fit: initial
}

/* Encarts bleus : pleine largeur, une seule ligne si possible */
.band2 p {
  max-width: none
}

/* Images détourées : sur le thème sombre, elles posent sur une plaque claire pour rester lisibles */
:root[data-theme="dark"] .mos .cut {
  background: #EAEAE6
}

/* r2 : précédent / suivant */
.pn{display:grid;grid-template-columns:1fr 1fr;gap:4vw;margin-top:8vh}
.pn .nx{margin-top:0}
.pn .nt{text-align:right}
.pn .nt b{transform-origin:right bottom}
.nx small{font-size:clamp(18px,1.8vw,26px);margin-bottom:.35em}
.pn .nx b{font-size:clamp(28px,6vw,96px)}
@media(max-width:700px){.pn{grid-template-columns:1fr}.pn .nt{text-align:left}}

/* ecole : gif à gauche, images à droite */
.mos.ec{grid-template-columns:minmax(0,1fr) minmax(0,2.3fr);gap:14px;align-items:start}
.mos.ec .ec-col{display:grid;gap:14px}
.mos.ec figure{max-width:none}
@media(max-width:760px){.mos.ec{grid-template-columns:1fr}}

/* légendes rénovation */
.mos .rl{grid-column:1 / -1;margin:2.5vh 0 0;font-family:var(--ac);font-weight:500;font-size:clamp(15px,1.5vw,20px);line-height:1;letter-spacing:0;color:var(--mute);text-transform:none}
.mos .rl:first-child{margin-top:0}

.links{margin-top:8vh;margin-bottom:3vh}

/* coupures de lignes propres */
p, dd, li, figcaption { text-wrap: pretty; }
h1, h2, h3, .pjt { text-wrap: balance; }

p[style*="8vh"] { text-wrap: balance; }
