/* Responsive Design */

/* Large Desktop */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-section h2 {
        font-size: 3rem;
    }
    
    .article-content h1 {
        font-size: 3rem;
    }
}

/* Desktop */
@media (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
    
    .content-wrapper {
        gap: 2rem;
    }
    
    .sidebar {
        width: 280px;
    }
}

/* Tablet */
@media (max-width: 991px) {
    .container {
        max-width: 720px;
        padding: 0 15px;
    }
    
    .content-wrapper {
        display: inline;
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .post-item{
        flex-direction: column;
    }
    .post-item-image{
        width: 100%;
        height: 200px;
    }
    .featured-posts,.recent-posts{
        margin-bottom: 0;
    }
    .sidebar {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .hero-section h2 {
        font-size: 2rem;
    }
    
    .hero-section p {
        font-size: 1.1rem;
    }
    
    .post-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .articles-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1.5rem;
    }
    
    .topics-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .article-navigation {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .nav-next {
        text-align: left;
    }
    
    .filter-buttons {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    .article-content{
        margin-bottom: 1.5rem;
    }
    
}

/* Mobile Large */
@media (max-width: 767px) {
    .container {
        max-width: 540px;
        padding: 0 10px;
    }
    
    .header-content {
        padding: 0.8rem 0;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .nav {
        gap: 1rem;
    }
    
    .header-search {
        order: -1;
    }
    
    .search-form {
        width: 150px;
    }
    
    .nav-list {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: white;
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        gap: 1rem;
    }
    
    .nav-list.active {
        display: flex;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    .hero-section {
        padding: 2rem 1rem;
    }
    
    .hero-section h2 {
        font-size: 1.8rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .page-header h1,
    .page-header h2 {
        font-size: 2rem;
    }
    
    .article-content h1 {
        font-size: 2rem;
    }
    
    .post-grid {
        grid-template-columns: 1fr;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    .meta-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .share-buttons {
        justify-content: center;
    }
    
    .article-body {
        font-size: 1rem;
    }
    
    .article-body .lead {
        font-size: 1.1rem;
    }
    
    .article-body h2 {
        font-size: 1.5rem;
    }
    
    .article-body h3 {
        font-size: 1.3rem;
    }
    .article-body img{
        width: 100%;
    }
    
    .pagination {

    }
    
    .pagination-numbers {
        order: -1;
        width: 100%;
        justify-content: center;
    }
    
    .topics-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-buttons {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .filter-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* Mobile Small */
@media (max-width: 575px) {
    .container {
        padding: 0 8px;
    }
    
    .search-form {
        width: 120px;
    }
    
    .search-input {
        font-size: 0.8rem;
    }
    
    .main {
        padding: 1rem 0;
    }
    
    .hero-section {
        padding: 1.5rem 0.5rem;
        margin-bottom: 2rem;
    }
    
    .hero-section h2 {
        font-size: 1.5rem;
    }
    
    .page-header {
        padding: 1rem 0 2rem;
    }
    
    .page-header h1,
    .page-header h2 {
        font-size: 1.8rem;
    }
    
    .article-content h1 {
        font-size: 1.8rem;
    }
    
    .post-card,
    .article-card {
        margin: 0 -8px;
        border-radius: 0;
    }
    
    .widget {
        padding: 1rem;
    }
    
    .article-body ul,
    .article-body ol {
        padding-left: 1.5rem;
    }
    
    .article-body blockquote {
        margin: 1.5rem -8px;
        padding: 1rem;
        border-radius: 0;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .tag-cloud {
        justify-content: center;
    }
    
    .article-image {
        height: 200px;
        margin-left: -8px;
        margin-right: -8px;
        border-radius: 0;
    }
    
    .breadcrumb {
        font-size: 0.8rem;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 0.5rem;
    }
}

/* Print Styles */
@media print {
    .header,
    .sidebar,
    .footer,
    .share-buttons,
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .main {
        padding: 0;
    }
    
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .article-content {
        max-width: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .article-content h1 {
        font-size: 18pt;
    }
    
    .article-body h2 {
        font-size: 16pt;
    }
    
    .article-body h3 {
        font-size: 14pt;
    }
    
    .article-body {
        font-size: 11pt;
    }
    
    a {
        color: #000 !important;
        text-decoration: underline;
    }
    
    .post-card,
    .article-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

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

/* Reduced Motion */
@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 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #e0e0e0;
        --card-bg: #2d2d2d;
        --border-color: #404040;
    }
    
    /* Uncomment to enable dark mode */
    /*
    body {
        background-color: var(--bg-color);
        color: var(--text-color);
    }
    
    .header {
        background-color: var(--card-bg);
        border-bottom-color: var(--border-color);
    }
    
    .post-card,
    .article-card,
    .widget {
        background-color: var(--card-bg);
        border-color: var(--border-color);
    }
    
    .hero-section {
        background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-color) 100%);
    }
    */
}

/* Focus Styles for Accessibility */
button:focus,
.filter-btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #3498db;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.error {
    color: #e74c3c;
    background-color: #fdf2f2;
    border: 1px solid #fecaca;
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}

/* Success States */
.success {
    color: #059669;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}