/* PDF-Links: Popover „Ansehen / Herunterladen“ mit Vorschau (assets/addons/project/pdf-links.js) und Fenster mit dem PDFOut-Viewer */
.hage-pdfpop {
  position: absolute;
  z-index: 1000;
  box-sizing: border-box;
  width: max-content;
  max-width: min(20rem, calc(100vw - 24px));
  padding: 14px 16px;
  border: 1px solid #c9d6dd;
  border-radius: 6px;
  background: #ffffff;
  color: #1e2a32;
  box-shadow: 0 14px 40px rgb(0 0 0 / 18%), 0 2px 6px rgb(0 0 0 / 8%);
}
.hage-pdfpop.has-thumb { display: flex; align-items: flex-start; gap: 14px; max-width: min(24rem, calc(100vw - 24px)); }
.hage-pdfpop__thumb {
  flex: none;
  width: 72px;
  height: 102px;
  overflow: hidden;
  border-radius: 3px;
  background: #f1f5f7;
  box-shadow: 0 3px 10px rgb(0 0 0 / 18%);
}
.hage-pdfpop__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.hage-pdfpop__thumb.is-landscape { width: 108px; height: 76px; }
.hage-pdfpop__body { min-width: 0; }
.hage-pdfpop__title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.3;
}
.hage-pdfpop__meta { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; font-size: 0.85rem; color: #4a5560; }
.hage-pdfpop__badge {
  padding: 1px 5px;
  border-radius: 3px;
  background: #b3261e;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.5;
}
.hage-pdfpop__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hage-pdfpop__title { font-weight: 600; color: #0071a5; }
.hage-pdf-close:focus-visible, .hage-pdfpop :focus-visible { outline: 3px solid #0071a5; outline-offset: 2px; }
@media (max-width: 30rem) {
  .hage-pdfpop.has-thumb { gap: 12px; }
  .hage-pdfpop__thumb { width: 56px; height: 80px; }
  .hage-pdfpop__thumb.is-landscape { width: 84px; height: 59px; }
  .hage-pdfpop__actions { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: no-preference) {
  .hage-pdfpop.is-below { animation: hage-pdfpop-down 0.18s ease-out both; }
  .hage-pdfpop.is-above { animation: hage-pdfpop-up 0.18s ease-out both; }
}
@keyframes hage-pdfpop-down { from { opacity: 0; translate: 0 -6px; } }
@keyframes hage-pdfpop-up { from { opacity: 0; translate: 0 6px; } }

/* Fenster mit dem Viewer */
.hage-pdf-dialog {
  width: min(94vw, 72rem);
  height: 92vh;
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: #2b2b2b;
  color: #f2f2f2;
  overflow: visible;
}
.hage-pdf-dialog[open] { display: flex; flex-direction: column; }
.hage-pdf-dialog::backdrop { background: rgb(0 0 0 / 0.82); }
.hage-pdf-caption {
  flex: none;
  margin: 0;
  padding: 0.6rem 3.2rem 0.6rem 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hage-pdf-frame { flex: 1; width: 100%; border: 0; border-radius: 0 0 6px 6px; background: #525659; }
.hage-pdf-close {
  position: absolute;
  inset-block-start: -0.9rem;
  inset-inline-end: -0.9rem;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: #1a1a1a;
  cursor: pointer;
  box-shadow: 0 4px 14px rgb(0 0 0 / 30%);
}
.hage-pdf-close svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (max-width: 40rem) {
  .hage-pdf-dialog { width: 100vw; height: 100dvh; border-radius: 0; }
  .hage-pdf-frame { border-radius: 0; }
  .hage-pdf-close { inset-block-start: 0.25rem; inset-inline-end: 0.4rem; }
}

/* Modul „Downloads“: Darstellung Liste / Kompakt */
.hage-downloads > li { margin-top: 0; }
.hage-dl { display: flex; align-items: center; gap: 12px; padding: 2px 0; color: inherit; text-decoration: none; }
.hage-dl:hover, .hage-dl:focus-visible { text-decoration: none; }
.hage-dl:hover .hage-dl__title, .hage-dl:focus-visible .hage-dl__title { text-decoration: underline; }
.hage-dl__icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 4px; background: #f5f5f5; color: currentColor; }
.hage-dl__text { min-width: 0; overflow-wrap: anywhere; }
.hage-dl__title { font-weight: 600; }
.hage-dl__meta { white-space: nowrap; }
.hage-dl__desc { display: block; margin-top: 2px; font-size: .9em; }
.hage-downloads--compact .hage-dl { align-items: flex-start; gap: 8px; padding: 0; }
.hage-downloads--compact .hage-dl__icon { width: auto; height: auto; background: none; padding-top: 2px; }
.hage-downloads--compact .hage-dl__title { font-weight: inherit; }
.hage-downloads--compact .hage-dl__meta { display: block; }
