/* Site public — La Compagnie Jaoul
   Front uniquement. Le backoffice utilise admin/assets/css/admin.css
   (+ preview-contenu.css pour l’aperçu Markdown, sans charger ce fichier).

   Labeur : Velvelyne (Manon Van der Borght & Mariel Nils), licence CUTE.
   Source : https://velvetyne.fr/fonts/velvelyne/
   Formats servis : woff2, woff (fallback).

   Dette JS (hors K) : --texte-largeur = clientX (viewport → bord aside),
   donc trop large d’une largeur de rail. main cale sur
   var(--texte-largeur, calc(100vh * 2 / 3)) sans corriger le JS.

   Dette CUTE : crédit + lien dans ce fichier + fonts/velvelyne/ ;
   pas de nœud HTML ajouté pour un crédit visible. */

/* Velvelyne labeur : Light 300 · Book 400 · Regular 500 · Bold 700 */
@font-face {
  font-family: "Velvelyne";
  src:
    url("../../fonts/velvelyne/fonts/woff2/Velvelyne-Light.woff2") format("woff2"),
    url("../../fonts/velvelyne/fonts/woff/Velvelyne-Light.woff") format("woff");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Velvelyne";
  src:
    url("../../fonts/velvelyne/fonts/woff2/Velvelyne-Book.woff2") format("woff2"),
    url("../../fonts/velvelyne/fonts/woff/Velvelyne-Book.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Velvelyne";
  src:
    url("../../fonts/velvelyne/fonts/woff2/Velvelyne-Regular.woff2") format("woff2"),
    url("../../fonts/velvelyne/fonts/woff/Velvelyne-Regular.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Velvelyne";
  src:
    url("../../fonts/velvelyne/fonts/woff2/Velvelyne-Bold.woff2") format("woff2"),
    url("../../fonts/velvelyne/fonts/woff/Velvelyne-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --burger-opacity-scroll: 0.33;
  --burger-fade: 300ms;
  --burger-reappear-delay: 600ms;
  --font-labeur: "Velvelyne", Georgia, serif;
  --font-menu: var(--font-labeur);
  --color-bg: #f4f4f2;
  --color-text: #111111;
  --color-bg-hover: #ffff00;
  --color-muted: #333333;
  --color-border: #111111;
  --color-caption: #111111;
  --color-caption-text: #f4f4f2;
  --color-quote-bg: #fff;

  /* Réf. hauteur fenêtre 1000px : 1rem=16px → 1.6vh ; rail 2.85rem → 4.56vh */
  --rail-w: 4.56vh;
  --rail-pad: 1.12vh;
  --texte-defaut: calc(100vh * 2 / 3);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  display: grid;
  grid-template-columns:
    var(--rail-w)
    minmax(0, var(--texte-largeur, var(--texte-defaut)))
    minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas:
    "header main aside"
    "header footer aside";
  margin: 0;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  font-family: var(--font-labeur);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
}

a:hover,
a:focus-visible {
  text-decoration-thickness: 2px;
}

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

.site-header {
  grid-area: header;
  position: fixed;
  /* top: 100% + origin top left + rotate(-90deg) → collé bas, sans trou ≈ --rail-w */
  left: 0;
  top: 100%;
  bottom: auto;
  z-index: 40;
  box-sizing: border-box;
  width: 100dvh;
  max-width: none;
  height: var(--rail-w);
  overflow: hidden;
  display: flex;
  flex-flow: row nowrap;
  align-items: stretch;
  /* base em = 16px @ 1000px de haut → le rail entier scale en vh */
  font-size: 1.6vh;
  gap: 1.25em;
  padding: 0 1.1em;
  border-block-start: 1px solid var(--color-border);
  border-bottom: 1px dotted #aaa;
  background: var(--color-bg);
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  transform: rotate(-90deg);
  transform-origin: top left;
}

.site-header > button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  align-self: center;
  box-sizing: border-box;
  margin: 0;
  padding: 0.15em;
  border: none;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  line-height: 0;
  transform: rotate(90deg);
}

.site-header > button svg {
  display: block;
  width: 1.5em;
  height: 1.5em;
}

.site-header > button:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}

p.site-brand {
  margin: 0;
  font-family: var(--font-labeur);
  font-weight: 700;
  text-transform: none;
}

.site-brand a {
  color: inherit;
  text-decoration: none;
  font-size: 1.15em;
  font-weight: 700;
  line-height: var(--rail-w);
}

.site-brand a:hover,
.site-brand a:focus-visible {
  text-decoration: underline;
}

.site-nav {
  display: flex;
  font-family: var(--font-menu);
  font-weight: 400;
  text-transform: uppercase;
  align-self: stretch;
}

.site-nav ul {
  display: flex;
  flex-flow: row nowrap;
  align-items: stretch;
  gap: 0.35em 0.9em;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav > ul {
  align-self: stretch;
}

.site-nav > ul > li {
  display: flex;
  flex-flow: row nowrap;
  align-items: stretch;
  align-self: stretch;
  gap: 0.35em;
}

.site-nav li > ul {
  position: relative;
  flex: 1 1 auto;
  flex-direction: row;
  flex-wrap: nowrap;
  align-self: stretch;
  align-items: stretch;
  box-sizing: border-box;
  margin: 0;
  min-block-size: auto;
  padding-block: 0;
  padding-inline: 0.45em;
  background: none;
  /* Filets | via pseudo : même paint des deux côtés (border-inline asymétrique sous rotate) */
  border-inline: none;
  clip-path: inset(0 50% 0 50%);
  animation: subnav-reveal 350ms ease forwards;
}

.site-nav li > ul::before,
.site-nav li > ul::after {
  content: "";
  position: absolute;
  inset-block: 0;
  inline-size: 1px;
  background-color: var(--color-border);
  pointer-events: none;
}

.site-nav li > ul::before {
  inset-inline-start: 0;
}

.site-nav li > ul::after {
  inset-inline-end: 0;
}

.site-nav a {
  display: flex;
  align-items: center;
  align-self: stretch;
  color: inherit;
  text-decoration: none;
  font-weight: 400;
}

.site-nav li > ul a {
  display: block;
  line-height: var(--rail-w);
  font-weight: 300;
  opacity: 0;
  animation: subnav-fade 350ms ease 80ms forwards;
}

.site-nav a:hover {
  text-decoration: underline;
  text-decoration-style: wavy;
}
.site-nav a:focus-visible {
  /* text-decoration: underline; */
}

.site-nav a[aria-current="page"] {
  font-weight: 700;
  /* text-decoration: underline; */
  background: none;
  color: inherit;
}

.site-nav li > ul a[aria-current="page"] {
  font-weight: 500;
}

@keyframes subnav-reveal {
  from {
    clip-path: inset(0 50% 0 50%);
  }

  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes subnav-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.site-main {
  grid-area: main;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.5rem 1.25rem 2rem;
}

.contenu {
  width: 100%;
  max-width: none;
  margin: 0;
}

.contenu .page-titre,
.page-titre {
  font-family: var(--font-labeur);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  font-style: normal;
  line-height: 1.15;
  margin: 0 0 1.1rem;
}

.contenu h1 {
  font-family: var(--font-labeur);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 1.5rem 0 0.6rem;
}

.contenu h2 {
  font-family: var(--font-labeur);
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1.2;
  margin: 1.35rem 0 0.5rem;
}

.contenu h3 {
  font-family: var(--font-labeur);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.25;
  margin: 1.2rem 0 0.4rem;
}

.contenu p {
  margin: 0 0 0.9rem;
}

.contenu ul,
.contenu ol {
  margin: 0 0 0.9rem;
  padding-left: 1.2rem;
}

.contenu li {
  margin-bottom: 0.3rem;
}

.contenu blockquote {
  font-family: var(--font-labeur);
  font-weight: 300;
  margin: 0 0 0.9rem;
  padding: 0.75rem 1rem;
  background-color: var(--color-quote-bg);
  border-radius: 0.5rem;
}

.contenu blockquote p {
  margin: 0 0 0.5rem;
}

.contenu blockquote p:last-child {
  margin-bottom: 0;
}

.grille {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
}

.grille > section {
  min-width: 0;
  border: 1px dotted var(--color-border);
  padding: .5rem;
  border-radius: .5rem;
}
.grille>section:hover{
  background-color: var(--color-bg-hover);
}

.grille > section > :first-child {
  margin-top: 0;
}

/* Titres de colonnes — à ajuster à la main */
section.grille section h2 {
  font-family: var(--font-labeur);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
}

section.grille section h3 {
  font-family: var(--font-labeur);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.25;
  text-transform: uppercase;
  margin: 1rem 0 0.4rem;
}

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

.site-medias {
  grid-area: aside;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background-color: #d8d8d4;
  /* background-image:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 7px,
      rgba(17, 17, 17, 0.07) 7px,
      rgba(17, 17, 17, 0.07) 8px
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 7px,
      rgba(17, 17, 17, 0.07) 7px,
      rgba(17, 17, 17, 0.07) 8px
    ); */
  background-image: url(../../medias/fond_traits_s.png);
  background-position: center;
  background-attachment: fixed;
}

.site-medias figure {
  position: relative;
  /* margin: 0 0 0.75rem; */
  margin: 0;
}

.site-medias figure:last-child {
  margin-bottom: 0;
}

.site-medias img {
  width: 100%;
  height: auto;
}

.site-medias video {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background-color: #1a1a1a;
}

.site-medias figcaption {
  position: absolute;
  bottom: 1rem;
  left: 0;
  /* right: 0;
  width: 100%; */
  background: var(--color-caption);
  color: var(--color-caption-text);
  padding: 0.4rem 0.65rem;
  font-family: var(--font-labeur);
  font-size: 0.85rem;
  line-height: 1.35;
}

.site-medias figure.site-media--video > figcaption {
  top: 1rem;
  bottom: auto;
  left: 0;
  /* pas de width, pas de right */
}

.site-footer {
  grid-area: footer;
  /* padding: 1rem 1.25rem 1.5rem; */
  padding: 0 1.25rem 0;
  /* border-top: 1px solid var(--color-border); */
  font-size: 0.95rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  color: inherit;
  text-decoration: none;
}

.site-footer a svg {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  /* outline: 2px solid var(--color-text);
  outline-offset: 2px; */
  background-color: var(--color-bg-hover);
  border-radius: 50%;
}

/* —— Mobile : pile + burger sticky haut-droite —— */
@media (max-width: 640px) {
  :root {
    --rail-w: 2.85rem;
    --rail-pad: 0.7rem;
  }

  body {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    grid-template-rows: none;
    grid-template-areas: none;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .site-main {
    min-height: 0;
    overflow: visible;
  }

  .site-header {
    position: sticky;
    top: 0;
    bottom: auto;
    left: auto;
    width: auto;
    height: auto;
    max-height: none;
    overflow: visible;
    display: grid;
    grid-template-columns: 1fr auto;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    transform: none;
    transform-origin: initial;
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
    border-inline-end: none;
    border-bottom: 1px solid var(--color-border);
    gap: 0.35rem 0.75rem;
    align-items: center;
  }

  .site-header > button {
    display: flex;
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 0;
    z-index: 60;
    justify-self: end;
    transform: none;
    padding: 0.15rem;
    opacity: 1;
    transition: opacity var(--burger-fade) var(--burger-reappear-delay);
  }

  .site-header > button svg {
    width: 1.5rem;
    height: 1.5rem;
  }

  html.is-scrolling .site-header > button[aria-expanded="false"] {
    opacity: var(--burger-opacity-scroll);
    transition: opacity var(--burger-fade);
    transition-delay: 0s;
  }

  .site-header > button[aria-expanded="true"] {
    opacity: 1;
    transition: none;
  }

  .site-brand {
    padding: 0.75rem 1rem 0.25rem;
  }

  .site-brand a {
    font-size: 1.15rem;
    line-height: 1.2;
  }

  .site-nav {
    display: none;
    min-block-size: 0;
  }

  .site-header > button[aria-expanded="true"] ~ #site-nav {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: var(--color-bg);
    padding: 4rem 1.25rem 1.5rem;
    overflow: auto;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0.85rem;
    font-size: 1.35rem;
    min-block-size: 0;
  }

  .site-nav > ul > li {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .site-nav li > ul {
    flex: none;
    flex-direction: column;
    min-block-size: 0;
    margin: 0.35rem 0 0.15rem;
    padding: 0.5rem 0.65rem;
  }

  .site-nav li > ul a {
    display: flex;
    line-height: 1.3;
  }

  .site-medias {
    min-height: 0;
    overflow: visible;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --burger-fade: 0ms;
    --burger-reappear-delay: 0ms;
  }

  .site-header > button {
    transition: none;
  }

  .site-nav li > ul {
    clip-path: none;
    animation: none;
  }

  .site-nav li > ul a {
    opacity: 1;
    animation: none;
  }
}
