/* Gallery lightbox - modern minimal */

:root {
  --abc-lb-bg: rgba(8, 8, 12, 0.72);
  --abc-lb-control: rgba(255, 255, 255, 0.06);
  --abc-lb-control-hover: rgba(255, 255, 255, 0.14);
  --abc-lb-control-border: rgba(255, 255, 255, 0.1);
  --abc-lb-text-bright: rgba(255, 255, 255, 0.95);
  --abc-lb-accent: rgba(255, 255, 255, 0.92);
  --abc-lb-radius: 12px;
  --abc-lb-thumb-radius: 8px;
  --abc-lb-transition: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Elementor button reset for gallery controls */

.abc-gallery-block button.abc-gallery-item,
.abc-gallery-block button.abc-gallery-mobile__hero,
.abc-gallery-block button.abc-gallery-mobile__thumb,
.abc-gallery-block button.abc-lightbox__thumb,
.abc-gallery-block button.abc-lightbox__nav,
.abc-gallery-block button.abc-lightbox__close {
  padding: 0 !important;
  margin: 0;
  min-width: 0;
  min-height: 0;
  box-shadow: none !important;
  font-family: inherit;
  line-height: 0 !important;
  text-align: left;
  text-decoration: none;
  text-transform: none;
  appearance: none;
  -webkit-appearance: none;
}

.abc-gallery-block button.abc-gallery-item {
  border: 0 !important;
  border-radius: 20px !important;
}

.abc-gallery-block button.abc-gallery-mobile__hero {
  border: 0 !important;
  border-radius: 14px !important;
}

.abc-gallery-block button.abc-gallery-mobile__thumb {
  border-radius: 10px !important;
}

.abc-gallery-block button.abc-lightbox__thumb {
  border-radius: var(--abc-lb-thumb-radius) !important;
}

.abc-gallery-block button.abc-lightbox__nav,
.abc-gallery-block button.abc-lightbox__close {
  border-radius: 999px !important;
}


/* Gallery grid - desktop only */

.abc-gallery-mobile {
  display: none;
}

.abc-gallery-grid {
  display: grid;
}

.abc-gallery-item {
  overflow: hidden;
  position: relative;
  transition: box-shadow 0.32s var(--abc-lb-transition);
}

.abc-gallery-item picture {
  position: absolute;
  inset: 0;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}

.abc-gallery-item img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  min-width: 100%;
  min-height: 100%;
  display: block !important;
  object-fit: cover !important;
  object-position: center center !important;
  transition: transform 0.5s var(--abc-lb-transition);
}

.abc-gallery-item:hover img,
.abc-gallery-item:focus-visible img {
  transform: scale(1.04);
}

.abc-gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.14) 100%);
  opacity: 0;
  transition: opacity 0.32s ease;
  pointer-events: none;
  z-index: 1;
}

.abc-gallery-item:hover::after,
.abc-gallery-item:focus-visible::after {
  opacity: 1;
}

.abc-gallery-item:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.4);
  outline-offset: 3px;
}

/* Last tile: darker overlay behind "+X" */
.abc-gallery-item:last-child::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  z-index: 2;
  pointer-events: none;
}

.abc-gallery-block .abc-gallery-count,
.abc-gallery-block--before-template .abc-gallery-count {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
  z-index: 3 !important;
  display: block !important;
  border: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: none !important;
  color: #fff !important;
  font-size: 50px !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em !important;
  white-space: nowrap !important;
  pointer-events: none !important;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35) !important;
  line-height: 1 !important;
  padding: 0 !important;
  margin: 0 !important;
  text-align: center !important;
  width: auto !important;
  border-radius: 0 !important;
}

.abc-gallery-count svg {
  display: none !important;
}


/* Gallery mobile - hero and scrollable thumbs */

@media (max-width: 767px) {
  .abc-gallery-grid {
    display: none !important;
  }

  .abc-gallery-mobile {
    display: block;
  }

  .abc-gallery-mobile__hero {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    height: auto;
    min-height: 220px;
    max-height: 400px;
    border: none;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    border-radius: 14px;
    background: #111;
    font-family: inherit;
    line-height: 0;
  }

  .abc-gallery-mobile__hero picture {
    position: absolute;
    inset: 0;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
  }

  .abc-gallery-mobile__hero img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    min-height: 0;
    max-height: none;
    object-fit: cover !important;
    object-position: center center !important;
    display: block !important;
    transition: opacity 0.3s ease, transform 0.3s var(--abc-lb-transition);
  }

  .abc-gallery-mobile__hero img.is-switching {
    opacity: 0.35;
    transform: scale(0.98);
  }

  .abc-gallery-mobile__count {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    pointer-events: none;
    letter-spacing: 0.01em;
  }

  .abc-gallery-mobile__thumbs {
    display: flex;
    gap: 6px;
    padding: 10px 0 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
  }

  .abc-gallery-mobile__thumbs::-webkit-scrollbar {
    display: none;
  }

  .abc-gallery-mobile__thumb {
    position: relative;
    flex: 0 0 68px;
    width: 68px;
    height: 48px;
    box-sizing: border-box;
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 0;
    cursor: pointer;
    background: none;
    opacity: 0.45;
    transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    outline: none;
    font-family: inherit;
    line-height: 0;
    overflow: hidden;
  }

  .abc-gallery-mobile__thumb picture {
    position: absolute;
    inset: 0;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
  }

  .abc-gallery-mobile__thumb img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    border-radius: 8px;
    display: block !important;
  }

  .abc-gallery-mobile__thumb:active {
    transform: scale(0.96);
  }

  .abc-gallery-mobile__thumb.is-active {
    opacity: 1;
    border-color: #222;
  }
}


/* Lightbox - glass blur overlay */

.abc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  padding: 0;
  background: var(--abc-lb-bg);
  backdrop-filter: blur(44px) saturate(1.5);
  -webkit-backdrop-filter: blur(44px) saturate(1.5);
  transition: opacity 0.28s ease, visibility 0.28s ease;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  overscroll-behavior: none;
  touch-action: manipulation;
}

.abc-lightbox.is-visible {
  visibility: visible;
}

.abc-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}


/* Dialog - fullscreen, frameless */

.abc-lightbox__dialog {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: 100vh;
  max-height: 100dvh;
  max-width: 100vw;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  display: flex;
  flex-direction: column;
  transform: scale(0.97);
  transition: transform 0.36s var(--abc-lb-transition);
  overflow: hidden;
}

.abc-lightbox.is-open .abc-lightbox__dialog {
  transform: scale(1);
}


/* Top bar */

.abc-lightbox__top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  margin-bottom: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, transparent 100%);
  pointer-events: none;
}

.abc-lightbox__top > * {
  pointer-events: auto;
}

.abc-lightbox__label,
.abc-lightbox__title {
  display: none;
}


/* Counter pill */

.abc-lightbox__counter {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--abc-lb-text-bright);
  font-variant-numeric: tabular-nums;
  background: var(--abc-lb-control);
  border: 1px solid var(--abc-lb-control-border);
  border-radius: 999px;
  padding: 8px 16px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}


/* Close */

.abc-lightbox__close {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
  position: relative;
  z-index: 31;
}

.abc-lightbox__close svg {
  display: block;
  width: 18px;
  height: 18px;
  color: #fff;
  overflow: visible;
}

.abc-lightbox__close svg path {
  stroke: #fff;
  stroke-width: 2;
}

.abc-lightbox__close:hover,
.abc-lightbox__close:focus-visible {
  background: rgba(0, 0, 0, 0.72);
  border-color: rgba(255, 255, 255, 0.42);
  transform: scale(1.06);
  outline: none;
}


/* Image stage */

.abc-lightbox__stage {
  --abc-lightbox-image-center-y: 50%;
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  overflow: hidden;
  background: transparent;
  border: none;
  touch-action: none;
}

.abc-lightbox__image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 56px 80px 0;
  touch-action: none;
}

.abc-lightbox__image {
  max-width: 100%;
  max-height: calc(100vh - 160px);
  max-height: calc(100dvh - 160px);
  width: auto;
  height: auto;
  object-fit: contain !important;
  border-radius: var(--abc-lb-radius);
  background: transparent;
  transition: opacity 0.24s ease, transform 0.24s var(--abc-lb-transition);
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.abc-lightbox.is-loading .abc-lightbox__image {
  opacity: 0.3;
  transform: scale(0.98);
}


/* Nav arrows */

.abc-lightbox__nav {
  position: absolute;
  top: var(--abc-lightbox-image-center-y, 50%);
  transform: translateY(-50%);
  z-index: 20;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--abc-lb-text-bright);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.abc-lightbox__nav--prev {
  left: 20px;
}

.abc-lightbox__nav--next {
  right: 20px;
}

.abc-lightbox__nav:hover,
.abc-lightbox__nav:focus-visible {
  background: rgba(0, 0, 0, 0.68);
  border-color: rgba(255, 255, 255, 0.38);
  transform: translateY(-50%) scale(1.08);
  outline: none;
}

.abc-lightbox__nav svg {
  display: block;
  width: 14px;
  height: 14px;
  color: #fff;
  overflow: visible;
}

.abc-lightbox__nav svg path {
  stroke: #fff;
  stroke-width: 2;
}


/* Bottom thumbs */

.abc-lightbox__bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 24px 20px;
  margin-top: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.45) 0%, transparent 100%);
}

.abc-lightbox__bottom .abc-lightbox__counter {
  display: none;
}

.abc-lightbox__thumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
  max-width: calc(100vw - 48px);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
}

.abc-lightbox__thumbs::-webkit-scrollbar {
  display: none;
}

.abc-lightbox__thumb {
  position: relative;
  flex: 0 0 72px;
  width: 72px;
  height: 48px;
  border: 2px solid transparent;
  border-radius: var(--abc-lb-thumb-radius);
  opacity: 0.5;
  cursor: pointer;
  background: none;
  padding: 0;
  transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  outline: none;
  overflow: hidden;
}

.abc-lightbox__thumb::after {
  display: none;
}

.abc-lightbox__thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
  border-radius: calc(var(--abc-lb-thumb-radius) - 2px);
  display: block !important;
}

.abc-lightbox__thumb:hover,
.abc-lightbox__thumb:focus-visible {
  opacity: 0.85;
  transform: translateY(-1px);
}

.abc-lightbox__thumb.is-active {
  opacity: 1;
  border-color: var(--abc-lb-accent);
}


/* Scroll lock */

html.abc-lightbox-lock,
body.abc-lightbox-lock {
  overflow: hidden;
  height: 100%;
  overscroll-behavior: none;
}


/* Responsive - lightbox only */

@media (max-width: 980px) {
  .abc-lightbox__image-wrap {
    padding: 52px 20px 0;
  }

  .abc-lightbox__image {
    max-height: calc(100vh - 140px);
    max-height: calc(100dvh - 140px);
    border-radius: 8px;
  }

  .abc-lightbox__nav {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }

  .abc-lightbox__nav--prev { left: 12px; }
  .abc-lightbox__nav--next { right: 12px; }
}

@media (max-width: 767px) {
  .abc-lightbox__top {
    padding: 14px 16px;
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
  }

  .abc-lightbox__image-wrap {
    padding: 48px 8px 0;
  }

  .abc-lightbox__image {
    max-height: calc(100vh - 120px);
    max-height: calc(100dvh - 120px);
    border-radius: 6px;
  }

  .abc-lightbox__nav {
    width: 38px;
    height: 38px;
    font-size: 18px;
    color: #fff;
  }

  .abc-lightbox__nav svg {
    width: 13px;
    height: 13px;
  }

  .abc-lightbox__nav svg path {
    stroke: #fff;
    stroke-width: 2;
  }

  .abc-lightbox__nav--prev { left: 8px; }
  .abc-lightbox__nav--next { right: 8px; }

  .abc-lightbox__close {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }

  .abc-lightbox__counter {
    font-size: 13px;
    padding: 6px 12px;
  }

  .abc-lightbox__bottom {
    padding: 12px 14px 14px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .abc-lightbox__thumbs {
    width: 100%;
    max-width: none;
    gap: 10px;
  }

  .abc-lightbox__thumb {
    flex: 0 0 78px;
    width: 78px;
    height: 54px;
  }

  .abc-lightbox__thumb img {
    width: 100% !important;
    height: 100% !important;
  }
}

@media (max-width: 480px) {
  .abc-lightbox__nav {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }

  .abc-lightbox__nav svg {
    width: 13px;
    height: 13px;
  }

  .abc-lightbox__thumb {
    flex: 0 0 68px;
    width: 68px;
    height: 48px;
  }

  .abc-lightbox__thumb img {
    width: 100% !important;
    height: 100% !important;
  }
}

/* Elementor typography inheritance */

.abc-gallery-block,
.abc-gallery-mobile,
.abc-lightbox,
.abc-lightbox button {
  font-family: var(--e-global-typography-text-font-family, inherit);
}

.abc-lightbox__counter,
.abc-gallery-mobile__count,
.abc-gallery-count {
  font-family: var(--e-global-typography-text-font-family, inherit);
  letter-spacing: normal;
}
