/* Modal: hidden host on the site; a visible panel in the editor. */
.pb-modal-host { display: contents; }

/* The dialog itself: centred, no chrome; the panel carries the look. */
.pb-modal { position: fixed; inset: 0; width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; padding: 1rem; border: 0; background: transparent; display: none; place-items: center; overflow: auto; }
.pb-modal[open] { display: grid; }
.pb-modal::backdrop { background: rgba(0, 0, 0, 0.55); }
.pb-modal__panel {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 2.5rem 2.5rem 2rem;
  border-radius: 1rem;
  background: #ffffff;
  color: #000000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}
.pb-modal-host--sm .pb-modal__panel { max-width: 440px; }
.pb-modal-host--lg .pb-modal__panel { max-width: 800px; }
@media (max-width: 640px) { .pb-modal__panel { padding: 2rem 1.5rem 1.5rem; } }

/* Enter: fade + lift. Exit is instant (the dialog leaves the top layer on close()). */
@media (prefers-reduced-motion: no-preference) {
  .pb-modal[open] { animation: pb-modal-fade 0.25s ease-out; }
  .pb-modal[open] .pb-modal__panel { animation: pb-modal-rise 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
  .pb-modal[open]::backdrop { animation: pb-modal-fade 0.25s ease-out; }
}
@keyframes pb-modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pb-modal-rise { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }

.pb-modal__x {
  position: absolute; top: 1rem; right: 1rem;
  display: grid; place-items: center;
  width: 2.25rem; height: 2.25rem; padding: 0;
  border: 1px solid var(--color-line, #e5e7eb); border-radius: 50%;
  background: #ffffff; color: #000000; cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.pb-modal__x:hover { background: #193798; border-color: #193798; color: #ffffff; }
.pb-modal__x:focus-visible { outline: 2px solid #193798; outline-offset: 2px; }
.pb-modal__x-icon { width: 1rem; height: 1rem; }
.pb-modal__title { padding-right: 2.5rem; }

/* Body prose: the same rhythm as the site's text columns; links in the site blue. */
.pb-modal__body > * { margin: 0 0 1rem; }
.pb-modal__body > :last-child { margin-bottom: 0; }
.pb-modal__body h3, .pb-modal__body h4 { font-family: var(--font-display, inherit); font-weight: 400; text-transform: uppercase; letter-spacing: 0.05em; line-height: 1.1; margin-top: 1.5rem; }
.pb-modal__body h3 { font-size: 1.25rem; }
.pb-modal__body h4 { font-size: 1.05rem; }
.pb-modal__body a { color: #193798; text-decoration: underline; text-underline-offset: 0.2em; }
.pb-modal__body a:hover { opacity: 0.7; }
.pb-modal__body ul.wp-block-list, .pb-modal__body ol.wp-block-list { padding-left: 1.5rem; }
.pb-modal__body .wp-block-list li { margin: 0 0 0.35rem; }

/* Download list: a core list with the class "pb-modal__downloads" renders as a divided list of file links
   (used for spec-sheet modals; the link text is the file label). */
.pb-modal__body ul.pb-modal__downloads { list-style: none; margin: 0 0 0.5rem; padding: 0; border-top: 1px solid var(--color-line, #e5e7eb); }
.pb-modal__body ul.pb-modal__downloads li { margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--color-line, #e5e7eb); }
.pb-modal__body ul.pb-modal__downloads li::marker { content: ""; }
.pb-modal__body ul.pb-modal__downloads li a { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 0.25rem; color: #193798; font-weight: 500; text-decoration: none; transition: opacity 0.2s; }
.pb-modal__body ul.pb-modal__downloads li a:hover { opacity: 0.7; }
.pb-modal__body ul.pb-modal__downloads li a::after {
  content: ""; flex: none; width: 1rem; height: 1rem;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5'%3E%3Cpath d='M8 2v9M4 7l4 4 4-4M2 14h12'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5'%3E%3Cpath d='M8 2v9M4 7l4 4 4-4M2 14h12'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Trigger buttons rendered as <a> without href. */
a[data-pb-modal-open] { cursor: pointer; }

/* Editor preview: the panel sits in the canvas with a label bar above it. */
.pb-modal-host--preview { display: block; padding: 1.5rem 0; }
.pb-modal__editor-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1rem; margin: 0 auto 0.75rem; max-width: 560px; font: 12px/1.4 -apple-system, system-ui, sans-serif; color: #1e1e1e; }
.pb-modal-host--sm .pb-modal__editor-bar { max-width: 440px; }
.pb-modal-host--lg .pb-modal__editor-bar { max-width: 800px; }
.pb-modal__editor-bar code { padding: 1px 6px; border: 1px solid #ddd; border-radius: 3px; background: #fff; font-size: 11px; }
.pb-modal__panel--preview { margin: 0 auto; max-height: none; overflow: visible; border: 1px dashed #193798; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12); }
.pb-modal__body > .block-editor-inner-blocks, .pb-modal__body > .block-editor-inner-blocks > .block-editor-block-list__layout { display: contents; }
