/* Auto Folder Gallery styles */
.afg-wrap { margin-top: 10px; }
.afg-title { margin: 0 0 15px; }
.afg-controls { margin-bottom: 15px; display: flex; flex-wrap: wrap; gap: 8px; }
.afg-controls .form-group { margin: 0; }
.afg-empty { margin-top: 10px; }
.afg-card { margin-bottom: 15px; }
.afg-thumb { width: 100%; object-fit: cover; }
.afg-caption { font-size: 12px; margin-top: 6px; word-break: break-word; }
.afg-meta { margin-top: 6px; display: flex; align-items: center; gap: 8px; }
.afg-meta .pull-right { margin-left: auto; }
.afg-grid .img-thumbnail { border-radius: 4px; }
.afg-video-tile { width: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 10px; }
.afg-video-label { font-weight: bold; letter-spacing: 1px; margin-bottom: 6px; }
.afg-video-name { font-size: 12px; opacity: 0.85; }
.afg-modal-body { text-align: center; }
.afg-modal-body img { max-width: 100%; height: auto; }
.afg-modal-body video { width: 100%; max-height: 70vh; }
.afg-list-thumb { width: 72px; height: 48px; object-fit: cover; border-radius: 3px; border: 1px solid #ddd; }
.afg-video-badge { display:inline-block; padding: 6px 8px; border: 1px solid #ddd; border-radius: 3px; font-size: 11px; }
.afg-pagination { margin-top: 10px; }

/* Custom lightbox modal - avoids template/bootstrap overlay conflicts */
body.afg-modal-open { overflow: hidden; }
#afgModal.afg-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2147483000 !important;
  background: rgba(0, 0, 0, 0.65) !important;
  padding: 18px;
  overflow-x: hidden;
  overflow-y: auto;
}
#afgModal.afg-modal-overlay.is-open { display: block; }
#afgModal .afg-modal-dialog {
  position: relative;
  width: 92%;
  max-width: 1100px;
  margin: 0 auto;
  z-index: 2147483001 !important;
}
#afgModal .afg-modal-content {
  position: relative;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 12px 32px rgba(0,0,0,.35);
  overflow: hidden;
}
#afgModal .afg-modal-header,
#afgModal .afg-modal-footer {
  padding: 12px 16px;
  background: #fff;
}
#afgModal .afg-modal-header {
  border-bottom: 1px solid #ddd;
}
#afgModal .afg-modal-footer {
  border-top: 1px solid #ddd;
  text-align: right;
}
#afgModal .afg-modal-title {
  margin: 0;
  padding-right: 36px;
  font-size: 24px;
  line-height: 1.3;
}
#afgModal .afg-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  color: #666;
  cursor: pointer;
}
#afgModal .afg-modal-close:hover { color: #000; }
#afgModal .afg-modal-inner {
  padding: 16px;
  background: #fff;
}

/* Neutralize template/bootstrap rules if they still match old classes */
#afgModal.modal,
#afgModal.fade {
  opacity: 1 !important;
}
.modal-backdrop.in,
.modal-backdrop,
body > .modal-backdrop {
  z-index: 1040 !important;
}
