/* Mobile First Responsive Design */

/* Extra Small Devices (phones, 576px and down) */
@media (max-width: 575.98px) {
    /* Typography */
    html {
        font-size: 14px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    /* Container */
    .container {
        padding: 0 15px;
    }
    
    /* Navigation */
    .nav-links {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 2rem;
        gap: 1rem;
        transform: translateY(-100%);
        transition: transform 0.3s ease;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        z-index: 999;
    }
    
    .nav-links.active {
        transform: translateY(0);
    }
    
    .nav-toggle {
        display: flex;
    }
    
    /* Hero Section */
    .hero {
        min-height: 80vh;
        padding: 2rem 0;
    }
    
    .hero-content {
        padding: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hero-buttons .btn {
        width: 100%;
        margin: 0.5rem 0;
    }
    
    /* Page Header */
    .page-header {
        padding: 100px 0 60px;
    }
    
    /* Sections */
    .main-content {
        padding: 60px 0;
    }
    
    section {
        padding: 60px 0;
    }
    
    .section-header {
        margin-bottom: 3rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    /* Grids */
    .features-grid,
    .services-grid,
    .testimonials-grid,
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Cards */
    .feature-card,
    .service-card,
    .testimonial-card,
    .blog-card {
        padding: 1.5rem;
    }
    
    /* Newsletter */
    .newsletter-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .newsletter-text {
        text-align: center;
    }
    
    .newsletter-form .form-group {
        flex-direction: column;
    }
    
    .newsletter-form input[type="email"] {
        margin-bottom: 1rem;
    }
    
    /* Contact Preview */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .contact-item {
        justify-content: center;
        text-align: center;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-links {
        grid-template-columns: 1fr;
    }
    
    .footer-brand {
        text-align: center;
    }
    
    /* Forms */
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .contact-form {
        padding: 1.5rem;
    }
    
    /* Cookie Consent */
    .cookie-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .cookie-buttons {
        justify-content: center;
        width: 100%;
    }
    
    .cookie-buttons .btn {
        flex: 1;
        min-width: 120px;
    }
    
    /* Legal Content */
    .legal-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .legal-sidebar {
        position: static;
        order: -1;
    }
    
    .toc {
        margin-bottom: 1rem;
    }
    
    .toc ul {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    /* Thank You Page */
    .thank-you-main {
        padding: 100px 0 60px;
    }
    
    .thank-you-content {
        padding: 0 1rem;
    }
    
    .thank-you-message h1 {
        font-size: 2rem;
    }
    
    .contact-options,
    .resource-links {
        grid-template-columns: 1fr;
    }
    
    .thank-you-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    /* Article Styles */
    .article-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .article-hero {
        flex-direction: column;
        gap: 1rem;
    }
    
    .article-info h1 {
        font-size: 2rem;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .article-meta span::after {
        display: none;
    }
    
    .article-sidebar {
        position: static;
        order: -1;
    }
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .hero-title {
        font-size: 3rem;
    }
    
    .newsletter-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .newsletter-text {
        text-align: center;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-brand {
        text-align: center;
    }
    
    .legal-layout {
        grid-template-columns: 1fr;
    }
    
    .legal-sidebar {
        position: static;
    }
    
    .article-content {
        grid-template-columns: 1fr;
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Navigation */
    .nav-toggle {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 2rem;
        gap: 1rem;
        transform: translateY(-100%);
        transition: transform 0.3s ease;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        z-index: 999;
    }
    
    .nav-links.active {
        transform: translateY(0);
    }
    
    /* Grids */
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Newsletter */
    .newsletter-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .newsletter-text {
        text-align: center;
    }
    
    /* Contact */
    .contact-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
    
    .footer-brand {
        text-align: left;
    }
    
    /* Legal */
    .legal-layout {
        grid-template-columns: 1fr;
    }
    
    .legal-sidebar {
        position: static;
        margin-bottom: 2rem;
    }
    
    .toc ul {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    /* Articles */
    .article-content {
        grid-template-columns: 1fr;
    }
    
    .article-sidebar {
        position: static;
        margin-top: 2rem;
    }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    /* Services Grid */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Newsletter */
    .newsletter-content {
        grid-template-columns: 1fr 1fr;
    }
    
    .newsletter-text {
        text-align: left;
    }
    
    /* Contact */
    .contact-content {
        grid-template-columns: 2fr 1fr;
    }
    
    /* Legal */
    .legal-layout {
        grid-template-columns: 200px 1fr;
        gap: 2rem;
    }
    
    .legal-sidebar {
        position: sticky;
        top: 120px;
    }
    
    /* Articles */
    .article-content {
        grid-template-columns: 1fr 250px;
        gap: 2rem;
    }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
    
    /* All grids at full capacity */
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .testimonials-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Navigation Responsive Behavior */
@media (max-width: 991.98px) {
    .nav-links {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 2rem;
        gap: 1rem;
        transform: translateY(-100%);
        transition: transform 0.3s ease;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        z-index: 999;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .nav-links.active {
        transform: translateY(0);
    }
    
    .nav-links li {
        width: 100%;
        text-align: center;
    }
    
    .nav-links a {
        display: block;
        padding: 0.75rem 1rem;
        border-radius: 5px;
        transition: all 0.3s ease;
    }
    
    .nav-links a:hover,
    .nav-links a.active {
        background: rgba(44, 90, 160, 0.1);
        color: #2c5aa0;
    }
    
    .nav-toggle {
        display: flex;
    }
}

/* Cookie Consent Responsive */
@media (max-width: 767.98px) {
    .cookie-consent {
        padding: 1rem 0;
    }
    
    .cookie-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .cookie-content p {
        min-width: auto;
        margin-bottom: 1rem;
    }
    
    .cookie-buttons {
        justify-content: center;
        width: 100%;
    }
    
    .cookie-buttons .btn {
        flex: 1;
        min-width: 100px;
        font-size: 0.85rem;
        padding: 6px 12px;
    }
}

/* Form Responsive Behavior */
@media (max-width: 767.98px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .contact-form-section,
    .contact-info-section {
        padding: 1.5rem;
    }
    
    .contact-layout {
        display: block;
    }
    
    .contact-info-section {
        margin-top: 2rem;
    }
}

/* Article Responsive Adjustments */
@media (max-width: 1199.98px) {
    .article-content {
        grid-template-columns: 1fr;
    }
    
    .article-sidebar {
        position: static;
        margin-top: 2rem;
    }
    
    .sidebar-section {
        display: inline-block;
        width: calc(50% - 1rem);
        margin-right: 1rem;
        margin-bottom: 1rem;
        vertical-align: top;
    }
}

@media (max-width: 767.98px) {
    .sidebar-section {
        display: block;
        width: 100%;
        margin-right: 0;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-background svg {
        animation: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .btn-primary {
        border: 2px solid #000;
    }
    
    .btn-secondary {
        border: 2px solid #000;
        background: #fff;
        color: #000;
    }
    
    .feature-card,
    .testimonial-card,
    .blog-card {
        border: 2px solid #000;
    }
}

/* Print Responsive */
@media print {
    .container {
        max-width: none;
        padding: 0;
    }
    
    .hero,
    .newsletter,
    .contact-preview,
    .cookie-consent {
        display: none;
    }
    
    .main-content {
        padding: 0;
    }
    
    .legal-layout {
        grid-template-columns: 1fr;
    }
    
    .legal-sidebar {
        display: none;
    }
    
    .article-content {
        grid-template-columns: 1fr;
    }
    
    .article-sidebar {
        display: none;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn {
        padding: 14px 28px;
        font-size: 1.1rem;
    }
    
    .nav-links a {
        padding: 1rem;
        font-size: 1.1rem;
    }
    
    .contact-item,
    .resource-link {
        padding: 1.25rem;
    }
    
    /* Increase touch targets */
    .cookie-buttons .btn {
        padding: 12px 20px;
        font-size: 1rem;
    }
}

/* Landscape Orientation Adjustments */
@media (orientation: landscape) and (max-height: 600px) {
    .hero {
        min-height: 90vh;
    }
    
    .hero-content {
        padding: 1rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }
    
    .page-header {
        padding: 100px 0 40px;
    }
}

/* Focus and Keyboard Navigation */
@media (prefers-reduced-motion: no-preference) {
    a:focus,
    button:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: 3px solid #4a90e2;
        outline-offset: 2px;
    }
}

/* Dark Mode Considerations (for future implementation) */
@media (prefers-color-scheme: dark) {
    /* This is prepared for future dark mode implementation */
    .footer {
        background: #1a1a1a;
    }
}
