/**
 * Pretpot Text with Hover Media
 * text-with-hover-media.css
 */

/* ── Wrapper ── */
.pthm-wrapper {
    position: relative;
}

.pthm-wrapper--inline {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0;
}

.pthm-wrapper--vertical {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.pthm-wrapper--single {
    display: block;
}

/* ── Item ── */
.pthm-item {
    position: relative;
    display: inline-block;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.pthm-wrapper--vertical .pthm-item {
    display: block;
}

/* ── Trigger text ── */
.pthm-trigger-text {
    margin: 0;
    transition: color 0.2s ease;
    display: inline;
}

.pthm-underline .pthm-trigger-text,
.pthm-item .pthm-trigger-text.pthm-underline {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}

/* When the item itself is the trigger-text wrapper in single mode */
.pthm-trigger-text.pthm-underline {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}

/* ── Popup ── */
.pthm-popup {
    position: absolute;
    z-index: 9999;
    overflow: hidden;
    pointer-events: none;
    background: #000;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);

    /* Size defaults — overridden by Elementor responsive selectors */
    width: 280px;
    height: 200px;

    /* Hidden state */
    opacity: 0;
    visibility: hidden;
    will-change: opacity, transform;
}

/* ── Popup visible state ── */
.pthm-popup.pthm-popup--visible {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}

/* ── Animation: fade ── */
.pthm-popup[data-anim="fade"] {
    transition-property: opacity, visibility;
}
.pthm-popup[data-anim="fade"].pthm-popup--visible {
    transform: none;
}

/* ── Animation: fade-scale ── */
.pthm-popup[data-anim="fade-scale"] {
    transform: scale(0.88);
    transition-property: opacity, visibility, transform;
    transform-origin: center center;
}
.pthm-popup[data-anim="fade-scale"].pthm-popup--visible {
    transform: scale(1);
}

/* ── Animation: fade-slide ── */
.pthm-popup[data-anim="fade-slide"] {
    transform: translateY(8px);
    transition-property: opacity, visibility, transform;
}
.pthm-popup[data-anim="fade-slide"].pthm-popup--visible {
    transform: translateY(0);
}

/* Transition timing applied via JS inline style for duration control */

/* ── Media inside popup ── */
.pthm-popup img,
.pthm-popup video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
}

.pthm-video-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pthm-video-inline {
    position: absolute;
    inset: 0;
}

/* ── Play button ── */
.pthm-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    padding: 0;
}

.pthm-play-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translate(-50%, -50%) scale(1.1);
}

.pthm-play-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.pthm-play-btn svg {
    width: 20px;
    height: 20px;
    fill: #fff;
    display: block;
    /* Slight optical nudge for play triangle */
    margin-left: 2px;
}

/* ── Lightbox ── */
.pthm-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.pthm-lightbox.pthm-lightbox--open {
    opacity: 1;
}

.pthm-lightbox-inner {
    position: relative;
    width: 100%;
    max-width: 85vw;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
}

.pthm-lightbox-media {
    width: 100%;
    height: 100%;
}

.pthm-lightbox-media iframe,
.pthm-lightbox-media video {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.pthm-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    padding: 0;
    z-index: 1;
}

.pthm-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.pthm-lightbox-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.pthm-lightbox-close svg {
    width: 16px;
    height: 16px;
    stroke: #fff;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    pointer-events: none;
}

/* ── Cursor mode ── */
.pthm-popup--cursor {
    position: fixed;
    pointer-events: none;
}

/* ── Accessibility: reduce motion ── */
@media (prefers-reduced-motion: reduce) {
    .pthm-popup,
    .pthm-lightbox {
        transition: opacity 0.01ms, visibility 0.01ms !important;
        transform: none !important;
    }
}