/*
  Digitana Social - Feed-Bilderblock V1
  Eigenes Modul fuer Feed-Bilder, Collage, lokale Vorschau und Bildloeschung.
  Keine Grossansicht, kein Overlay, keine Erweiterung der base.css.
*/

.ds-feed-compose-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 12px;
  padding: 0 0 2px;
}

.ds-feed-compose-preview[hidden],
.ds-feed-compose-note[hidden] {
  display: none !important;
}

.ds-feed-compose-preview-item {
  position: relative;
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  min-width: 64px;
  min-height: 64px;
  max-width: 64px;
  max-height: 64px;
  padding: 0;
  border-radius: 8px;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

.ds-feed-compose-preview-item img {
  width: 64px !important;
  height: 64px !important;
  max-width: 64px;
  max-height: 64px;
  display: block !important;
  object-fit: cover;
  border-radius: 8px;
  image-rendering: auto;
}

.ds-feed-compose-remove {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.82);
  color: #ffffff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow:
    inset 0 0 0 1px rgba(215, 237, 255, 0.26),
    0 0 10px rgba(0, 0, 0, 0.50);
}

.ds-feed-compose-note {
  margin-top: 7px;
  color: #9fdcff;
  font-size: 0.76rem;
  line-height: 1.35;
}

.ds-feed-images {
  position: relative;
  width: min(560px, 100%);
  margin: 10px 0 8px;
  padding: 8px;
  border-radius: 10px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(215, 237, 255, 0.07), transparent 56%),
    linear-gradient(135deg, rgba(34, 36, 40, 0.98), rgba(12, 13, 16, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(215, 237, 255, 0.10),
    inset 0 -14px 22px rgba(0, 0, 0, 0.28),
    0 12px 24px rgba(0, 0, 0, 0.34);
}

.ds-feed-image-grid {
  display: grid;
  gap: 7px;
  width: 100%;
}

.ds-feed-image-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #181a1f;
  box-shadow: inset 0 0 0 1px rgba(215, 237, 255, 0.08);
}

.ds-feed-image-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  image-rendering: auto;
}

.ds-feed-images-count-1 {
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.ds-feed-images-count-1 .ds-feed-image-grid {
  display: block;
}

.ds-feed-images-count-1 .ds-feed-image-item {
  width: fit-content;
  max-width: 100%;
  max-height: 360px;
  background: transparent;
  box-shadow: none;
}

.ds-feed-images-count-1 .ds-feed-image-item img {
  width: auto;
  max-width: min(520px, 100%);
  height: auto;
  max-height: 360px;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.34), inset 0 0 0 1px rgba(215, 237, 255, 0.10);
}

.ds-feed-images-count-2 .ds-feed-image-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ds-feed-images-count-2 .ds-feed-image-item {
  height: 180px;
}

.ds-feed-images-count-3 .ds-feed-image-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ds-feed-images-count-3:not(.ds-feed-images-slider-active) .ds-feed-image-item:first-child {
  grid-row: span 2;
  height: 367px;
}

.ds-feed-images-count-3:not(.ds-feed-images-slider-active) .ds-feed-image-item:not(:first-child) {
  height: 180px;
}

.ds-feed-images-count-4 .ds-feed-image-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ds-feed-images-count-4 .ds-feed-image-item {
  height: 180px;
}

.ds-feed-image-delete-form {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  margin: 0;
}

.ds-feed-image-remove {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.76);
  color: #ffffff;
  font-size: 1.08rem;
  line-height: 1;
  cursor: pointer;
  box-shadow:
    inset 0 0 0 1px rgba(215, 237, 255, 0.28),
    0 0 12px rgba(0, 0, 0, 0.58);
}

.ds-feed-image-remove:hover,
.ds-feed-image-remove:focus-visible {
  background: rgba(22, 28, 34, 0.92);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.44),
    0 0 14px rgba(215, 237, 255, 0.26);
}

.ds-feed-image-nav {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 30px;
  height: 42px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.56);
  color: #eaf6ff;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  box-shadow:
    inset 0 0 0 1px rgba(215, 237, 255, 0.18),
    0 0 14px rgba(0, 0, 0, 0.48);
}

.ds-feed-image-prev { left: 10px; }
.ds-feed-image-next { right: 10px; }

.ds-feed-image-nav:hover,
.ds-feed-image-nav:focus-visible {
  background: rgba(12, 18, 24, 0.82);
  box-shadow:
    inset 0 0 0 1px rgba(215, 237, 255, 0.34),
    0 0 14px rgba(215, 237, 255, 0.18);
}

.ds-feed-images-slider-active .ds-feed-image-grid {
  display: block;
}

.ds-feed-images-slider-active .ds-feed-image-item {
  display: none;
  height: 360px;
}

.ds-feed-images-slider-active .ds-feed-image-item.ds-feed-image-active {
  display: flex;
}

.ds-feed-images-slider-active .ds-feed-image-item.ds-feed-image-active img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (max-width: 820px) {
  .ds-feed-images {
    width: 100%;
  }

  .ds-feed-images-count-1 .ds-feed-image-item,
  .ds-feed-images-count-1 .ds-feed-image-item img {
    max-width: 100%;
    max-height: 320px;
  }

  .ds-feed-images-count-2 .ds-feed-image-item,
  .ds-feed-images-count-3:not(.ds-feed-images-slider-active) .ds-feed-image-item:not(:first-child),
  .ds-feed-images-count-4 .ds-feed-image-item {
    height: 150px;
  }

  .ds-feed-images-count-3:not(.ds-feed-images-slider-active) .ds-feed-image-item:first-child {
    height: 307px;
  }

  .ds-feed-images-slider-active .ds-feed-image-item {
    height: 320px;
  }
}

@media (max-width: 460px) {
  .ds-feed-compose-preview {
    gap: 9px;
  }

  .ds-feed-images-count-2 .ds-feed-image-grid,
  .ds-feed-images-count-3 .ds-feed-image-grid,
  .ds-feed-images-count-4 .ds-feed-image-grid {
    gap: 5px;
  }

  .ds-feed-images-count-2 .ds-feed-image-item,
  .ds-feed-images-count-3:not(.ds-feed-images-slider-active) .ds-feed-image-item:not(:first-child),
  .ds-feed-images-count-4 .ds-feed-image-item {
    height: 126px;
  }

  .ds-feed-images-count-3:not(.ds-feed-images-slider-active) .ds-feed-image-item:first-child {
    height: 257px;
  }

  .ds-feed-image-nav {
    width: 28px;
    height: 38px;
  }
}
