/* =====================================================================
   Online-Archiv – ergänzende Styles zu Bootstrap 5.3
   Farben kommen aus den CSS-Variablen (siehe brand_css() in Branding.php)
   ===================================================================== */

/* --- Navbar / Branding -------------------------------------------- */
.app-navbar { background-color: var(--app-navbar-bg, #212529); }
.app-logo { max-height: 36px; max-width: 160px; width: auto; object-fit: contain; }
.app-brand-name { max-width: 50vw; font-weight: 600; }
@media (min-width: 992px) { .app-brand-name { max-width: 28vw; } .app-nav-search { min-width: 260px; } }
.app-login { min-height: 70vh; }
.app-login-logo { max-height: 110px; max-width: 260px; object-fit: contain; }
.app-footer a { color: inherit; }

.brand-thumb {
  width: 96px; height: 64px; border-radius: .375rem; border: 1px solid var(--bs-border-color);
  display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0;
}
.brand-thumb img { max-width: 90%; max-height: 90%; object-fit: contain; }

/* --- Statistik-Kacheln -------------------------------------------- */
.stat-card .stat-icon {
  width: 48px; height: 48px; border-radius: .75rem; display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis);
}

/* --- Rasteransicht -------------------------------------------------- */
.media-card { transition: box-shadow .15s ease, transform .15s ease; }
.media-card:hover { box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .12); transform: translateY(-2px); }
.media-thumb {
  aspect-ratio: 4 / 3; background: var(--bs-tertiary-bg); display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative; border-top-left-radius: inherit; border-top-right-radius: inherit;
}
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-thumb .placeholder-icon { font-size: 3rem; color: var(--bs-secondary-color); }
.media-thumb .type-badge { position: absolute; top: .5rem; left: .5rem; }
.media-thumb .play-icon {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; color: #fff; text-shadow: 0 0 8px rgba(0, 0, 0, .6); pointer-events: none;
}
.media-card .card-title { font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list-thumb { width: 64px; height: 48px; object-fit: cover; border-radius: .25rem; background: var(--bs-tertiary-bg); }
.list-thumb-icon { width: 64px; height: 48px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
  background: var(--bs-tertiary-bg); border-radius: .25rem; color: var(--bs-secondary-color); }
.search-snippet { font-size: .85rem; color: var(--bs-secondary-color); }
mark { padding: 0 .15em; border-radius: .2em; }

/* --- Detailansicht -------------------------------------------------- */
.detail-media { background: var(--bs-tertiary-bg); border-radius: .5rem; overflow: hidden; text-align: center; }
.detail-media img { max-width: 100%; max-height: 75vh; object-fit: contain; cursor: zoom-in; }
.detail-media video { width: 100%; max-height: 75vh; background: #000; display: block; }
.pdf-frame { width: 100%; height: 80vh; border: 0; display: block; }
.ocr-text { font-family: var(--bs-font-monospace); font-size: .85rem; min-height: 16rem; }
.meta-list dt { font-weight: 500; color: var(--bs-secondary-color); font-size: .85rem; }
.meta-list dd { margin-bottom: .75rem; }

/* --- Lightbox ------------------------------------------------------- */
.lightbox-modal .lb-img { max-width: 100%; max-height: calc(100vh - 70px); object-fit: contain; user-select: none; }
.lightbox-modal .lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; opacity: .7; }
.lightbox-modal .lb-nav:hover { opacity: 1; }
.lightbox-modal .lb-prev { left: .75rem; }
.lightbox-modal .lb-next { right: .75rem; }

/* --- Upload --------------------------------------------------------- */
.dropzone {
  border: 2px dashed var(--bs-border-color); border-radius: .75rem; padding: 2.5rem 1rem; text-align: center;
  cursor: pointer; transition: background-color .15s ease, border-color .15s ease; background: var(--bs-body-bg);
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.dragover { border-color: var(--bs-primary); background: var(--bs-primary-bg-subtle); outline: none; }
.dropzone .bi { font-size: 2.75rem; color: var(--bs-primary); }
.upload-item .progress { height: .5rem; }

/* --- Kategorien ----------------------------------------------------- */
.cat-tree, .cat-tree ul { list-style: none; padding-left: 0; margin: 0; }
.cat-tree ul { padding-left: 1.5rem; border-left: 1px dashed var(--bs-border-color); margin-left: .6rem; }
.cat-tree li > .cat-row { padding: .4rem .5rem; border-radius: .375rem; }
.cat-tree li > .cat-row:hover { background: var(--bs-tertiary-bg); }
.cat-checklist { max-height: 280px; overflow-y: auto; }

/* --- Veröffentlichungs-Editor --------------------------------------- */
.pub-item { cursor: grab; }
.pub-item.dragging { opacity: .5; }
.pub-item.drag-over { border-top: 3px solid var(--bs-primary) !important; }
.pub-item .drag-handle { cursor: grab; font-size: 1.25rem; color: var(--bs-secondary-color); touch-action: none; }
.pub-item img, .picker-item img { width: 72px; height: 54px; object-fit: cover; border-radius: .25rem; }
.picker-results { max-height: 55vh; overflow-y: auto; }
.qr-box { background: #fff; padding: 1rem; border-radius: .5rem; display: inline-block; }
.qr-box svg, .qr-box canvas { display: block; width: 100%; height: auto; max-width: 280px; }

/* --- Sonstiges ------------------------------------------------------ */
.text-break-all { word-break: break-all; }
.min-w-0 { min-width: 0; }
.table td, .table th { vertical-align: middle; }
@media (max-width: 575.98px) {
  h1.h3 { font-size: 1.35rem; }
  .btn-toolbar-mobile .btn { flex: 1 1 auto; }
}

/* --- Öffentliche Seiten --------------------------------------------- */
.public-page .public-cover { max-height: 420px; object-fit: cover; }
.public-page .public-media-img { max-height: 80vh; object-fit: contain; background: var(--bs-tertiary-bg); }
.public-page video { max-height: 80vh; }
.public-page figure .pdf-frame { height: 70vh; }
.public-hint summary { cursor: pointer; color: var(--bs-link-color); }
.public-hint summary:hover { text-decoration: underline; }
