/* Post Featured Image Block - Utilise les styles single post pour cohérence */

/* Styles universels - appliquent les styles single post */
.post-featured-image,
.container .content figure {
  margin: auto;
  margin-bottom: var(--margin-medium);
}

.post-featured-image figure {
  margin: 0;
  display: block;
}

.post-featured-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

.post-featured-image figcaption,
.container .content .wp-block-image figcaption {
  margin-top: 8px;
  font-size: 14px;
  color: #7c7c7c;
  font-style: italic;
  text-align: center;
  line-height: 1.4;
}

/* Mode light */
.light-mode .post-featured-image figcaption,
.light-mode .container .content .wp-block-image figcaption {
  color: #6c6c6c;
}

/* Infinite scroll utilise les mêmes styles */
.infinite-scroll-article .post-featured-image {
  margin: 24px auto;
}

/* Alignment */
.post-featured-image.align-left {
  text-align: left;
}

.post-featured-image.align-center {
  text-align: center;
}

.post-featured-image.align-right {
  text-align: right;
}

/* Style variations */
.post-featured-image.rounded img {
  border-radius: 12px;
}

.post-featured-image.shadow {
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

.post-featured-image.shadow img {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.post-featured-image.bordered img {
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 1px #e1e1e1;
}

.post-featured-image.hover-effect img:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.post-featured-image.grayscale img {
  filter: grayscale(100%);
  transition: filter 0.3s ease;
}

.post-featured-image.grayscale img:hover {
  filter: grayscale(0%);
}

.post-featured-image.sepia img {
  filter: sepia(100%);
  transition: filter 0.3s ease;
}

.post-featured-image.sepia img:hover {
  filter: sepia(0%);
}

.post-featured-image.overlay {
  position: relative;
}

.post-featured-image.overlay::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  transition: opacity 0.3s ease;
}

.post-featured-image.overlay:hover::after {
  opacity: 0;
}

.post-featured-image.full-width {
  margin-left: -20px;
  margin-right: -20px;
  width: calc(100% + 40px);
}

.post-featured-image.full-width img {
  border-radius: 0;
}

/* Caption styles */
.post-featured-image.caption-center figcaption {
  text-align: center;
}

.post-featured-image.caption-overlay {
  position: relative;
}

.post-featured-image.caption-overlay figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: white;
  padding: 20px 15px 15px;
  margin: 0;
  border-radius: 0 0 4px 4px;
}

.game-iframe-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  width: 100%;
  gap: 10px;
  background-color: transparent;
  background: transparent;
  margin-bottom: 10px;
}

.game-iframe-container figure {
  width: 100%;
  margin: 0;
}

.game-iframe-container figure img {
  width: 100%;
  height: auto;
  display: block;
  background-color: transparent;
  background: transparent;
}

/* Plein écran - container prend toute la place */
.game-iframe-container:fullscreen {
  width: 100vw;
  height: 100vh;
  padding: 0;
  margin: 0;
  border: none;
  justify-content: flex-start;
  align-items: flex-start;
}

.game-iframe-container:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  padding: 0;
  margin: 0;
  border: none;
}

.game-iframe-container:-moz-full-screen {
  width: 100vw;
  height: 100vh;
  padding: 0;
  margin: 0;
  border: none;
}

.game-iframe-container:-ms-fullscreen {
  width: 100vw;
  height: 100vh;
  padding: 0;
  margin: 0;
  border: none;
}

.post {
  width: 100% !important;
}

.game-iframe {
  display: none;
  width: 100%;
  height: 760px;
  z-index: 1;
}

/* Plein écran - iframe prend tout l'espace */
.game-iframe-container:fullscreen .game-iframe {
  width: 100vw;
  height: 100vh;
}

.game-iframe-container:-webkit-full-screen .game-iframe {
  width: 100vw;
  height: 100vh;
}

.game-iframe-container:-moz-full-screen .game-iframe {
  width: 100vw;
  height: 100vh;
}

.game-iframe-container:-ms-fullscreen .game-iframe {
  width: 100vw;
  height: 100vh;
}

.game-iframe canvas {
  width: 100%;
  height: 100%;
  background-color: transparent;
  background: transparent;
}

.game-iframe-container.is-blur #game-iframe-image {
  filter: blur(5px);
  transition: filter 0.3s ease;
}

.buttons_container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 10px;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  backdrop-filter: blur(10px);
}

.game-button {
  color: #0e0e10;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-size: 16px;
  font-weight: bold;
  margin-top: 10px;
  outline: none;
  border: none;
  cursor: pointer;
  width: fit-content;
  min-width: 250px;
  text-align: center;
  padding: 16px 24px;
}

.game-button-pay {
  background-color: var(--accent-color);
}

.light-mode .game-button-pay {
  color: #0e0e10 !important;
}

.game-button-play {
  background-color: #0e0e10;
  color: #fff;
  border: 2px solid var(--accent-color);
}

.fullscreen-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  color: #fff;
  background-color: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  border: none;
  cursor: pointer;
  border-radius: 4px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.fullscreen-toggle:hover {
  background-color: rgba(0, 0, 0, 0.5);
}

.fullscreen-toggle svg {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

/* Cacher le bouton close par défaut (il s'affichera en plein écran) */
#fullscreen-game-close {
  display: none;
  align-items: center;
  justify-content: center;
}

/* Afficher le bouton open par défaut */
#fullscreen-game-open {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

#game-button-CTA {
  display: none;
  margin-top: 10px;
  margin-inline: auto;
}

.light-mode .game-button:last-of-type {
  background-color: #fff;
  color: #101215;
  border: none;
}

.game-button:last-of-type {
  border: 2px solid var(--accent-color);
}

/* Responsive */
@media (max-width: 768px) {
  .post-featured-image {
    margin: 20px 0;
  }

  .post-featured-image.full-width {
    margin-left: -15px;
    margin-right: -15px;
    width: calc(100% + 30px);
  }

  .post-featured-image figcaption {
    font-size: 13px;
  }

  .post-featured-image.caption-overlay figcaption {
    padding: 15px 12px 12px;
  }

  .game-iframe-container {
    width: 100%;
  }

  .game-iframe {
    height: 70vh;
    min-height: 500px;
  }
}

@media (max-width: 480px) {
  .post-featured-image {
    margin: 15px 0;
  }

  .post-featured-image.full-width {
    margin-left: -10px;
    margin-right: -10px;
    width: calc(100% + 20px);
  }

  .post-featured-image figcaption {
    font-size: 12px;
  }

  .game-iframe-container {
    width: 100%;
    padding: 0;
    border: none;
  }

  .game-iframe {
    height: 60vh;
    min-height: 400px;
  }
}
