/* LM Galeria – front-end */
.lmg { margin: 1.5rem 0; clear: both; }
.lmg__title { margin: 0 0 .75rem; }
.lmg__grid {
  display: grid;
  grid-template-columns: repeat(var(--lmg-cols, 4), minmax(0, 1fr));
  gap: var(--lmg-gap, 8px);
}
.lmg__item {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: var(--lmg-ratio, 4/3);
  background: #e9ecef;
  border-radius: 4px;
  cursor: zoom-in;
}
.lmg__item[hidden] { display: none; }
.lmg__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
  max-width: none;
  transition: transform .35s ease, opacity .2s ease;
}
.lmg__item:hover img, .lmg__item:focus-visible img { transform: scale(1.06); }
.lmg__item:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; }
.lmg__more { text-align: center; margin-top: 1rem; }
.lmg__more-btn {
  border: 1px solid currentColor; background: transparent; color: inherit;
  padding: .55rem 1.4rem; border-radius: 999px; font: inherit; cursor: pointer;
}
.lmg__more-btn:hover { background: rgba(0,0,0,.05); }

@media (max-width: 991px) { .lmg__grid { grid-template-columns: repeat(min(var(--lmg-cols, 4), 3), minmax(0, 1fr)); } }
@media (max-width: 575px) { .lmg__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Lightbox */
.lmg-lb {
  position: fixed; inset: 0; z-index: 100000;
  background: rgba(10, 10, 12, .94);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s ease;
  touch-action: pan-y;
  user-select: none;
}
.lmg-lb.is-open { opacity: 1; }
.lmg-lb__figure { margin: 0; max-width: 100vw; max-height: 100vh; display: flex; flex-direction: column; align-items: center; }
.lmg-lb__img {
  max-width: 94vw; max-height: calc(100vh - 110px);
  width: auto; height: auto; object-fit: contain;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
  transition: opacity .15s ease;
}
.lmg-lb__img.is-loading { opacity: .3; }
.lmg-lb__caption { color: #eee; font-size: .95rem; text-align: center; padding: .6rem 1rem 0; max-width: 90vw; }
.lmg-lb__counter { position: absolute; top: 14px; left: 18px; color: #ccc; font-size: .9rem; font-variant-numeric: tabular-nums; }
.lmg-lb__btn {
  position: absolute; border: 0; background: rgba(255,255,255,.08); color: #fff;
  width: 48px; height: 48px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; line-height: 1; transition: background .15s;
}
.lmg-lb__btn:hover, .lmg-lb__btn:focus-visible { background: rgba(255,255,255,.22); outline: none; }
.lmg-lb__close { top: 8px; right: 10px; }
.lmg-lb__prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lmg-lb__next { right: 12px; top: 50%; transform: translateY(-50%); }
.lmg-lb__btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 575px) {
  .lmg-lb__prev, .lmg-lb__next { top: auto; bottom: 14px; transform: none; }
  .lmg-lb__img { max-height: calc(100vh - 150px); }
}
html.lmg-lb-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  .lmg__item img, .lmg-lb, .lmg-lb__img { transition: none; }
}
