/* MIT License. Scoped selectors avoid changing the Joomla template. */
dialog.csibepopup:not([open]) { display: none !important; }
dialog.csibepopup {
    box-sizing: border-box;
    position: fixed;
    inset: 0;
    margin: auto;
    width: calc(100vw - 32px);
    max-width: 1000px;
    max-height: calc(100dvh - 32px);
    padding: 16px;
    border: 0;
    border-radius: 14px;
    background: #fff;
    color: #20252b;
    box-shadow: 0 20px 70px rgba(0, 0, 0, .3);
    overflow: auto;
    overscroll-behavior: contain;
    font-family: inherit;
    line-height: 1.5;
}
dialog.csibepopup[data-width="640"] { max-width: 640px; }
dialog.csibepopup[data-width="800"] { max-width: 800px; }
dialog.csibepopup[data-width="1200"] { max-width: 1200px; }
dialog.csibepopup::backdrop { background: rgba(0, 0, 0, .65); }
.csibepopup__header { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.csibepopup__title { margin: 0; font-size: 1.25rem; line-height: 1.3; overflow-wrap: anywhere; }
.csibepopup__close {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    margin-inline-start: auto;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #edf0f3;
    color: #20252b;
    font: 32px/1 system-ui, sans-serif;
    cursor: pointer;
}
.csibepopup__close:hover { background: #dde3e8; color: #000; }
.csibepopup :focus-visible { outline: 3px solid #1769b3; outline-offset: 3px; }
.csibepopup__images { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.csibepopup__images[data-arrangement="grid"][data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.csibepopup__images[data-arrangement="grid"][data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.csibepopup__item { min-width: 0; }
.csibepopup__link { display: block; }
.csibepopup__image { display: block; width: 100%; max-width: 100%; height: auto; border: 0; border-radius: 6px; }
html.csibepopup-active { overflow: hidden; }
@media (max-width: 640px) {
    dialog.csibepopup { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); padding: 12px; }
    .csibepopup__images[data-arrangement="grid"][data-count] { grid-template-columns: minmax(0, 1fr); }
}
