/**
 * Dietary Theme Responsive Styles - Modern Design
 */

/* ==========================================================================
   Desktop - Large Screens (1440px+)
   ========================================================================== */

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

    .hero-content {
        max-width: 860px;
    }
}

/* ==========================================================================
   Laptop - Max Width 1280px
   ========================================================================== */

@media (max-width: 1280px) {
    .recipe-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* ==========================================================================
   Tablet - Max Width 1024px
   ========================================================================== */

@media (max-width: 1024px) {
    /* Typography adjustments */
    html {
        font-size: 15px;
    }

    .container {
        padding: 0 32px;
    }

    /* Layout */
    .site-content .container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        margin-top: 60px;
    }

    /* Hero */
    .hero-section {
        min-height: 70vh;
    }

    .hero-overlay {
        padding: 100px 0;
    }

    /* Recipe Grid */
    .recipe-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 28px;
    }

    /* Sections */
    .featured-recipes,
    .cta-section {
        padding: 80px 0;
    }

    .about-section {
        padding: 80px 0;
        margin: 80px 0;
    }
}

/* ==========================================================================
   Tablet - Max Width 768px
   ========================================================================== */

@media (max-width: 768px) {
    /* Typography */
    html {
        font-size: 14px;
    }

    .container {
        padding: 0 20px;
    }

    /* Section padding - all consistent */
    .hero-section,
    .featured-recipes,
    .cta-section,
    .about-section {
        padding: 60px 20px;
    }

    .hero-section {
        min-height: 400px;
    }

    /* Header */
    .header-main {
        padding: 16px 0;
    }

    .header-inner {
        gap: 16px;
    }

    .site-title {
        font-size: 1.25rem;
    }

    /* Mobile Navigation */
    .menu-toggle {
        display: flex;
        z-index: 1001;
    }

    .main-navigation {
        position: relative;
    }

    .nav-menu {
        display: none;
        position: fixed;
        top: 70px;
        left: 16px;
        right: 16px;
        background: #ffffff;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
        border-radius: 12px;
        margin: 0;
        padding: 20px;
        z-index: 1000;
        flex-direction: column;
        gap: 0;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }

    .main-navigation.toggled .nav-menu {
        display: flex !important;
    }

    .nav-menu ul {
        display: flex;
        flex-direction: column;
    }

    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid var(--color-border);
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-menu a {
        padding: 16px 12px;
        display: block;
    }

    .nav-menu a::after {
        display: none;
    }

    .nav-menu .sub-menu {
        position: static;
        box-shadow: none;
        background: var(--color-bg-alt);
        padding: 12px;
        margin: 8px 0;
        border-radius: 8px;
    }

    /* Hero */
    .hero-section {
        min-height: 60vh;
    }

    .hero-overlay {
        padding: 80px 0;
    }

    .hero-tags {
        gap: 8px;
        margin-bottom: 24px;
    }

    .hero-tag {
        padding: 6px 12px;
        font-size: 0.8125rem;
    }

    .hero-cta {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .hero-cta .btn {
        width: 100%;
        justify-content: center;
    }

    /* CTA Section */
    .cta-section {
        padding: 60px 0;
    }

    .benefits-list {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .benefits-list li {
        padding: 24px 20px;
    }

    .newsletter-fallback {
        flex-direction: column;
        gap: 12px;
    }

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

    /* Recipe Grid */
    .recipe-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 24px;
    }

    .posts-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 32px;
    }

    /* Remove old section styles - now handled above */

    /* Single Post */
    .entry-title {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
    }

    .entry-meta {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .entry-content {
        font-size: 1rem;
    }

    .post-cta {
        padding: 32px 24px;
    }

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

    /* Social Share */
    .social-share-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .share-btn {
        width: 100%;
        justify-content: center;
    }

    /* Footer */
    .footer-newsletter {
        padding: 60px 0;
    }

    .footer-widgets {
        padding: 60px 0;
    }

    .footer-widget-area {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 12px;
    }

    .footer-nav {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    /* Page Header */
    .page-header {
        text-align: center;
        margin-bottom: 40px;
    }

    .page-description {
        margin-top: 12px;
    }

    /* Blog Cards */
    .blog-card {
        display: flex;
        flex-direction: column;
    }
}

/* ==========================================================================
   Mobile - Max Width 480px
   ========================================================================== */

@media (max-width: 480px) {
    /* Container */
    .container {
        padding: 0 16px;
    }

    /* Section padding */
    .hero-section {
        padding: 24px 16px !important;
        min-height: auto !important;
    }

    .featured-recipes,
    .cta-section,
    .about-section {
        padding: 48px 16px;
    }

    /* Hero mobile adjustments */
    .hero-overlay {
        padding: 0 !important;
    }

    .hero-content {
        text-align: left !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .hero-tags {
        display: none !important;
    }

    .hero-content h1 {
        font-size: 1.5rem !important;
        margin-bottom: 0.75rem !important;
        line-height: 1.2 !important;
    }

    .hero-subtitle {
        font-size: 0.875rem !important;
        margin-bottom: 1.25rem !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        line-height: 1.5 !important;
    }

    .hero-cta {
        justify-content: flex-start !important;
        flex-direction: column !important;
        gap: 12px !important;
    }

    .hero-cta .btn {
        width: 100%;
    }

    /* Typography */
    body {
        font-size: 0.9375rem;
    }

    /* Header */
    .site-title {
        font-size: 1.125rem;
    }

    .header-main {
        padding: 12px 0;
    }

    /* Hero */
    .hero-section {
        min-height: 50vh;
    }

    .hero-overlay {
        padding: 60px 0;
    }

    .hero-tags {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Buttons */
    .btn {
        padding: 14px 24px;
        font-size: 0.9375rem;
    }

    /* Remove old section styles - now standardized above */

    .benefits-list li {
        padding: 20px 16px;
    }

    .section-title {
        margin-bottom: 32px;
    }

    /* Recipe Cards */
    .recipe-card {
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    }

    .recipe-content {
        padding: 20px;
    }

    /* Single Post */
    .entry-header {
        margin-bottom: 2rem;
    }

    .entry-categories {
        margin-bottom: 16px;
    }

    .category-badge {
        font-size: 0.8125rem;
        padding: 4px 12px;
    }

    .post-cta {
        padding: 28px 20px;
    }

    .cta-box h3 {
        font-size: 1.5rem;
    }

    /* Footer */
    .footer-newsletter {
        padding: 48px 0;
    }

    .newsletter-content h3 {
        font-size: 1.75rem;
    }

    .footer-widgets {
        padding: 48px 0;
    }

    .site-info {
        padding: 24px 0;
    }

    /* Comments */
    .comment {
        padding: 20px;
    }

    .comment-form input,
    .comment-form textarea {
        padding: 14px 16px;
    }

    /* Pagination */
    .pagination {
        gap: 6px;
    }

    .pagination .page-numbers {
        min-width: 40px;
        height: 40px;
        font-size: 0.875rem;
    }

    /* Back to Top */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .site-header,
    .main-navigation,
    .sidebar,
    .site-footer,
    .post-cta,
    .social-share-wrapper,
    .related-posts,
    .comments-area,
    .back-to-top {
        display: none;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    .entry-content img {
        max-width: 100%;
        page-break-inside: avoid;
    }

    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
}

/* ==========================================================================
   Accessibility & Preferences
   ========================================================================== */

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

/* High contrast mode */
@media (prefers-contrast: high) {
    body {
        background: #fff;
        color: #000;
    }

    a {
        color: #0000ff;
        text-decoration: underline;
    }

    .btn {
        border: 2px solid #000;
    }

    .recipe-card,
    .blog-card,
    .widget {
        border: 2px solid #000;
    }
}

/* Dark mode preferences */
@media (prefers-color-scheme: dark) {
    /* Optional: Add dark mode support if desired */
}

/* ==========================================================================
   Additional Utility Responsive Classes
   ========================================================================== */

/* Hide on mobile */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Hide on desktop */
@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Text alignment utilities */
@media (max-width: 768px) {
    .text-center-mobile {
        text-align: center !important;
    }
}

/* Spacing adjustments for small screens */
@media (max-width: 480px) {
    .mt-mobile-sm {
        margin-top: 1rem !important;
    }

    .mb-mobile-sm {
        margin-bottom: 1rem !important;
    }
}
