/* Image Gallery for Digital Garden */

.dg-image-gallery {
  margin: 1.5em 0;
}

/* Vertical: masonry (Pinterest style) */
.dg-gallery-vertical {
  columns: var(--dg-cols, 3);
  column-gap: var(--dg-gap, 8px);
}

/* Horizontal: fixed-height rows */
.dg-gallery-horizontal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--dg-gap, 8px);
}
.dg-gallery-horizontal::after {
  content: "";
  flex-grow: 999; /* Keeps the last row from stretching */
}
.dg-gallery-horizontal .dg-gallery-item {
  height: var(--dg-h, 260px);
  flex-grow: 1;
  margin-bottom: 0;
}
.dg-gallery-horizontal .dg-gallery-item img {
  height: 100%;
  width: 100%;
  min-width: 100%;
  object-fit: cover;
}

/* Items */
.dg-gallery-item {
  display: block;
  break-inside: avoid;
  margin-bottom: var(--dg-gap, 8px);
  overflow: hidden;
  border-radius: var(--dg-r, 0px);
  cursor: pointer;
  background: transparent;
}

.dg-gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--dg-r, 0px);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.dg-gallery-item:hover img {
  transform: scale(1.03);
  opacity: 0.85;
}

/* Error message */
.dg-gallery-error {
  padding: 0.75em 1em;
  border: 1px solid var(--color-red, #e74c3c);
  border-radius: 4px;
  color: var(--color-red, #e74c3c);
  font-size: 0.9em;
  margin: 1em 0;
}

/* Mobile */
@media (max-width: 600px) {
  .dg-gallery-vertical {
    columns: var(--dg-cols-mobile, 1);
  }
  .dg-gallery-horizontal .dg-gallery-item {
    height: calc(var(--dg-h, 260px) * 0.6);
  }
}

/* Lightbox (lightgallery) */
.lg-container {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
.lg-container button { box-shadow: none !important; }

.lg-backdrop { background-color: rgba(0,0,0,0.92) !important; }

/* Arrows */
.lg-next, .lg-prev {
  border-radius: 2px; opacity: 0.6 !important; border: none; outline: none;
}
.lg-next:hover:not(.disabled),
.lg-prev:hover:not(.disabled) { opacity: 1 !important; }

.lg-next {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 16 16'%3E%3Cpath fill='%23FFFFFF' d='M9.707 13.707l5-5c0.391-0.39 0.391-1.024 0-1.414l-5-5c-0.391-0.391-1.024-0.391-1.414 0s-0.391 1.024 0 1.414l3.293 3.293h-9.586c-0.552 0-1 0.448-1 1s0.448 1 1 1h9.586l-3.293 3.293c-0.195 0.195-0.293 0.451-0.293 0.707s0.098 0.512 0.293 0.707c0.391 0.391 1.024 0.391 1.414 0z'%3E%3C/path%3E%3C/svg%3E");
  background-position: center; background-repeat: no-repeat;
}
.lg-prev {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 16 16'%3E%3Cpath fill='%23FFFFFF' d='M6.293 13.707l-5-5c-0.391-0.39-0.391-1.024 0-1.414l5-5c0.391-0.391 1.024-0.391 1.414 0s0.391 1.024 0 1.414l-3.293 3.293h9.586c0.552 0 1 0.448 1 1s-0.448 1-1 1h-9.586l3.293 3.293c0.195 0.195 0.293 0.451 0.293 0.707s-0.098 0.512-0.293 0.707c-0.391 0.391-1.024 0.391-1.414 0z'%3E%3C/path%3E%3C/svg%3E");
  background-position: center; background-repeat: no-repeat;
}
.lg-outer .lg-next,
.lg-outer .lg-prev { width: 44px; height: 40px; }

/* Close button */
.lg-toolbar .lg-close.lg-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");
  background-position: center; background-repeat: no-repeat; opacity: 0.6;
}
.lg-toolbar .lg-close:hover { opacity: 1; }

/* Hides lightgallery's default icons (prevents double arrows) */
.lg-outer .lg-next:before,
.lg-outer .lg-prev:after,
.lg-outer .lg-toolbar .lg-close:after { content: none; }

/* Thumbnails */
.lg-outer .lg-thumb-outer { background-color: rgba(0,0,0,0.95); }
.lg-outer .lg-thumb-item { border-radius: 3px; border: 2px solid transparent; }
.lg-outer .lg-thumb-item.active,
.lg-outer .lg-thumb-item:hover { outline: 2px solid rgba(255,255,255,0.9); border-color: transparent; }
.lg-outer .lg-thumb-item img { object-fit: cover; }
