/* ==========================================================================
   v0.42 — Janelas em tela inteira
   Toda janela (formulários, confirmações, detalhes) cobre a tela toda. O conteúdo
   fica numa coluna centralizada, com largura conforme o tamanho pedido:
   narrow 520 · padrão 680 · wide 880 · xl / sheet 1160. Fotos e PDF têm visor próprio.
   ========================================================================== */
dialog.modal,
dialog.modal--wide, dialog.modal--narrow, dialog.modal--drawer, dialog.modal--xl, dialog.modal--sheet {
  --modal-col: 680px;
  position: fixed; inset: 0;
  width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh;
  margin: 0; border-radius: 0; box-shadow: none;
  background: var(--c-bg, var(--c-surface));
}
dialog.modal--narrow { --modal-col: 520px; }
dialog.modal--wide, dialog.modal--drawer { --modal-col: 880px; }
dialog.modal--xl, dialog.modal--sheet { --modal-col: 1160px; }
dialog.modal--sheet.mf-dialog { --modal-col: 1320px; }

dialog.modal > .modal-head,
dialog.modal > .modal-body,
dialog.modal > .modal-foot {
  padding-inline: max(var(--sp-5), calc((100vw - var(--modal-col)) / 2));
}
dialog.modal > .modal-head { padding-top: var(--sp-6); padding-bottom: var(--sp-4); }
dialog.modal > .modal-head:not(.modal-hero) { background: var(--c-bg, var(--c-surface)); }
dialog.modal > .modal-head.modal-hero { padding-top: var(--sp-6); padding-bottom: var(--sp-5); }
dialog.modal > .modal-body { flex: 1; align-content: start; padding-top: var(--sp-5); padding-bottom: var(--sp-6); }
dialog.modal > .modal-foot { background: var(--c-surface); padding-top: var(--sp-3); padding-bottom: calc(var(--sp-3) + env(safe-area-inset-bottom)); }
dialog.modal .modal-title { font-size: var(--fs-2xl, 1.6rem); letter-spacing: -.01em; }

/* janelas curtas (confirmações, formulários pequenos): o bloco fica no meio da tela */
dialog.modal--narrow, dialog.modal:not([class*="modal--"]) { justify-content: center; }
dialog.modal--narrow > .modal-body, dialog.modal:not([class*="modal--"]) > .modal-body { flex: 0 1 auto; padding-bottom: var(--sp-5); }
dialog.modal--narrow > .modal-head, dialog.modal:not([class*="modal--"]) > .modal-head { border-bottom: 0; padding-bottom: 0; }
dialog.modal--narrow > .modal-foot, dialog.modal:not([class*="modal--"]) > .modal-foot { border-top: 0; background: transparent; padding-bottom: var(--sp-6); }
dialog.modal--narrow > .modal-foot:empty, dialog.modal:not([class*="modal--"]) > .modal-foot:empty { display: none; }

dialog.modal[open], dialog.modal--drawer[open], dialog.modal--xl[open], dialog.modal--sheet[open] { animation: modal-full-in 200ms var(--ease, ease-out); }
@keyframes modal-full-in { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { dialog.modal[open] { animation: none; } }
@media (max-width: 640px) {
  dialog.modal > .modal-head { padding-top: var(--sp-4); }
  dialog.modal .modal-title { font-size: var(--fs-xl); }
}
