/* ── Photo Gallery (tab "🖼️ Fotky" v detailu realizace) ──────────────────── */

.photo-gallery-wrap {
  padding: 8px 0;
}

.photo-gallery-section {
  margin-bottom: 24px;
}

.photo-gallery-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--c-text);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.photo-gallery-count {
  font-size: 12px;
  color: var(--c-text-muted);
  font-weight: 400;
}

/* Lišta upload tlačítek pod titulkem sekce. Na mobilu 2×2 mřížka (velké
   touch-targety), na desktopu kompaktní řádek zarovnaný vpravo. */
.photo-upload-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.photo-upload-btn {
  flex: 1 1 calc(50% - 4px);     /* 2 sloupce na mobilu */
  min-width: 130px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  background: var(--c-surface);
  color: var(--c-text);
  cursor: pointer;
  user-select: none;
  -webkit-text-size-adjust: 100%;  /* zabraň Android font-boostingu */
  text-size-adjust: 100%;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.photo-upload-btn .pub-lbl { display: block; }

.photo-upload-btn:hover,
.photo-upload-btn:active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: white;
}

.photo-upload-btn-cam { background: #10b981; color: #fff; border-color: #10b981; }
.photo-upload-btn-cam:hover,
.photo-upload-btn-cam:active { background: #059669; border-color: #059669; }

/* Desktop (myš): skryj „Vyfotit/Natočit" (jen touch) a tlačítka udělej
   kompaktní v jednom řádku zarovnaná vpravo. */
@media (pointer: fine) {
  .photo-upload-btn-cam { display: none; }
  .photo-upload-bar { justify-content: flex-end; }
  .photo-upload-btn {
    flex: 0 0 auto;
    min-width: 0;
    min-height: 0;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--c-text-muted);
  }
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  transition: background 0.15s, outline 0.15s;
  border-radius: 8px;
  padding: 4px;
}
/* Drag&drop highlight — modré orámování + lehké pozadí */
.photo-grid.photo-drag-over {
  background: #eff6ff;
  outline: 2px dashed #2563eb;
  outline-offset: -4px;
}

.photo-empty {
  grid-column: 1 / -1;
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--c-text-light);
  background: var(--c-bg);
  border: 1px dashed var(--c-border);
  border-radius: 8px;
}

.photo-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  transition: transform 0.15s, box-shadow 0.15s;
}

.photo-thumb:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.photo-thumb img,
.photo-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

/* ▶ ikona ve středu video thumb */
.photo-thumb-video-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  transition: transform 0.15s, opacity 0.15s;
}
.photo-thumb-video:hover .photo-thumb-video-icon {
  transform: scale(1.15);
  opacity: 1;
}

.photo-thumb-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s;
}

.photo-thumb:hover .photo-thumb-overlay {
  opacity: 1;
}

.photo-thumb-name {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* ── Lightbox ─────────────────────────────────────────────────────────────── */

.photo-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.photo-lightbox-content {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.photo-lightbox-img {
  max-width: 95vw;
  max-height: 85vh;
  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
}

.photo-lightbox-video {
  max-width: 95vw;
  max-height: 85vh;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  background: #000;
  outline: none;
}

.photo-lightbox-media {
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  margin-top: 8px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
}

.photo-lightbox-info {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  gap: 2px;
}

.photo-lightbox-meta {
  font-size: 11px;
  opacity: 0.7;
}

.photo-lightbox-actions {
  display: flex;
  gap: 8px;
}

.photo-lightbox-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  text-decoration: none;
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.photo-lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
/* Mazací tlačítko (jen admin) — nebezpečná akce, červené zvýraznění při hoveru. */
.photo-lightbox-del:hover {
  background: rgba(220, 38, 38, 0.85);
  border-color: rgba(220, 38, 38, 0.9);
}

.photo-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.photo-lightbox-nav:hover {
  background: rgba(0, 0, 0, 0.8);
}

.photo-lightbox-prev { left: -64px; }
.photo-lightbox-next { right: -64px; }

@media (max-width: 768px) {
  .photo-lightbox-prev { left: 8px; }
  .photo-lightbox-next { right: 8px; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* Hint pro Ctrl+V vkládání ze schránky */
.photo-paste-hint {
  font-size: 11px; color: var(--c-text-muted, #6b7280);
  align-self: center; margin-left: 4px; cursor: help; white-space: nowrap;
}
