/**
 * CIE Gallery — section4 (matches 3.html layout; scoped under .sweans-cg-wrap)
 */
.sweans-cg-wrap {
  box-sizing: border-box;
}

.sweans-cg-wrap *,
.sweans-cg-wrap *::before,
.sweans-cg-wrap *::after {
  box-sizing: border-box;
}

.sweans-cg-section {
  width: 100%;
  padding: 60px 0 70px;
  background: #ffffff;
}

.sweans-cg-inner {
  max-width: 1620px;
  margin: 0 auto;
  padding: 0 20px;
}

.sweans-cg-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 36px;
}

/* Typography (font, size, weight, etc.) comes from Elementor — do not set here or it overrides the Style tab. */
.sweans-cg-title {
  flex-shrink: 0;
  margin: 0;
}

.sweans-cg-line {
  flex: 1;
  height: 1px;
  background: #cccccc;
}

.sweans-cg-nav {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.sweans-cg-nav-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid #1e7bbf;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s, border-color 0.25s;
  outline: none;
  flex-shrink: 0;
  padding: 0;
}

.sweans-cg-nav-btn:hover:not(:disabled) {
  background: #1e7bbf;
}

.sweans-cg-nav-btn svg {
  width: 14px;
  height: 14px;
  stroke: #1e7bbf;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.25s;
}

.sweans-cg-nav-btn:hover:not(:disabled) svg {
  stroke: #ffffff;
}

.sweans-cg-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* Override global theme rules that inject #c36 on button:focus / button:active / [type="button"]:hover */
.sweans-cg-wrap button.sweans-cg-nav-btn:focus,
.sweans-cg-wrap button.sweans-cg-nav-btn:focus-visible {
  background: transparent !important;
  background-color: transparent !important;
  border-color: #1e7bbf !important;
  color: inherit !important;
  box-shadow: none !important;
  outline: none !important;
  text-decoration: none;
}

.sweans-cg-wrap button.sweans-cg-nav-btn:active {
  background: #1e7bbf !important;
  background-color: #1e7bbf !important;
  border-color: #1e7bbf !important;
  color: inherit !important;
  box-shadow: none !important;
}

.sweans-cg-wrap button.sweans-cg-nav-btn:hover:not(:disabled) {
  background: #1e7bbf !important;
  background-color: #1e7bbf !important;
  border-color: #1e7bbf !important;
  color: inherit !important;
  text-decoration: none;
}

.sweans-cg-viewport {
  overflow: hidden;
  width: 100%;
  cursor: grab;
  user-select: none;
  outline: none;
}

.sweans-cg-viewport.is-dragging {
  cursor: grabbing;
}

.sweans-cg-viewport.is-dragging .sweans-cg-item img {
  pointer-events: none;
}

.sweans-cg-track {
  display: flex;
  gap: 16px;
  transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
  will-change: transform;
}

.sweans-cg-item {
  flex: 0 0 calc(25% - 12px);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  background: #e0e0e0;
  aspect-ratio: 320 / 330;
}

.sweans-cg-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.sweans-cg-item:hover img {
  transform: scale(1.04);
}

.sweans-cg-lightbox-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 100000;
  align-items: center;
  justify-content: center;
}

.sweans-cg-lightbox-backdrop.open {
  display: flex;
}

.sweans-cg-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sweans-cg-lightbox-content img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 4px;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  display: block;
}

.sweans-cg-lightbox-close {
  position: absolute;
  top: -18px;
  right: -18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  transition: background 0.2s, transform 0.2s;
  z-index: 10;
  padding: 0;
}

.sweans-cg-lightbox-close:hover {
  background: #f0f0f0;
  transform: scale(1.1);
}

.sweans-cg-lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  z-index: 10;
  padding: 0;
}

.sweans-cg-lightbox-arrow:hover {
  background: rgba(0, 0, 0, 0.7);
  border-color: #fff;
}

.sweans-cg-lightbox-arrow svg {
  width: 16px;
  height: 16px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sweans-cg-lightbox-arrow.prev {
  left: -60px;
}

.sweans-cg-lightbox-arrow.next {
  right: -60px;
}

@media (max-width: 1024px) {
  .sweans-cg-item {
    flex: 0 0 calc(50% - 8px);
  }
}

@media (max-width: 600px) {
  .sweans-cg-section {
    padding: 40px 0 50px;
  }
  .sweans-cg-inner {
    padding: 0 14px;
  }
  .sweans-cg-header {
    margin-bottom: 24px;
  }
  .sweans-cg-item {
    flex: 0 0 calc(100% - 0px);
  }
  .sweans-cg-nav-btn {
    width: 36px;
    height: 36px;
  }
  .sweans-cg-lightbox-arrow.prev {
    left: -14px;
  }
  .sweans-cg-lightbox-arrow.next {
    right: -14px;
  }
}

/* Mobile nav (below viewport) — hidden by default, shown only at ≤500px */
.sweans-cg-nav--mobile {
  display: none;
}

@media (max-width: 500px) {
  .sweans-cg-header .sweans-cg-nav {
    display: none;
  }

  .sweans-cg-nav--mobile {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
  }

  .sweans-cg-line {
    display: none;
  }

  .sweans-cg-title {
    width: 100%;
    text-align: center;
  }
}

/* Editor preview */
.sweans-cg-wrap.sweans-cg--editor-preview {
  position: relative;
}

.sweans-cg-editor-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  font-family: 'Barlow', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  background: #2271b1;
  padding: 4px 8px;
  border-radius: 2px;
  pointer-events: none;
}
