/* mirror-fixes.css - static mirror of fairytrees.de.
   Written into public/ by tools/mirror/10_pages.py from tools/mirror/src/mirror-fixes.css;
   edit the source, never the file under public/.
   The donor's HTML waits for scripts that the mirror does not carry; these rules put the
   elements into the state those scripts leave them. site.css is loaded after this file and
   may override every rule in it. */

/* PageBuilder slider: hidden until a script adds .slick-initialized */
div[data-content-type='slider'] { visibility: visible; }

/* PageBuilder product carousel (slick): every item but the first is hidden, and the first one
   made invisible, until a script initialises the slider and fixes the item widths. Without the
   script the items fall back to rows with the slide counts of the donor's own configuration
   (breakpoints > products > default > slidesToShow in the page's widget-initializer data:
   4 from 1024 px, 3 from 768 px, 2 from 640 px, 1 below) */
#html-body [data-content-type='products'][data-appearance='carousel'] li.product-item {
  display: block; float: left; width: 33.333333%; margin-left: 0;
}
#html-body [data-content-type='products'][data-appearance='carousel'] li.product-item:first-child { visibility: visible; }
@media only screen and (max-width: 767px) {
  #html-body [data-content-type='products'][data-appearance='carousel'] li.product-item { width: 50%; }
}
@media only screen and (max-width: 639px) {
  #html-body [data-content-type='products'][data-appearance='carousel'] li.product-item { width: 100%; }
}
@media only screen and (min-width: 1024px) {
  #html-body [data-content-type='products'][data-appearance='carousel'] li.product-item { width: 25%; }
}

/* Hero slider: everything after the lazy preloader stays hidden until the slider script
   removes the preloader */
.swiper-lazy-preloader { display: none; }
.swiper-lazy-preloader ~ * { visibility: visible; }

/* YouTube embeds: the mirror shows the video's thumbnail in the box of the embed. The donor's
   rule for the box addresses iframe and video, the image needs the same geometry
   (hqdefault.jpg is 4:3 with letterbox bars: cover crops them in the 16:9 box) */
div[data-content-type='video'] .pagebuilder-video-container > img[data-mirror-video] {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover; border: 0; display: block;
}

/* YouTube embeds replaced by their local thumbnail (same box, no link) */
img[data-mirror-video="-6_a0TtqSOg"], img[data-mirror-video="ToHhQUhdyBY"], img[data-mirror-video="wrzsK-zmfzg"] {object-fit:cover;}
