/* ================== RESPONSIVE STYLES ================== */

/* Tablet styles */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .articles-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 25px;
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
    
    .nav-right {
        gap: 1.5rem;
    }
    
    .header-social {
        gap: 0.75rem;
    }
    
    .social-icon {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .article-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .article-sidebar {
        order: 2;
    }
    
    .article-body {
        order: 1;
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    /* Navigation */
    .header-social {
        display: none !important;
    }
    
    .categories-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.8rem;
    }
    
    .dropdown-menu {
        right: -10px;
        min-width: 180px;
    }
    
    .mobile-toggle {
        display: flex;
    }
    
    .mobile-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Hero section */
    .hero {
        padding: 100px 0 60px;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    /* Main content */
    .main-content {
        padding: 40px 0;
    }
    
    /* Featured article */
    .article-image {
        height: 250px;
    }
    
    .article-content {
        padding: 20px;
    }
    
    .article-title {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .article-excerpt {
        font-size: 1rem;
    }
    
    /* Articles grid */
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .card-image {
        height: 200px;
    }
    
    .card-content {
        padding: 20px;
    }
    
    .card-title {
        font-size: 1.125rem;
        margin-bottom: 10px;
    }
    
    .card-meta {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }
    
    /* Footer */
    .footer {
        padding: 40px 0 20px;
        margin-top: 60px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    /* Load more button */
    .load-more-btn {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
    
    /* Social links */
    .social-links {
        justify-content: center;
    }
}

/* Article page responsive styles */
@media (max-width: 768px) {
    .article-header {
        padding: 100px 0 40px;
    }
    
    .article-main-title {
        font-size: 2rem;
    }
    
    .article-subtitle {
        font-size: 1.125rem;
    }
    
    .article-header-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .article-stats {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .article-body {
        padding: 20px;
    }
    
    .article-featured-image {
        margin: -20px -20px 30px -20px;
    }
    
    .article-featured-image img {
        height: 250px;
    }
    
    .article-text h2 {
        font-size: 1.5rem;
        margin: 2rem 0 1rem;
    }
    
    .article-text h3 {
        font-size: 1.25rem;
        margin: 1.5rem 0 0.75rem;
    }
    
    .article-text p {
        font-size: 1rem;
        line-height: 1.7;
        margin-bottom: 1.5rem;
        text-align: left;
    }
    
    .article-quote {
        margin: 2rem 0;
        padding: 1.5rem;
    }
    
    .article-quote p {
        font-size: 1.125rem;
        padding-left: 1rem;
    }
    
    .code-example {
        margin: 1.5rem -20px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .code-example pre {
        padding: 1rem;
        font-size: 0.8rem;
    }
    
    .info-box,
    .warning-box {
        margin: 1.5rem -20px;
        border-radius: 0;
        border-left: 4px solid;
        border-right: none;
        border-top: none;
        border-bottom: none;
    }
    
    .sidebar-widget {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .related-articles {
        gap: 15px;
    }
    
    .share-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .share-btn {
        justify-content: center;
        width: 100%;
    }
}

/* Small mobile styles */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .hero {
        padding: 80px 0 40px;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .nav-brand .brand-link {
        font-size: 1.25rem;
    }
    
    .nav-brand .brand-link i {
        font-size: 1.5rem;
    }
    
    .featured-article,
    .article-card {
        margin: 0 -10px;
        border-radius: 0;
    }
    
    .article-content,
    .card-content {
        padding: 15px;
    }
    
    .article-title {
        font-size: 1.375rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    .content-grid {
        gap: 30px;
    }
    
    .load-more-section {
        margin-top: 30px;
    }
    
    .article-main-title {
        font-size: 1.75rem;
    }
    
    .article-body {
        padding: 15px;
        margin: 0 -10px;
        border-radius: 0;
    }
    
    .article-featured-image {
        margin: -15px -15px 20px -15px;
    }
    
    .sidebar-widget {
        margin: 0 -10px 20px -10px;
        border-radius: 0;
        padding: 15px;
    }
    
    .tags-list {
        gap: 6px;
    }
    
    .tag {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
}

/* Print styles */
@media print {
    .header,
    .nav-toggle,
    .load-more-section,
    .footer,
    .back-to-top,
    .share-buttons,
    .article-sidebar {
        display: none;
    }
    
    .hero {
        margin-top: 0;
        background: white;
        color: black;
        padding: 20px 0;
    }
    
    .hero-title,
    .hero-subtitle {
        color: black;
    }
    
    .main-content {
        padding: 0;
    }
    
    .article-main {
        padding: 0;
    }
    
    .article-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .featured-article,
    .article-card,
    .article-body {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
        margin-bottom: 20px;
        background: white;
        color: black;
    }
    
    .article-image,
    .card-image,
    .article-featured-image {
        height: auto;
        max-height: 200px;
    }
    
    .article-main-title,
    .article-title,
    .card-title,
    h1, h2, h3, h4, h5, h6 {
        color: black;
    }
    
    .article-text {
        color: black;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: black;
        background: white;
    }
    
    .article-quote {
        background: #f5f5f5;
        border-left-color: #333;
    }
    
    .code-example {
        background: #f8f8f8;
        border-color: #ddd;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .article-image img,
    .card-image img,
    .article-featured-image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

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

/* Dark mode support (for future use) */
@media (prefers-color-scheme: dark) {
    /* Already using dark theme by default */
}

/* Landscape mobile orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 80px 0 40px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .article-header {
        padding: 80px 0 30px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .nav-link,
    .share-btn,
    .load-more-btn,
    .social-link,
    .tag {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .article-card:hover,
    .featured-article:hover {
        transform: none;
    }
    
    .card-image img,
    .article-image img {
        transition: none;
    }
}