/* version 1.0.1 */

.mgznkr-stack {
  --step: 15; /* distance between stacked cards - in px */
  --gap: 6rem; /* distance between UNstacked cards - value with unit */
  --min-height: 0;
  /* v1.0.6 was   --gap: 4rem; --min-height: 400px with repsonive issues */;

  --header-height: 100; /* keep room for sticky Header - in px */
  --base-scale: 0.95;  /* stacked cards scaled smaller */
  --min-scale: 0.8; /* stacked cards scaled smaller but max to this value */
  --tolerance: 2; /* technical value for scroll-detection - keep it like this */

  --card-bg-color: #ffffff; /* Default Background-color of .mgznkr-card, manually override with wordpress block background-color  */

  display: grid;
  gap: var(--gap, 60px);
}

/* Chaplin reset */
		:root .mgznkr-stack .has-border-color {color: unset!important; }

.mgznkr-stack > .wp-block-group {
  position: sticky;
  top: var(--sticky-top, 0px);
  z-index: var(--z, 1);
  border-radius: 1.5rem;
  background-color: var(--card-bg-color, #fff);
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
  min-height: var(--min-height, 400px);
  border: none;
  width: 100%;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding: 1.5rem;
  transform-origin: top center;
  transition: transform 260ms ease;
  will-change: transform;
}

.mgznkr-stack:has(.start-card) > .wp-block-group:not(.start-card) {
  top: calc(var(--sticky-top, 0px) + var(--start-card-height));
}


.mgznkr-stack > .wp-block-group > .wp-block-group__inner-container {
  margin-bottom: var(--gap);
}



@media (max-width: 781px) {
.mgznkr-stack {
  --header-height: 80;
}
}

.mgznkr-stack > .wp-block-group.is-front {
  filter: none;
}

.mgznkr-stack > .wp-block-group.is-behind {
  filter: brightness(0.9) blur(1px);
}




.mgznkr-stack .start-card {
  box-shadow: none;
  padding: 15px 0!important;
  filter: none!important;
  height: auto;
  min-height: 0;
  border-radius: 0;
  transform: none!important;
}






.mgznkr-stack .start-card.is-behind {
  margin-bottom: 0 !important;
 
}



/*
.mgznkr-stack.is-layout-constrained > :where(:not(.alignleft):not(.has-text-alignleft):not(.alignright):not(.has-text-alignright):not(.alignfull)) {
  margin-left: auto !important;
  margin-right: auto !important;
}
*/


/* extra-style only with classes */
/* TODO */
.mgznkr-stack > .wp-block-group.no-shadow {
  box-shadow: none;
}
@media (max-width: 781px) {
/* TODO */
.mgznkr-stack.no-stack-mobile  > .wp-block-group {
    position: relative;
    transform: none!important;
    filter: none!important;
    --sticky-top: 0!important;
  }
/* TODO */
.mgznkr-stack.no-stack-mobile .start-card > * {
   transform: none;
}
}



/* extra-style foto-stack */

.mgznkr-stack.mgznkr-stack-image {
  --foto-width: 600px; /* max-width-foto */
  --frame-border-width: 15px; /* figure padding = Frame width */
  --frame-background: rgb(255,250,245); /* frame border color */
}

.mgznkr-stack.mgznkr-stack-image.alignwide {
   --foto-width: 90%; /* max-width-foto */
}


.mgznkr-stack.mgznkr-stack-image > .wp-block-group:not(.start-card) {
  box-shadow: none;
  padding: 0;
  background: transparent !important;
  margin-left: auto;
  margin-right: auto;
  border-width: 0!important;
  border-color: var(--frame-background, #fff);
}

.mgznkr-stack-image > :where(.wp-block-group:not(.start-card)) {
  max-width: var(--foto-width);
}


.mgznkr-stack.mgznkr-stack-image  > .wp-block-group:not(.no-shadow) figure {
    box-shadow: 0 12px 30px rgba(0,0,0,.25);
    border-radius: 2px;
    border: var(--frame-border-width) solid var(--frame-background, #fff);
    border-color: inherit;
    background: var(--figure-bg-color, #fff);
    width: fit-content;
}

.mgznkr-stack.mgznkr-stack-image figure figcaption {
  font-size: 2rem;
  width: 100%;
  padding: 2px 8px 0;
  font-size: 16px;
  text-align: center;
  contain: inline-size;
}
  
.mgznkr-stack.mgznkr-stack-image .wp-block-image.aligncenter > figcaption {
  display: block;
}


.mgznkr-stack.mgznkr-stack-image  > .wp-block-group:nth-of-type(5n+1) figure {
  transform: rotate(3deg);
}
.mgznkr-stack.mgznkr-stack-image  > .wp-block-group:nth-of-type(5n+2) figure {
  transform: rotate(-5deg) translateX(36px);
}
.mgznkr-stack.mgznkr-stack-image  > .wp-block-group:nth-of-type(5n+3) figure {
  transform: rotate(4deg)  translateX(-32px) translateY(2px);
}
.mgznkr-stack.mgznkr-stack-image  > .wp-block-group:nth-of-type(5n+4) figure {
  transform: rotate(-3deg) translateX(-29px) translateY(2px);
}
.mgznkr-stack.mgznkr-stack-image > .wp-block-group:nth-of-type(5n+5) figure {
  transform: rotate(1deg) translateX(13px);
}

.mgznkr-stack.mgznkr-stack-image figure img {
  margin: 0;
  width: 100%;
}





/* extra-style polaroid */

.mgznkr-stack.mgznkr-stack-image.mgznkr-stack-polaroid {
  --foto-width: 420px; /* max-width-foto */
  --frame-background: rgb(255,250,245); /* frame border color */
  --frame-padding: 26px; /* figure padding = Frame width */
  --frame-padding-bottom: 106px; /* figure padding bottom = Frame width bottom */
}

.mgznkr-stack.mgznkr-stack-image.mgznkr-stack-polaroid {
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.mgznkr-stack.mgznkr-stack-image.mgznkr-stack-polaroid > .wp-block-group figure {
  border: var(--frame-padding) solid var(--frame-background, #fff);
  border-width: var(--frame-padding) var(--frame-padding) var(--frame-padding-bottom) var(--frame-padding);
  border-color: inherit;
}

.mgznkr-stack.mgznkr-stack-image.mgznkr-stack-polaroid figure figcaption {
  transform: translateY(20px);
  text-align: center;
  position: absolute;
}



/* alignwide */

@media (min-width: 700px) {
  .mgznkr-stack.mgznkr-stack-image.alignwide {
    max-width: calc( 100vw - 8rem );
    width: calc( 100vw - 8rem );
    margin-left: calc( ( (100vw - 8rem) - 100% ) / -2 );
}
.mgznkr-stack.mgznkr-stack-image.alignwide figure {
    max-width: calc( 100vw - 8rem );
}
}
@media (min-width: 1000px) {
  .mgznkr-stack.mgznkr-stack-image.alignwide {
    max-width: calc( 100vw - 10rem );
    width: calc( 100vw - 10rem );
}

.mgznkr-stack.mgznkr-stack-image.alignwide figure {
    max-width: calc( 100vw - 10rem );
}
}
@media (min-width: 1220px) {
.mgznkr-stack.mgznkr-stack-image.alignwide {
  max-width: var(--wp--style--global--wide-size);
    width: var(--wp--style--global--wide-size);
    margin-left: calc( ( var(--wp--style--global--wide-size) - 100% ) / -2 );
}

.mgznkr-stack.mgznkr-stack-image.alignwide figure {
    max-width: var(--wp--style--global--wide-size);
}
}
