/* 
   CodeMaster - Responsive Layout Media Queries
   Defines tablet and mobile breakpoints for full fluid responsive design
*/

/* --- Large Tablet / Small Desktop (Max 1024px) --- */
@media screen and (max-width: 1024px) {
    h1 { font-size: 2.25rem; }
    h2 { font-size: 1.85rem; }
    
    .hero-container {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .hero-content {
        margin: 0 auto;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Article Detail Layout Adjustment */
    .article-detail-layout {
        grid-template-columns: 220px 1fr;
    }
    
    .sidebar-right {
        display: none; /* Hide Table of Contents sidebar on tablet */
    }
    
    .footer-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem;
    }
    
    .sitemap-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Small Tablet / Large Mobile (Max 768px) --- */
@media screen and (max-width: 768px) {
    html {
        font-size: 15px;
    }
    
    h1 { font-size: 2rem; }
    
    .hero-title {
        font-size: 2.75rem;
    }
    
    .nav-links {
        display: none; /* Hide desktop nav links */
    }
    
    .mobile-nav-toggle {
        display: block; /* Show hamburger button */
        order: 3;
    }
    
    .nav-actions {
        order: 2;
    }
    
    /* Mobile Drawer Menu style */
    .main-nav {
        position: fixed;
        top: var(--header-height);
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: calc(100vh - var(--header-height));
        background-color: var(--bg-secondary);
        box-shadow: var(--shadow-lg);
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem;
        gap: 2rem;
        transition: var(--transition-smooth);
        border-right: 1px solid var(--border-color);
        z-index: 999;
        overflow-y: auto;
    }
    
    .main-nav.open {
        left: 0;
    }
    
    .main-nav .nav-links {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 1.5rem;
    }
    
    .main-nav .nav-link {
        font-size: 1.1rem;
        width: 100%;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    /* Article Detail Layout Adjustment */
    .article-detail-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar-left {
        position: static;
        height: auto;
        overflow-y: visible;
        padding-right: 0;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 2rem;
        margin-bottom: 1rem;
    }
    
    .sidebar-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .sidebar-link {
        font-size: 0.875rem;
        padding: 0.4rem 0.8rem;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        background-color: var(--bg-secondary);
    }
    
    .sidebar-link:hover, .sidebar-link.active {
        padding-left: 0.8rem;
    }
    
    .article-container {
        padding: 1.5rem;
        border-radius: var(--radius-sm);
    }
    
    .article-title-main {
        font-size: 2.25rem;
    }
    
    .contact-form {
        grid-template-columns: 1fr;
    }
    
    .form-group.full-width {
        grid-column: span 1;
    }
    
    .cookie-consent-container {
        flex-direction: column;
        text-align: center;
        gap: 1.25rem;
    }
    
    .cookie-consent-buttons {
        width: 100%;
        justify-content: center;
    }
}

/* --- Small Mobile (Max 480px) --- */
@media screen and (max-width: 480px) {
    .hero-title {
        font-size: 2.25rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
    }
    
    .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .testimonials-grid {
        grid-template-columns: 1fr;
    }
    
    .newsletter-form {
        flex-direction: column;
        width: 100%;
    }
    
    .newsletter-form input {
        width: 100%;
    }
    
    .newsletter-form .btn {
        width: 100%;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: center;
    }
    
    .footer-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .footer-bottom-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .article-title-main {
        font-size: 1.75rem;
    }
    
    .article-nav {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .sitemap-grid {
        grid-template-columns: 1fr;
    }
}
