/* LCP Optimization Styles */

/* Ensure hero images load with high priority */
.hero-img {
  content-visibility: auto;
  contain-intrinsic-size: 1200px 600px;
  /* Force GPU acceleration for better rendering */
  will-change: transform;
  transform: translateZ(0);
}

/* Optimize parallax images */
.parallax-image {
  content-visibility: auto;
  contain-intrinsic-size: 1200px 600px;
}

/* Optimize image loading — skip catalog cards (intrinsic size would flash full-res art). */
img[loading="eager"]:not([data-catalog-image]) {
  content-visibility: auto;
}

/* Catalog cards: constrain before block CSS. Grid min-width:auto + .image-59 { max-width:none }
   otherwise paints the bitmap at native width and crops it to the viewport.
   Scoped to the SSR catalog (data-catalog-*) so the Vue catalog / other blocks stay untouched. */
[data-catalog-list] > *,
[data-catalog-card] {
  min-width: 0;
  max-width: 100%;
}

[data-catalog-card] .link-block-38 {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.catalog [data-catalog-card] .link-block-38 img[data-catalog-image],
[data-catalog-card] img[data-catalog-image] {
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: cover;
  min-width: 0;
}

/* about-gamebg: full-size gallery attachments paint at intrinsic height until
   block CSS + Swiper init. Constrain in head so the section cannot grow the page. */
.about-gamebg,
.wp-block-acf-about-gamebg {
  max-width: 100%;
}

.about-gamebg img,
.wp-block-acf-about-gamebg img,
about-gamebg img {
  max-width: 100%;
  height: auto;
}

.about-gamebg .gallery-slider,
.about-gamebg .gallery-top,
.about-gamebg .gallery-thumbs,
.wp-block-acf-about-gamebg .gallery-slider,
.wp-block-acf-about-gamebg .gallery-top,
.wp-block-acf-about-gamebg .gallery-thumbs {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.about-gamebg .gallery-top .swiper-slide,
.wp-block-acf-about-gamebg .gallery-top .swiper-slide {
  max-width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.about-gamebg .gallery-top .swiper-slide img,
.wp-block-acf-about-gamebg .gallery-top .swiper-slide img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.about-gamebg .gallery-top:not(.swiper-initialized) .swiper-slide:not(:first-child),
.wp-block-acf-about-gamebg .gallery-top:not(.swiper-initialized) .swiper-slide:not(:first-child) {
  display: none;
}

.about-gamebg .gallery-thumbs .swiper-slide img,
.wp-block-acf-about-gamebg .gallery-thumbs .swiper-slide img {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* Preload critical images */
img[fetchpriority="high"] {
  will-change: transform;
}

/* Optimize swiper slides for LCP */
.swiper-slide:first-child .hero-img {
  content-visibility: auto;
  contain-intrinsic-size: 1200px 600px;
}

/* Critical LCP optimization for first slide */
.swiper-slide:first-child {
  contain-intrinsic-size: 1200px 800px;
}

/* Optimize hero-corporate container */
.hero-corporate {
  content-visibility: auto;
  contain-intrinsic-size: 1200px 800px;
}

/* Ensure first slide images are prioritized */
.swiper-slide:first-child img[loading="eager"] {
  content-visibility: auto;
  contain-intrinsic-size: 1200px 600px;
}

/* Optimize lazy loading for non-critical slides */
.swiper-slide:not(:first-child) img[loading="lazy"] {
  content-visibility: auto;
  contain-intrinsic-size: 1200px 600px;
}

/* Rive Animation Optimizations */
.rive-animation {
  content-visibility: auto;
  contain-intrinsic-size: 400px 300px;
}

/* Disable heavy animations on slow connections */
.slow-connection .rive-animation,
.slow-connection .animation-popup-game {
  display: none !important;
}

/* Optimize Rive canvas loading */
.canvas-animation {
  content-visibility: auto;
  contain-intrinsic-size: 400px 300px;
}

/* Preload optimization for Rive files */
.rive-preload {
  content-visibility: auto;
  contain-intrinsic-size: 400px 300px;
}

/* Reduce animation quality on slow connections */
.slow-connection .rive-animation canvas {
  image-rendering: optimizeSpeed;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Additional performance optimizations */
* {
  /* Optimize repaints */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Optimize scrolling performance */
.swiper-container {
  will-change: transform;
  transform: translateZ(0);
}

/* Optimize font loading */
@font-face {
  font-display: swap;
}

/* Critical path optimization */
.above-fold {
  contain: layout style paint;
  content-visibility: auto;
}

/* CRITICAL LCP OPTIMIZATION - Hero Images */
.hero-img {
  /* Force GPU acceleration for faster rendering */
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}