/* Native dialog is independent of the plugin's current popup engine and jQuery. */
dialog.bmg-legacy-popup {
    box-sizing: border-box;
    width: min(800px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0px 0 0px;
    border: 2px solid #aacbc2;
    background: #fff;
    color: #222;
    overflow: auto;
    overscroll-behavior: contain;
}
dialog.bmg-legacy-popup:not([open]) { display: none; }
dialog.bmg-legacy-popup::backdrop { background: rgba(255, 255, 255, .8); }
.bmg-legacy-popup-content img { width: 100%; height: auto; }
.bmg-legacy-popup-content > p:first-child { margin-top: 0; }
.bmg-legacy-popup-content .popup-block-text { box-sizing: border-box; max-width: 100%; }
.bmg-legacy-popup-content .popup-block-text h3{ font-family: "ＭＳ Ｐ明朝", "MS PMincho", "ヒラギノ明朝 Pro W3", "Hiragino Mincho Pro", serif; font-weight: bold;}
.bmg-legacy-popup-content .popup-block-text p{
    padding-top:12px;
}
dialog.bmg-legacy-popup .bmg-legacy-popup-close {
    position: absolute; top: 0; right: 0;
    width: 36px; height: 28px; margin: 0; padding: 0;
    border: 0; border-radius: 0;
    background: #aacbc2; color: #222;
    font: 24px/28px sans-serif; cursor: pointer;
}
.bmg-legacy-popup-close{
    display: none;
}
.bmg-legacy-popup-trigger { cursor: pointer; }
.bmg-legacy-popup-trigger:focus-visible,
.bmg-legacy-popup-close:focus-visible { outline: 2px solid #595757; outline-offset: 2px; }
body.bmg-legacy-popup-open { overflow: hidden; }
.bmg-popup-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Preserve the original 31% / 3.5% product grid after shortcode wrapping. */
.entry-content .lineup:has(> a.bmg-legacy-popup-trigger) {
    display: flex;
    flex-wrap: wrap;
    column-gap: 3.5%;
    row-gap: 0;
    max-width: 100%;
}
.entry-content .lineup > a.bmg-legacy-popup-trigger {
    display: block;
    flex: 0 0 31%;
    width: 31%;
    min-width: 0;
    margin: 0 0 3.5%;
    padding: 0;
    line-height: 0;
}
.entry-content .lineup > a.bmg-legacy-popup-trigger img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    transition: opacity 200ms ease;
}
.entry-content .lineup > a.bmg-legacy-popup-trigger:hover img,
.entry-content .lineup > a.bmg-legacy-popup-trigger:focus-visible img { opacity: .8; }
/* Keep the old saved fadeIn duration (1 second in this site's DB). */
dialog.bmg-legacy-popup[open][data-effect="fade"] {
    animation: bmg-legacy-popup-fade var(--bmg-popup-duration, 1s) ease both;
}
dialog.bmg-legacy-popup[open][data-effect="fade"]::backdrop {
    animation: bmg-legacy-popup-fade var(--bmg-popup-duration, 1s) ease both;
}
@keyframes bmg-legacy-popup-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    dialog.bmg-legacy-popup[open][data-effect="fade"],
    dialog.bmg-legacy-popup[open][data-effect="fade"]::backdrop { animation: none; }
    .entry-content .lineup > a.bmg-legacy-popup-trigger img { transition: none; }
}
