/*
 * Page TOP (/jeux-porno-ia/) : carrousel hero, box scrollable,
 * bloc Meilleur Jeu du Moment, grille de tous les jeux.
 * Chargée après refonte.css et home.css (réutilise .jpia-hero, .jpia-btn…).
 */

/* L'image à la une d'origine (GP Element rendu avant le main) fait doublon
   avec le carrousel sur cette page : masquée visuellement. */
body.postid-1201 figure.gb-block-image-a1eaa992 {
  display: none;
}

/* La page est un article "contenu encadré" : GP limite le site à 1200px et
   une règle inline (#content {max-width:960px}, largeur de lecture des
   articles) encadre encore le contenu. On reproduit le full-width-content de
   l'accueil : hero full-bleed, sections internes déjà centrées à 1240px. */
body.postid-1201 .site.grid-container.container,
body.postid-1201 #content {
  max-width: 100%;
}

/* ==========================================================================
   Carrousel hero
   ========================================================================== */
.jpia-carousel {
  position: relative;
  min-height: clamp(460px, 60vh, 660px);
  overflow: hidden;
  display: block;
}

.jpia-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center 25%;
  background-color: var(--jpia-bg-deep);
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}

.jpia-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

.jpia-rank {
  position: absolute;
  right: 36px;
  bottom: 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(110px, 16vw, 220px);
  font-weight: 700;
  line-height: 1;
  color: rgba(168, 85, 247, 0.22);
  text-shadow: 0 0 60px rgba(168, 85, 247, 0.25);
  user-select: none;
}

.jpia-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 26px;
}

.jpia-chips span {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #e3e4f0;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.jpia-dots {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  gap: 9px;
}

button.jpia-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.35);
  box-shadow: none;
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}

button.jpia-dot:hover {
  background: rgba(255, 255, 255, 0.6);
  filter: none;
  transform: none;
  box-shadow: none;
}

button.jpia-dot.is-active {
  width: 28px;
  background: linear-gradient(135deg, #8b5cf6, var(--jpia-fuchsia));
}

/* ==========================================================================
   Box scrollable + Meilleur Jeu du Moment
   ========================================================================== */
.jpia-top-cols {
  max-width: 1240px;
  margin: 30px auto 10px;
  padding: 0 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

.jpia-content-box {
  background: var(--base-3);
  border: 1px solid var(--jpia-border);
  border-radius: 16px;
  overflow: hidden;
}

.jpia-box-head {
  padding: 18px 26px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(217, 70, 239, 0.18));
  border-bottom: 1px solid var(--jpia-border-accent);
}

h1.jpia-box-title {
  margin: 0;
  padding: 0;
  border: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.jpia-box-desc {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--contrast-2);
}

.jpia-box-meta {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--contrast-3);
}

.jpia-box-scroll {
  max-height: 320px;
  overflow-y: auto;
  padding: 8px 28px 28px;
  scrollbar-width: thin;
  scrollbar-color: #4c3a78 transparent;
  overscroll-behavior: contain;
}

.jpia-box-scroll::-webkit-scrollbar { width: 10px; }
.jpia-box-scroll::-webkit-scrollbar-track { background: transparent; }
.jpia-box-scroll::-webkit-scrollbar-thumb {
  background: #3a2d5e;
  border-radius: 5px;
}
.jpia-box-scroll::-webkit-scrollbar-thumb:hover { background: #4c3a78; }

/* Bloc Meilleur Jeu du Moment */
.jpia-best {
  position: sticky;
  top: 90px;
  background: var(--base-3);
  border: 1px solid var(--jpia-border-accent);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--jpia-glow);
}

.jpia-best-head {
  margin: 0;
  padding: 14px 18px;
  text-align: center;
  background: linear-gradient(135deg, #8b5cf6, var(--jpia-fuchsia));
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.jpia-best > img {
  display: block;
  width: 100%;
  height: 210px;
  object-fit: cover;
}

.jpia-best-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.jpia-best-name {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--contrast);
}

.jpia-chips-center {
  justify-content: center;
  margin: 0;
}

.jpia-best .jpia-btn {
  justify-content: center;
}

/* ==========================================================================
   Grille de tous les jeux (max 4 colonnes)
   ========================================================================== */
.jpia-all {
  max-width: 1240px;
  margin: 34px auto 0;
  padding: 0 40px 54px;
}

.jpia-all .jpia-row-head {
  padding: 0;
  margin-bottom: 16px;
}

.jpia-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.jpia-gcard {
  background: var(--base-3);
  border: 1px solid var(--jpia-border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.jpia-gcard:hover {
  transform: translateY(-4px);
  border-color: var(--jpia-border-accent);
  box-shadow: var(--jpia-glow);
}

.jpia-gcard img.jpia-gcard-img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 0;
  border: 0;
}

.jpia-gcard-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.jpia-gcard-name {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--contrast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jpia-btn-sm {
  padding: 10px 16px;
  font-size: 13px;
  justify-content: center;
  text-align: center;
}

/* ==========================================================================
   Bloc auteur + commentaires : alignés sur la largeur du contenu
   (1240px - 2x40px de padding = 1160px, comme les cartes au-dessus)
   ========================================================================== */
body.postid-1201 .gb-container-2b35d05b,
body.postid-1201 #comments {
  width: calc(100% - 80px);
  max-width: 1160px;
  margin-left: auto;
  margin-right: auto;
}

body.postid-1201 .gb-container-2b35d05b {
  border: 1px solid var(--jpia-border);
  border-radius: 16px;
  overflow: hidden;
}

body.postid-1201 #comments {
  padding-bottom: 44px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .jpia-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 880px) {
  .jpia-top-cols {
    grid-template-columns: 1fr;
    padding: 0 20px;
  }
  /* Le bloc Meilleur Jeu passe AU-DESSUS de la box de contenu */
  .jpia-best {
    position: static;
    order: -1;
  }
}

@media (max-width: 768px) {
  .jpia-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jpia-all { padding: 0 20px 40px; }
  body.postid-1201 .gb-container-2b35d05b,
  body.postid-1201 #comments {
    width: calc(100% - 40px);
  }
  .jpia-box-scroll { max-height: 240px; padding: 6px 18px 20px; }
  .jpia-rank { right: 16px; }
}

@media (max-width: 480px) {
  .jpia-grid { grid-template-columns: 1fr; }
}
