/* Platecraft Addons – Image Grid.
   Every image carries its column / row span for each preset layout as
   --pig-c-{layout} / --pig-r-{layout}; the Layout control (per device) picks
   the set. --pig-w / --pig-h are the per-image sizes set in the list.
   The rules below are the defaults; the widget's controls use a more
   specific selector. */

/* Takes the full width even inside a shrink-to-fit parent (flex row etc.). */
.pig-wrap::before {
  content: "";
  display: block;
  width: 100000px;
  max-width: 100%;
  height: 0;
}

.pig {
  --pig-cols-uniform: var(--pig-n, 3);
  --pig-cols-custom: var(--pig-n, 3);
  --pig-cols: var(--pig-cols-l23, 6);
  /* Masonry: CSS columns, images at their own height with the row gap below
     each one. "Left to right" order switches to .pig--js-masonry (below). */
  --pig-cols-masonry: var(--pig-n, 3);
  --pig-m-masonry: 1;
  --pig-disp-masonry: block;
  --pig-cc-masonry: var(--pig-n, 3);
  --pig-imgh-masonry: auto;
  --pig-mb-masonry: var(--pig-gap-y, 16px);
  display: grid;
  grid-template-columns: repeat(var(--pig-cols), minmax(0, 1fr));
  grid-auto-rows: var(--pig-row-h, 260px);
  gap: var(--pig-gap-y, 16px) var(--pig-gap-x, 16px);
  box-sizing: border-box;
}

.pig .pig__item {
  /* Never wider than the grid: a 4-column image in a 2-column layout takes 2. */
  grid-column: span min(var(--pig-w, var(--pig-c-l23, 1)), var(--pig-cols));
  grid-row: span var(--pig-h, var(--pig-r-l23, 1));
  position: relative;
  box-sizing: border-box;
  min-width: 0;
  min-height: 0;
  margin: 0 0 var(--pig-item-mb, 0px);
  break-inside: avoid;
  overflow: hidden;
  border: 0 solid transparent;
  box-shadow: var(--pig-shadow, none);
  transform: translateY(0);
  transition: box-shadow var(--pig-speed, 400ms) ease, transform var(--pig-speed, 400ms) ease, border-color var(--pig-speed, 400ms) ease;
}
/* Elementor sets "margin: 0" on every figure in a widget with a long
   selector; this one is a little stronger so the masonry gap applies. */
.elementor-widget .pig-wrap .pig .pig__item.pig__item {
  margin: 0 0 var(--pig-item-mb, 0px);
}
.pig .pig__item:hover {
  /* No hover shadows set = keep the normal ones. */
  box-shadow: var(--pig-shadow-h, var(--pig-shadow, none));
  transform: translateY(calc(var(--pig-lift, 0px) * -1));
}

/* Masonry in reading order: a grid of thin rows where every image spans as
   many rows as it is tall (set by image-grid.js), so the grid puts each one
   into the shortest column while the HTML order stays 1, 2, 3 … */
.pig.pig--js-masonry {
  --pig-disp-masonry: grid;
  --pig-cc-masonry: auto;
  grid-auto-rows: var(--pig-mu, 1px);
  row-gap: 0;
}
.pig.pig--js-masonry .pig__item {
  align-self: start;
}

.pig .pig__link {
  display: block;
  position: relative;
  width: 100%;
  height: var(--pig-img-h, 100%);
  overflow: hidden;
  border-radius: inherit;
  color: inherit;
  text-decoration: none;
}
.pig a.pig__link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -4px;
}

.pig .pig__img {
  display: block;
  width: 100%;
  height: var(--pig-img-h, 100%);
  max-width: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  object-fit: var(--pig-fit, cover);
  object-position: var(--pig-pos, center);
  transition: transform var(--pig-speed, 400ms) ease, opacity var(--pig-speed, 400ms) ease, filter var(--pig-speed, 400ms) ease;
}
.pig--fx-zoom-in .pig__item:hover .pig__img,
.pig--fx-zoom-out .pig__img {
  transform: scale(var(--pig-zoom, 1.06));
}
.pig--fx-zoom-out .pig__item:hover .pig__img {
  transform: scale(1);
}

.pig .pig__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: var(--pig-ov-op, 1);
  transition: opacity var(--pig-speed, 400ms) ease, background-color var(--pig-speed, 400ms) ease;
}
.pig .pig__item:hover .pig__overlay {
  opacity: var(--pig-ov-op-h, var(--pig-ov-op, 1));
}

.pig .pig__icon {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
  transition: opacity var(--pig-speed, 400ms) ease, transform var(--pig-speed, 400ms) ease;
}
.pig .pig__item:hover .pig__icon,
.pig .pig__link:focus-visible .pig__icon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.pig .pig__icon svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
}

/* The caption sits over the image; clicks go through to the link. */
.pig .pig__caption {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: var(--pig-cap-v, flex-end);
  align-items: var(--pig-cap-h, stretch);
  box-sizing: border-box;
  padding: 12px;
  pointer-events: none;
  transition: opacity var(--pig-speed, 400ms) ease, transform var(--pig-speed, 400ms) ease;
}
.pig .pig__caption-text {
  display: block;
  max-width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  background-color: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: break-word;
}
.pig--cap-hover .pig__caption {
  opacity: 0;
  transform: translateY(8px);
}
.pig--cap-hover .pig__item:hover .pig__caption,
.pig--cap-hover .pig__item:focus-within .pig__caption {
  opacity: 1;
  transform: none;
}

.pig__notice {
  margin: 0;
  padding: 12px 16px;
  background: #fff8e5;
  color: #1d2327;
  font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  .pig .pig__item,
  .pig .pig__img,
  .pig .pig__overlay,
  .pig .pig__icon,
  .pig .pig__caption {
    transition-duration: 0ms;
  }
  .pig .pig__item:hover,
  .pig--fx-zoom-in .pig__item:hover .pig__img,
  .pig--fx-zoom-out .pig__img,
  .pig--fx-zoom-out .pig__item:hover .pig__img {
    transform: none;
  }
}
