/**
 * MrWin Gallery - what every template shares
 *
 * The title, the item and its picture, video thumbnails with their play button, and the
 * navigation buttons of the moving templates. A template's own stylesheet only lays items
 * out. Colors and corners come from the settings as custom properties on the wrapper.
 */

.mwpc-gallery {
    --mwpc-gallery-radius: 6px;
    --mwpc-gallery-accent: #3b82f6;
    position: relative;
    width: 100%;
    margin: 2rem 0;
    box-sizing: border-box;
}

.mwpc-gallery *,
.mwpc-gallery *::before,
.mwpc-gallery *::after {
    box-sizing: border-box;
}

.mwpc-gallery .mwpc-gallery-title {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

/* =============================================================================
   ITEMS
   ============================================================================= */

.mwpc-gallery [data-mwpc-item] {
    position: relative;
    cursor: pointer;
    outline: none;
}

.mwpc-gallery [data-mwpc-item]:focus-visible {
    outline: 3px solid var(--mwpc-gallery-accent);
    outline-offset: 2px;
    border-radius: var(--mwpc-gallery-radius);
}

.mwpc-gallery .mwpc-gallery-image,
.mwpc-gallery .mwpc-gallery-thumb-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0;
    border-radius: 0; /* the item clips it, with the corners from the settings */
}

/* =============================================================================
   VIDEOS
   ============================================================================= */

.mwpc-gallery .mwpc-gallery-video-thumb {
    position: relative;
    width: 100%;
    height: 100%;
}

.mwpc-gallery .mwpc-gallery-video-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 150px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.mwpc-gallery .mwpc-gallery-video-ext {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}

.mwpc-gallery .mwpc-gallery-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.15);
    pointer-events: none;
    transition: background 0.2s ease;
}

.mwpc-gallery .mwpc-gallery-play-btn {
    display: block;
    width: 56px;
    height: 40px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
    transition: transform 0.2s ease;
}

.mwpc-gallery [data-mwpc-item]:hover .mwpc-gallery-play-overlay {
    background: rgba(0, 0, 0, 0.05);
}

.mwpc-gallery [data-mwpc-item]:hover .mwpc-gallery-play-btn {
    transform: scale(1.1);
}

/* =============================================================================
   NAVIGATION BUTTONS (carousel, slider)
   ============================================================================= */

.mwpc-gallery .mwpc-gallery-nav {
    position: absolute;
    top: 50%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background 0.2s ease, opacity 0.2s ease;
}

.mwpc-gallery .mwpc-gallery-nav:hover {
    background: rgba(0, 0, 0, 0.75);
}

.mwpc-gallery .mwpc-gallery-nav:focus-visible {
    outline: 3px solid var(--mwpc-gallery-accent);
    outline-offset: 2px;
}

.mwpc-gallery .mwpc-gallery-nav:disabled {
    opacity: 0.35;
    cursor: default;
}

.mwpc-gallery .mwpc-gallery-nav svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 480px) {
    .mwpc-gallery {
        margin: 1rem 0;
    }

    .mwpc-gallery .mwpc-gallery-title {
        font-size: 1.25rem;
    }

    .mwpc-gallery .mwpc-gallery-nav {
        width: 36px;
        height: 36px;
    }

    .mwpc-gallery .mwpc-gallery-nav svg {
        width: 18px;
        height: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mwpc-gallery *,
    .mwpc-gallery *::before,
    .mwpc-gallery *::after {
        transition: none !important;
    }
}
