/* =========================================================
   Theme Name: Blocksy Child
   Template: blocksy
   Version: 1.0
========================================================= */

/* =========================================================
   GRILLE MODENI (béton WordPress / Blocksy / Gutenberg)
========================================================= */

/* 1) Force la grille même si WP/Blocksy met flex sur les galeries */
.modeni-grid,
.entry-content .modeni-grid,
.wp-block-post-content .modeni-grid,
.ct-container .modeni-grid,
/* Cas fréquent : galerie Gutenberg */
.wp-block-gallery.modeni-grid,
.wp-block-gallery .modeni-grid,
/* Cas fréquent : "gallery" classique */
.gallery.modeni-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 14px !important;
  align-items: start !important;
  margin: 40px auto !important;
  max-width: 1200px !important;

  /* Reset utiles si c'est un <ul> */
  padding: 0 !important;
  list-style: none !important;
}

/* Enfants : empêche les débordements bizarres en grid */
.modeni-grid > * {
  min-width: 0;
}

/* Responsive */
@media (max-width: 900px) {
  .modeni-grid,
  .entry-content .modeni-grid,
  .wp-block-post-content .modeni-grid,
  .ct-container .modeni-grid,
  .wp-block-gallery.modeni-grid,
  .gallery.modeni-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 600px) {
  .modeni-grid,
  .entry-content .modeni-grid,
  .wp-block-post-content .modeni-grid,
  .ct-container .modeni-grid,
  .wp-block-gallery.modeni-grid,
  .gallery.modeni-grid {
    grid-template-columns: 1fr !important;
  }
}

/* =========================================================
   CARTES (VIGNETTES)
========================================================= */

.modeni-card {
  width: 100% !important;
  max-width: 100% !important;
  aspect-ratio: 3 / 4; /* cadre vertical galerie */
  cursor: pointer;
  border-radius: 0;
  overflow: hidden;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 160ms ease-out,
              opacity 160ms ease-out,
              box-shadow 160ms ease-out;
  will-change: transform;
}

/* ✅ mouvement réduit */
.modeni-card:hover {
  transform: translateY(-1px) scale(1.007);
  opacity: .985;
  box-shadow: 0 6px 18px rgba(0,0,0,.20);
}

.modeni-card:focus-visible {
  outline: 1px solid rgba(255,255,255,.14);
  outline-offset: 2px;
}

.modeni-card img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;

  /* ✅ pas de zoom image (évite le crop/passe-partout) */
  transition: opacity 160ms ease-out;
}

/* Caption (si utilisé) */
.modeni-cap {
  padding: 12px 12px 14px;
  color: rgba(255,255,255,.72);
}

/* =========================================================
   LIGHTBOX
========================================================= */

#modeni-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

#modeni-modal.is-open {
  display: block;
}

.modeni-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.72);
}

.modeni-panel {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  box-sizing: border-box;
  background: transparent;
}

.modeni-shell {
  display: flex;
  width: min(2200px, 98vw);
  max-height: 98vh;
  background: #111;
  color: #fff;
  border-radius: 0;
  border: none;
  overflow: hidden;
  box-shadow: 0 18px 70px rgba(0,0,0,.55);
}

.modeni-media {
  flex: 1 1 auto;
  min-width: 0;
  background: #0c0c0c;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modeni-image {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 8vh - 48px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.modeni-text {
  flex: 0 0 30%;
  max-width: 420px;
  width: 35%;
  padding: 22px 22px 18px;
  overflow: auto;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,.02),
    rgba(255,255,255,0)
  );
}

.modeni-title {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 600;
}

.modeni-desc {
  margin: 0 0 14px;
  opacity: .92;
  line-height: 1.55;
  font-size: 14px;
}

.modeni-meta {
  margin: 0;
  opacity: .70;
  font-size: 13px;
  line-height: 1.45;
}

/* NAV (hors cadre) */
.modeni-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10000;
  width: 48px;
  height: 48px;
  border: none;
  background: rgba(255,255,255,.06);
  color: #fff;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .75;
  transition: opacity .2s ease,
              background .2s ease,
              transform .2s ease;
}

.modeni-nav:hover {
  opacity: 1;
  background: rgba(255,255,255,.12);
  transform: translateY(-50%) scale(1.05);
}

.modeni-prev {
  left: calc(4vw - 12px);
}

.modeni-next {
  right: calc(4vw - 12px);
}

/* Close */
.modeni-close {
  position: fixed;
  top: calc(4vh + 10px);
  right: calc(4vw + 10px);
  z-index: 10001;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.15);
  color: #fff;
  font-size: 18px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
}

/* Mobile lightbox */
@media (max-width: 900px) {
  .modeni-shell {
    flex-direction: column;
    width: min(980px, 94vw);
    max-height: 92vh;
  }

  .modeni-text {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    border-top: 1px solid rgba(255,255,255,.08);
  }

  .modeni-image {
    max-height: calc(92vh - 8vh - 170px);
  }
}

@media (max-width: 700px) {
  .modeni-nav {
    width: 40px;
    height: 40px;
    font-size: 30px;
  }
}

/* =========================================================
   ZOOM (clic sur l'image)
========================================================= */

#modeni-modal .modeni-image {
  cursor: zoom-in;
}

#modeni-modal.is-zoom .modeni-image {
  cursor: zoom-out;
}

#modeni-modal.is-zoom .modeni-shell {
  width: 98vw;
  max-height: 98vh;
}

#modeni-modal.is-zoom .modeni-text {
  display: none;
}

#modeni-modal.is-zoom .modeni-image {
  max-width: 98vw;
  max-height: 98vh;
}

#modeni-modal.is-zoom .modeni-media {
  padding: 8px;
}

/* =========================================================
   MENU SÉRIES
========================================================= */

.modeni-series-menu a {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 6px 0;
  opacity: 0.6;
  transition: opacity .2s ease;
}

.modeni-series-menu a:hover {
  opacity: 1;
}

.modeni-series-menu .current-menu-item > a {
  opacity: 1;
  font-weight: 600;
}

.modeni-series-menu li:first-child > a {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 15px;
  opacity: 0.60;
  margin-bottom: 10px;
}

.modeni-series-menu li:not(:first-child) > a {
  font-size: 16px;
}

.modeni-series-menu .current-menu-item > a::before {
  content: "—";
  margin-right: 4px;
  opacity: 0.6;
}

/* Masquer le gros titre (H1) sur les pages Séries */
.modeni-series-page .entry-title,
.modeni-series-page .page-title,
.modeni-series-page h1 {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.modeni-series-page .hero-section,
.modeni-series-page .page-header,
.modeni-series-page .entry-header {
  display: none !important;
}

/* =========================================================
   HOME = ACTE 2 (1 image) + ACTE 3 (constellation)
========================================================= */

/* Vignettage global très léger (focus centre) */
.home .site-main {
  position: relative;
}

.home .site-main::before,
.home .site-main::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  height: 16vh;
  pointer-events: none;
  z-index: 5;
}

.home .site-main::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(11,11,12,.55), rgba(11,11,12,0));
}

.home .site-main::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(11,11,12,.55), rgba(11,11,12,0));
}

/* -------------------------
   ACTE 2 — 1 image (pas bannière)
------------------------- */

.home .modeni-act2 {
  padding: 4vh 0 2vh;
}

/* Image “fragmentée par l’espace” */
.home .modeni-home-hero {
  width: min(980px, 86vw);
  margin: 0 auto;
  opacity: 0; /* fade-in via JS */
  transform: translateY(10px);
  transition: opacity 520ms ease, transform 520ms ease;
  will-change: opacity, transform;
}

.home .modeni-home-hero.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.home .modeni-home-hero img {
  width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: contain;
  display: block;
}

/* Petit décalage pour éviter “bannière centrée” */
@media (min-width: 900px) {
  .home .modeni-home-hero {
    margin-left: max(7vw, 40px);
    margin-right: auto;
  }
}

/* -------------------------
   ACTE 3 — Constellation (déconstruite)
------------------------- */

.home .modeni-act3 {
  padding: 3vh 0 10vh;
}

/* HOME — ACTE 3 : apparition/disparition douce au scroll */
.home .modeni-act3 figure,
.home .modeni-act3 .wp-block-image {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 1400ms ease, transform 1400ms ease;
  will-change: opacity, transform;
}

.home .modeni-act3 .is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* On garde modeni-grid, mais on l’adapte sur la home */
.home .modeni-constellation.modeni-grid {
  max-width: 1280px !important;
  margin: 6vh auto 0 !important;
  gap: 14px !important;

  /* plus “constellation” : colonnes + lignes auto */
  grid-auto-flow: dense !important;
  grid-auto-rows: 12px !important; /* permet des hauteurs variées */
}

/* Chaque item Gutenberg image = figure/wp-block-image */
.home .modeni-constellation figure,
.home .modeni-constellation .wp-block-image {
  margin: 0;
  overflow: hidden;

  /* fade-in via JS */
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 420ms ease, transform 420ms ease;
  will-change: opacity, transform;
}

/* visible */
.home .modeni-constellation .is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Images */
.home .modeni-constellation img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover; /* constellation = ça vit, ça remplit */
}

/* Effet mosaïque discret : on réutilise l’ADN (hover léger) */
@media (hover: hover) {
  .home .modeni-constellation figure:hover,
  .home .modeni-constellation .wp-block-image:hover {
    transform: translateY(-1px) scale(1.007);
    box-shadow: 0 6px 18px rgba(0,0,0,.20);
  }
}

/* Déconstruction via motifs nth-child */
.home .modeni-constellation figure:nth-child(6n + 1),
.home .modeni-constellation .wp-block-image:nth-child(6n + 1) {
  grid-column: span 2;
  grid-row: span 28;
}

.home .modeni-constellation figure:nth-child(6n + 2),
.home .modeni-constellation .wp-block-image:nth-child(6n + 2) {
  grid-column: span 1;
  grid-row: span 22;
}

.home .modeni-constellation figure:nth-child(6n + 3),
.home .modeni-constellation .wp-block-image:nth-child(6n + 3) {
  grid-column: span 1;
  grid-row: span 30;
}

.home .modeni-constellation figure:nth-child(6n + 4),
.home .modeni-constellation .wp-block-image:nth-child(6n + 4) {
  grid-column: span 2;
  grid-row: span 34;
}

.home .modeni-constellation figure:nth-child(6n + 5),
.home .modeni-constellation .wp-block-image:nth-child(6n + 5) {
  grid-column: span 1;
  grid-row: span 18;
}

.home .modeni-constellation figure:nth-child(6n),
.home .modeni-constellation .wp-block-image:nth-child(6n) {
  grid-column: span 1;
  grid-row: span 26;
}

/* Mobile : constellation moins “dense” */
@media (max-width: 900px) {
  .home .modeni-constellation.modeni-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-rows: 10px !important;
  }
}

@media (max-width: 600px) {
  .home .modeni-constellation.modeni-grid {
    grid-template-columns: 1fr !important;
    grid-auto-rows: auto !important;
  }

  .home .modeni-constellation figure,
  .home .modeni-constellation .wp-block-image {
    grid-column: auto;
    grid-row: auto;
  }
}

/* Respect réduction animations */
@media (prefers-reduced-motion: reduce) {
  .home .modeni-home-hero,
  .home .modeni-constellation figure,
  .home .modeni-constellation .wp-block-image {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* =========================================================
   HOME – ACTE 3 : images neutres (aucune interaction)
========================================================= */

/* Images de l'acte 3 : regard pur */
.home .modeni-act3 img {
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* Désactiver tout hover / zoom / ombre sur la home */
@media (hover: hover) {
  .home .modeni-act3 figure:hover,
  .home .modeni-act3 .wp-block-image:hover,
  .home .modeni-act3 img:hover {
    transform: none !important;
    box-shadow: none !important;
    filter: none !important;
  }
}

/* =========================================================
   HEADER MODENI — noir noble
========================================================= */

/* Fond header */
#header,
header#header,
.ct-header {
  background: #0b0b0c !important;
}

/* Zone intérieure (selon Blocksy) */
.ct-header [data-row],
.ct-header .ct-container,
#header .ct-container {
  background: transparent !important;
}

/* Enlever ombres/traits trop “template” */
#header,
.ct-header {
  box-shadow: none !important;
  border-bottom: 1px solid rgba(255,255,255,.08) !important;
}

/* Couleur des liens menu */
.ct-header .menu a,
.ct-header .ct-menu-link,
.ct-header .ct-header-cta a,
.ct-header a {
  color: rgba(255,255,255,.82) !important;
}

/* Hover : discret */
.ct-header .menu a:hover,
.ct-header a:hover {
  color: rgba(255,255,255,.98) !important;
  opacity: 1 !important;
}

/* État actif */
.ct-header .current-menu-item > a,
.ct-header .current_page_item > a {
  color: rgba(255,255,255,.95) !important;
}

/* Typo menu : “noble” */
.ct-header .menu a,
.ct-header .ct-menu-link {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12px;
  font-weight: 600;
}

/* Espacement du header */
.ct-header [data-row*="top"],
.ct-header [data-row*="middle"],
.ct-header [data-row*="bottom"] {
  padding-top: 18px !important;
  padding-bottom: 18px !important;
}

/* Icônes */
.ct-header svg,
.ct-header .ct-icon {
  fill: rgba(255,255,255,.82) !important;
  color: rgba(255,255,255,.82) !important;
}

/* Survol icônes */
.ct-header button:hover svg,
.ct-header a:hover svg {
  fill: rgba(255,255,255,.98) !important;
  color: rgba(255,255,255,.98) !important;
}

/* =========================
   HEADER — matière finale propre
========================= */

/* Global : noir noble + micro matière */
.ct-header {
  background: linear-gradient(
      to bottom,
      rgba(255,255,255,.08),
      rgba(255,255,255,0) 70%
    ),
    #0b0b0c !important;
  box-shadow: none !important;
}

/* HOME — matière noble */
.home .ct-header {
  background: linear-gradient(
      to bottom,
      rgba(255,255,255,.08),
      rgba(255,255,255,0) 70%
    ),
    rgba(11,11,12,.82) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* MENU HEADER */
.ct-header .menu a,
.ct-header .ct-menu-link {
  font-family: "Afacad", system-ui, sans-serif;
  font-size: 13px;              /* + gros */
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--modeni-text-soft) !important;
}

.ct-header .menu a:hover,
.ct-header .current-menu-item > a {
  color: var(--modeni-text) !important;
}

/* MENU SÉRIES (gauche) */
.modeni-series-menu a {
  font-family: "Afacad", system-ui, sans-serif;
  font-size: 22px;                /* + lisible */
  font-weight: 400;
  color: var(--modeni-blue);
  opacity: .9;
}

.modeni-series-menu a:hover {
  color: var(--modeni-blue-soft);
  opacity: 0.9;
}

/* Titre "— ŒUVRES" */
.modeni-series-menu li:first-child > a {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 1;
}

.modeni-title {
  font-family: "Afacad", system-ui, sans-serif;
  font-size: 19px;                 /* + impact */
  font-weight: 400;
  color: var(--modeni-blue);
  margin-bottom: 12px;
}

#modeni-modal .modeni-title {
  color: rgba(139, 184, 230, 0.78);
}

.modeni-desc {
  font-family: "Ancizar Sans", system-ui, sans-serif;
  font-size: 15.5px;               /* + confortable */
  line-height: 1.7;
  color: var(--modeni-text);
}

.modeni-meta {
  font-family: "Ancizar Sans", system-ui, sans-serif;
  font-size: 13.5px;
  color: var(--modeni-text-soft);
}

@media (max-width: 700px) {
  .modeni-title {
    font-size: 20px;
  }

  .modeni-desc {
    font-size: 15px;
  }
}

:root {
  --modeni-blue: #8bb8e6;       /* bleu principal */
  --modeni-blue-soft: #8bb8e6;  /* hover / titres */
  --modeni-text: rgba(255,255,255,.92);
  --modeni-text-soft: rgba(255,255,255,.72);
}

/* Bloquer le scroll page */
body.modeni-lock {
  overflow: hidden;
}
