/* Styles pour le visualiseur photo modal MarocPsy */
dialog.psy-photo-viewer {
  box-sizing: border-box;
  position: fixed !important;
  inset: auto !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  margin: 0 !important;
  transform: translate(-50%, -50%) !important;
  height: auto;
  max-height: 92vh;
  max-height: 92dvh;
  width: -moz-fit-content;
  width: fit-content;
  max-width: min(920px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid #dbe5ef;
  border-radius: 16px;
  background: #ffffff;
  color: #1e293b;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.45), 0 0 0 1px rgba(15, 23, 42, 0.08);
  z-index: 99999;
}

dialog.psy-photo-viewer[open] {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 10px;
}

[dir="rtl"] dialog.psy-photo-viewer {
  left: 50% !important;
  right: auto !important;
}

dialog.psy-photo-viewer::backdrop {
  background: rgba(15, 23, 42, 0.75) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.psy-photo-viewer-close {
  align-self: flex-end;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  background: #f1f5f9;
  color: #475569;
  cursor: pointer;
  font-size: 1.05rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

[dir="rtl"] .psy-photo-viewer-close {
  align-self: flex-start;
}

.psy-photo-viewer-close:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: scale(1.08);
}

.psy-photo-viewer-close:focus-visible {
  outline: 2px solid #2b59c3;
  outline-offset: 2px;
}

.psy-photo-viewer-image {
  display: block;
  max-width: 100%;
  max-height: min(78vh, 720px);
  max-height: min(78dvh, 720px, calc(100dvh - 110px));
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 10px;
  background: #0f172a;
}

.psy-photo-viewer-error {
  padding: 32px 16px;
  text-align: center;
  color: #64748b;
  font-size: 0.95rem;
}

dialog.psy-photo-viewer [hidden] {
  display: none !important;
}

body.psy-photo-viewer-open {
  overflow: hidden !important;
}
