/*
 * KlikErotiek — Gallery Art
 *
 * Gebruik:
 * Voeg "kr-gallery-art" toe aan het WPBakery Text Block,
 * Gallery-element of de rij waarin de WordPress [gallery] staat.
 *
 * De bestaande gallery-columns-* class bepaalt het kolomaantal.
 */

.kr-gallery-art {
  --kr-gallery-gap: clamp(12px, 1.6vw, 26px);
  --kr-gallery-card: clamp(112px, 16vw, 250px);
  --kr-gallery-gold: #d2ad65;
  --kr-gallery-magenta: #ff00c8;
  --kr-gallery-green: #2ce0b0;
  --kr-gallery-ivory: #f4eadf;
  --kr-gallery-ink: #151012;

  position: relative;
  isolation: isolate;
  width: fit-content;
  max-width: calc(100vw - 40px);
  margin: clamp(34px, 5vw, 72px) 0;
  margin-left: 50%;
  transform: translateX(-50%);
}

/* Speelse KlikErotiek-lijnen buiten de compositie */
.kr-gallery-art::before,
.kr-gallery-art::after {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
}

.kr-gallery-art::before {
  top: -38px;
  right: -46px;
  width: 58%;
  height: 118px;
  opacity: .86;
  transform: rotate(.7deg);
  background:
    linear-gradient(90deg, rgba(255, 0, 200, .72), rgba(255, 0, 200, .72))
      8% 18px / 24% 2px no-repeat,
    linear-gradient(90deg, rgba(210, 173, 101, .94), rgba(210, 173, 101, .94))
      29% 25px / 48% 1px no-repeat,
    linear-gradient(90deg, rgba(44, 224, 176, .78), rgba(44, 224, 176, .78))
      79% 32px / 18% 2px no-repeat,
    linear-gradient(rgba(255, 0, 200, .66), rgba(255, 0, 200, .66))
      86% 20px / 1px 68px no-repeat,
    linear-gradient(
      132deg,
      transparent 38%,
      rgba(210, 173, 101, .18) 39% 53%,
      transparent 54%
    ) 43% 0 / 96px 96px no-repeat;
}

.kr-gallery-art::after {
  left: -48px;
  bottom: -36px;
  width: 62%;
  height: 112px;
  opacity: .82;
  transform: rotate(-.9deg);
  background:
    linear-gradient(90deg, rgba(44, 224, 176, .74), rgba(44, 224, 176, .74))
      0 72px / 22% 2px no-repeat,
    linear-gradient(90deg, rgba(210, 173, 101, .92), rgba(210, 173, 101, .92))
      17% 66px / 51% 1px no-repeat,
    linear-gradient(90deg, rgba(255, 0, 200, .70), rgba(255, 0, 200, .70))
      61% 58px / 20% 2px no-repeat,
    linear-gradient(rgba(210, 173, 101, .82), rgba(210, 173, 101, .82))
      12% 24px / 1px 62px no-repeat,
    linear-gradient(
      46deg,
      transparent 36%,
      rgba(255, 0, 200, .14) 37% 54%,
      transparent 55%
    ) 70% 12px / 92px 82px no-repeat;
}

/* De koffiecontainer krimpt mee met de galerij-inhoud. */
.kr-gallery-art > .wpb_wrapper,
.wpb_gallery.kr-gallery-art {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  padding: clamp(54px, 4vw, 72px) clamp(16px, 2.5vw, 38px)
    clamp(24px, 2.5vw, 40px);
  background:
    /* gebroken lijnen achter de fotografie */
    linear-gradient(90deg, rgba(255, 0, 200, .34), rgba(255, 0, 200, .34))
      0 29% / 19% 1px no-repeat,
    linear-gradient(90deg, rgba(210, 173, 101, .50), rgba(210, 173, 101, .50))
      17% 31% / 31% 1px no-repeat,
    linear-gradient(90deg, rgba(44, 224, 176, .30), rgba(44, 224, 176, .30))
      76% 68% / 24% 1px no-repeat,
    linear-gradient(90deg, rgba(255, 0, 200, .28), rgba(255, 0, 200, .28))
      58% 82% / 18% 2px no-repeat,
    linear-gradient(rgba(210, 173, 101, .34), rgba(210, 173, 101, .34))
      8% 0 / 1px 38% no-repeat,
    linear-gradient(rgba(255, 0, 200, .26), rgba(255, 0, 200, .26))
      71% 63% / 1px 37% no-repeat,

    /* Rembrandtlicht: warm linksboven, diepe schaduw rechtsonder */
    radial-gradient(
      ellipse at 18% 10%,
      rgba(230, 176, 92, .36) 0,
      rgba(180, 112, 59, .18) 31%,
      transparent 57%
    ),
    radial-gradient(
      ellipse at 82% 88%,
      rgba(12, 6, 9, .54) 0,
      rgba(24, 11, 15, .30) 38%,
      transparent 69%
    ),
    radial-gradient(
      ellipse at 50% 100%,
      rgba(129, 91, 65, .25),
      transparent 60%
    ),
    linear-gradient(
      112deg,
      rgba(74, 48, 35, .91),
      rgba(91, 57, 43, .66) 43%,
      rgba(46, 27, 27, .88) 100%
    );
  border: 1px solid rgba(210, 173, 101, .30);
  box-shadow:
    0 28px 52px rgba(0, 0, 0, .30),
    inset 0 0 0 1px rgba(244, 234, 223, .05);
}

.kr-gallery-art > .wpb_wrapper::before,
.wpb_gallery.kr-gallery-art::before {
  content: "KLIKEROTIEK  •  GALLERY";
  position: absolute;
  top: 19px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--kr-gallery-ivory);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .32em;
  white-space: nowrap;
  opacity: .88;
}

.kr-gallery-art > .wpb_wrapper::after,
.wpb_gallery.kr-gallery-art::after {
  content: "";
  position: absolute;
  top: -20px;
  left: -20px;
  width: 70px;
  height: 70px;
  pointer-events: none;
  border-top: 2px solid var(--kr-gallery-gold);
  border-left: 2px solid var(--kr-gallery-gold);
}

/*
 * WordPress [gallery].
 * Eén kaartmaat wordt voor ieder kolomaantal gebruikt.
 * Daardoor bepaalt de inhoud automatisch de totale breedte.
 */
.kr-gallery-art .gallery {
  display: inline-grid !important;
  gap: var(--kr-gallery-gap);
  width: max-content !important;
  max-width: 100%;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  vertical-align: top;
}

.kr-gallery-art .gallery-columns-1 {
  grid-template-columns: repeat(1, var(--kr-gallery-card));
}

.kr-gallery-art .gallery-columns-2 {
  grid-template-columns: repeat(2, var(--kr-gallery-card));
}

.kr-gallery-art .gallery-columns-3 {
  grid-template-columns: repeat(3, var(--kr-gallery-card));
}

.kr-gallery-art .gallery-columns-4 {
  grid-template-columns: repeat(4, var(--kr-gallery-card));
}

.kr-gallery-art .gallery-columns-5 {
  grid-template-columns: repeat(5, var(--kr-gallery-card));
}

.kr-gallery-art .gallery-columns-6 {
  grid-template-columns: repeat(6, var(--kr-gallery-card));
}

.kr-gallery-art .gallery-columns-7 {
  grid-template-columns: repeat(7, var(--kr-gallery-card));
}

.kr-gallery-art .gallery-columns-8 {
  grid-template-columns: repeat(8, var(--kr-gallery-card));
}

.kr-gallery-art .gallery-columns-9 {
  grid-template-columns: repeat(9, var(--kr-gallery-card));
}

/* WPBakery Image Grid gebruikt dezelfde kaartmaat automatisch. */
.kr-gallery-art .wpb_image_grid_ul {
  display: inline-grid !important;
  grid-template-columns: repeat(auto-fit, var(--kr-gallery-card));
  gap: var(--kr-gallery-gap);
  width: max-content !important;
  max-width: 100%;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

.kr-gallery-art .gallery::before,
.kr-gallery-art .gallery::after,
.kr-gallery-art .wpb_image_grid_ul::before,
.kr-gallery-art .wpb_image_grid_ul::after {
  display: none !important;
}

.kr-gallery-art .gallery-item,
.kr-gallery-art .wpb_image_grid_ul > li,
.kr-gallery-art .wpb_image_grid_ul .isotope-item {
  position: relative !important;
  inset: auto !important;
  float: none !important;
  display: block !important;
  box-sizing: border-box;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none;
  text-align: initial !important;
}

.kr-gallery-art .gallery-icon,
.kr-gallery-art .wpb_image_grid_ul > li > a,
.kr-gallery-art .wpb_image_grid_ul .isotope-item > a {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 100%;
  aspect-ratio: 5 / 6;
  padding: 7px;
  overflow: hidden;
  line-height: 0;
  background: var(--kr-gallery-ink);
  border: 1px solid rgba(210, 173, 101, .64);
  box-shadow:
    0 14px 25px rgba(0, 0, 0, .25),
    0 0 18px rgba(218, 203, 42, .22),
    inset 0 0 0 1px rgba(244, 234, 223, .06);
  transition:
    transform .35s ease,
    border-color .35s ease,
    box-shadow .35s ease;
}

.kr-gallery-art .gallery-icon a {
  display: block;
  width: 100%;
  height: 100%;
}

.kr-gallery-art .gallery-icon img,
.kr-gallery-art .wpb_image_grid_ul img {
  display: block;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  max-height: none !important;
  margin: 0 !important;
  border: 0 !important;
  object-fit: cover !important;
  object-position: center;
  aspect-ratio: auto !important;
  transition:
    transform .55s cubic-bezier(.2, .72, .25, 1),
    filter .4s ease;
}

.kr-gallery-art .gallery-icon::before,
.kr-gallery-art .gallery-icon::after,
.kr-gallery-art .wpb_image_grid_ul > li > a::before,
.kr-gallery-art .wpb_image_grid_ul > li > a::after {
  content: "";
  position: absolute;
  z-index: 3;
  width: 34px;
  height: 34px;
  pointer-events: none;
  opacity: .90;
  transition: width .35s ease, height .35s ease;
}

.kr-gallery-art .gallery-icon::before,
.kr-gallery-art .wpb_image_grid_ul > li > a::before {
  top: 4px;
  left: 4px;
  border-top: 2px solid var(--kr-gallery-gold);
  border-left: 2px solid var(--kr-gallery-gold);
}

.kr-gallery-art .gallery-icon::after,
.kr-gallery-art .wpb_image_grid_ul > li > a::after {
  right: 4px;
  bottom: 4px;
  border-right: 2px solid var(--kr-gallery-green);
  border-bottom: 2px solid var(--kr-gallery-gold);
}

.kr-gallery-art .gallery-caption,
.kr-gallery-art .flex-caption {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 11px 2px 0;
  color: var(--kr-gallery-ivory);
  background: transparent;
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: .08em;
  text-transform: uppercase;
}

@media (hover: hover) {
  .kr-gallery-art .gallery-icon:hover,
  .kr-gallery-art .wpb_image_grid_ul > li > a:hover {
    z-index: 4;
    transform: translateY(-4px);
    border-color: rgba(210, 173, 101, .98);
    box-shadow:
      0 21px 38px rgba(0, 0, 0, .34),
      0 0 24px rgba(255, 0, 200, .12);
  }

  .kr-gallery-art .gallery-icon:hover img,
  .kr-gallery-art .wpb_image_grid_ul a:hover img {
    transform: scale(1.025);
    filter: contrast(1.025) saturate(1.025);
  }

  .kr-gallery-art .gallery-icon:hover::before,
  .kr-gallery-art .gallery-icon:hover::after,
  .kr-gallery-art .wpb_image_grid_ul a:hover::before,
  .kr-gallery-art .wpb_image_grid_ul a:hover::after {
    width: 47px;
    height: 47px;
  }
}

/* Tablet: iedere bestaande galerij wordt twee gelijke kolommen. */
@media (max-width: 700px) {
  .kr-gallery-art::before {
    top: -24px;
    right: -10px;
    width: 72%;
    transform: scale(.82) rotate(.7deg);
    transform-origin: right top;
  }

  .kr-gallery-art::after {
    left: -10px;
    bottom: -25px;
    width: 76%;
    transform: scale(.82) rotate(-.9deg);
    transform-origin: left bottom;
  }

  .kr-gallery-art {
    width: calc(100vw - 24px);
    max-width: none;
  }

  .kr-gallery-art > .wpb_wrapper,
  .wpb_gallery.kr-gallery-art {
    width: 100%;
    padding: 54px 14px 22px;
  }

  .kr-gallery-art .gallery,
  .kr-gallery-art .wpb_image_grid_ul,
  .kr-gallery-art .gallery[class*="gallery-columns-"] {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
  }
}

/* Smalle telefoon: één kolom. */
@media (max-width: 430px) {
  .kr-gallery-art .gallery,
  .kr-gallery-art .wpb_image_grid_ul,
  .kr-gallery-art .gallery[class*="gallery-columns-"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .kr-gallery-art > .wpb_wrapper::after,
  .wpb_gallery.kr-gallery-art::after {
    top: -12px;
    left: -5px;
    width: 44px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kr-gallery-art *,
  .kr-gallery-art *::before,
  .kr-gallery-art *::after {
    transition-duration: .01ms !important;
  }
}
