/* WHAT IF Concept — feuille de style (reprend le thème Twenty Twenty-Three du site WordPress) */

:root {
  --color-text: #212121;
  --color-bg: #ffffff;
  --color-primary: #2160ff;
  --color-secondary: #284ba2;
  --color-muted: #6b6b6b;
  --color-border: #e2e2e2;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;

  --fs-small: clamp(0.875rem, 0.82rem + 0.2vw, 0.975rem);
  --fs-body: clamp(1rem, 0.95rem + 0.25vw, 1.1rem);
  --fs-medium: clamp(1.2rem, 1.1rem + 0.35vw, 1.4rem);
  --fs-large: clamp(1.4rem, 1.2rem + 0.8vw, 1.85rem);
  --fs-h2: clamp(1.6rem, 1.3rem + 1vw, 2.1rem);
  --fs-h1: clamp(2.2rem, 1.5rem + 2.6vw, 3.3rem);

  --content: 1000px;
  --wide: 1200px;
  --gutter: clamp(1.5rem, 5vw, 2rem);
  --space-s: clamp(1rem, 2vw, 1.5rem);
  --space-m: clamp(1.5rem, 4vw, 2.5rem);
  --space-l: clamp(2.5rem, 7vw, 5rem);
}

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

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible,
button:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }

h1, h2, h3 { font-weight: 400; line-height: 1.2; margin: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 100;
  background: var(--color-text); color: #fff; padding: 0.5rem 1rem;
}
.skip-link:focus { top: 1rem; }

/* ---------- Mise en page ---------- */

.wrap {
  width: 100%;
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap.wide { max-width: calc(var(--wide) + 2 * var(--gutter)); }

/* ---------- En-tête ---------- */

.site-header { padding-block: var(--space-m); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  font-weight: 700;
  font-size: var(--fs-body);
}
.brand img { width: 40px; height: 40px; border-radius: 50%; }

.site-header nav a {
  text-decoration: none;
  font-size: var(--fs-small);
}
.site-header nav a:hover { text-decoration: underline; }

/* ---------- Pied de page ---------- */

.site-footer {
  padding-block: var(--space-l) var(--space-m);
  font-size: var(--fs-small);
}
.site-footer p { margin: 0; }

/* ---------- Accueil ---------- */

.home-title {
  font-size: var(--fs-h1);
  margin-bottom: var(--space-m);
}

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-m) var(--space-s);
}

.card-media {
  display: block;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #f2f2f2;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.card:hover .card-media img { transform: scale(1.04); }

.cards--wide .card-media { aspect-ratio: 16 / 9; }

.card-title {
  font-size: var(--fs-medium);
  line-height: 1.2;
  margin-top: 1.25rem;
}
.card-title a { text-decoration: none; }
.card-title a:hover { text-decoration: underline; }

.read-more {
  display: inline-block;
  margin-top: 1rem;
  font-size: var(--fs-small);
  text-decoration: none;
}
.read-more:hover { text-decoration: underline; }

@media (max-width: 781px) {
  .cards { grid-template-columns: 1fr; }
  .card-media { aspect-ratio: 3 / 2; }
}

/* ---------- Pages & articles ---------- */

.page-title,
.post-title { font-size: var(--fs-h1); }
.page-title { margin-bottom: var(--space-m); }

.post-header { margin-bottom: var(--space-m); }
.post-hero { margin: 0 0 var(--space-m); }
.post-hero img { width: 100%; max-height: 80vh; object-fit: cover; }
.post-header .wrap-inner { max-width: var(--content); margin-inline: auto; }

.content > * { margin-block: 0; }
.content > * + * { margin-top: 1.5rem; }
.content > h2 { font-size: var(--fs-h2); margin-top: 2.5rem; }
.content > h3 { font-size: var(--fs-medium); margin-top: 2rem; }
.content > hr + h2,
.content > hr + h3 { margin-top: 0; }

.content hr {
  width: 100px;
  border: 0;
  border-top: 2px solid currentColor;
  opacity: 0.4;
  margin: var(--space-m) auto;
}

.content ul { padding-left: 1.3em; }
.content li + li { margin-top: 0.35em; }
.content sup { line-height: 0; }
.content a { color: var(--color-primary); }

.lead { font-size: var(--fs-large); line-height: 1.6; }
.hl { color: var(--color-primary); }

/* Boutons */
.buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.button {
  display: inline-block;
  padding: 0.8em 1.45em;
  background: var(--color-primary);
  color: #fff !important;
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.button:hover { background: var(--color-secondary); }

/* Images & galeries */
.content figure { margin-inline: 0; }
.content figure img { width: 100%; }
.content img { cursor: zoom-in; }

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}
.gallery.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gallery.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gallery > figure { margin: 0; overflow: hidden; }
.gallery > figure img { height: 100%; object-fit: cover; }
/* Une image seule sur la dernière ligne prend toute la largeur */
.gallery:not(.cols-3):not(.cols-4) > figure:last-child:nth-child(odd) { grid-column: 1 / -1; }

@media (max-width: 600px) {
  .gallery.cols-3,
  .gallery.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Méta de l'article */
.post-meta { margin-top: var(--space-l); font-size: var(--fs-small); }
.post-meta hr { border: 0; border-top: 1px solid currentColor; opacity: 0.25; margin: 0 0 1.5rem; }
.post-meta-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 2rem; }
.post-meta-cols > div:last-child { text-align: right; }
@media (max-width: 600px) {
  .post-meta-cols { grid-template-columns: 1fr; }
  .post-meta-cols > div:last-child { text-align: left; }
}

.latest { margin-top: var(--space-l); }
.latest h2 { font-size: var(--fs-h2); margin-bottom: var(--space-m); }

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 10, 0.94);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
}
.lightbox button {
  position: absolute;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 2rem;
  line-height: 1;
  padding: 1rem;
  cursor: pointer;
  opacity: 0.75;
}
.lightbox button:hover { opacity: 1; }
.lightbox .lb-close { top: 0.5rem; right: 0.5rem; }
.lightbox .lb-prev { left: 0.25rem; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 0.25rem; top: 50%; transform: translateY(-50%); }
.lightbox .lb-count {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  opacity: 0.7;
  font-size: var(--fs-small);
}
body.lb-locked { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
