/* DarkGram embeddable player */
.darkgram-album {
  --bg: #0e0a0c;
  --bg-card: #1a1418;
  --border: #2d2226;
  --text: #f5e9ec;
  --text-muted: #a48b91;
  --rose: #e11d48;
  --amber: #f59e0b;
  background: var(--bg);
  color: var(--text);
  border-radius: 12px;
  overflow: hidden;
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.darkgram-loading, .darkgram-error {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
}
.darkgram-error { background: #3b1118; color: #fca5a5; border-radius: 8px; }

/* Feed: single vertical column — one image/video per row, full width,
   natural aspect ratio so nothing is cropped or boxed. */
.darkgram-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}
.darkgram-tile {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s;
}
.darkgram-tile:hover {
  transform: scale(1.015);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.darkgram-tile img {
  width: 100%;
  height: auto;
  display: block;
  background: #000;
  -webkit-user-drag: none; user-drag: none;
  pointer-events: none;
}
.darkgram-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.18);
  pointer-events: none;
  transition: background 0.15s;
}
.darkgram-tile:hover .darkgram-play { background: rgba(0,0,0,0.05); }
.darkgram-play::before {
  content: '';
  width: 0; height: 0;
  border-left: 22px solid white;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  margin-left: 5px;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.8));
}
.darkgram-duration {
  position: absolute; bottom: 6px; right: 6px;
  background: rgba(0,0,0,0.75); color: white;
  padding: 2px 7px; border-radius: 4px;
  font-size: 0.78em; font-weight: 500;
  pointer-events: none;
}

/* Modal / carousel */
.darkgram-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 999999;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
  touch-action: pan-y;
}
.darkgram-modal.open { display: flex; }
.darkgram-modal-inner {
  position: relative;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.darkgram-stage {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s;
  will-change: transform, opacity;
}
.darkgram-stage.swiping { transition: none; }
.darkgram-stage video,
.darkgram-stage img {
  max-width: 100%; max-height: 90vh;
  width: auto; height: auto;
  display: block;
  -webkit-user-drag: none; user-drag: none;
  border-radius: 6px;
}
.darkgram-stage video { background: #000; }

.darkgram-close {
  position: fixed; top: 16px; right: 16px;
  background: rgba(0,0,0,0.6); border: none; color: white;
  font-size: 22px; line-height: 1; cursor: pointer;
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
}
.darkgram-close:hover { background: rgba(0,0,0,0.85); }
.darkgram-counter {
  position: fixed; top: 22px; left: 16px;
  color: rgba(255,255,255,0.75);
  font-size: 0.85em; letter-spacing: 0.05em;
  background: rgba(0,0,0,0.4);
  padding: 4px 10px; border-radius: 999px;
}
.darkgram-watermark {
  position: fixed;
  right: 14px; bottom: 14px;
  color: rgba(255,255,255,0.55);
  font-size: 0.85em;
  letter-spacing: 0.05em;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  font-weight: 500;
}
.darkgram-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  background: rgba(20,20,20,0.7); border: 1px solid rgba(255,255,255,0.2);
  color: white;
  width: 38px; height: 38px; border-radius: 50%;
  font-size: 20px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.darkgram-nav:active { background: rgba(0,0,0,0.9); transform: translateY(-50%) scale(0.9); }
.darkgram-prev { left: 14px; }
.darkgram-next { right: 14px; }
@media (max-width: 600px) {
  .darkgram-nav { width: 34px; height: 34px; font-size: 18px; }
  .darkgram-prev { left: 8px; }
  .darkgram-next { right: 8px; }
  .darkgram-counter { top: 14px; }
  .darkgram-close { top: 10px; right: 10px; }
}

/* simple loading spinner */
.darkgram-spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,0.18);
  border-top-color: white;
  border-radius: 50%;
  animation: darkgram-spin 0.8s linear infinite;
}
@keyframes darkgram-spin { to { transform: rotate(360deg); } }

/* Image zoom inside modal */
.darkgram-zoomable {
  transform-origin: center center;
  transition: transform 0.15s ease;
  cursor: zoom-in;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Smooth high-res image swap: placeholder shows blurred until full-res lands */
.darkgram-img-loading {
  filter: blur(8px);
  transition: filter 0.18s ease;
}
.darkgram-zoomable {
  transition: filter 0.18s ease, transform 0.15s ease;
}
