/* detail-sheet.css — Detail-Seitenleiste mit der Mechanik des Lesers (reader.js: Breiten-Griff + Bottom-Sheet-Griff).
   Desktop (>880 px): schmaler Ziehgriff am linken Rand, Breite 280–640 px (--aside-w, gemeinsam mit dem Leser gespeichert).
   Handy (≤880 px): Bottom-Sheet mit Griff (.eg-handle), Raststufen in vh, Antippen = Streifen ein/aus, Wischen nach unten = schließen. */
.eg-gutter { position: absolute; left: -9px; top: 0; bottom: 0; width: 18px; cursor: col-resize; touch-action: none; z-index: 5; }
.eg-gutter::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--border, var(--line, #e3d8c6)); }
.eg-gutter:hover::before, .eg-gutter.dragging::before { background: var(--gold, #c9a87a); }
.eg-gutter:focus-visible::before { background: var(--red, #b30000); }
.eg-handle { display: none; position: absolute; left: 0; right: 0; top: 0; height: 22px; z-index: 6; cursor: grab; touch-action: none; -webkit-tap-highlight-color: transparent; background: inherit; border-radius: 16px 16px 0 0; }
.eg-handle::before { content: ''; position: absolute; left: 50%; top: 9px; width: 38px; height: 4px; margin-left: -19px; border-radius: 4px; background: var(--border, #c9bfae); }
.eg-handle:hover::before, .eg-sheet.dragging .eg-handle::before { background: var(--gold, #c9a87a); }
.eg-sheet.eg-compact .eg-handle { height: 58px; }
.eg-sheet.eg-compact .eg-handle::before { top: 27px; }

/* Desktop: Panel rechts, fest an den Seitenrand gedockt */
@media (min-width: 881px) {
  .eg-dock { position: fixed !important; top: var(--eg-top, 0px); right: 0; bottom: 0; left: auto; width: clamp(280px, var(--aside-w, 380px), 640px) !important; max-width: none !important; max-height: none !important;
    margin: 0 !important; border-radius: 0 !important; overflow-y: auto; box-shadow: -14px 0 40px rgba(0,0,0,.28); z-index: 900; }
  .eg-gutter { display: block; }
}
/* Handy: Bottom-Sheet */
@media (max-width: 880px) {
  .eg-gutter { display: none; }
  .eg-handle { display: block; }
  .eg-sheet { padding-top: 22px; }
  .eg-dock { position: fixed !important; left: 0; right: 0; bottom: 0; top: auto !important; width: auto !important; max-width: none !important; margin: 0 !important;
    height: var(--eg-h, 48vh); max-height: 82vh !important; min-height: 0; border-radius: 16px 16px 0 0 !important; overflow-y: auto; box-shadow: 0 -12px 36px rgba(0,0,0,.32); z-index: 900;
    transition: height .18s ease; }
  .eg-dock.dragging { transition: none; }
  .eg-dock.eg-compact { height: 58px !important; overflow: hidden; }
}

/* mobileOnly: auf dem Desktop bleibt das Element im Seitenlayout (Spalte), nur der Breiten-Griff kommt dazu */
@media (min-width: 881px) { .eg-dock-m { position: relative; } .eg-dock-m .eg-gutter { display: block; } }
@media (max-width: 880px) {
  .eg-dock-m { position: fixed !important; left: 0; right: 0; bottom: 0; top: auto !important; width: auto !important; max-width: none !important; margin: 0 !important;
    height: var(--eg-h, 48vh); max-height: 82vh !important; border-radius: 16px 16px 0 0 !important; overflow-y: auto; box-shadow: 0 -12px 36px rgba(0,0,0,.32); z-index: 900;
    transition: height .18s ease; background: var(--bg-panel, var(--bg-card, #fff)); padding: 22px 12px 12px; }
  .eg-dock-m.dragging { transition: none; }
  .eg-dock-m.eg-compact { height: 58px !important; overflow: hidden; }
  .eg-dock-m .eg-handle { display: block; }
}

/* Museum: das Exponat-Fenster wird zur gedockten Seitenleiste (Seite dahinter bleibt bedienbar) */
.modal-overlay.eg-dockwrap { background: transparent !important; backdrop-filter: none !important; padding: 0 !important; pointer-events: none; }
.modal-overlay.eg-dockwrap.open { display: block !important; }
.modal-overlay.eg-dockwrap .modal-content { pointer-events: auto; display: block !important; background: var(--bg-card); border-left: 1px solid var(--border); }
.modal-overlay.eg-dockwrap .modal-visual-side { min-height: 0 !important; padding: 1.2rem !important; }
.modal-overlay.eg-dockwrap .modal-info-side { padding: 1.2rem !important; }
.modal-overlay.eg-dockwrap .modal-display-img { max-height: 300px; }
.modal-overlay.eg-dockwrap .modal-close-btn { top: 12px; right: 12px; background: rgba(120,120,120,.25); color: var(--fg); z-index: 8; }

.modal-overlay.eg-dockwrap .modal-content { overflow-x: hidden !important; }
.modal-overlay.eg-dockwrap .modal-content * { max-width: 100%; }

@media (min-width: 881px) { body.eg-dock-open { padding-right: clamp(280px, var(--aside-w, 380px), 640px); } }
