/* ============================================
   Responsive Design
   ============================================ */

/* Tablets and smaller */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.2rem; }

    /* Navigation */
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: white;
        gap: 0;
        z-index: 999;
        border-bottom: 1px solid var(--border);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-link {
        padding: 1rem 1.5rem;
        border: none;
    }

    .nav-menu > li {
        width: 100%;
    }

    .nav-menu .search-btn,
    .nav-menu .theme-toggle {
        margin: 0.75rem 1.5rem;
    }

    .nav-item-dropdown {
        width: 100%;
    }

    .dropdown-toggle {
        justify-content: space-between;
        width: 100%;
    }

    .dropdown-toggle i {
        transition: transform 0.2s ease;
    }

    .nav-item-dropdown.open .dropdown-toggle i {
        transform: rotate(180deg);
    }

    .dropdown-menu {
        position: static;
        display: none;
        width: 100%;
        min-width: 0;
        border: 0;
        border-top: 1px solid var(--border);
        border-radius: 0;
        box-shadow: none;
        background: var(--background);
    }

    .nav-item-dropdown:hover .dropdown-menu {
        display: none;
    }

    .nav-item-dropdown.open .dropdown-menu {
        display: block;
    }

    .dropdown-menu li a {
        padding: 0.8rem 2.25rem;
    }

    /* Hero */
    .hero {
        padding: 3rem 1.5rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-actions {
        flex-direction: column;
    }

    /* Sections */
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }

    /* Grids */
    .featured-grid,
    .posts-grid,
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    /* Footer */
    .footer-top {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    /* Pagination */
    .pagination {
        gap: 0.25rem;
    }

    .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    /* Scroll to Top */
    .scroll-to-top {
        width: 45px;
        height: 45px;
        bottom: 1rem;
        right: 1rem;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.2rem; }
    h3 { font-size: 1rem; }

    /* Navigation */
    .nav-container {
        height: 60px;
        padding: 0 1rem;
    }

    .nav-logo {
        font-size: 1.1rem;
    }

    .nav-logo span:not(.logo-text),
    .nav-logo img {
        height: 35px;
        width: 35px;
    }

    .logo-text {
        display: none;
    }

    /* Hero */
    .hero {
        padding: 2rem 1rem;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .search-hero {
        height: 2.875rem;
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }

    .hero-actions {
        grid-template-columns: minmax(0, 1fr) 2.875rem;
        max-width: 100%;
    }

    .btn-search {
        width: 2.875rem;
        height: 2.875rem;
        padding: 0;
    }

    .search-modal {
        align-items: flex-start;
        padding: 5.5rem 1rem 1rem;
    }

    .search-container {
        max-height: calc(100vh - 6.5rem);
    }

    .search-input-wrapper {
        grid-template-columns: 1fr 2.875rem;
        padding: 1rem 3.5rem 1rem 1rem;
    }

    .search-input,
    .search-submit,
    .search-form input,
    .search-form button {
        height: 2.875rem;
    }

    .search-submit,
    .search-form button {
        width: 2.875rem;
    }

    .search-page-header {
        padding: 2.5rem 0 2rem;
    }

    .search-form {
        grid-template-columns: minmax(0, 1fr) 2.875rem;
    }

    .search-result {
        padding: 1rem;
    }

    .breadcrumb {
        padding: 0.8rem 0;
    }

    .post-header {
        padding: 2.25rem 0 2rem;
    }

    .post-header-content h1 {
        margin-bottom: 0.85rem;
        font-size: 1.85rem;
        line-height: 1.2;
    }

    .post-header .post-excerpt {
        margin-bottom: 1.15rem;
        font-size: 1rem;
        line-height: 1.65;
    }

    .post-info {
        gap: 0.6rem 0.9rem;
        margin-bottom: 1.1rem;
        font-size: 0.88rem;
    }

    .post-featured-image {
        padding-top: 1.25rem;
    }

    .post-featured-image .featured-image {
        border-radius: 8px;
    }

    .post-content-wrapper {
        padding: 2rem 0 3rem;
    }

    /* Grids */
    .featured-grid,
    .posts-grid {
        gap: 1rem;
    }

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

    /* Post Cards */
    .post-image {
        height: 180px;
    }

    .post-content {
        padding: 1rem;
    }

    .post-category {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }

    /* Buttons */
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    /* Newsletter */
    .newsletter-card {
        padding: 2rem 1rem;
    }

    .newsletter-form {
        flex-direction: column;
    }

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

    /* Forms */
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 0.6rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Comments */
    .guest-input-row,
    .guest-reply-inputs {
        grid-template-columns: 1fr;
    }

    .comment-form-footer {
        flex-direction: column;
    }

    .comment-form-footer button {
        width: 100%;
    }

    .emoji-picker {
        grid-template-columns: repeat(6, 36px);
        max-height: 250px;
    }

    .emoji-textarea-wrapper textarea {
        min-height: 100px;
    }

    .comment-reply {
        margin-left: 0;
    }

    /* Post Layout */
    .post-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .post-sidebar {
        order: -1;
    }

    /* Toast */
    .toast {
        right: 0.5rem;
        left: 0.5rem;
        bottom: 1rem;
    }

    /* Scroll to Top */
    .scroll-to-top {
        width: 40px;
        height: 40px;
        bottom: 0.5rem;
        right: 0.5rem;
    }

    /* Footer */
    .newsletter-notice {
        font-size: 0.8rem;
    }
}

/* Large screens */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }

    .posts-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .featured-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .scroll-to-top,
    .newsletter-section,
    .search-modal {
        display: none;
    }

    body {
        background: white;
    }

    .post-card,
    article {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
