/* Xcellent Media Gallery — isolated styles; section background is intentionally transparent. */
.xmg-gallery, .xmg-gallery * { box-sizing:border-box; }
.xmg-gallery {width:100%;max-width:100%;height:auto;min-height:0;display:flow-root;position:relative;padding:0;margin:0;background:transparent;color:inherit;font-family:inherit;clear:both;}
.xmg-filters {display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px;margin:0 0 22px;padding:0;}
.xmg-filter {cursor:pointer;appearance:none;background:transparent;border:1px solid rgba(120,120,120,.35);color:inherit;border-radius:999px;font:inherit;font-size:13px;font-weight:600;line-height:1.3;padding:9px 17px;transition:background .2s,border-color .2s,color .2s;}
.xmg-filter:hover,.xmg-filter:focus-visible {border-color:var(--xmg-accent);}
.xmg-filter.is-active {background:var(--xmg-accent);border-color:var(--xmg-accent);color:#111;}
.xmg-grid {display:grid;grid-template-columns:repeat(var(--xmg-d,4),minmax(0,1fr));grid-auto-flow:row;align-items:stretch;gap:var(--xmg-gap,16px);width:100%;height:auto;min-height:0;position:relative;}
.xmg-tile {display:block;margin:0!important;padding:0!important;width:100%;height:auto;min-width:0;min-height:0;position:relative;align-self:stretch;aspect-ratio:var(--xmg-aspect,4 / 3);border-radius:var(--xmg-radius,12px);overflow:hidden;background:#191b1d;}
.xmg-tile[hidden] {display:none!important;}
.xmg-open {width:100%;height:100%;min-width:0;display:block;position:absolute;inset:0;padding:0;margin:0;border:0;appearance:none;background:transparent;color:#fff;cursor:zoom-in;text-align:left;overflow:hidden;border-radius:inherit;}
.xmg-open:focus-visible {outline:3px solid var(--xmg-accent);outline-offset:-3px;}
.xmg-media {width:100%;height:100%;display:block;max-width:none;object-fit:cover;position:absolute;inset:0;}
.xmg-gallery .xmg-media {object-fit:var(--xmg-fit,cover);}
.xmg-external-fallback {position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-family:inherit;font-weight:800;font-size:clamp(16px,2vw,30px);background:radial-gradient(circle at 35% 35%,#30343a,#111315);color:rgba(255,255,255,.54);}
.xmg-zoom .xmg-media {transition:transform .4s cubic-bezier(.2,.8,.2,1);}
@media (hover:hover) and (prefers-reduced-motion:no-preference) {.xmg-zoom .xmg-open:hover .xmg-media{transform:scale(1.045);}}
.xmg-play {position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);z-index:2;width:58px;height:58px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:rgba(8,9,11,.64);border:1.5px solid var(--xmg-accent);box-shadow:0 8px 28px rgba(0,0,0,.3);color:#fff;pointer-events:none;transition:background .2s,transform .2s;}
.xmg-play svg{width:24px;height:24px;margin-left:3px;}
.xmg-open:hover .xmg-play {background:var(--xmg-accent);color:#111;transform:translate(-50%,-50%) scale(1.06);}
.xmg-caption {position:absolute;bottom:0;left:0;right:0;display:block;padding:38px 15px 14px;z-index:1;background:linear-gradient(0deg,rgba(0,0,0,var(--xmg-overlay,.68)),transparent);color:var(--xmg-caption-color,#fff);font-family:inherit;font-size:clamp(12px,1.3vw,17px);font-weight:700;line-height:1.3;text-shadow:0 1px 5px rgba(0,0,0,.3);pointer-events:none;}
.xmg-more-wrap {display:flex;justify-content:center;position:relative;inset:auto;width:100%;height:auto;clear:both;margin:25px 0 0;padding:0;}
.xmg-more-wrap[hidden] {display:none!important;}
.xmg-more {cursor:pointer;font:inherit;font-weight:700;font-size:14px;color:#121212;border:1px solid var(--xmg-accent);background:var(--xmg-accent);padding:12px 28px;border-radius:999px;transition:transform .2s,filter .2s;}
.xmg-more:hover {transform:translateY(-2px);filter:brightness(1.08);}
.xmg-more span {margin-left:7px;}
@media (max-width:1024px){.xmg-grid{grid-template-columns:repeat(var(--xmg-t,3),minmax(0,1fr));}.xmg-play{width:52px;height:52px;}}
@media (max-width:767px){.xmg-grid{grid-template-columns:repeat(var(--xmg-m,2),minmax(0,1fr));}.xmg-filters{justify-content:flex-start;gap:7px;margin-bottom:15px;}.xmg-filter{font-size:12px;padding:8px 12px;}.xmg-play{width:40px;height:40px;}.xmg-play svg{width:19px;height:19px;}.xmg-caption{font-size:12px;padding:26px 9px 9px;}.xmg-more{font-size:13px;}}
/* Modal attaches to body to prevent clipping by Elementor containers. */
body.xmg-lock-scroll {overflow:hidden!important;}
.xmg-lightbox[hidden] {display:none!important;}
.xmg-lightbox {position:fixed;inset:0;z-index:2147483000;display:flex;flex-direction:column;justify-content:center;align-items:center;background:rgba(4,5,8,.97);color:#fff;padding:65px 68px 45px;font-family:inherit;}
.xmg-lightbox * {box-sizing:border-box;}
.xmg-lightbox-dialog {width:100%;height:100%;display:flex;align-items:center;justify-content:center;flex-direction:column;outline:none;}
.xmg-lightbox-stage {height:100%;min-height:0;width:100%;max-width:1600px;display:flex;align-items:center;justify-content:center;position:relative;}
.xmg-lightbox-stage img,.xmg-lightbox-stage video,.xmg-lightbox-stage iframe {display:block;width:auto;height:auto;max-width:100%;max-height:100%;object-fit:contain;border:0;border-radius:4px;box-shadow:0 12px 42px rgba(0,0,0,.4);}
.xmg-lightbox-stage video {max-height:min(80vh,900px);background:#000;}
.xmg-lightbox-stage iframe {width:min(100%,1400px);height:min(76vh,800px);aspect-ratio:16/9;background:#000;}
.xmg-lightbox-stage img {max-height:calc(100vh - 145px);}
.xmg-lightbox-toolbar {position:absolute;right:19px;top:16px;display:flex;gap:11px;z-index:3;}
.xmg-modal-btn {display:flex;justify-content:center;align-items:center;width:41px;height:41px;border-radius:50%;border:1px solid rgba(255,255,255,.35);background:rgba(27,27,28,.75);color:#fff;font-size:23px;line-height:1;cursor:pointer;font-family:Arial,sans-serif;padding:0;transition:background .15s,border-color .15s;}
.xmg-modal-btn[hidden]{display:none!important;}
.xmg-modal-btn:hover,.xmg-modal-btn:focus-visible{background:#D5A12B;color:#111;border-color:#D5A12B;}
.xmg-modal-prev,.xmg-modal-next {position:absolute;top:50%;transform:translateY(-50%);z-index:4;}
.xmg-modal-prev {left:17px;}.xmg-modal-next{right:17px;}
.xmg-modal-bottom{flex:0 0 auto;display:flex;justify-content:center;align-items:center;gap:15px;text-align:center;max-width:85vw;min-height:31px;padding-top:9px;font-size:14px;}
.xmg-modal-title{font-weight:600;overflow-wrap:anywhere;}.xmg-modal-count{font-size:12px;opacity:.66;white-space:nowrap;}
.xmg-modal-bottom:empty{display:none;}
@media (max-width:767px){.xmg-lightbox{padding:69px 12px 75px;}.xmg-lightbox-toolbar{right:12px;top:12px;}.xmg-modal-btn{width:36px;height:36px;font-size:22px;}.xmg-modal-prev,.xmg-modal-next{top:auto;bottom:18px;transform:none;}.xmg-modal-prev{left:14px;}.xmg-modal-next{right:14px;}.xmg-lightbox-stage iframe{width:100%;height:auto;min-height:220px;aspect-ratio:16/9;}.xmg-lightbox-stage video{max-height:74vh;}.xmg-lightbox-stage img{max-height:74vh;}.xmg-modal-bottom{max-width:calc(100vw - 110px);font-size:12px;padding-top:6px;}}
@media (prefers-reduced-motion:reduce){.xmg-zoom .xmg-media,.xmg-play,.xmg-more,.xmg-filter{transition:none!important;}}


/* 1.0.1 — Elementor + mobile layout guard rails. These keep the plugin's own
   gallery in normal document flow. A fixed-height Elementor parent or an
   absolutely positioned *external* Elementor button still needs correcting
   in the page editor. */
.elementor-widget-xcellent_media_gallery > .elementor-widget-container { min-height:0; height:auto; overflow:visible; }
.xmg-gallery .xmg-grid > .xmg-tile { position:relative; float:none; }
@media (max-width:767px) {
  .xmg-gallery { height:auto!important; min-height:0; margin-bottom:0; }
  .xmg-gallery .xmg-grid { display:grid!important; grid-template-columns:repeat(var(--xmg-m,2),minmax(0,1fr))!important; grid-auto-flow:row; height:auto!important; min-height:0!important; }
  .xmg-gallery .xmg-grid > .xmg-tile { width:100%; height:auto!important; min-width:0; min-height:0; aspect-ratio:var(--xmg-aspect,4 / 3); position:relative!important; margin:0!important; }
  .xmg-gallery .xmg-more-wrap { position:relative!important; inset:auto!important; margin-top:20px!important; transform:none!important; }
}


/* 1.0.2 — Site-wide Elementor mobile flow repair.
   JS marks only the Elementor wrapper containing an actual XMG gallery.
   Prevents fixed mobile container heights / row-flex / absolute CTA buttons
   from overlapping the gallery or the following section, without relying on
   page-specific Elementor IDs or affecting galleries on desktop. */
@media screen and (max-width: 767px) {
  .elementor .xmg-layout-ancestor,
  .elementor .xmg-layout-host {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  /* The direct container holding the shortcode and neighboring CTA. */
  .elementor .xmg-layout-host {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    --flex-direction: column;
    --flex-wrap: nowrap;
    align-items: stretch !important;
    position: relative !important;
  }

  .elementor .xmg-layout-widget {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    flex: 0 0 auto !important;
    align-self: stretch !important;
    margin: 0 !important;
  }

  .elementor .xmg-layout-widget > .elementor-widget-container,
  .elementor .xmg-layout-widget .elementor-shortcode {
    display: flow-root !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  /* Restore external Elementor buttons following a gallery to normal flow. */
  .elementor .xmg-layout-host > :is(.elementor-widget-button, .elementor-widget-wpr-button) {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    flex: 0 0 auto !important;
    align-self: center !important;
    max-width: 100% !important;
    margin-top: 20px !important;
    z-index: 1 !important;
  }

  /* Ensure every instance retains equal-width, equal-ratio tiles. */
  .xmg-gallery {
    display: flow-root !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    position: relative !important;
  }
  .xmg-gallery .xmg-grid {
    display: grid !important;
    grid-template-columns: repeat(var(--xmg-m, 2), minmax(0, 1fr)) !important;
    grid-auto-flow: row !important;
    grid-auto-rows: auto !important;
    gap: var(--xmg-gap, 16px) !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    position: relative !important;
    overflow: visible !important;
  }
  .xmg-gallery .xmg-grid > .xmg-tile {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: var(--xmg-aspect, 4 / 3) !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }
  .xmg-gallery .xmg-grid > .xmg-tile[hidden] {
    display: none !important;
  }
  .xmg-gallery .xmg-grid > .xmg-tile > .xmg-open,
  .xmg-gallery .xmg-grid > .xmg-tile > .xmg-open > .xmg-media {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
  }
  .xmg-gallery .xmg-grid > .xmg-tile > .xmg-open > .xmg-media {
    object-fit: var(--xmg-fit, cover) !important;
  }
}

/* 1.0.2 — Same container-flow protection for tablet widths. Desktop remains untouched. */
@media screen and (min-width: 768px) and (max-width: 1024px) {
  .elementor .xmg-layout-ancestor,
  .elementor .xmg-layout-host {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }
  .elementor .xmg-layout-host {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    --flex-direction: column;
    --flex-wrap: nowrap;
    align-items: stretch !important;
    position: relative !important;
  }
  .elementor .xmg-layout-widget {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    flex: 0 0 auto !important;
    align-self: stretch !important;
    margin: 0 !important;
  }
  .elementor .xmg-layout-widget > .elementor-widget-container,
  .elementor .xmg-layout-widget .elementor-shortcode {
    display: flow-root !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }
  .elementor .xmg-layout-host > :is(.elementor-widget-button, .elementor-widget-wpr-button) {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    flex: 0 0 auto !important;
    align-self: center !important;
    max-width: 100% !important;
    margin-top: 20px !important;
    z-index: 1 !important;
  }
  .xmg-gallery,
  .xmg-gallery .xmg-grid {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }
  .xmg-gallery .xmg-grid {
    display: grid !important;
    grid-template-columns: repeat(var(--xmg-t, 3), minmax(0, 1fr)) !important;
    grid-auto-flow: row !important;
    grid-auto-rows: auto !important;
  }
  .xmg-gallery .xmg-grid > .xmg-tile {
    aspect-ratio: var(--xmg-aspect, 4 / 3) !important;
    min-height: 0 !important;
    height: auto !important;
    position: relative !important;
    float: none !important;
  }
}
