/* =========================================================
   Hors Jeu asbl — feuille de style v3
   Le HTML est le même que la v2 : mêmes blocs <article>,
   mêmes classes. Seule l'apparence change ici.
   ========================================================= */

/* ---------- Couleurs et polices ---------- */
:root {
  --papier: #f7f4ee;
  --blanc: #ffffff;
  --encre: #1f1d1a;
  --gris: #6b665f;
  --gris-clair: #e7e2d9;
  --ombre: 0 1px 2px rgba(31, 29, 26, 0.06), 0 4px 14px rgba(31, 29, 26, 0.07);
  --ombre-survol: 0 2px 4px rgba(31, 29, 26, 0.08), 0 12px 28px rgba(31, 29, 26, 0.14);

  /* une couleur par famille de projets */
  --horsjeu: #0b84c6;        /* article_title1 / lb_title1 */
  --video: #0a8a5e;          /* article_title2 / lb_title2 */
  --echangegraphic: #e0610e; /* article_title3 / lb_title3 */
  --exodus: #a5179f;         /* article_title4 / lb_title4 */
  --laboratoire: #d81f12;    /* article_title5 / lb_title5 */

  --titre: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --texte: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --rayon: 10px;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  overflow-x: clip;
  background-color: var(--papier);
  background-image: radial-gradient(rgba(31, 29, 26, 0.07) 1px, transparent 1px);
  background-size: 14px 14px;
  color: var(--encre);
  font-family: var(--texte);
  font-size: 16px;
  line-height: 1.6;
}
body.modal-open {
  overflow: hidden;
}
img {
  max-width: 100%;
  height: auto;
}
a {
  color: var(--horsjeu);
}
h1,
h2,
h3,
h4,
h5 {
  font-family: var(--titre);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.5em;
}
p {
  margin: 0 0 1em;
}
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
strong,
.gras {
  font-weight: 700;
}
.pluspetit {
  font-size: 0.85em;
  font-style: italic;
  color: var(--gris);
}
.red {
  color: var(--laboratoire);
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  /* le pied de page reste en bas de l'écran sur les pages courtes */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.container > section {
  flex: 1 0 auto;
  align-content: start;
}

/* ---------- En-tête ---------- */
/* logo à gauche, titre et slogan empilés à droite */
header {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 4px 32px;
  padding: 28px 0 20px;
  overflow: hidden;
}
header > a {
  grid-row: 1 / span 2;
  align-self: center;
}
#logo img {
  display: block;
  width: 190px;
}
header h1,
header p {
  position: relative;
  z-index: 1;
  margin: 0;
}
header h1 {
  align-self: end;
  font-size: 2.6rem;
  letter-spacing: -0.01em;
}
header p {
  align-self: start;
  color: var(--gris);
  font-family: var(--titre);
  font-size: 1.15rem;
  font-style: italic;
}
#tache {
  position: absolute;
  right: -20px;
  top: -10px;
  width: 300px;
  opacity: 0.35;
  pointer-events: none;
}
#tache img {
  display: block;
  width: 100%;
}

/* ---------- Menu ---------- */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  margin: 0 calc(50% - 50vw) 32px;
  padding: 0 max(20px, calc(50vw - 570px));
  background: rgba(247, 244, 238, 0.9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--gris-clair);
  border-bottom: 1px solid var(--gris-clair);
}
nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
}
nav ul li a {
  display: inline-block;
  padding: 14px 0 12px;
  color: var(--gris);
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
}
nav ul li a:hover {
  color: var(--encre);
}
nav ul li a.selected {
  color: var(--encre);
  border-bottom-color: var(--laboratoire);
}

/* ---------- Grille des projets (accueil) ---------- */
section {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 28px;
  margin-bottom: 48px;
}
article {
  min-width: 0;
}

/* la vignette : un bouton (ou un lien) qui contient catégorie, image, titre, résumé */
.post {
  height: 100%;
  background: var(--blanc);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.post:hover {
  transform: translateY(-3px);
  box-shadow: var(--ombre-survol);
}
.post > button,
.post > a {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0 0 18px;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.post > button:focus-visible,
.post > a:focus-visible {
  outline: 3px solid var(--horsjeu);
  outline-offset: -3px;
}
.post img {
  order: -1; /* l'image passe au-dessus de la catégorie */
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  margin-bottom: 14px;
}
.post p,
.post h2 {
  margin-left: 18px;
  margin-right: 18px;
}
.post p[class^="article_title"] {
  margin-bottom: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.post h2 {
  font-size: 1.3rem;
  margin-bottom: 6px;
}
.post p.article_info {
  margin-bottom: 0;
  color: var(--gris);
  font-size: 0.92rem;
  line-height: 1.5;
}

.article_title1,
.lb_title1 {
  color: var(--horsjeu);
}
.article_title2,
.lb_title2 {
  color: var(--video);
}
.article_title3,
.lb_title3 {
  color: var(--echangegraphic);
}
.article_title4,
.lb_title4 {
  color: var(--exodus);
}
.article_title5,
.lb_title5 {
  color: var(--laboratoire);
}

/* ---------- Fenêtre de détail d'un projet ---------- */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(31, 29, 26, 0.6);
}
body.modal-open .modal-backdrop {
  display: block;
}
.modal_window {
  display: none;
  position: fixed;
  z-index: 100;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(980px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--blanc);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
#modal_header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  padding: 12px 12px 0;
  pointer-events: none;
}
#modal_header button {
  pointer-events: auto;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--papier);
  color: var(--encre);
  font: 600 1rem var(--texte);
  cursor: pointer;
  box-shadow: var(--ombre);
}
#modal_header button:hover {
  background: var(--gris-clair);
}
#modal_content {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 32px;
  padding: 0 36px 36px;
}
#modal_content .modal_left h3 {
  font-size: 1.8rem;
  margin: 8px 0 6px;
}
#modal_content .modal_left h4 {
  font-family: var(--texte);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 18px;
}
#modal_content .modal_left h5 {
  font-family: var(--texte);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gris);
  margin: 0 0 6px;
}
#modal_content .modal_left p {
  font-size: 0.95rem;
  line-height: 1.65;
}
#modal_content .modal_left .lb_deco {
  display: none;
}
#modal_content .modal_right {
  padding-top: 8px;
}
#modal_content .modal_right img {
  display: block;
  width: 100%;
  border-radius: var(--rayon);
  margin-bottom: 14px;
}
#modal_content .modal_right p {
  font-size: 0.85rem;
  color: var(--gris);
  margin-bottom: 6px;
}
#modal_content .modal_right a {
  font-size: 0.85rem;
  word-break: break-word;
}
#modal_footer {
  display: none;
}

/* ---------- Pages de texte (présentation, historique, démarche, contact) ---------- */
article#blocinfo {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 44px 52px;
  background: var(--blanc);
  border-radius: 14px;
  box-shadow: var(--ombre);
  font-size: 1.05rem;
  line-height: 1.75;
}
article#blocinfo h3 {
  font-size: 1.45rem;
  margin: 1.6em 0 0.5em;
  color: var(--encre);
}
article#blocinfo h3:first-child {
  margin-top: 0;
}
article#blocinfo ul {
  margin: 0 0 1em;
  padding-left: 14px;
  border-left: 3px solid var(--gris-clair);
  color: var(--gris);
  font-size: 0.92rem;
  font-style: italic;
  line-height: 1.6;
}
article#blocinfo a {
  color: var(--horsjeu);
}

/* ---------- Page « Huit chaises assises » ---------- */
article#blocinfo.blocchaises {
  max-width: 820px;
}
.blocchaises blockquote {
  margin: 1em 0;
  font-family: var(--titre);
  font-size: 1.3rem;
  font-style: italic;
  line-height: 1.5;
  text-align: center;
}
.blocchaises h2 {
  font-size: 1.35rem;
  margin: 1.4em 0 0.5em;
}
.blocchaises .imagemap {
  overflow-x: auto;
  margin: 1.5em 0;
}
.blocchaises .imagemap img {
  max-width: none;
  border-radius: var(--rayon);
}
ul.listchaise {
  margin: 0.5em 0 1.5em !important;
  padding-left: 22px !important;
  border-left: 0 !important;
  list-style: disc;
  font-style: normal !important;
  color: var(--encre) !important;
  font-size: 1rem !important;
}
ul.listchaise li {
  margin: 6px 0;
}
.liens-chaises a {
  color: var(--laboratoire) !important;
  font-weight: 600;
}

/* ---------- Pied de page ---------- */
/* bandeau sur toute la largeur de l'écran, même si la page est centrée */
footer {
  margin: 0 calc(50% - 50vw);
  padding: 28px 20px;
  background: var(--encre);
  color: #d8d3ca;
  text-align: center;
}
footer p {
  margin: 0;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
}

/* ---------- Tablette ---------- */
@media (max-width: 900px) {
  #modal_content {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 0 24px 28px;
  }
  article#blocinfo {
    padding: 32px 28px;
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .container {
    padding: 0 14px;
  }
  header {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    padding: 20px 0 14px;
  }
  header > a {
    grid-row: auto;
  }
  #logo img {
    width: 150px;
  }
  header h1 {
    font-size: 2rem;
  }
  header p {
    font-size: 1rem;
  }
  #tache {
    display: none;
  }
  nav {
    margin-bottom: 20px;
    padding: 0 14px;
  }
  nav ul {
    justify-content: center;
    gap: 0 18px;
  }
  nav ul li a {
    font-size: 0.8rem;
    padding: 12px 0 10px;
  }
  section {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .modal_window {
    top: 0;
    left: 0;
    transform: none;
    width: 100%;
    max-height: none;
    height: 100%;
    border-radius: 0;
  }
  #modal_content {
    padding: 0 18px 24px;
  }
  #modal_content .modal_left h3 {
    font-size: 1.5rem;
  }
  article#blocinfo {
    padding: 24px 18px;
    font-size: 1rem;
    border-radius: var(--rayon);
  }
}
