/* Réalisations — aperçu (préfixe rea-) */
html body .rea {
  --rea-ink: #2f4a6a;
  --rea-accent: #ee9b80;
  --rea-accent-txt: color-mix(in srgb, var(--rea-accent) 72%, #7a2e14);
  --rea-muted: color-mix(in srgb, var(--rea-ink) 62%, #8a8079);
  --rea-line: color-mix(in srgb, var(--rea-ink) 16%, transparent);
  --rea-radius: 24px;
  --rea-serif: var(--e-global-typography-primary-font-family, "DM Serif Display"), Georgia, "Times New Roman", serif;
  position: relative; color: var(--rea-ink); font-size: 16px; line-height: 1.5;
}
html body .rea *, html body .rea *::before, html body .rea *::after { box-sizing: border-box; }
html body .rea a { color: inherit; text-decoration: none; }
html body .rea img { display: block; max-width: 100%; margin: 0; border: 0; border-radius: 0; box-shadow: none; }

/* Apparition douce au défilement (seulement si le script est actif) */
html body .rea.rea-anim .rea-item { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--i, 0) * 90ms); }
html body .rea.rea-anim .rea-item.is-in { opacity: 1; transform: none; }

/* Pastille flèche */
html body .rea-go {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: var(--rea-accent); color: var(--rea-ink);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), background-color .25s, color .25s;
}
html body .rea-go svg { width: 20px; height: 20px; transition: transform .35s cubic-bezier(.2, .8, .2, 1); }

html body .rea-type { display: block; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--rea-accent-txt); }
html body .rea-year { font-size: 14px; color: var(--rea-muted); font-variant-numeric: tabular-nums; }

/* =========================================================
 * Disposition 1 : grille (textes au survol)
 * ======================================================= */
html body .rea-mosaic { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--rea-cols, 3), minmax(0, 1fr)); gap: 26px; }
html body .rea-mosaic > li { margin: 0; padding: 0; list-style: none; min-width: 0; }

html body .rea-card { display: block; height: 100%; border-radius: var(--rea-radius); }
html body .rea-media { position: relative; display: block; overflow: hidden; border-radius: var(--rea-radius); aspect-ratio: 3 / 2; max-width: 100%; background: color-mix(in srgb, var(--rea-ink) 8%, transparent); isolation: isolate; }
html body .rea-media img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; transform: scale(1.001); transition: transform .9s cubic-bezier(.2, .8, .2, 1); }

/* Voile + textes : invisibles au repos, apparaissent au survol */
html body .rea-over {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 22px;
  background: linear-gradient(to top, color-mix(in srgb, var(--rea-ink) 88%, transparent) 0%, color-mix(in srgb, var(--rea-ink) 45%, transparent) 42%, transparent 72%);
  opacity: 0; transition: opacity .35s ease;
}
html body .rea-over-txt { min-width: 0; display: grid; justify-items: start; gap: 9px; transform: translateY(14px); transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
html body .rea-title { margin: 0; font-family: var(--rea-serif); font-weight: 400; font-size: 22px; line-height: 1.15; color: #fbf3ec; }
html body .rea-tag { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 99px; background: #fbf3ec; color: var(--rea-ink); font-size: 12px; font-weight: 700; line-height: 1.2; }
html body .rea-tag .rea-year { font-size: 12px; font-weight: 400; color: var(--rea-muted); }
html body .rea-over .rea-go { flex: none; width: 44px; height: 44px; transform: scale(.6) rotate(-45deg); opacity: 0; transition: transform .4s cubic-bezier(.2, .8, .2, 1) .05s, opacity .3s .05s; }
html body .rea-over .rea-go svg { width: 18px; height: 18px; }

html body .rea-card:hover .rea-media img, html body .rea-card:focus-visible .rea-media img { transform: scale(1.06); }
html body .rea-card:hover .rea-over, html body .rea-card:focus-visible .rea-over { opacity: 1; }
html body .rea-card:hover .rea-over-txt, html body .rea-card:focus-visible .rea-over-txt { transform: none; }
html body .rea-card:hover .rea-over .rea-go, html body .rea-card:focus-visible .rea-over .rea-go { opacity: 1; transform: none; }
html body .rea-card:focus-visible { outline: 2px solid var(--rea-accent); outline-offset: 4px; }

/* Écrans tactiles (pas de survol) : textes toujours visibles */
@media (hover: none) {
  html body .rea-over { opacity: 1; padding: 16px; }
  html body .rea-over-txt { transform: none; }
  html body .rea-over .rea-go { opacity: 1; transform: none; width: 38px; height: 38px; }
}

/* Tuile « Et le vôtre ? » : cadre pointillé corail */
html body .rea-cta {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center;
  height: 100%; min-height: 0; aspect-ratio: 3 / 2; padding: 24px;
  border-radius: var(--rea-radius); border: 2px dashed var(--rea-accent); background: transparent;
  transition: background-color .3s ease, border-color .3s ease, transform .35s cubic-bezier(.2, .8, .2, 1);
}
html body .rea-cta-q { font-family: var(--rea-serif); font-style: italic; font-size: 28px; line-height: 1.1; color: var(--rea-ink); margin: 0; }
html body .rea-cta-row { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; color: var(--rea-accent-txt); }
html body .rea-cta-row svg { width: 18px; height: 18px; transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
html body .rea-cta:hover, html body .rea-cta:focus-visible { background: color-mix(in srgb, var(--rea-accent) 12%, transparent); border-style: solid; transform: translateY(-3px); }
html body .rea-cta:hover .rea-cta-row svg, html body .rea-cta:focus-visible .rea-cta-row svg { transform: translateX(5px); }
html body .rea-cta:focus-visible { outline: 2px solid var(--rea-ink); outline-offset: 4px; }

/* =========================================================
 * Filtres par catégorie
 * ======================================================= */
html body .rea-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 0 34px; }
html body .rea-f {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 700; line-height: 1;
  padding: 11px 18px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--rea-ink) 22%, transparent);
  background: transparent; color: var(--rea-ink);
  transition: background-color .25s, color .25s, border-color .25s, transform .2s;
}
html body .rea-f-n { font-size: 12px; font-weight: 700; min-width: 22px; padding: 3px 6px; border-radius: 99px; text-align: center; background: color-mix(in srgb, var(--rea-ink) 9%, transparent); color: var(--rea-ink); transition: background-color .25s, color .25s; }
html body .rea-f:hover, html body .rea-f:focus-visible { border-color: var(--rea-accent); color: var(--rea-accent-txt); transform: scale(1.04); }
html body .rea-f.is-on, html body .rea-f.is-on:hover { background: var(--rea-ink); border-color: var(--rea-ink); color: #fbf3ec; transform: none; }
html body .rea-f.is-on .rea-f-n { background: var(--rea-accent); color: var(--rea-ink); }
html body .rea-f:focus-visible { outline: 2px solid var(--rea-accent); outline-offset: 3px; }
html body .rea-live { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Masquage / apparition lors du filtrage */
html body .rea-item[hidden] { display: none !important; }
html body .rea .rea-item.is-out { opacity: 0 !important; transform: scale(.94) !important; transition: opacity .22s ease, transform .22s ease !important; transition-delay: 0s !important; }
html body .rea .rea-item.is-pop { animation: rea-pop .45s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--k, 0) * 45ms); }
@keyframes rea-pop { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }

/* =========================================================
 * Disposition 2 : liste éditoriale
 * ======================================================= */
html body .rea-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rea-line); }
html body .rea-list > li { margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--rea-line); }
html body .rea-row {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 12px 36px;
  padding: 26px 8px;
}
html body .rea-row .rea-thumb { display: none; }
html body .rea-row .rea-title { font-size: clamp(26px, 3.4vw, 42px); transition: color .3s, transform .45s cubic-bezier(.2, .8, .2, 1); transform-origin: left center; }
html body .rea-row .rea-go { width: 46px; height: 46px; background: transparent; color: var(--rea-ink); border: 1px solid var(--rea-line); }
html body .rea-row:hover .rea-title, html body .rea-row:focus-visible .rea-title { color: var(--rea-accent-txt); transform: translateX(10px); }
html body .rea-row:hover .rea-go, html body .rea-row:focus-visible .rea-go { background: var(--rea-accent); border-color: var(--rea-accent); transform: rotate(-45deg); }
html body .rea-row:focus-visible { outline: 2px solid var(--rea-accent); outline-offset: 2px; border-radius: 12px; }
html body .rea-row.is-cta .rea-title { font-style: italic; color: var(--rea-accent-txt); }
html body .rea-row.is-cta .rea-type { color: var(--rea-ink); font-size: 15px; letter-spacing: 0; text-transform: none; }
html body .rea-row.is-cta .rea-go { background: var(--rea-ink); color: var(--rea-accent); border-color: var(--rea-ink); }

/* Aperçu qui suit la souris (ordinateur) */
html body .rea-float {
  position: fixed; left: 0; top: 0; z-index: 50; width: 300px; aspect-ratio: 4 / 3; border-radius: 20px; overflow: hidden;
  pointer-events: none; opacity: 0; transform: translate3d(-9999px, 0, 0) scale(.85) rotate(-3deg);
  transition: opacity .25s ease, scale .35s ease; box-shadow: 0 30px 60px -30px rgba(28, 38, 54, .5);
}
html body .rea-float.is-on { opacity: 1; }
html body .rea-float img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  html body .rea-mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  html body .rea-title { font-size: 20px; }
}
@media (max-width: 560px) {
  html body .rea-filters { justify-content: flex-start; gap: 8px; margin-bottom: 24px; }
  html body .rea-f { font-size: 14px; padding: 10px 14px; }
  html body .rea-mosaic { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  html body .rea-media { aspect-ratio: 16 / 10; }
  html body .rea-cta { aspect-ratio: auto; padding: 30px 20px; }
  html body .rea-row { grid-template-columns: 72px minmax(0, 1fr) auto; gap: 4px 16px; padding: 18px 0; }
  html body .rea-row .rea-thumb { display: block; grid-row: 1 / 3; width: 72px; height: 72px; border-radius: 16px; overflow: hidden; }
  html body .rea-row .rea-thumb { position: relative; }
  html body .rea-row .rea-thumb img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; }
  html body .rea-row .rea-title { grid-column: 2; font-size: 24px; }
  html body .rea-row .rea-type { grid-column: 2; grid-row: 2; }
  html body .rea-row .rea-year { display: none; }
  html body .rea-row .rea-go { grid-column: 3; grid-row: 1 / 3; width: 40px; height: 40px; }
  html body .rea-row.is-cta { grid-template-columns: minmax(0, 1fr) auto; }
  html body .rea-row.is-cta .rea-title, html body .rea-row.is-cta .rea-type { grid-column: 1; }
  html body .rea-row.is-cta .rea-go { grid-column: 2; }
}
@media (hover: none), (max-width: 900px) { html body .rea-float { display: none; } }
@media (prefers-reduced-motion: reduce) {
  html body .rea .rea-item.is-pop { animation: none; }
  html body .rea *, html body .rea.rea-anim .rea-item { transition: none !important; }
  html body .rea.rea-anim .rea-item { opacity: 1; transform: none; }
}

/* ---------- Protection contre les styles du thème ---------- */
html body .rea a, html body .rea a:hover, html body .rea a:focus { text-decoration: none; box-shadow: none; color: inherit; }
html body .rea ul, html body .rea li { list-style: none; }
html body .rea li::before { content: none; }
html body .rea button.rea-f, html body .rea button.rea-f:hover, html body .rea button.rea-f:focus { text-transform: none; letter-spacing: normal; box-shadow: none; background-image: none; min-height: 0; }
html body .rea button.rea-f:not(.is-on), html body .rea button.rea-f:not(.is-on):focus { background-color: transparent; }
html body .rea button.rea-f:not(.is-on):hover { background-color: transparent; color: var(--rea-accent-txt); }
html body .rea button.rea-f.is-on, html body .rea button.rea-f.is-on:hover, html body .rea button.rea-f.is-on:focus { background-color: var(--rea-ink); color: #fbf3ec; }
html body .rea h3.rea-title { margin: 0; padding: 0; letter-spacing: normal; text-transform: none; }
html body .rea .rea-card h3.rea-title, html body .rea .rea-card:hover h3.rea-title { color: #fbf3ec; }
html body .rea .rea-row:hover h3.rea-title { color: var(--rea-accent-txt); }
html body .rea .rea-row h3.rea-title { color: var(--rea-ink); }
html body .rea .rea-row:hover h3.rea-title { color: var(--rea-accent-txt); }
html body .rea .rea-row.is-cta h3.rea-title { color: var(--rea-accent-txt); }

/* ---------- [projet_fonctionnalites] : pastilles ---------- */
html body .rea-pills { list-style: none; margin: 0 auto; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 980px; }
html body .rea-pills li {
  list-style: none; margin: 0; display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 20px; border-radius: 99px; background: #ffffff; color: var(--rea-ink, #2f4a6a);
  font-size: 16px; font-weight: 600; line-height: 1.3;
  border: 1px solid color-mix(in srgb, var(--rea-ink, #2f4a6a) 10%, transparent);
}
html body .rea-pills li::before { content: none; }
html body .rea-pill-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--rea-accent, #ee9b80); }
@media (max-width: 560px) { html body .rea-pills { justify-content: flex-start; gap: 8px; } html body .rea-pills li { font-size: 15px; padding: 9px 16px; } }
