/* ══════════════════════════════════════════════════
   NOCTURNE PRODUCT DISPLAY — Gallery Styles
   MusicNotes-style image viewer for WooCommerce
   ══════════════════════════════════════════════════ */

.nocturne-gallery {
    --ng-shadow: 0 6px 30px rgba(0, 0, 0, 0.15);
    --ng-shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.2);
    --ng-radius: 6px;
    --ng-arrow-bg: rgba(255, 255, 255, 0.9);
    --ng-arrow-hover: rgba(255, 255, 255, 1);
    --ng-dot-color: #ccc;
    --ng-dot-active: #333;
    --ng-watermark-color: rgba(0, 0, 0, 0.06);
    --ng-counter-color: #888;

    position: relative;
    max-width: 100%;
    margin-bottom: 20px;
}

/* ── Viewport ── */
.nocturne-gallery .ng-viewport {
    position: relative;
    overflow: hidden;
    border-radius: var(--ng-radius);
    box-shadow: var(--ng-shadow);
    background: #fff;
    transition: box-shadow 0.3s ease;
}

.nocturne-gallery .ng-viewport:hover {
    box-shadow: var(--ng-shadow-hover);
}

/* ── Slides Container ── */
.nocturne-gallery .ng-slides {
    position: relative;
    width: 100%;
}

/* ── Individual Slide ── */
.nocturne-gallery .ng-slide {
    display: none;
    position: relative;
    width: 100%;
}

.nocturne-gallery .ng-slide.active {
    display: block;
}

.nocturne-gallery .ng-slide img {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    pointer-events: none;
}

/* ── Slide Transition (fade) ── */
.nocturne-gallery .ng-slide {
    animation: ng-fadeIn 0.25s ease;
}

@keyframes ng-fadeIn {
    from { opacity: 0.5; }
    to   { opacity: 1; }
}

/* ── Navigation Arrows ── */
.nocturne-gallery .ng-prev,
.nocturne-gallery .ng-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--ng-arrow-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    opacity: 0;
    transition: opacity 0.25s ease, background 0.15s ease, transform 0.15s ease;
    padding: 0;
    line-height: 1;
}

.nocturne-gallery .ng-prev {
    left: 10px;
}

.nocturne-gallery .ng-next {
    right: 10px;
}

.nocturne-gallery .ng-viewport:hover .ng-prev,
.nocturne-gallery .ng-viewport:hover .ng-next {
    opacity: 1;
}

.nocturne-gallery .ng-prev:hover,
.nocturne-gallery .ng-next:hover {
    background: var(--ng-arrow-hover);
    transform: translateY(-50%) scale(1.08);
}

.nocturne-gallery .ng-prev:active,
.nocturne-gallery .ng-next:active {
    transform: translateY(-50%) scale(0.95);
}

/* Focus styles for keyboard accessibility */
.nocturne-gallery .ng-prev:focus-visible,
.nocturne-gallery .ng-next:focus-visible {
    opacity: 1;
    outline: 3px solid #333;
    outline-offset: 2px;
}

.nocturne-gallery .ng-prev svg,
.nocturne-gallery .ng-next svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ── Footer (counter + dots) ── */
.nocturne-gallery .ng-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 0 4px;
}

/* ── Counter ── */
.nocturne-gallery .ng-counter {
    font-size: 0.8rem;
    color: var(--ng-counter-color);
    font-variant-numeric: tabular-nums;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    user-select: none;
}

/* ── Dots ── */
.nocturne-gallery .ng-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.nocturne-gallery .ng-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: var(--ng-dot-color);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease, transform 0.15s ease;
}

.nocturne-gallery .ng-dot:hover {
    background: #999;
    transform: scale(1.2);
}

.nocturne-gallery .ng-dot.active {
    background: var(--ng-dot-active);
    transform: scale(1.15);
}

.nocturne-gallery .ng-dot:focus-visible {
    outline: 2px solid #333;
    outline-offset: 2px;
}

/* ── Watermark Overlay ── */
.nocturne-gallery .ng-watermark {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    overflow: hidden;
    z-index: 5;
}

.nocturne-gallery .ng-watermark span {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: clamp(1.5rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--ng-watermark-color);
    transform: rotate(-25deg);
    white-space: nowrap;
    user-select: none;
}

/* ── No Images Placeholder ── */
.nocturne-gallery .ng-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: #999;
    font-size: 0.9rem;
    background: #f9f9f9;
    border-radius: var(--ng-radius);
}

/* ══════════════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════════════ */

/* Arrows always visible on touch devices (no hover) */
@media (hover: none) {
    .nocturne-gallery .ng-prev,
    .nocturne-gallery .ng-next {
        opacity: 0.8;
    }
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .nocturne-gallery .ng-prev,
    .nocturne-gallery .ng-next {
        width: 34px;
        height: 34px;
    }

    .nocturne-gallery .ng-prev svg,
    .nocturne-gallery .ng-next svg {
        width: 16px;
        height: 16px;
    }

    .nocturne-gallery .ng-prev {
        left: 6px;
    }

    .nocturne-gallery .ng-next {
        right: 6px;
    }

    .nocturne-gallery .ng-watermark span {
        font-size: 1.2rem;
    }

    .nocturne-gallery .ng-footer {
        padding: 8px 0 2px;
        gap: 6px;
    }
}

/* ══════════════════════════════════════════════════
   Audio Preview Player
   ══════════════════════════════════════════════════ */

.nocturne-audio-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f8f8f8;
    border-radius: 8px;
    margin-top: 10px;
    border: 1px solid #eee;
}

.nocturne-audio-preview .nap-play-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: #333;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    padding: 0;
    transition: background 0.15s, transform 0.1s;
}

.nocturne-audio-preview .nap-play-btn:hover {
    background: #555;
    transform: scale(1.05);
}

.nocturne-audio-preview .nap-play-btn:active {
    transform: scale(0.95);
}

.nocturne-audio-preview .nap-play-btn.playing .nap-icon-play {
    display: none;
}

.nocturne-audio-preview .nap-play-btn.playing .nap-icon-pause {
    display: block !important;
}

.nocturne-audio-preview .nap-progress {
    flex: 1;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.nocturne-audio-preview .nap-progress-fill {
    height: 100%;
    background: #333;
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
    pointer-events: none;
}

.nocturne-audio-preview .nap-time {
    font-size: 0.75rem;
    color: #888;
    font-variant-numeric: tabular-nums;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-width: 35px;
    text-align: right;
    white-space: nowrap;
}

/* ══════════════════════════════════════════════════
   Reduced Motion
   ══════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .nocturne-gallery .ng-slide {
        animation: none;
    }

    .nocturne-gallery .ng-viewport,
    .nocturne-gallery .ng-prev,
    .nocturne-gallery .ng-next,
    .nocturne-gallery .ng-dot {
        transition: none;
    }
}
