/* 📱 ULTIMATE MOBILE POST PAGE OPTIMIZATION - RESPONSIVE DESIGN */

/* ========================================
   MOBILE FIRST - Base Styles  
======================================== */

/* Hero Section - Mobile Optimized */
@media (max-width: 767px) {

    /* Container padding - reduce for mobile */
    .premium-post-container {
        padding-bottom: 0 !important;
    }

    /* Hero section - less top padding on mobile */
    .premium-post-container>div:nth-child(1) {
        padding-top: 4rem !important;
        /* 64px instead of 128px */
        padding-bottom: 1.5rem !important;
    }

    /* Title - more readable on mobile */
    .premium-post-container h1 {
        font-size: 1.5rem !important;
        /* 24px */
        line-height: 1.3 !important;
        margin-bottom: 1rem !important;
    }

    /* Subtitle/Excerpt */
    .premium-post-container h3 {
        font-size: 1rem !important;
        /* 16px */
        line-height: 1.5 !important;
        margin-bottom: 1.5rem !important;
        padding-left: 1rem !important;
    }

    /* Meta info - stack vertically */
    .premium-post-container .flex-wrap {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
    }

    /* Main image - full width on mobile */
    .premium-post-container>div:nth-child(2) {
        max-width: 100% !important;
        margin-bottom: 1.5rem !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* Content section */
    .premium-post-content {
        font-size: 1rem !important;
        /* 16px instead of 24px */
        line-height: 1.6 !important;
    }

    .premium-post-content p {
        margin-bottom: 1rem !important;
    }

    .premium-post-content h2 {
        font-size: 1.25rem !important;
        /* 20px */
        margin-top: 1.5rem !important;
        margin-bottom: 0.75rem !important;
    }

    .premium-post-content h3 {
        font-size: 1.125rem !important;
        /* 18px */
        margin-top: 1.25rem !important;
        margin-bottom: 0.5rem !important;
    }

    /* AI Summary box - better mobile fit */
    .ai-breakout-wrapper {
        margin-bottom: 1rem !important;
    }

    .ai-breakout-wrapper>div {
        width: 98% !important;
        padding: 0.5rem !important;
    }

    .ai-breakout-wrapper .px-8 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .ai-breakout-wrapper .py-5 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    /* Source button - smaller on mobile */
    .premium-source-button {
        font-size: 0.875rem !important;
        padding: 0.75rem 1.5rem !important;
    }

    /* Tags - smaller and better wrapped */
    .trend-tag-item {
        font-size: 0.75rem !important;
        /* 12px */
        padding: 0.375rem 0.75rem !important;
    }

    /* Related posts - better mobile scroll */
    .related-posts-horizontal-scroll {
        margin-top: 1rem !important;
        padding-top: 1rem !important;
    }

    .related-posts-scroll-container {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* TL;DR Box - mobile compact */
    .tldr-box {
        padding: 1rem !important;
        margin-bottom: 1.5rem !important;
    }

    .tldr-box h4 {
        font-size: 0.875rem !important;
        margin-bottom: 0.75rem !important;
    }

    .tldr-box li {
        font-size: 0.875rem !important;
    }
}

/* ========================================
   TABLET - 768px to 1023px
======================================== */
@media (min-width: 768px) and (max-width: 1023px) {
    .premium-post-container h1 {
        font-size: 2rem !important;
        /* 32px */
    }

    .premium-post-content {
        font-size: 1.125rem !important;
        /* 18px */
    }
}

/* ========================================
   DESKTOP - 1024px and above
======================================== */
@media (min-width: 1024px) {

    /* Main image - 60% width on large screens */
    .premium-post-container>div:nth-child(2) {
        max-width: 60% !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* ========================================
   UTILITY FIXES
======================================== */

/* Fix overflow on mobile */
@media (max-width: 767px) {
    body {
        overflow-x: hidden !important;
    }

    .premium-post-container {
        overflow-x: hidden !important;
    }

    /* Ensure all containers respect mobile width */
    .container {
        max-width: 100% !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Fix wide elements */
    img {
        max-width: 100% !important;
        height: auto !important;
    }

    table {
        width: 100% !important;
        overflow-x: auto !important;
        display: block !important;
    }
}

/* Better scrollbar on mobile */
@media (max-width: 767px) {
    ::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    ::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.1);
    }

    ::-webkit-scrollbar-thumb {
        background: rgba(59, 130, 246, 0.5);
        border-radius: 3px;
    }
}