.io-gallery {
  --io-gallery-columns: 3;
  margin: 1.25rem 0;
  position: relative;
}

.io-gallery-loading {
  display: none;
}

.io-gallery-spinner {
  display: none;
}

@keyframes io-gallery-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes io-gallery-shimmer {
  to {
    background-position-x: -220%;
  }
}

.io-gallery-grid {
  display: grid;
  grid-template-columns: repeat(var(--io-gallery-columns), minmax(0, 1fr));
  grid-auto-rows: 8px;
  gap: 0.9rem;
  align-items: start;
}

.io-gallery-item {
  margin: 0;
  overflow: hidden;
  border-radius: 10px;
  background: #f8fafc;
}

.io-gallery-open {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  position: relative;
  background: transparent;
  cursor: zoom-in;
  line-height: 0;
  overflow: hidden;
  border-radius: 10px;
}

.io-gallery-skeleton {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: linear-gradient(110deg, #e2e8f0 8%, #f1f5f9 18%, #e2e8f0 33%);
  background-size: 220% 100%;
  animation: io-gallery-shimmer 1.15s linear infinite;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

.io-gallery-item.is-pending .io-gallery-skeleton,
.io-gallery-item.is-loading .io-gallery-skeleton {
  opacity: 1;
  visibility: visible;
}

.io-gallery-item.is-loaded .io-gallery-skeleton,
.io-gallery-item.is-failed .io-gallery-skeleton {
  opacity: 0;
  visibility: hidden;
}

.io-gallery-thumb {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.io-gallery-thumb-deferred {
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.io-gallery-item.is-loaded .io-gallery-thumb-deferred {
  opacity: 1;
}

.io-gallery-item.is-loading .io-gallery-thumb-deferred,
.io-gallery-item.is-pending .io-gallery-thumb-deferred {
  opacity: 0;
}

.io-gallery-open:hover .io-gallery-thumb,
.io-gallery-open:focus .io-gallery-thumb {
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.io-gallery-controls {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.io-gallery-controls button {
  border: 1px solid #0f172a;
  background: #0f172a;
  color: #fff;
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
}

.io-gallery-controls button[disabled] {
  opacity: 0.45;
  cursor: default;
}

.io-gallery-page-status {
  font-size: 0.92rem;
  color: #334155;
}

.io-gallery-controls-mobile {
  display: none;
}

.io-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 16, 0.88);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.io-lightbox.is-open {
  display: flex;
}

.io-lightbox-content {
  position: relative;
  width: min(1200px, 95vw);
}

.io-lightbox-image {
  display: block;
  max-width: 100%;
  max-height: 82vh;
  margin: 0 auto;
  border-radius: 10px;
}

.io-lightbox-caption {
  margin-top: 0.55rem;
  text-align: center;
  color: #e2e8f0;
}

.io-lightbox-share {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
}

.io-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.io-lightbox-share button {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
  color: #ffffff;
  border-radius: 999px;
  width: 40px;
  height: 40px;
  padding: 0;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.45);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
  position: relative;
}

.io-lightbox-share button:hover,
.io-lightbox-share button:focus {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(2, 6, 23, 0.55);
  filter: brightness(1.08);
}

.io-lightbox-share button svg {
  width: 18px;
  height: 18px;
  display: block;
  margin: 0 auto;
  fill: currentColor;
}

.io-share-copy.is-copied {
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.65), 0 10px 20px rgba(2, 6, 23, 0.45);
}

.io-share-copy {
  background: linear-gradient(160deg, #334155, #1e293b);
}

.io-share-facebook {
  background: linear-gradient(160deg, #2563eb, #1e40af);
}

.io-share-x {
  background: linear-gradient(160deg, #0f172a, #000000);
}

.io-share-linkedin {
  background: linear-gradient(160deg, #0284c7, #0369a1);
}

.io-share-whatsapp {
  background: linear-gradient(160deg, #22c55e, #15803d);
}

.io-share-instagram {
  background: linear-gradient(135deg, #f58529, #dd2a7b 45%, #8134af 75%, #515bd4);
}

.io-share-download {
  background: linear-gradient(160deg, #475569, #1f2937);
}

.io-lightbox-close,
.io-lightbox-prev,
.io-lightbox-next {
  position: absolute;
  border: 0;
  border-radius: 999px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.86);
  color: #fff;
}

.io-lightbox-close {
  top: -16px;
  right: -16px;
}

.io-lightbox-prev {
  top: 50%;
  left: -20px;
  transform: translateY(-50%);
}

.io-lightbox-next {
  top: 50%;
  right: -20px;
  transform: translateY(-50%);
}

@media (max-width: 900px) {
  .io-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .io-lightbox-prev {
    left: 6px;
  }

  .io-lightbox-next {
    right: 6px;
  }
}

@media (max-width: 640px) {
  .io-gallery-grid {
    grid-template-columns: 1fr;
  }

  .io-gallery-controls-mobile {
    display: flex;
  }

  .io-lightbox {
    padding: 1rem;
  }

  .io-lightbox-share {
    gap: 0.35rem;
  }
}
