/**
 * PinstaViewer CSS - Custom Fullscreen Media Viewer Styles
 * ========================================================
 * 
 * Styles for the custom PinstaViewer lightbox replacement.
 * Replace GLightbox styles with these custom styles.
 * 
 * =============================================================================
 * STRUCTURE
 * =============================================================================
 * 
 * .pinsta-viewer (main container)
 * ├── .pinsta-viewer-slides (slides wrapper)
 * │   └── .pinsta-slide (individual slide)
 * │       ├── .pinsta-media (media element wrapper)
 * │       │   ├── img.pinsta-media-img
 * │       │   ├── video.pinsta-media-video
 * │       │   └── .pinsta-text-content
 * │       ├── .pinsta-caption (caption area)
 * │       │   ├── .pinsta-caption-title
 * │       │   └── .pinsta-caption-description
 * │       └── .pinsta-loader (loading indicator)
 * ├── .pinsta-viewer-close (close button)
 * ├── .pinsta-viewer-prev (previous button)
 * ├── .pinsta-viewer-next (next button)
 * └── .pinsta-viewer-counter (slide counter)
 * 
 * =============================================================================
 * CUSTOMIZING
 * =============================================================================
 * 
 * Override these CSS variables to easily customize the look:
 * 
 * :root {
 *     --pinsta-bg: rgba(0, 0, 0, 0.95);
 *     --pinsta-text: #fff;
 *     --pinsta-accent: #3b82f6;
 *     --pinsta-btn-size: 48px;
 *     --pinsta-transition: 0.3s;
 * }
 * 
 * =============================================================================
 */

/* =============================================================================
   CSS CUSTOM PROPERTIES - Easy customization
   ============================================================================= */

:root {
    /* Background */
    --pinsta-bg: rgba(0, 0, 0, 0.95);
    --pinsta-bg-solid: #000;
    
    /* Text colors */
    --pinsta-text: #fff;
    --pinsta-text-muted: #9ca3af;
    
    /* Accent color */
    --pinsta-accent: #3b82f6;
    --pinsta-accent-hover: #60a5fa;
    
    /* Button dimensions */
    --pinsta-btn-size: 48px;
    --pinsta-btn-font-size: 24px;
    --pinsta-close-size: 44px;
    --pinsta-close-font-size: 32px;
    
    /* Counter */
    --pinsta-counter-bg: rgba(0, 0, 0, 0.5);
    --pinsta-counter-padding: 8px 16px;
    --pinsta-counter-font-size: 14px;
    --pinsta-counter-radius: 20px;
    
    /* Caption */
    --pinsta-caption-bg: linear-gradient(transparent, rgba(0,0,0,0.8));
    --pinsta-caption-padding: 60px 20px 20px;
    --pinsta-caption-title-size: 18px;
    --pinsta-caption-desc-size: 14px;
    
    /* Animation */
    --pinsta-transition: 0.3s;
    --pinsta-ease: ease;
    
    /* Z-index layers */
    --pinsta-z-base: 1000;
    --pinsta-z-btn: 1001;
    --pinsta-z-counter: 1001;
    --pinsta-z-close: 1001;
}

/* =============================================================================
   MAIN CONTAINER
   ============================================================================= */

.pinsta-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--pinsta-bg);
    z-index: var(--pinsta-z-base);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--pinsta-transition) var(--pinsta-ease),
                visibility var(--pinsta-transition) var(--pinsta-ease);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pinsta-viewer.pinsta-viewer-open {
    opacity: 1;
    visibility: visible;
}

/* =============================================================================
   SLIDES CONTAINER
   ============================================================================= */

.pinsta-viewer-slides {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* =============================================================================
   INDIVIDUAL SLIDE
   ============================================================================= */

.pinsta-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity var(--pinsta-transition) var(--pinsta-ease),
                transform var(--pinsta-transition) var(--pinsta-ease);
}

.pinsta-slide.pinsta-slide-active {
    opacity: 1;
    transform: scale(1);
}

/* =============================================================================
   MEDIA ELEMENTS
   ============================================================================= */

.pinsta-media {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pinsta-media-img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.pinsta-video-wrapper {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    width: auto;
    height: auto;
}

.pinsta-media-video {
    max-width: 100%;
    max-height: 85vh;
    width: auto;
    height: auto;
    background: #000;
}

.pinsta-text-content {
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px;
    color: var(--pinsta-text);
    font-size: 16px;
    line-height: 1.6;
}

.pinsta-text-content a {
    color: var(--pinsta-accent);
    text-decoration: underline;
}

.pinsta-text-content a:hover {
    color: var(--pinsta-accent-hover);
}

/* =============================================================================
   HOLOGRAPHIC TEXT EFFECT
   ============================================================================= */

.holo-text-wrapper {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    isolation: isolate;
    padding: 0;
}

.holo-text-wrapper .holo-html-layer {
    position: relative;
    z-index: 1;
    padding-inline: calc(var(--pinsta-btn-size) + 20px);
}

.holo-text-wrapper .holo-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    mix-blend-mode: multiply;
    border-radius: inherit;
}

/* Dark card background when WebGL is active */
.holo-text-wrapper[data-holo-webgl="true"] {
    background: #060310;
    box-shadow: inset 0 0 0 4px rgba(6, 3, 16, 0.5);
}

/* Solid white text when WebGL is active — multiply blend needs opaque pixels */
.holo-text-wrapper[data-holo-webgl="true"] .holo-html-layer {
    background: none !important;
    -webkit-text-fill-color: #fff !important;
    color: #fff !important;
    animation: none !important;
}

/* CSS-only fallback - animated iridescent gradient */
.holo-text-wrapper .holo-html-layer.holo-effect {
    background: linear-gradient(
        135deg,
        #ff6b6b 0%,
        #feca57 15%,
        #48dbfb 30%,
        #ff9ff3 45%,
        #54a0ff 60%,
        #5f27cd 75%,
        #ff6b6b 90%,
        #ff6b6b 100%
    );
    background-size: 400% 400%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: holo-gradient 8s ease infinite;
    color: transparent;
}

.holo-text-wrapper .holo-html-layer.holo-effect a {
    -webkit-text-fill-color: initial;
    background: none;
    color: var(--pinsta-accent, #3b82f6);
    text-decoration: underline;
    pointer-events: auto;
}

@keyframes holo-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Tilt-responsive variant */
.holo-text-wrapper[data-tilt="true"] .holo-html-layer.holo-effect {
    animation: none;
    transition: background-position 0.1s ease;
}

/* Hide canvas when using CSS fallback */
.holo-text-wrapper:not([data-holo-webgl="true"]) .holo-canvas {
    display: none;
}



/* =============================================================================
   HOLOGRAPHIC EFFECT CONTROLS
   ============================================================================= */

.pinsta-holo-controls {
    position: absolute;
    bottom: 60px;
    left: 10px;
    z-index: 100;
    display: flex;
    flex-direction: row;
    gap: 6px;
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 10px;
}

.holo-control-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(258px, calc(100vw - 55px));
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 10px;
    position: absolute;
    bottom: 0;
    left: 100%;
    transform: scale(0);
    transform-origin: bottom left;
    opacity: 0;
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1),
                opacity 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.pinsta-holo-controls:not(.collapsed) .holo-control-panel {
    transform: scale(1);
    opacity: 1;
}

.pinsta-holo-controls.collapsed .holo-control-panel {
    pointer-events: none;
}

@keyframes holo-toggle-shimmer {
    0%   { box-shadow: 0 0 6px 1px rgba(255, 100, 200, 0.5), 0 0 0 1px rgba(255, 100, 200, 0.3); border-color: rgba(255, 100, 200, 0.6); }
    25%  { box-shadow: 0 0 6px 1px rgba(100, 200, 255, 0.5), 0 0 0 1px rgba(100, 200, 255, 0.3); border-color: rgba(100, 200, 255, 0.6); }
    50%  { box-shadow: 0 0 6px 1px rgba(150, 255, 150, 0.5), 0 0 0 1px rgba(150, 255, 150, 0.3); border-color: rgba(150, 255, 150, 0.6); }
    75%  { box-shadow: 0 0 6px 1px rgba(255, 220, 80, 0.5),  0 0 0 1px rgba(255, 220, 80, 0.3);  border-color: rgba(255, 220, 80, 0.6);  }
    100% { box-shadow: 0 0 6px 1px rgba(255, 100, 200, 0.5), 0 0 0 1px rgba(255, 100, 200, 0.3); border-color: rgba(255, 100, 200, 0.6); }
}

.pinsta-holo-toggle {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.5);
    padding: 6px 10px 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Status dot */
.pinsta-holo-toggle::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    transition: background 0.25s ease, box-shadow 0.25s ease;
}

/* Chevron to hint at expand/collapse */
.pinsta-holo-toggle::after {
    content: '›';
    font-size: 13px;
    line-height: 1;
    transform: rotate(90deg);
    opacity: 0.4;
    transition: transform 0.2s ease, opacity 0.2s ease;
    margin-left: auto;
}

.pinsta-holo-toggle:hover {
    background: rgba(0, 0, 0, 0.8);
    color: rgba(255, 255, 255, 0.85);
    border-color: rgba(255, 255, 255, 0.35);
}

/* Panel open: rotate chevron, brighter look */
.pinsta-holo-controls:not(.collapsed) .pinsta-holo-toggle {
    background: rgba(20, 20, 30, 0.85);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
}

.pinsta-holo-controls:not(.collapsed) .pinsta-holo-toggle::after {
    transform: rotate(0deg);
    opacity: 0.7;
}

/* Holo effect ON: shimmer animation on button, dot lights up */
.pinsta-holo-controls:not(.holo-off) .pinsta-holo-toggle {
    color: #fff;
    animation: holo-toggle-shimmer 3s linear infinite;
}

.pinsta-holo-controls:not(.holo-off) .pinsta-holo-toggle::before {
    background: rgba(180, 255, 255, 0.9);
    box-shadow: 0 0 4px 1px rgba(150, 220, 255, 0.7);
}

/* Panel open + holo ON: stop shimmer anim, stay bright */
.pinsta-holo-controls:not(.collapsed):not(.holo-off) .pinsta-holo-toggle {
    animation: none;
    box-shadow: 0 0 8px 2px rgba(120, 200, 255, 0.35);
    border-color: rgba(120, 200, 255, 0.5);
}

.pinsta-holo-controls:not(.collapsed) .holo-control-panel {
    transform: scale(1);
    opacity: 1;
}

.holo-panel-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
}

.holo-panel-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    width: calc(100% + 20px);
    margin: 0 -10px;
}

.holo-control-panel label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    margin: 0;
}

.holo-effect-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    width: 100%;
}

.holo-effect-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    text-align: center;
    width: 100%;
    transition: all 0.15s ease;
}

@media (hover: hover) {
    .holo-effect-btn:hover {
        background: rgba(255, 255, 255, 0.15);
        color: #fff;
    }
}

.holo-effect-btn.active {
    background: rgba(100, 200, 255, 0.3);
    border-color: rgba(100, 200, 255, 0.5);
    color: #fff;
}

.holo-mode-options {
    display: flex;
    gap: 4px;
    width: 100%;
}

.holo-mode-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    text-align: center;
    white-space: nowrap;
    transition: all 0.15s ease;
}

@media (hover: hover) {
    .holo-mode-btn:hover {
        background: rgba(255, 255, 255, 0.15);
        color: #fff;
    }
}

.holo-mode-btn.active {
    background: rgba(150, 255, 150, 0.3);
    border-color: rgba(150, 255, 150, 0.5);
    color: #fff;
}

.holo-disable-btn {
    background: rgba(255, 100, 100, 0.2);
    border: 1px solid rgba(255, 100, 100, 0.3);
    color: rgba(255, 150, 150, 0.8);
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 100%;
    transition: all 0.15s ease;
}

@media (hover: hover) {
    .holo-disable-btn:hover {
        background: rgba(255, 100, 100, 0.35);
        color: #fff;
    }
}

.holo-disable-btn.active {
    background: rgba(255, 100, 100, 0.5);
    border-color: rgba(255, 100, 100, 0.7);
    color: #fff;
}

/* Mode section muted while holo is off */
.pinsta-holo-controls.holo-off .holo-mode-btn {
    opacity: 0.35;
    pointer-events: none;
    cursor: default;
}

@media (hover: hover) {
    .pinsta-holo-controls.holo-off .holo-mode-btn:hover {
        background: rgba(255, 255, 255, 0.08);
        color: rgba(255, 255, 255, 0.6);
    }
}

/* Tilt indicator hidden while holo is off */
.pinsta-holo-controls.holo-off .holo-indicator-wrap {
    display: none;
}

.holo-indicator-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.holo-tilt-indicator {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.04);
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
}

.holo-tilt-dot {
    width: 8px;
    height: 8px;
    background: rgba(100, 200, 255, 0.9);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 6px rgba(100, 200, 255, 0.6);
    pointer-events: none;
}

.holo-mode-btn.denied {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: rgba(255, 100, 100, 0.3);
    color: rgba(255, 150, 150, 0.5);
}

@media (hover: hover) {
    .holo-mode-btn.denied:hover {
        background: rgba(255, 255, 255, 0.08);
        color: rgba(255, 150, 150, 0.5);
    }
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .pinsta-holo-controls {
        bottom: 50px;
        left: 5px;
    }

    .holo-control-panel {
        min-width: 120px;
        padding: 8px;
    }

    .holo-tilt-indicator {
        width: 28px;
        height: 28px;
    }
}


/* =============================================================================
   CAPTION
   ============================================================================= */

.pinsta-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--pinsta-caption-padding);
    background: var(--pinsta-caption-bg);
    color: var(--pinsta-text);
    text-align: center;
    pointer-events: none;
}

.pinsta-caption-title {
    font-size: var(--pinsta-caption-title-size);
    font-weight: 600;
    margin-bottom: 4px;
}

.pinsta-caption-description {
    font-size: var(--pinsta-caption-desc-size);
    color: var(--pinsta-text-muted);
}

.pinsta-caption-description a {
    color: var(--pinsta-accent);
    pointer-events: auto;
}

/* =============================================================================
   NAVIGATION BUTTONS
   ============================================================================= */

.pinsta-viewer-close,
.pinsta-viewer-prev,
.pinsta-viewer-next {
    position: absolute;
    background: transparent;
    border: none;
    color: var(--pinsta-text);
    cursor: pointer;
    z-index: var(--pinsta-z-btn);
    transition: opacity 0.5s var(--pinsta-ease),
                transform var(--pinsta-transition) var(--pinsta-ease);
    opacity: 0.7;
}

.pinsta-viewer.pinsta-controls-hidden .pinsta-viewer-prev,
.pinsta-viewer.pinsta-controls-hidden .pinsta-viewer-next {
    opacity: 0;
    pointer-events: none;
}

.pinsta-viewer-close:hover,
.pinsta-viewer-prev:hover,
.pinsta-viewer-next:hover {
    opacity: 1;
    transform: scale(1.1);
}

.pinsta-viewer-close {
    top: 16px;
    right: 16px;
    width: var(--pinsta-close-size);
    height: var(--pinsta-close-size);
    font-size: var(--pinsta-close-font-size);
    line-height: 1;
}

.pinsta-viewer-prev,
.pinsta-viewer-next {
    top: 50%;
    transform: translateY(-50%);
    width: var(--pinsta-btn-size);
    height: var(--pinsta-btn-size);
    font-size: var(--pinsta-btn-font-size);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pinsta-viewer-prev:hover,
.pinsta-viewer-next:hover {
    transform: translateY(-50%) scale(1.1);
}

.pinsta-viewer-prev {
    left: 16px;
}

.pinsta-viewer-next {
    right: 16px;
}

/* Hide navigation buttons when there's only one item */
.pinsta-viewer[data-count="1"] .pinsta-viewer-prev,
.pinsta-viewer[data-count="1"] .pinsta-viewer-next {
    opacity: 0;
    pointer-events: none;
}

/* =============================================================================
   COUNTER
   ============================================================================= */

.pinsta-viewer-counter {
    position: absolute;
    background: var(--pinsta-counter-bg);
    color: var(--pinsta-text);
    padding: var(--pinsta-counter-padding);
    transition: opacity 0.3s ease;
    font-size: var(--pinsta-counter-font-size);
    border-radius: var(--pinsta-counter-radius);
    z-index: var(--pinsta-z-counter);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.pinsta-counter-top {
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
}

.pinsta-counter-bottom {
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
}

/* =============================================================================
   LOADING INDICATOR
   ============================================================================= */

.pinsta-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid var(--pinsta-text-muted);
    border-top-color: var(--pinsta-accent);
    border-radius: 50%;
    animation: pinsta-spin 1s linear infinite;
    opacity: 0;
    transition: opacity 0.2s;
}

.pinsta-slide-active .pinsta-media-img:not([src]),
.pinsta-slide-active .pinsta-media-video:not([src]),
.pinsta-slide-active .pinsta-text-content:empty {
    opacity: 0;
}

.pinsta-slide-active .pinsta-media-img:not([src]) + .pinsta-loader,
.pinsta-slide-active .pinsta-media-video:not([src]) + .pinsta-loader {
    opacity: 1;
}

@keyframes pinsta-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* =============================================================================
   ERROR STATE
   ============================================================================= */

.pinsta-error {
    color: #ef4444;
    font-size: 16px;
    text-align: center;
    padding: 20px;
}

/* =============================================================================
   DRAG-TO-DISMISS CAT
   ============================================================================= */

/* Container — fixed top-center track, starts above viewport */
.pinsta-dismiss-ghost {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-140%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    z-index: 1010;
    opacity: 0;
    will-change: transform, opacity;
}

/* Emoji cat */
.pinsta-dismiss-ghost .ghost-figure {
    font-size: 36px;
    line-height: 1;
    display: block;
    filter: drop-shadow(0 0 0px transparent);
    transition: filter 0.25s ease;
}

/* Label — JS drives opacity proportionally */
.pinsta-dismiss-ghost .ghost-label {
    font-size: 11px;
    color: rgba(255, 230, 170, 0.95);
    opacity: 0;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    font-family: 'SF Mono', 'Monaco', monospace;
}

/* ---- Committed state: threshold reached, user can release ---- */

.pinsta-dismiss-ghost.committed .ghost-figure {
    filter: drop-shadow(0 0 10px rgba(255, 185, 60, 0.8))
            drop-shadow(0 0 22px rgba(255, 140, 40, 0.35));
    animation: ghost-float 1.2s ease-in-out infinite;
}

@keyframes ghost-float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-4px); }
}

@media (prefers-reduced-motion: reduce) {
    .pinsta-dismiss-ghost.committed .ghost-figure {
        animation: none;
    }
}

/* =============================================================================
   MOBILE RESPONSIVE
   ============================================================================= */

@media (max-width: 768px) {
    :root {
        --pinsta-btn-size: 44px;
        --pinsta-btn-font-size: 20px;
        --pinsta-close-size: 40px;
        --pinsta-close-font-size: 28px;
    }
    
    .pinsta-media {
        max-width: 100vw;
        max-height: 70vh;
    }
    
    .pinsta-video-wrapper,
    .pinsta-media-video {
        max-height: 70vh;
    }
    
    .pinsta-text-content {
        max-height: 70vh;
        font-size: 14px;
    }
    
    .pinsta-caption {
        padding: 40px 16px 16px;
    }
    
    .pinsta-caption-title {
        font-size: 16px;
    }
    
    .pinsta-caption-description {
        font-size: 13px;
    }
    
    .pinsta-viewer-prev {
        left: 8px;
    }
    
    .pinsta-viewer-next {
        right: 8px;
    }
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    .pinsta-viewer-close {
        top: max(16px, env(safe-area-inset-top));
        right: max(16px, env(safe-area-inset-right));
    }
    
    .pinsta-viewer-prev {
        left: max(8px, env(safe-area-inset-left));
    }
    
    .pinsta-viewer-next {
        right: max(8px, env(safe-area-inset-right));
    }
    
    .pinsta-counter-top {
        top: max(16px, env(safe-area-inset-top));
    }
}

/* =============================================================================
   ACCESSIBILITY
   ============================================================================= */

.pinsta-viewer-close:focus,
.pinsta-viewer-prev:focus,
.pinsta-viewer-next:focus {
    outline: 2px solid var(--pinsta-accent);
    outline-offset: 2px;
}

.pinsta-viewer-close:focus:not(:focus-visible),
.pinsta-viewer-prev:focus:not(:focus-visible),
.pinsta-viewer-next:focus:not(:focus-visible) {
    outline: none;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    :root {
        --pinsta-transition: 0s;
    }
    
    .pinsta-loader {
        animation: none;
    }
}

/* =============================================================================
   DARK/LIGHT THEME SUPPORT (if using CSS variables)
   ============================================================================= */

@media (prefers-color-scheme: dark) {
    :root {
        --pinsta-text: #fff;
        --pinsta-text-muted: #9ca3af;
    }
}

/* =============================================================================
   PRINT STYLES
   ============================================================================= */

@media print {
    .pinsta-viewer {
        display: none !important;
    }
}
