/**
 * ShowcaseX Pro — Accessibility Stylesheet
 * WCAG 2.1 AA compliance: focus outlines, reduced motion, screen reader aids.
 *
 * @package PixevosShowcasePro
 */

/* -----------------------------------------------------------------------
   FOCUS MANAGEMENT (WCAG 2.4.7 — Focus Visible)
   ----------------------------------------------------------------------- */
.pixsp-showcase-container *:focus-visible {
    outline: 3px solid var(--pixsp-primary, #7c3aed);
    outline-offset: 3px;
    border-radius: 4px;
}

/* High-contrast mode override (accessibility.focus_outlines = true) */
.pixsp-focus-high-contrast *:focus-visible {
    outline: 3px solid #ffbf47;
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(255, 191, 71, 0.25);
}

/* Remove outline for mouse users only */
.pixsp-showcase-container *:focus:not(:focus-visible) {
    outline: none;
}

/* -----------------------------------------------------------------------
   REDUCED MOTION (WCAG 2.3.3 — Animation from Interactions)
   ----------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .pixsp-card,
    .pixsp-card-image,
    .pixsp-card-overlay,
    .pixsp-badge,
    .pixsp-filter-chip,
    .pixsp-load-more-btn,
    .pixsp-reveal,
    .pixsp-action-btn {
        transition: none !important;
        animation: none !important;
    }

    .pixsp-card:hover {
        transform: none !important;
    }

    .pixsp-card:hover .pixsp-card-image {
        transform: none !important;
    }
}

/* -----------------------------------------------------------------------
   SCREEN READER ONLY UTILITY
   ----------------------------------------------------------------------- */
.pixsp-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* -----------------------------------------------------------------------
   SKIP TO CONTENT LINK (WCAG 2.4.1)
   ----------------------------------------------------------------------- */
.pixsp-skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    z-index: 9999;
    background: var(--pixsp-primary, #7c3aed);
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.2s;
}

.pixsp-skip-link:focus {
    top: 6px;
}

/* -----------------------------------------------------------------------
   ARIA LIVE REGION (Grid status for filter updates)
   ----------------------------------------------------------------------- */
.pixsp-aria-status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

/* -----------------------------------------------------------------------
   COLOUR CONTRAST HELPERS (WCAG 1.4.3 — Contrast AA)
   ----------------------------------------------------------------------- */
/* Ensure muted text meets 4.5:1 on light background */
.pixsp-showcase-container .pixsp-card-subtitle,
.pixsp-showcase-container .pixsp-card-meta,
.pixsp-showcase-container .pixsp-results-count {
    color: var(--pixsp-text-muted, #64748b);
}

/* Ensure badge text is always legible */
.pixsp-badge {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* -----------------------------------------------------------------------
   INTERACTIVE ELEMENT MIN SIZE (WCAG 2.5.5 — Target Size)
   ----------------------------------------------------------------------- */
.pixsp-filter-chip,
.pixsp-action-btn,
.pixsp-load-more-btn,
.pixsp-page-btn {
    min-height: 44px;
    min-width: 44px;
}

.pixsp-filter-chip {
    padding: 0 16px;
}

/* -----------------------------------------------------------------------
   CARD KEYBOARD INTERACTION
   ----------------------------------------------------------------------- */
.pixsp-card[tabindex="0"]:focus-visible {
    outline: 3px solid var(--pixsp-primary, #7c3aed);
    outline-offset: 3px;
    z-index: 10;
}

/* -----------------------------------------------------------------------
   MODAL ACCESSIBILITY
   ----------------------------------------------------------------------- */
.pixsp-modal-overlay[aria-hidden="true"] {
    display: none;
}

.pixsp-modal-close {
    min-width: 44px;
    min-height: 44px;
}

/* -----------------------------------------------------------------------
   MOTION-SAFE ANIMATIONS (Only apply animations if no preference set)
   ----------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
    .pixsp-reveal {
        opacity: 0;
        transform: translateY(16px);
    }

    .pixsp-reveal.revealed {
        opacity: 1;
        transform: translateY(0);
        transition: opacity 0.5s ease, transform 0.5s ease;
    }
}

/* When reduced motion is preferred, show all items immediately */
@media (prefers-reduced-motion: reduce) {
    .pixsp-reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}
