/* 
 * Responsive CSS for Canadian Business Magazine
 * Mobile-first approach with breakpoints at:
 * - 576px (small devices)
 * - 768px (medium devices)
 * - 992px (large devices)
 * - 1200px (extra large devices)
 */

/* Base Mobile Styles (below 576px) */
@media (max-width: 575.98px) {
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    section {
        padding: 4rem 0;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
        white-space: normal;
        animation: fadeIn 1.5s ease forwards;
        width: 100%;
        border-right: none;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    h1 {
        font-size: 3rem;
    }
    
    h2 {
        font-size: 2.2rem;
    }
    
    .hero-section h1 {
        font-size: 3rem;
        white-space: normal;
        animation: fadeIn 1.5s ease forwards;
        width: 100%;
        border-right: none;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    h1 {
        font-size: 3.2rem;
    }
    
    .hero-section h1 {
        font-size: 3.5rem;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .container {
        padding: 0 2rem;
    }
}

/* Mobile Navigation */
@media (max-width: 991.98px) {
    .main-nav {
        position: relative;
    }
    
    .menu-toggle {
        display: none;
    }
    
    .menu-toggle-label {
        display: flex;
        flex-direction: column;
        width: 30px;
        height: 21px;
        cursor: pointer;
        z-index: 2;
    }
    
    .menu-toggle-label span {
        display: block;
        width: 100%;
        height: 3px;
        background-color: var(--color-primary);
        margin-bottom: 6px;
        border-radius: 3px;
        transition: var(--transition);
    }
    
    .menu-toggle-label span:last-child {
        margin-bottom: 0;
    }
    
    .menu-toggle:checked + .menu-toggle-label span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .menu-toggle:checked + .menu-toggle-label span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle:checked + .menu-toggle-label span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 250px;
        height: 100vh;
        background-color: white;
        flex-direction: column;
        padding: 80px 20px 30px;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 1;
    }
    
    .menu-toggle:checked ~ .nav-menu {
        right: 0;
    }
    
    .nav-menu li {
        margin: 0 0 20px 0;
    }
    
    .nav-menu li a::after {
        display: none;
    }
    
    .nav-menu li:last-child {
        margin-top: auto;
    }
    
    .nav-menu li:last-child a {
        display: block;
        text-align: center;
    }
}

/* Section-specific responsive styles */
@media (max-width: 991.98px) {
    /* About Section */
    .about-content {
        flex-direction: column;
        gap: 2rem;
    }
    
    .about-image {
        order: -1;
    }
    
    /* Advantages Grid */
    .advantages-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Services Grid */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .service-card.featured {
        transform: scale(1);
    }
    
    .service-card.featured:hover {
        transform: translateY(-10px);
    }
    
    /* Testimonials */
    .testimonial {
        flex: 0 0 calc(100% - 2rem);
    }
    
    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Contact */
    .contact-content {
        flex-direction: column;
        gap: 3rem;
    }
    
    /* Footer */
    .footer-content {
        flex-direction: column;
        gap: 3rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 2rem;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    /* Adjust for medium tablets */
    .advantages-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .service-card.featured {
        grid-column: span 2;
    }
}

@media (max-width: 767.98px) {
    /* Form */
    .order-form {
        padding: 2rem;
        transform: none;
    }
    
    .order-form:hover {
        animation: none;
    }
}

@media (max-width: 575.98px) {
    /* Gallery for small phones */
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    /* Cookie popup */
    .cookie-popup {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        padding: 1.5rem;
    }
}

/* Fix for landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: 8rem 0;
    }
    
    .nav-menu {
        padding-top: 60px;
    }
}

/* Print styles */
@media print {
    .site-header, .site-footer, .cookie-popup {
        display: none;
    }
    
    body {
        background-color: white;
        color: black;
    }
    
    main {
        margin: 0;
        padding: 0;
    }
    
    .container {
        max-width: 100%;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    p, h2, h3 {
        orphans: 3;
        widows: 3;
    }
    
    img {
        max-width: 100% !important;
    }
} 