/* input(320,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '&' */
/**
 * ============================================
 * POLISPORTIVA FORMIGINESE - DESIGN SYSTEM
 * Complete Design System Aggregation File
 * ============================================
 *
 * This file imports all design system components in the correct order
 * Import this single file in your layout to load the entire design system
 */

/* 1. CSS Variables (Foundation) */
@import url('./design-system/variables.css?v=hm_rwTlr--gKesa8hSxTC4QNqWk');

/* 2. Typography */
@import url('./design-system/typography.css?v=eZ9mnOH7HqwUfzGFgzClMb7UyUo');

/* 3. Utilities */
@import url('./design-system/utilities.css?v=eZ9mnOH7HqwUfzGFgzClMb7UyUo');

/* 4. Base Components (Atoms) */
@import url('./design-system/components.css?v=eZ9mnOH7HqwUfzGFgzClMb7UyUo');

/**
 * Component-specific styles are embedded within ViewComponents
 * This approach keeps component styles colocated with their templates
 *
 * For global overrides or additional utilities, add them below:
 */

/* ========================================
   GLOBAL HELPERS
   ======================================== */

/* Smooth scroll behavior + prevent horizontal overflow on mobile */
html,
body {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
}

/* Fix Iubenda cookie banner overflow on mobile */
#iubenda-cs-banner,
.iubenda-cs-container,
.iubenda-cs-content,
.iubenda-cs-rationale {
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Selection color */
::selection {
    background: var(--color-primary);
    color: var(--color-white);
}

::-moz-selection {
    background: var(--color-primary);
    color: var(--color-white);
}

/* ========================================
   ANIMATION UTILITIES
   ======================================== */

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Slide up animation */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide down animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scale in animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pulse animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Animation classes */
.animate-fade-in {
    animation: fadeIn var(--transition-slow) ease-out;
}

.animate-slide-up {
    animation: slideUp var(--transition-slow) ease-out;
}

.animate-slide-down {
    animation: slideDown var(--transition-slow) ease-out;
}

.animate-scale-in {
    animation: scaleIn var(--transition-slow) ease-out;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ========================================
   SCROLLBAR CUSTOMIZATION
   ======================================== */

/* Webkit browsers */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--color-gray-300);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-400);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-gray-300) var(--color-gray-100);
}

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

@media print {
    /* Hide non-essential elements */
    nav,
    footer,
    .navbar,
    .footer,
    .btn-custom,
    .cta-section {
        display: none !important;
    }

    /* Ensure content is readable */
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }

    /* Prevent page breaks inside elements */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        page-break-inside: avoid;
    }

    /* Show link URLs in print */
    a[href]::after {
        content: " (" attr(href) ")";
    }
}

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

/* Screen reader only content */
.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 main content link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: var(--color-white);
    padding: var(--spacing-2) var(--spacing-4);
    text-decoration: none;
    z-index: var(--z-modal);
}

.skip-to-content:focus {
    top: 0;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --color-text-primary: #000;
        --color-bg-primary: #fff;
        --color-border-medium: #000;
    }
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* GPU acceleration for animations */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* Contain layout shifts */
.contain-layout {
    contain: layout;
}

.contain-paint {
    contain: paint;
}

/* ========================================
   DARK MODE SUPPORT (Future Enhancement)
   ======================================== */

@media (prefers-color-scheme: dark) {
    /* Dark mode variables can be added here in future */
    /* Currently the site uses light theme only */
}

/* ========================================
   COMPONENT-SPECIFIC GLOBAL FIXES
   ======================================== */

/* Ensure images don't overflow containers */
img {
    max-width: 100%;
    height: auto;
}

/* Remove Bootstrap default focus shadows if present */
.btn:focus,
.form-control:focus {
    box-shadow: none;
}

/* Ensure all interactive elements are keyboard accessible */
button,
a,
input,
select,
textarea {
    &:focus-visible {
        outline: 2px solid var(--color-primary);
        outline-offset: 2px;
    }
}
