/* PaperCraft Boutique - Responsive CSS */

/* Mobile-First Responsive Design */

/* Extra Small Devices (phones, 576px and down) */
@media (max-width: 575.98px) {
    /* Typography */
    .display-4 {
        font-size: 2rem !important;
    }
    
    .h3 {
        font-size: 1.5rem !important;
    }
    
    .h4 {
        font-size: 1.25rem !important;
    }
    
    .h5 {
        font-size: 1.1rem !important;
    }
    
    .lead {
        font-size: 1rem !important;
    }
    
    /* Navbar */
    .navbar-brand {
        font-size: 1.25rem !important;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 0.75rem;
        margin: 0.25rem 0;
    }
    
    /* Hero Section */
    #hero {
        min-height: 70vh !important;
        padding: 2rem 0;
    }
    
    #hero .display-4 {
        margin-bottom: 1rem;
    }
    
    #hero .col-lg-6 {
        text-align: center;
        margin-bottom: 2rem;
    }
    
    /* Cards */
    .card {
        margin-bottom: 1.5rem;
    }
    
    .card-img-top {
        height: 180px;
    }
    
    /* Remove hover effects on mobile */
    .card:hover {
        transform: none !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    }
    
    .btn:hover {
        transform: none !important;
    }
    
    .rounded-circle:hover {
        transform: none !important;
    }
    
    #gallery img:hover {
        transform: none !important;
    }
    
    /* Team Images */
    .rounded-circle {
        width: 100px !important;
        height: 100px !important;
    }
    
    /* Process Steps */
    .rounded-circle.bg-primary {
        width: 50px !important;
        height: 50px !important;
        font-size: 1rem !important;
    }
    
    /* Sections Padding */
    section {
        padding: 3rem 0 !important;
    }
    
    /* Footer */
    footer {
        text-align: center;
        background: #000000 !important; /* Убеждаемся что фон черный на мобильных */
    }
    
    footer .col-lg-4 {
        margin-bottom: 2rem;
    }
    
    footer h5 {
        font-size: 1.3rem !important; /* Больше заголовки на мобильных */
        margin-bottom: 1rem;
    }
    
    footer p, footer .text-muted {
        font-size: 1rem !important; /* Больше текст для лучшей читаемости */
        line-height: 1.8 !important;
    }
    
    footer a {
        font-size: 1rem !important;
        padding: 0.25rem 0; /* Больше область касания */
        display: inline-block;
    }
    
    /* Contact Form */
    .contact-info {
        margin-top: 2rem;
        text-align: center;
    }
    
    /* Gallery Grid */
    #gallery .col-6 {
        padding: 0.25rem;
    }
    
    /* Blog Grid */
    #blog_grid .col-lg-4 {
        margin-bottom: 2rem;
    }
    
    /* Disable animations on mobile */
    [data-sal] {
        transition: none !important;
    }
    
    .sal-animate {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .display-4 {
        font-size: 2.25rem !important;
    }
    
    .card-img-top {
        height: 200px;
    }
    
    .rounded-circle {
        width: 110px !important;
        height: 110px !important;
    }
    
    /* Reduce animations on small screens */
    @media (prefers-reduced-motion: no-preference) {
        .card:hover {
            transform: translateY(-4px) !important;
        }
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .display-4 {
        font-size: 2.5rem !important;
    }
    
    .card-img-top {
        height: 220px;
    }
    
    .rounded-circle {
        width: 120px !important;
        height: 120px !important;
    }
    
    /* Hero adjustments */
    #hero {
        min-height: 80vh;
    }
    
    /* Navigation */
    .navbar-nav .nav-link {
        padding: 0.75rem 0.875rem;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    /* Full animations and effects enabled */
    .card-img-top {
        height: 200px;
    }
    
    /* Hero section adjustments */
    #hero::before {
        display: block;
    }
    
    /* Hover effects */
    @media (prefers-reduced-motion: no-preference) {
        .card:hover {
            transform: translateY(-8px);
        }
        
        .btn:hover {
            transform: translateY(-2px);
        }
        
        .rounded-circle:hover {
            transform: scale(1.1);
        }
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    /* Enhanced spacing */
    section {
        padding: 5rem 0;
    }
    
    /* Hero enhancements */
    #hero .display-4 {
        font-size: 3rem;
    }
    
    .card-img-top {
        height: 220px;
    }
}

/* Ultra wide screens (1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    section {
        padding: 6rem 0;
    }
}

/* High DPI / Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Ensure crisp images and icons */
    .card-img-top {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
    
    .fa {
        text-rendering: optimizeLegibility;
    }
}

/* Landscape Orientation on Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    #hero {
        min-height: 100vh !important;
        padding: 1rem 0;
    }
    
    section {
        padding: 2rem 0 !important;
    }
    
    .navbar {
        padding: 0.25rem 0;
    }
}

/* Print Styles */
@media print {
    .navbar,
    footer,
    .btn,
    #gallery {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    overflow-x: hidden;
}
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        page-break-inside: avoid;
    }
    
    section {
        padding: 1rem 0 !important;
    }
}

/* Dark Mode Support (if user prefers) */

/* Accessibility Improvements */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0000ff;
        --secondary-color: #ff0080;
        --success-color: #008000;
        --warning-color: #ffcc00;
        --accent-color: #00ccaa;
    }
    
    .card {
        border: 2px solid var(--neutral-400) !important;
    }
    
    .btn {
        border-width: 2px !important;
    }
    
    /* Высококонтрастный режим для подвала */
    footer {
        background: #000000 !important;
        border: 3px solid #ffffff !important;
    }
    
    footer h5, footer p, footer a, footer small {
        color: #ffffff !important;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8) !important;
    }
    
    footer a:hover {
        background: #ffffff !important;
        color: #000000 !important;
        text-shadow: none !important;
    }
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
    /* Disable all animations and transitions */
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    /* Disable hover transforms */
    .card:hover,
    .btn:hover,
    .rounded-circle:hover,
    #gallery img:hover {
        transform: none !important;
    }
    
    /* Disable Sal.js animations */
    [data-sal] {
        transition: none !important;
    }
    
    /* Ensure content is visible */
    [data-sal] {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Focus Styles for Accessibility */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Skip to content link for screen readers */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-to-content:focus {
    top: 6px;
}

/* Screen Reader Only Class */
.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;
}
