/* MisticEase – Frontend Styles */

.misticease-thumbnail {
  position: relative;
  display: block;
  margin: 1em auto;
  max-width: 640px;
  width: 100%;
  cursor: pointer;
  text-align: center;
  overflow: hidden;
  container-type: inline-size;
}

.misticease-thumbnail img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.misticease-thumbnail .play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30%;
  max-width: 60px;
  pointer-events: none;
}

.misticease-thumbnail .play-button img {
  display: block;
  width: 100%;
  height: auto;
}

.misticease-thumbnail--vimeo-fallback {
  aspect-ratio: 16 / 9;
  background: #05070e;
}

.misticease-thumbnail--vimeo-fallback > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0 !important;
  object-fit: cover;
  filter: none;
}

.misticease-vimeo-fallback-card {
  position: absolute;
  left: 50%;
  top: 62%;
  transform: translate(-50%, -50%);
  display: block;
  width: min(88%, 760px);
  padding: 0 14px;
  box-sizing: border-box;
  color: #fff;
  background: transparent;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0,0,0,.92), 0 0 18px rgba(0,0,0,.75);
  pointer-events: none;
  z-index: 2;
}

.misticease-vimeo-fallback-card__provider {
  display: block;
  margin-bottom: .38em;
  font-size: clamp(11px, 3.8cqw, 16px);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .95;
}

.misticease-vimeo-fallback-card__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
  margin: 0 auto .42em;
  font-size: clamp(14px, 5.5cqw, 24px);
  line-height: 1.25;
  font-weight: 700;
}

.misticease-vimeo-fallback-card__action {
  display: block;
  font-size: clamp(11px, 3.4cqw, 15px);
  line-height: 1.35;
  opacity: .94;
}

.misticease-thumbnail--vimeo-fallback .play-button {
  display: block;
  top: 39%;
  width: clamp(46px, 13cqw, 72px);
  max-width: 72px;
  opacity: .96;
  z-index: 3;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.65));
}

.misticease-thumbnail--vimeo-fallback .play-button img {
  width: 100%;
  height: auto;
}

@media (max-width: 640px) {
  .misticease-vimeo-fallback-card {
    top: 64%;
    width: 92%;
  }

  .misticease-thumbnail--vimeo-fallback .play-button {
    top: 38%;
    width: clamp(42px, 14cqw, 58px);
  }
}

.misticease-popup-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.2);
  backdrop-filter: brightness(0.2);
  -webkit-backdrop-filter: brightness(0.2);
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  box-sizing: border-box;
  contain: layout paint;
  overscroll-behavior: contain;
}

.misticease-popup-content {
  position: relative;
  background: #000;
  padding: 10px 20px;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 854px;
  width: 90vw;
  max-height: 90vh;
  height: auto;
}

@media screen and (max-width: 768px) {
  .misticease-popup-content { max-width: 640px; width: 90vw; max-height: 90vh; height: auto; }
}

@media screen and (max-width: 480px) {
  .misticease-popup-content { max-width: 95vw; padding: 5px; }
  .misticease-thumbnail     { margin: .5em auto; }
}

@media screen and (max-width: 320px) {
  .misticease-popup-content { max-width: 98vw; padding: 3px; }
  .misticease-thumbnail     { margin: .3em auto; }
}

.misticease-popup-content iframe {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  display: block;
  border: none;
  background: #000;
}

.misticease-popup-content .misticease-close {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(50%, -50%);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  z-index: 999999;
  background: #000;
  border: 2px solid #fff;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 4px rgba(0,0,0,0.3);
}

.misticease-popup-content .misticease-close img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.misticease-popup-content .misticease-close:hover {
  background: #111;
}

.misticease-image-overlay {
  position: fixed;
  inset: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.2);
  backdrop-filter: brightness(0.2);
  -webkit-backdrop-filter: brightness(0.2);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  contain: layout paint;
  overscroll-behavior: contain;
}

.misticease-image-popup-box {
  position: relative;
  background: #000;
  padding: 20px;
  box-sizing: border-box;
  max-width: 80vw;
  max-height: 80vh;
  overflow: visible;
}

.misticease-image-close {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(50%, -50%);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  z-index: 1100000;
  background: #000;
  border: 2px solid #fff;
  border-radius: 50%;
  overflow: hidden;
}

.misticease-image-close img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.misticease-image-close:hover {
  background: #111;
}


@media (hover:hover) and (pointer:fine) {
  .misticease-window .misticease-close,
  .misticease-window .misticease-image-close {
    display: none;
  }
  .misticease-window:hover .misticease-close,
  .misticease-window:hover .misticease-image-close {
    display: flex;
  }
}

@media (max-width: 1024px) {
  .misticease-window .misticease-close,
  .misticease-window .misticease-image-close {
    display: flex !important;
  }
}

.misticease-window.misticease-tablet .misticease-close,
.misticease-window.misticease-tablet .misticease-image-close,
.misticease-window.misticease-phone .misticease-close,
.misticease-window.misticease-phone .misticease-image-close {
  display: flex !important;
}


.misticease-image-popup-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff; font-size: 20px;
  width: 30px; height: 30px;
  border: 2px solid #fff; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  z-index: 1000000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.misticease-image-popup-prev { left: 50px; }
.misticease-image-popup-next { right: 50px; }

.misticease-hit {
  position: absolute;
  top: 0; bottom: 0;
  width: 50%;
  z-index: 1000000;
  cursor: pointer;
  background: transparent;
  -webkit-user-select: none;
  user-select: none;
}
.misticease-hit-left { left: 0; }
.misticease-hit-right { right: 0; }

.misticease-image-popup-box.hover-left  .misticease-image-popup-prev,
.misticease-image-popup-box.reveal-left .misticease-image-popup-prev,
.misticease-image-popup-box.hover-right .misticease-image-popup-next,
.misticease-image-popup-box.reveal-right .misticease-image-popup-next {
  opacity: 1;
  pointer-events: auto;
}

.misticease-image-popup-box.kbd-nav:focus-within .misticease-image-popup-nav {
  opacity: .6;
  pointer-events: auto;
}

.misticease-image-popup-box.hinting .misticease-image-popup-nav {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 768px) {
  .misticease-image-popup-box { padding: 15px; max-width: 95vw; max-height: 85vh; }
}
@media (max-width: 480px) {
  .misticease-image-popup-box { padding: 10px; max-width: 98vw; max-height: 85vh; }
  .misticease-image-popup-nav { width: 25px; height: 25px; font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .misticease-image-popup-nav { transition: none; }
}

/* =============================================================
 * Image navigation portal
 * ============================================================= */

:root { --me-image-nav-edge: 3vw; }

.misticease-image-popup-nav-portal {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 20px;
  width: 30px;
  height: 30px;
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  z-index: 2147483646;
}

.misticease-image-popup-nav-portal.misticease-image-popup-prev { left: var(--me-image-nav-edge, 3vw); right: auto; }
.misticease-image-popup-nav-portal.misticease-image-popup-next { right: var(--me-image-nav-edge, 3vw); left: auto; }

@media (max-width: 480px) {
  .misticease-image-popup-nav-portal {
    width: 25px;
    height: 25px;
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .misticease-image-popup-nav-portal { transition: none; }
}


.misticease-global-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.2);
  backdrop-filter: brightness(0.2);
  -webkit-backdrop-filter: brightness(0.2);
  z-index: 999980;
}

.misticease-window {
  position: fixed !important;
  z-index: 1000000;
  box-sizing: border-box;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
}

.misticease-window.misticease-modal {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.misticease-window.misticease-floating {
  transform: none;
}


@media (hover:hover) and (pointer:fine) {
  .misticease-window.misticease-floating-controls-enabled .misticease-drag-handle {
    touch-action: none;
  }
  .misticease-window.misticease-dragging {
    user-select: none;
    -webkit-user-select: none;
  }
  .misticease-window.misticease-floating-controls-enabled:hover .misticease-drag-handle {
    display: flex;
  }
}

.misticease-window.misticease-floating-controls-enabled .misticease-drag-handle,
.misticease-window.misticease-floating-controls-enabled .misticease-pin-btn {
  position: absolute;
  width: 30px;
  height: 30px;
  padding: 0;
  margin: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(0,0,0,0.93);
  box-shadow: 0 0 4px rgba(0,0,0,0.3);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000001;
}

.misticease-window.misticease-floating-controls-enabled .misticease-drag-handle {
  right: 0;
  bottom: 0;
  transform: translate(50%, 50%);
}

.misticease-window.misticease-floating-controls-enabled .misticease-pin-btn {
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
}

.misticease-window.misticease-floating-controls-enabled.misticease-show-pin .misticease-pin-btn {
  display: flex;
}

.misticease-window.misticease-floating-controls-enabled.misticease-pinned .misticease-pin-btn {
  display: flex;
}

@media (hover:hover) and (pointer:fine) {
  .misticease-window.misticease-floating-controls-enabled.misticease-floating:hover .misticease-pin-btn {
    display: flex;
  }
}

.misticease-window.misticease-floating-controls-enabled .misticease-drag-handle {
  cursor: grab;
  touch-action: none;
}
.misticease-window.misticease-floating-controls-enabled.misticease-dragging .misticease-drag-handle {
  cursor: grabbing;
}

.misticease-window.misticease-floating-controls-enabled .misticease-edge-grab {
  position: absolute;
  display: none;
  background: transparent;
  z-index: 1000000;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}
.misticease-window.misticease-floating-controls-enabled.misticease-dragging .misticease-edge-grab {
  cursor: grabbing;
}
.misticease-window.misticease-floating-controls-enabled .misticease-edge-top {
  left: 44px;
  top: -6px;
  width: calc(100% - 88px);
  height: 12px;
}
.misticease-window.misticease-floating-controls-enabled .misticease-edge-right {
  top: 44px;
  right: -6px;
  width: 12px;
  height: calc(100% - 88px);
}
.misticease-window.misticease-floating-controls-enabled .misticease-edge-bottom {
  left: 44px;
  bottom: -6px;
  width: calc(100% - 88px);
  height: 12px;
}
.misticease-window.misticease-floating-controls-enabled .misticease-edge-left {
  top: 44px;
  left: -6px;
  width: 12px;
  height: calc(100% - 88px);
}
@media (hover:hover) and (pointer:fine) {
  .misticease-window.misticease-floating-controls-enabled:hover .misticease-edge-grab {
    display: block;
  }
}

.misticease-window.misticease-floating-controls-enabled .misticease-drag-handle img,
.misticease-window.misticease-floating-controls-enabled .misticease-pin-btn img {
  width: 70%;
  height: 70%;
  display: block;
}

.misticease-window.misticease-floating-controls-enabled.misticease-pinned .misticease-pin-btn img {
  filter: brightness(0) saturate(100%) invert(88%) sepia(88%) saturate(4800%) hue-rotate(2deg) brightness(118%) contrast(106%)
    drop-shadow(0 0 2px rgba(255, 234, 0, 0.85));
}

.misticease-window.misticease-floating-controls-enabled .misticease-drag-handle:hover,
.misticease-window.misticease-floating-controls-enabled .misticease-pin-btn:hover {
  background: rgba(0,0,0,0.85);
}

.misticease-window.misticease-tablet.misticease-floating-controls-enabled .misticease-drag-handle,
.misticease-window.misticease-tablet.misticease-floating-controls-enabled .misticease-pin-btn {
  display: flex !important;
}

.misticease-window.misticease-tablet.misticease-floating-controls-enabled .misticease-edge-grab {
  display: block !important;
}

.misticease-window.misticease-phone.misticease-floating-controls-enabled .misticease-drag-handle,
.misticease-window.misticease-phone.misticease-floating-controls-enabled .misticease-pin-btn,
.misticease-window.misticease-phone.misticease-floating-controls-enabled .misticease-edge-grab {
  display: none !important;
}

@keyframes misticeasePinBtnFlash {
  0%   { box-shadow: 0 0 0 0 rgba(255,215,0,0.0), 0 0 4px rgba(0,0,0,0.3); }
  35%  { box-shadow: 0 0 0 3px rgba(255,215,0,0.65), 0 0 6px rgba(0,0,0,0.35); }
  100% { box-shadow: 0 0 0 0 rgba(255,215,0,0.0), 0 0 4px rgba(0,0,0,0.3); }
}

@keyframes misticeasePinFrameFlash {
  0% {
    outline: 0 solid rgba(255,140,0,0.0);
    outline-offset: 2px;
    box-shadow: 0 0 0 0 rgba(255,140,0,0.0), 0 0 6px rgba(0,0,0,0.0);
  }
  35% {
    outline: 3px solid rgba(255,140,0,0.95);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(255,140,0,0.92), 0 0 0 6px rgba(255,140,0,0.28), 0 0 10px rgba(0,0,0,0.25);
  }
  100% {
    outline: 0 solid rgba(255,140,0,0.0);
    outline-offset: 2px;
    box-shadow: 0 0 0 0 rgba(255,140,0,0.0), 0 0 6px rgba(0,0,0,0.0);
  }
}
.misticease-window.misticease-pin-flash .misticease-pin-btn {
  animation: misticeasePinBtnFlash 0.55s ease-out;
}

.misticease-window.misticease-pin-flash {
  animation: misticeasePinFrameFlash 0.55s ease-out;
}

@keyframes misticeaseWindowLimitFlash {
  0%   { box-shadow: 0 0 0 0 rgba(255,140,0,0.0), 0 0 6px rgba(0,0,0,0.0); }
  35%  { box-shadow: 0 0 0 3px rgba(255,140,0,0.92), 0 0 0 6px rgba(255,140,0,0.28), 0 0 10px rgba(0,0,0,0.25); }
  100% { box-shadow: 0 0 0 0 rgba(255,140,0,0.0), 0 0 6px rgba(0,0,0,0.0); }
}
.misticease-window.misticease-limit-flash {
  animation: misticeaseWindowLimitFlash 0.55s ease-out;
}

.misticease-popup-content .misticease-close img,
.misticease-image-close img {
  width: 84%;
  height: 84%;
  object-fit: contain;
  display: block;
  margin: auto;
}

.misticease-window .misticease-drag-handle img {
  width: 64%;
  height: 64%;
}
.misticease-popup-caption {
  box-sizing: border-box;
  width: 100%;
  padding: 10px 14px;
  color: #fff;
  background: #000;
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
}


.misticease-image-popup-title {
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 10px;
  color: #fff;
  text-align: center;
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  z-index: 1;
}

.misticease-image-popup-box.misticease-has-title .misticease-image-popup-title {
  display: block;
}

img.misticease-np {
    max-width: 100%;
    height: auto;
}