/* ==========================================================================
   Zoé Raphael — feuille de style du site
   Trois gabarits :  ordinateur ≥ 1200px · tablette 700–1199px · smartphone < 700px
   ========================================================================== */

/* ---------- Typographie (Source Code Pro, hébergée localement) ---------- */
@font-face {
  font-family: "Source Code Pro";
  src: url("../fonts/source-code-pro-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Code Pro";
  src: url("../fonts/source-code-pro-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 200 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Code Pro";
  src: url("../fonts/source-code-pro-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 900; font-style: italic; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Variables : valeurs « ordinateur » ---------- */
:root {
  --pink: #ff10f0;          /* couleur des liens (maquette) */
  --logo: 100px;            /* monogramme */
  --menu-w: 220px;          /* colonne du menu */
  --gut: 50px;              /* marges blanches qui accueillent les triangles */
  --edge: 30px;             /* marge extérieure de la page */
  --top: 50px;
  --row-gap: 40px;          /* espace entre monogramme / titre et la grande image */
  --gap: 20px;              /* espace entre les blocs */
  --fs: 16px;
  --menu-fs: 14px;
  --h1: 48px;
  --tri-w: 24px;
  --tri-h: 29px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-gutter: stable;}
body {
  margin: 0;
  font-family: "Source Code Pro", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: var(--fs);
  line-height: 1.5;
  color: #000;
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: var(--pink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, p, ul, figure { margin: 0; padding: 0; }
ul { list-style: none; }

/* ---------- Grille de la page ----------
   Ligne 1 : monogramme | titre + date
   Ligne 2 : menu | flèche ◀ | contenu (la grande image démarre ici) | flèche ▶
   → le premier item du menu et le haut de la grande image sont toujours alignés. */
.layout {
  display: grid;
  grid-template-columns: var(--menu-w) var(--gut) minmax(0, 1024px) var(--gut);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "logo . head ."
    "menu prev content next";
  justify-content: center;
  padding: var(--top) var(--edge) 80px;
  min-height: 100vh;
}

.logo { grid-area: logo; align-self: start; justify-self: start; width: var(--logo); height: var(--logo); margin-bottom: var(--row-gap); }
.logo img { width: 100%; height: 100%; }

.head { grid-area: head; align-self: end; margin-bottom: var(--row-gap); min-width: 0; }
.head h1 { font-size: var(--h1); font-weight: 700; line-height: 1.1; overflow-wrap: anywhere; hyphens: auto; }
.head .date { margin-top: .35em; }

.content { grid-area: content; min-width: 0; }

/* ---------- Menu ---------- */
.menu { grid-area: menu; align-self: start; padding-right: 24px; }
.menu ul { line-height: 1.25; }
.menu li { margin: 0 0 .6em; }
/* remonte légèrement le 1er item pour que la hauteur des capitales s'aligne sur le bord de l'image */
/*.menu li:first-child { margin-top: -0.3em; }*/
.menu a { color: #000; font-size: var(--menu-fs); overflow-wrap: anywhere; }
.menu a:hover { color: var(--pink); text-decoration: none; }
.menu a.is-current { font-weight: 700; }

.menu-toggle { display: none; }

/* ---------- Triangles précédent / suivant (ordinateur + tablette) ---------- */
.gutter { align-self: stretch; }
.gutter-prev { grid-area: prev; }
.gutter-next { grid-area: next; }
.gutter .tri {
  position: sticky;                       /* reste à la même place quand on déroule la page */
  top: calc(50vh - var(--tri-h) / 2);
}
.tri { display: flex; align-items: center; justify-content: center; width: 100%; height: var(--tri-h); color: #000; }
.tri svg { width: var(--tri-w); height: var(--tri-h); fill: currentColor; transition: fill .15s; }
.tri:hover, .tri:focus-visible { color: var(--pink); text-decoration: none; }
.pager { display: none; }

/* ---------- Grande image ---------- */
.hero { margin: 0 0 50px; background: #eee; aspect-ratio: 1024 / 800; overflow: hidden; }
.hero a, .hero img { display: block; width: 100%; height: 100%; }
.hero img { object-fit: cover; }
.hero-contain { background: #000; }
.hero-contain img { object-fit: contain; }
.hero a { cursor: zoom-in; }

/* Accueil : image 1024 × 850, tirée au hasard */
.hero-home { aspect-ratio: 1024 / 850; margin-bottom: 0; }
.hero-empty { display: flex; align-items: center; justify-content: center; text-align: center; font-size: .85em; color: #777; }

/* ---------- Texte du gabarit fixe ---------- */
.intro { margin-bottom: 50px; line-height: 1.5; text-align: justify; hyphens: auto; }
.intro p, .b-text p { margin: 0 0 1em; }
.intro p:last-child, .b-text p:last-child { margin-bottom: 0; }

/* ---------- Blocs modulables : grille de 12 colonnes ----------
   pleine largeur = 12 · moitié = 6 · tiers = 4 · quart = 3 */
.blocks {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  align-items: start;
  margin-bottom: 30px;
}
.block { min-width: 0; }
.b-full    { grid-column: span 12; }
.b-half    { grid-column: span 6; }
.b-third   { grid-column: span 4; }
.b-quarter { grid-column: span 3; }
.block img, .block video { width: 100%; height: auto; }
.b-image a { display: block; cursor: zoom-in; }
.block figcaption { margin-top: .5em; font-size: .8em; line-height: 1.4; }
.b-text { text-align: left; }
.b-file a { text-decoration: underline; }

/* ---------- Pastille « admin » (visible seulement une fois connecté) ---------- */
.admin-bar {
  position: fixed; right: 12px; bottom: 12px; z-index: 50;
  padding: 6px 12px; font-size: 12px; color: #fff; background: #000; border-radius: 99px; opacity: .85;
}
.admin-bar:hover { opacity: 1; text-decoration: none; background: var(--pink); }

/* ---------- Visionneuse plein écran ---------- */
.lb { position: fixed; inset: 0; z-index: 100; display: none; flex-direction: column; background: rgba(0, 0, 0, .95); color: #fff; touch-action: pan-y; }
.lb.is-open { display: flex; }
.lb-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 16px 16px 0; }
.lb-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lb-bar { display: flex; justify-content: space-between; gap: 24px; align-items: baseline; padding: 12px 20px 16px; font-size: 13px; min-height: 48px; }
.lb-caption { flex: 1; min-width: 0; }
.lb-count { opacity: .6; white-space: nowrap; }
.lb-close {
  position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: #000; color: #fff; cursor: pointer; display: grid; place-items: center; z-index: 2;
}
.lb-close:hover { background: var(--pink); }
.lb-close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; }
body.lb-lock { overflow: hidden; }

/* ==========================================================================
   TABLETTE  (700 – 1199px) : même structure, monogramme et image 2× plus petits
   ========================================================================== */
@media (max-width: 1199px) {
  :root {
    --logo: 50px;
    --menu-w: 170px;
    --gut: 40px;
    --edge: 24px;
    --top: 32px;
    --row-gap: 24px;
    --gap: 14px;
    --fs: 14px;
    --menu-fs: 12px;
    --h1: 28px;
    --tri-w: 16px;
    --tri-h: 20px;
  }
  .hero { margin-bottom: 32px; }
  .intro { margin-bottom: 32px; }
  .menu { padding-right: 16px; }
}

/* ==========================================================================
   SMARTPHONE  (< 700px) : menu en surimpression, flèches en bas de page
   ========================================================================== */
@media (max-width: 699px) {
  :root {
    --logo: 56px;
    --edge: 16px;
    --top: 14px;
    --row-gap: 18px;
    --gap: 10px;
    --fs: 15px;
    --h1: 26px;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas: "logo" "head" "content" "pager";
    align-content: start;
    padding-bottom: 40px;
  }
  .logo { margin-bottom: var(--row-gap); position: relative; z-index: 60; }
  .head { margin-bottom: 18px; }
  .hero { margin-bottom: 24px; }
  .intro { margin-bottom: 24px; text-align: left; hyphens: manual; }

  /* Pastille ronde : « + » blanc sur noir ; devient « − » une fois le menu ouvert */
  .menu-toggle {
    position: fixed; top: 14px; right: 14px; z-index: 70;
    display: block; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%;
    background: #000; cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .menu-toggle::before, .menu-toggle span {
    content: ""; position: absolute; left: 50%; top: 50%; background: #fff; border-radius: 1px;
    transition: transform .2s ease;
  }
  .menu-toggle::before { width: 18px; height: 2px; margin: -1px 0 0 -9px; }   /* barre horizontale */
  .menu-toggle span    { width: 2px; height: 18px; margin: -9px 0 0 -1px; }    /* barre verticale */
  .menu-open .menu-toggle span { transform: scaleY(0); }

  /* Menu déplié en surimpression */
  .menu {
    position: fixed; inset: 0; z-index: 65;
    display: none; padding: 96px 24px 40px; overflow-y: auto; background: #fff;
  }
  .menu-open .menu { display: block; }
  .menu-open { overflow: hidden; }
  .menu ul { line-height: 1.25; }
  .menu li { margin: 0 0 .9em; }
  .menu li:first-child { margin-top: 0; }
  .menu a { font-size: 22px; }

  /* Les blocs 1/3 et 1/4 passent à la moitié pour rester lisibles */
  .b-third, .b-quarter { grid-column: span 6; }

  /* Flèches : en bas de page, de part et d'autre */
  .gutter { display: none; }
  .pager {
    grid-area: pager; display: flex; justify-content: space-between; align-items: center;
    margin-top: 40px; padding-top: 8px;
  }
  .pager .tri { width: 64px; height: 64px; --tri-w: 22px; --tri-h: 26px; }
  .pager .tri svg { width: 22px; height: 26px; }

  .lb-stage { padding: 56px 0 0; }
}
