/* ============================================
   RESPONSIVE — TechBlog 2.0
   ============================================ */

/* ---- Mobile (up to 768px) ---- */
@media screen and (max-width: 768px) {
    :root {
        --container-padding: 1rem;
    }

    .nav-center {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background-color: var(--bg-card);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: var(--space-4) 0;
        z-index: 99;
    }
    .nav-center.active { display: flex; }

    .nav-link {
        padding: var(--space-3) var(--space-6);
        border-radius: 0;
        font-size: var(--text-base);
    }

    .hamburger { display: flex; }
    .hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
    .hamburger.active span:nth-child(2) { opacity: 0; }
    .hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

    .hero { padding: var(--space-12) 0 var(--space-10); }
    .hero-content h1 { font-size: clamp(1.75rem, 6vw, 2.25rem); }

    .search-bar { flex-direction: column; }
    .search-input, .search-btn { width: 100%; }

    .categories-grid, .hero-topics { flex-wrap: wrap; }

    .featured-post { grid-template-columns: 1fr; }
    .featured-post-image { min-height: 200px; }
    .featured-post-content { padding: var(--space-5); }

    .posts-grid { grid-template-columns: 1fr; }

    .footer-content { grid-template-columns: 1fr; gap: var(--space-6); }

    .contact-wrapper { grid-template-columns: 1fr; gap: var(--space-8); }
    .contact-form { order: -1; }

    .about-topics { grid-template-columns: 1fr; }

    .newsletter-form { flex-direction: column; }
    .newsletter-form input, .newsletter-form button { width: 100%; }

    .post-meta { flex-direction: column; gap: var(--space-2); }

    .author-bio { flex-direction: column; text-align: center; align-items: center; }

    .share-buttons { flex-direction: column; }
    .share-btn { text-align: center; }

    .filters-section { top: 56px; }
    .filters-bar { flex-direction: column; align-items: stretch; gap: var(--space-3); }
    .filter-group { flex-direction: row; justify-content: space-between; }
    .filter-group select { flex: 1; }
    .categories-filter { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: var(--space-2); -webkit-overflow-scrolling: touch; }

    .breadcrumb { font-size: var(--text-xs); flex-wrap: wrap; }
}

/* ---- Tablet (769-1024px) ---- */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .posts-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-content { grid-template-columns: repeat(2, 1fr); }
    .contact-wrapper { grid-template-columns: 1fr 1fr; }
}

/* ---- Desktop (1025-1440px) ---- */
@media screen and (min-width: 1025px) and (max-width: 1440px) {
    :root { --container-max: 1080px; }
    .posts-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Large (1441px+) ---- */
@media screen and (min-width: 1441px) {
    :root { --container-max: 1320px; }
    .posts-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Very Small (< 480px) ---- */
@media screen and (max-width: 480px) {
    .category-filter-btn { flex: 1; text-align: center; }
    .featured-post-meta { flex-direction: column; gap: var(--space-1); }
}

/* ---- Touch devices ---- */
@media (hover: none) and (pointer: coarse) {
    button, a, .category-card, .blog-card { min-height: 44px; }
    .blog-card:hover { transform: none; }
    .category-card:hover { transform: none; }
}

/* ---- Landscape mobile ---- */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .hero { padding: var(--space-6) 0; }
    .navbar .nav-container { height: 52px; }
    .reading-progress { top: 52px; }
}
