/* EZ Gallery (mod_ezgallery) - front end */

.ezg-module {
  margin-bottom: 2rem;
}

.ezg-heading {
  margin: 0 0 .75rem;
}

.ezg-intro {
  margin-bottom: 1.5rem;
}

.ezg-intro > :last-child {
  margin-bottom: 0;
}

/* ---------- Grid: no-JS fallback = CSS columns (true shape, top-to-bottom order) ---------- */

.ezg-gallery {
  --ezg-cols: var(--ezg-cols-xs, 1);
  background: var(--ezg-bg, transparent);
  column-count: var(--ezg-cols);
  column-gap: var(--ezg-gap, 20px);
}

@media (min-width: 576px)  { .ezg-gallery { --ezg-cols: var(--ezg-cols-sm, 2); } }
@media (min-width: 768px)  { .ezg-gallery { --ezg-cols: var(--ezg-cols-md, 3); } }
@media (min-width: 992px)  { .ezg-gallery { --ezg-cols: var(--ezg-cols-lg, 4); } }
@media (min-width: 1200px) { .ezg-gallery { --ezg-cols: var(--ezg-cols-xl, 6); } }

.ezg-item {
  display: block;
  box-sizing: border-box;
  margin: 0 0 var(--ezg-gap, 20px);
  break-inside: avoid;
  overflow: hidden;
  line-height: 0;
  background: #000;
  border: var(--ezg-frame-w, 3px) solid var(--ezg-frame, #1d305e);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.ezg-item img {
  display: block;
  width: 100%;
  height: auto;
}

.ezg-item:hover,
.ezg-item:focus-visible {
  border-color: var(--ezg-hover, #17264a);
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .25);
  outline: none;
}

.ezg-item:focus-visible {
  box-shadow: 0 0 0 3px rgba(52, 83, 162, .6), 0 6px 14px rgba(0, 0, 0, .25);
}

/* ---------- Hover: dim + "plus" to show the photo opens in the lightbox ---------- */

.ezg-gallery:not(.ezg-js) .ezg-item {
  position: relative;
}

.ezg-hover-plus .ezg-item {
  cursor: zoom-in;
}

.ezg-hover-plus .ezg-item::before,
.ezg-hover-plus .ezg-item::after {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
}

/* Dim layer */
.ezg-hover-plus .ezg-item::before {
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, .45);
}

/* White "+" in a circle, drawn with CSS (no icon font needed) */
.ezg-hover-plus .ezg-item::after {
  z-index: 2;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border: 2px solid #fff;
  border-radius: 50%;
  background:
    linear-gradient(#fff, #fff) center / 20px 2px no-repeat,
    linear-gradient(#fff, #fff) center / 2px 20px no-repeat;
  transform: scale(.75);
}

.ezg-hover-plus .ezg-item:hover::before,
.ezg-hover-plus .ezg-item:focus-visible::before {
  opacity: 1;
}

.ezg-hover-plus .ezg-item:hover::after,
.ezg-hover-plus .ezg-item:focus-visible::after {
  opacity: 1;
  transform: scale(1);
}

/* ---------- Grid: JS layout (positions set by gallery.js) ---------- */

.ezg-gallery.ezg-js {
  column-count: auto;
  position: relative;
}

.ezg-gallery.ezg-js .ezg-item {
  position: absolute;
  margin: 0;
}

.ezg-gallery.ezg-js .ezg-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

@media (prefers-reduced-motion: reduce) {
  .ezg-item,
  .ezg-hover-plus .ezg-item::before,
  .ezg-hover-plus .ezg-item::after { transition: none; }
  .ezg-item:hover, .ezg-item:focus-visible { transform: none; }
}

/* ---------- Lightbox ---------- */

html.ezg-lb-open {
  overflow: hidden;
}

.ezg-lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
}

.ezg-lightbox::backdrop {
  background: rgba(0, 0, 0, .9);
}

.ezg-lb-stage {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 3.5rem 4.5rem 1.5rem;
}

.ezg-lb-img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 11rem);
  max-height: calc(100dvh - 11rem);
  width: auto;
  height: auto;
  object-fit: contain;
  background: #000;
  border: var(--ezg-frame-w, 3px) solid var(--ezg-frame, #1d305e);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .6);
}

.ezg-lb-caption {
  max-width: 60rem;
  margin-top: 1rem;
  text-align: center;
  line-height: 1.45;
}

.ezg-lb-caption:empty {
  display: none;
}

.ezg-lb-title {
  font-weight: 700;
  font-size: 1.15rem;
}

.ezg-lb-desc {
  margin-top: .25rem;
  white-space: pre-line;
  opacity: .9;
}

.ezg-lb-counter {
  position: absolute;
  top: 1rem;
  left: 1.25rem;
  font-size: .95rem;
  opacity: .85;
}

.ezg-lb-btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease;
}

.ezg-lb-btn:hover,
.ezg-lb-btn:focus-visible {
  background: rgba(255, 255, 255, .28);
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.ezg-lb-close { top: .6rem; right: .8rem; }
.ezg-lb-prev  { top: 50%; left: .8rem;  transform: translateY(-50%); }
.ezg-lb-next  { top: 50%; right: .8rem; transform: translateY(-50%); }

.ezg-lb-btn[hidden] {
  display: none;
}

@media (max-width: 575.98px) {
  .ezg-lb-stage { padding: 3.5rem .75rem 1rem; }
  .ezg-lb-prev, .ezg-lb-next { top: auto; bottom: 1rem; transform: none; }
  .ezg-lb-img { max-height: calc(100dvh - 13rem); }
}
