.sgbs-gallery {
  --sgbs-bg: #071421;
  --sgbs-panel: #0d2234;
  --sgbs-text: #f7fbff;
  --sgbs-muted: #b7c5d4;
  --sgbs-accent: #34d2ff;
  --sgbs-accent-2: #f4c76b;
  --sgbs-tab-bg: #102a40;
  --sgbs-tab-active-bg: #34d2ff;
  --sgbs-tab-text: #d9e8f5;
  --sgbs-tab-active-text: #04131f;
  --sgbs-arrow-bg: rgba(7,20,33,0.76);
  --sgbs-lightbox-bg: rgba(2,8,14,0.92);
  --sgbs-radius: 24px;
  --sgbs-shadow: 0 24px 70px rgba(0,0,0,.34);
  --sgbs-stage-height: 540px;
  --sgbs-thumb-height: 86px;
  --sgbs-thumbs-per-row: 10;
  --sgbs-thumb-rows: 2;
  --sgbs-tab-justify: center;
  color: var(--sgbs-text);
  background: linear-gradient(180deg, color-mix(in srgb, var(--sgbs-bg) 94%, white 6%), var(--sgbs-bg));
  border-radius: calc(var(--sgbs-radius) + 6px);
  padding: 24px;
  box-shadow: var(--sgbs-shadow);
  overflow: hidden;
}

.sgbs-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: var(--sgbs-tab-justify, center);
  gap: 10px;
  margin: 0 auto 20px;
  width: 100%;
}

.sgbs-tab {
  appearance: none;
  border: 0;
  background: var(--sgbs-tab-bg);
  color: var(--sgbs-tab-text);
  padding: 11px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: transform .18s ease, background .18s ease, color .18s ease;
}

.sgbs-tab:hover,
.sgbs-tab.is-active {
  background: var(--sgbs-tab-active-bg);
  color: var(--sgbs-tab-active-text);
  transform: translateY(-1px);
}

.sgbs-stage-wrap {
  display: grid;
  gap: 14px;
}

.sgbs-stage {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.sgbs-main-figure {
  margin: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--sgbs-panel) 90%, white 10%), var(--sgbs-panel));
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--sgbs-radius);
  overflow: hidden;
  box-shadow: var(--sgbs-shadow);
}

.sgbs-main-button {
  width: 100%;
  height: var(--sgbs-stage-height);
  display: grid;
  place-items: center;
  padding: 18px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.sgbs-main-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.sgbs-caption {
  padding: 14px 18px 18px;
  display: grid;
  gap: 6px;
  background: linear-gradient(180deg, rgba(8, 18, 28, .08), rgba(4, 13, 22, .42));
  border-top: 1px solid rgba(255,255,255,.08);
}

.sgbs-caption strong,
.sgbs-grid-title {
  color: var(--sgbs-text);
  font-size: clamp(17px, 2vw, 24px);
  line-height: 1.15;
}

.sgbs-caption span,
.sgbs-grid-desc,
.sgbs-caption small,
.sgbs-grid-alt {
  color: var(--sgbs-muted);
  line-height: 1.45;
}

.sgbs-arrow {
  appearance: none;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: var(--sgbs-arrow-bg);
  color: var(--sgbs-text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform .18s ease, border-color .18s ease;
}

.sgbs-arrow:hover {
  transform: scale(1.04);
  border-color: color-mix(in srgb, var(--sgbs-accent) 60%, transparent);
}

.sgbs-thumbs-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.sgbs-thumbs {
  display: grid;
  grid-template-columns: repeat(var(--sgbs-thumbs-per-row), minmax(0, 1fr));
  gap: 12px;
  overflow: visible;
  padding: 4px 2px 2px;
}

.sgbs-thumb-page {
  appearance: none;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: var(--sgbs-arrow-bg);
  color: var(--sgbs-text);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 20px;
  transition: opacity .18s ease, transform .18s ease, border-color .18s ease;
}

.sgbs-thumb-page:hover {
  transform: scale(1.04);
  border-color: color-mix(in srgb, var(--sgbs-accent) 60%, transparent);
}

.sgbs-thumb-page.sgbs-disabled,
.sgbs-thumb-page:disabled {
  opacity: .28;
  cursor: not-allowed;
  transform: none;
}

.sgbs-thumb {
  appearance: none;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 16px;
  overflow: hidden;
  background: transparent;
  cursor: pointer;
  opacity: .72;
  transition: opacity .18s ease, transform .18s ease, border-color .18s ease;
}

.sgbs-thumb:hover,
.sgbs-thumb.is-active {
  opacity: 1;
  transform: translateY(-2px);
}

.sgbs-thumb.is-active {
  border-color: var(--sgbs-accent-2);
}

.sgbs-thumb img {
  display: block;
  width: 100%;
  height: var(--sgbs-thumb-height);
  object-fit: cover;
}

.sgbs-style-slider_clean .sgbs-thumbs {
  display: none;
}

.sgbs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.sgbs-grid-card {
  margin: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--sgbs-panel) 90%, white 10%), var(--sgbs-panel));
  border-radius: var(--sgbs-radius);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: var(--sgbs-shadow);
}

.sgbs-grid-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.sgbs-grid-button img {
  display: block;
  width: 100%;
  height: 280px;
  object-fit: cover;
}

.sgbs-grid-caption {
  padding: 14px 16px 16px;
  display: grid;
  gap: 6px;
}

.sgbs-hidden {
  display: none !important;
}

.sgbs-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: var(--sgbs-lightbox-bg);
}

.sgbs-lightbox.is-open {
  display: flex;
}

html.sgbs-lightbox-active,
html.sgbs-lightbox-active body {
  overflow: hidden;
}

.sgbs-lightbox-img {
  display: block;
  max-width: min(1120px, 86vw);
  max-height: 84vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--sgbs-radius);
  box-shadow: 0 30px 90px rgba(0,0,0,.5);
}

.sgbs-lightbox-close,
.sgbs-lightbox-arrow {
  appearance: none;
  position: fixed;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(5,12,20,.66);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.sgbs-lightbox-close {
  top: 18px;
  right: 18px;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  font-size: 36px;
  line-height: 1;
}

.sgbs-lightbox-arrow {
  top: 50%;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  font-size: 28px;
  transform: translateY(-50%);
}

.sgbs-lightbox-prev { left: 18px; }
.sgbs-lightbox-next { right: 18px; }

.sgbs-lightbox-caption {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  max-width: min(760px, calc(100vw - 40px));
  color: #fff;
  background: rgba(5,12,20,.66);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 16px;
  padding: 10px 14px;
  text-align: center;
}

.sgbs-empty-front {
  padding: 14px 16px;
  border: 1px dashed #ccd6df;
  border-radius: 12px;
}

@media (max-width: 782px) {
  .sgbs-gallery { padding: 18px; }
  .sgbs-stage {
    grid-template-columns: 1fr;
  }
  .sgbs-arrow {
    width: 48px;
    height: 48px;
    margin: 0 auto;
  }
  .sgbs-main-button {
    height: min(72vw, var(--sgbs-stage-height));
  }
  .sgbs-grid-button img {
    height: 230px;
  }
}

/* v1.4.1 professional no-crop display fix.
   Some WordPress themes force img height:auto, which cropped the main slider.
   These rules override theme image styles and keep the full photo visible. */
.sgbs-gallery .sgbs-main-figure {
  background: #071421 !important;
}

.sgbs-gallery .sgbs-main-button {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  min-height: var(--sgbs-stage-height) !important;
  isolation: isolate !important;
}

.sgbs-gallery .sgbs-main-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: inherit;
  filter: blur(22px) saturate(1.08);
  transform: scale(1.08);
  opacity: .42;
  z-index: -2;
}

.sgbs-gallery .sgbs-main-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,.08), rgba(4,13,22,.50) 60%, rgba(4,13,22,.80));
  z-index: -1;
}

.sgbs-gallery .sgbs-main-img {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  margin: auto !important;
  position: relative !important;
  z-index: 1 !important;
  border-radius: calc(var(--sgbs-radius) - 8px);
  box-shadow: 0 16px 44px rgba(0,0,0,.28);
}

.sgbs-gallery .sgbs-caption:empty,
.sgbs-gallery .sgbs-title:empty,
.sgbs-gallery .sgbs-desc:empty,
.sgbs-gallery .sgbs-alt:empty {
  display: none !important;
}

.sgbs-gallery .sgbs-thumbs-shell {
  border-top: 1px solid rgba(255,255,255,.08);
  margin-top: 4px;
  padding-top: 14px;
}

@media (max-width: 782px) {
  .sgbs-thumbs-shell {
    grid-template-columns: 1fr;
  }

  .sgbs-thumb-page {
    width: 46px;
    height: 46px;
    margin: 0 auto;
  }

  .sgbs-thumbs {
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 10px;
  }

  .sgbs-gallery .sgbs-main-button {
    min-height: min(72vw, var(--sgbs-stage-height)) !important;
  }
}
