/*
 * The YADIM popup (src/core/popup.js). Selectors are kept to one class so a theme or Divi's own CSS can override them; colours come
 * from custom properties the page can set (--yp-bg, --yp-text, --yp-accent, --yp-veil).
 */
.yp { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; pointer-events: none; }
.yp > * { pointer-events: auto; }
.yp-veil { position: absolute; inset: 0; background: var(--yp-veil, rgba(8, 12, 24, .62)); opacity: 0; transition: opacity .2s ease; }
.yp.is-open .yp-veil { opacity: 1; }
.yp-box { position: relative; box-sizing: border-box; width: min(var(--yp-w, 640px), var(--yp-max, 92%)); max-height: 92vh; overflow: auto; background: var(--yp-bg, #fff); color: var(--yp-text, #1f2937); border-radius: var(--yp-radius, 12px); box-shadow: 0 24px 60px rgba(0, 0, 0, .35); opacity: 0; transition: opacity .2s ease, transform .2s ease; overscroll-behavior: contain; }
.yp-box:focus { outline: none; }
.yp.is-open .yp-box { opacity: 1; transform: none; }
.yp.is-closing .yp-veil, .yp.is-closing .yp-box { opacity: 0; }
.yp-anim-zoom .yp-box { transform: scale(.94); }
.yp-anim-slide .yp-box { transform: translateY(24px); }
.yp-anim-none .yp-veil, .yp-anim-none .yp-box { transition: none; opacity: 1; transform: none; }
.yp-pos-left { justify-content: flex-start; }
.yp-pos-right { justify-content: flex-end; }
.yp-pos-left .yp-box, .yp-pos-right .yp-box { height: calc(100vh - 32px); max-height: none; width: min(var(--yp-w, 420px), var(--yp-max, 92%)); }
.yp-pos-bottom { align-items: flex-end; }
.yp-pos-bottom .yp-box { width: min(var(--yp-w, 720px), 100%); border-radius: 12px 12px 0 0; }
.yp-nooverlay { padding: 16px; }
.yp-close { position: absolute; top: 6px; right: 8px; z-index: 3; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--yp-text, #1f2937); font: 22px/26px system-ui, sans-serif; text-align: center; text-shadow: 0 0 4px var(--yp-bg, #fff); opacity: .65; cursor: pointer; }
.yp-close:hover, .yp-close:focus-visible { opacity: 1; background: rgba(128, 128, 128, .2); }
.yp-close:focus-visible, .yp-nav:focus-visible, .yp-btn:focus-visible { outline: 2px solid var(--yp-accent, #2a7de1); outline-offset: 2px; }
.yp-body { padding: 22px 24px 24px; }
.yp-body > :first-child.yp-img, .yp-body > :first-child.yp-video, .yp-body > :first-child.yp-gallery { margin: -22px -24px 16px; width: calc(100% + 48px); max-width: none; border-radius: var(--yp-radius, 12px) var(--yp-radius, 12px) 0 0; }
.yp-title { margin: 0 36px 10px 0; font-size: 1.35em; line-height: 1.25; color: inherit; }
.yp-text { margin: 0 0 10px; line-height: 1.55; }
.yp-html { line-height: 1.55; }
.yp-html img, .yp-html video, .yp-html iframe { max-width: 100%; height: auto; }
.yp-img { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain; background: #0b1020; }
.yp-video { position: relative; aspect-ratio: 16 / 9; background: #000; }
.yp-video iframe, .yp-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yp-gallery { position: relative; }
.yp-stage { position: relative; background: #0b1020; }
.yp-nav { position: absolute; top: 50%; z-index: 2; width: 40px; height: 40px; margin-top: -20px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; font: 28px/38px system-ui, sans-serif; cursor: pointer; }
.yp-prev { left: 10px; }
.yp-next { right: 10px; }
.yp-caption { margin: 0; padding: 8px 14px; font-size: .85em; opacity: .8; }
.yp-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.yp-btn { display: inline-block; padding: .6em 1.2em; border-radius: 999px; background: var(--yp-accent, #2a7de1); color: #fff; text-decoration: none; font-weight: 600; }
.yp-btn:hover { filter: brightness(1.08); }
@media (max-width: 600px) { .yp { padding: 0; align-items: flex-end; } .yp-pos-center .yp-box, .yp-pos-bottom .yp-box { width: 100%; max-height: 94vh; border-radius: 12px 12px 0 0; } .yp-pos-left .yp-box, .yp-pos-right .yp-box { width: 100%; height: 100%; border-radius: 0; } }
@media (prefers-reduced-motion: reduce) { .yp-veil, .yp-box { transition: none; } .yp-anim-zoom .yp-box, .yp-anim-slide .yp-box { transform: none; } }

/* a popup next to its hotspot: the box is placed by the script, a line joins it to the hotspot */
.yp-anchored { display: block; padding: 0; }
.yp-anchored .yp-box { position: fixed; max-height: calc(100vh - 16px); box-shadow: 0 12px 34px rgba(0, 0, 0, .3); }
.yp .yp-line { position: fixed; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.yp-line line, .yp-line path { fill: none; stroke: var(--yp-lcolor, var(--yp-accent, #2a7de1)); stroke-width: var(--yp-lw, 2); stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: var(--yp-ldash, none); }
.yp-line .yp-head1, .yp-line .yp-head2 { stroke-dasharray: none; }
.yp-line circle { fill: var(--yp-lcolor, var(--yp-accent, #2a7de1)); stroke: none; }
.yp-html h1, .yp-html h2, .yp-html h3, .yp-html h4 { margin: 0 0 8px; line-height: 1.25; color: inherit; }
.yp-html p { margin: 0 0 10px; }
.yp-html a { color: var(--yp-accent, #2a7de1); }

/* 3D tilt: the box turns toward the mouse (the angles are set by the script from the pointer position) */
.yp-tilt .yp-box { transition: opacity .2s ease, transform var(--yp-tspeed, 160ms) ease-out, box-shadow var(--yp-tspeed, 160ms) ease-out; will-change: transform; }
.yp-tilt.is-open .yp-box { transform: perspective(var(--yp-persp, 1100px)) rotateX(var(--yp-rx, 0deg)) rotateY(var(--yp-ry, 0deg)) translateZ(var(--yp-depth, 0px)); box-shadow: 0 calc(24px + var(--yp-depth, 0px) * .5) calc(60px + var(--yp-depth, 0px)) rgba(0, 0, 0, .38); }

/* the hover look of the buttons the author set in the Design tab */
.yp-hbg .yp-btn:hover { background-color: var(--yp-btn-hover-bg) !important; }
.yp-hcolor .yp-btn:hover { color: var(--yp-btn-hover-color) !important; }
.yp-hborder .yp-btn:hover { border-color: var(--yp-btn-hover-border) !important; }

/* glass: the popup box frosts the picture behind it only (the strength is --yp-glass, a blur in px) */
.yp[style*="--yp-glass"] .yp-box { background: color-mix(in srgb, var(--yp-bg, #fff) 58%, transparent); -webkit-backdrop-filter: blur(var(--yp-glass)) saturate(1.5); backdrop-filter: blur(var(--yp-glass)) saturate(1.5); border: 1px solid rgba(255, 255, 255, .35); }
