/* ================================================
   Ombra.io — Accessibility (WCAG 2.1 AA)
   ================================================
   Shared across all apps for consistent a11y support.
   Focus on: keyboard navigation, screen reader,
   high contrast under sunlight.
   ================================================ */

/* --- Focus indicators (keyboard navigation) --- */
*:focus-visible {
    outline: 3px solid #1B5E7B;
    outline-offset: 2px;
    border-radius: 4px;
}

/* MudBlazor button focus override */
.mud-button-root:focus-visible,
.mud-icon-button:focus-visible,
.mud-chip:focus-visible {
    outline: 3px solid #1B5E7B !important;
    outline-offset: 2px;
}

/* --- Skip to main content link --- */
.skip-to-main {
    position: absolute;
    top: -100px;
    left: 8px;
    z-index: 9999;
    padding: 8px 16px;
    background: #1B5E7B;
    color: white;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.2s ease;
}

.skip-to-main:focus {
    top: 0;
}

/* --- Touch target minimum size (44x44px) --- */
.touch-target {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* --- Map grid cells — keyboard accessible --- */
.gc-ombrellone[role="button"] {
    cursor: pointer;
}

.gc-ombrellone[role="button"]:focus-visible {
    outline: 3px solid #1B5E7B;
    outline-offset: -2px;
    z-index: 10;
}

/* --- High contrast mode (prefers-contrast) --- */
@media (prefers-contrast: high) {
    .gc-libera { background: #ffffff !important; border: 2px solid #006400 !important; }
    .gc-prenotata { background: #ffffff !important; border: 2px solid #00008b !important; }
    .gc-occupata { background: #ffffff !important; border: 2px solid #8b4513 !important; }
    .gc-manutenzione { background: #ffffff !important; border: 2px solid #8b0000 !important; }
}

/* --- Reduce motion for vestibular disorders --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* --- Screen reader only (visually hidden) --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Ensure minimum contrast for outdoor use --- */
.high-contrast-text {
    color: #1a1a1a;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
}

/* ================================================
   High Contrast Mode (toggle)
   ================================================ */
body.high-contrast {
    --ombra-bg: #FFFFFF;
    --ombra-text: #000000;
    --ombra-text-secondary: #333333;
    --ombra-border: #000000;
    --ombra-surface: #F5F5F5;
}

body.high-contrast .mp-item,
body.high-contrast .mud-paper {
    border: 2px solid #000 !important;
    background: #FFF !important;
}

body.high-contrast .mp-item-name,
body.high-contrast .mud-text,
body.high-contrast p,
body.high-contrast span {
    color: #000 !important;
}

body.high-contrast .mp-item-price {
    color: #000 !important;
    font-weight: 800 !important;
    font-size: 1.1em !important;
}

body.high-contrast button,
body.high-contrast .mud-button-root {
    border: 2px solid #000 !important;
    font-weight: 700 !important;
}

body.high-contrast .mp-allergen {
    font-size: 1.3rem !important;
    border: 1px solid #000;
    border-radius: 4px;
    padding: 2px;
}

body.high-contrast .mp-cat-sep .mp-cat-name {
    background: #000 !important;
    color: #FFF !important;
    padding: 2px 8px;
    border-radius: 4px;
}

body.high-contrast .mp-header {
    background: #1a1a1a !important;
    color: #FFF !important;
}

body.high-contrast .mp-readonly-banner {
    border: 2px solid #000 !important;
    background: #F5F5F5 !important;
}

body.high-contrast .mp-readonly-banner__title {
    color: #000 !important;
}

body.high-contrast .mp-cart-action {
    background: #000 !important;
    color: #FFF !important;
    border: 2px solid #FFF !important;
}
