/**
 * Advanced Responsive Styles
 * Mobile-first responsive design
 */

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

/* Mobile (Default - 320px to 767px) */
body {
    font-size: 16px;
}

.container {
    padding: 0 1rem;
}

/* Hero Section Mobile */
.hero-section {
    height: 350px !important;
    margin: 1rem 0 2rem !important;
}

.hero-content {
    padding: 1.5rem !important;
}

.hero-title {
    font-size: 1.75rem !important;
    line-height: 1.3 !important;
}

.hero-excerpt {
    font-size: 0.95rem !important;
    margin-bottom: 1rem !important;
}

.hero-meta {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
}

/* Posts Grid Mobile */
.posts-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
}

.post-card.featured-large {
    grid-column: span 1 !important;
}

.post-card-title {
    font-size: 1.25rem !important;
}

/* Breaking News Ticker Mobile */
.breaking-news-ticker::before {
    font-size: 0.7rem;
    padding: 0.4rem 0.75rem;
    letter-spacing: 0.5px;
}

.ticker-wrapper {
    margin-left: 90px;
}

.ticker-item {
    padding: 0 2rem;
    font-size: 0.9rem;
}

/* Social Share Mobile */
.social-share-wrapper {
    position: static !important;
    margin-bottom: 2rem;
}

.social-share-buttons {
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 0.5rem !important;
}

.social-share-button {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 140px;
    font-size: 0.8rem;
    padding: 0.6rem;
}

/* Sidebar Mobile */
.content-wrapper {
    flex-direction: column !important;
}

.sidebar,
.single-sidebar {
    width: 100% !important;
    margin-top: 2rem;
}

/* Related Posts Mobile */
.related-posts {
    padding: 1.5rem;
}

.related-posts-title {
    font-size: 1.5rem;
}

.related-posts-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
}

/* Widgets Mobile */
.widget {
    padding: 1.25rem;
}

.widget-title {
    font-size: 1.125rem;
}

/* Trending Posts Widget Mobile */
.trending-post-number {
    font-size: 1.5rem;
    min-width: 30px;
}

.trending-post-content h4 {
    font-size: 0.9rem;
}

/* Newsletter Widget Mobile */
.newsletter-form {
    flex-direction: column;
    gap: 0.75rem;
}

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

/* Comments Mobile */
.comments-area {
    padding: 1.5rem;
}

.comment {
    padding: 1rem;
}

/* Dark Mode Toggle Mobile */
.dark-mode-toggle {
    bottom: 15px !important;
    right: 15px !important;
    width: 50px !important;
    height: 50px !important;
}

.dark-mode-toggle svg {
    width: 24px !important;
    height: 24px !important;
}

/* Back to Top Mobile */
.back-to-top {
    bottom: 75px !important;
    right: 15px !important;
    width: 45px !important;
    height: 45px !important;
}

/* Breadcrumbs Mobile */
.breadcrumbs {
    font-size: 0.8rem;
    padding: 0.75rem 0;
}

/* Pagination Mobile */
.pagination {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pagination a,
.pagination span {
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
}

/* ============================================
   TABLET - 768px to 1023px
   ============================================ */
@media (min-width: 768px) {
    
    .container {
        padding: 0 2rem;
    }
    
    /* Hero Section Tablet */
    .hero-section {
        height: 450px !important;
    }
    
    .hero-content {
        padding: 2.5rem !important;
    }
    
    .hero-title {
        font-size: 2.5rem !important;
    }
    
    .hero-excerpt {
        font-size: 1.125rem !important;
    }
    
    .hero-meta {
        flex-direction: row !important;
        gap: 1.5rem !important;
    }
    
    /* Posts Grid Tablet */
    .posts-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2rem;
    }
    
    .post-card.featured-large {
        grid-column: span 2 !important;
    }
    
    .post-card-title {
        font-size: 1.35rem !important;
    }
    
    /* Breaking News Tablet */
    .ticker-wrapper {
        margin-left: 120px;
    }
    
    .ticker-item {
        font-size: 0.95rem;
    }
    
    /* Social Share Tablet */
    .social-share-wrapper {
        position: sticky !important;
        top: 100px;
    }
    
    .social-share-buttons {
        flex-direction: column !important;
    }
    
    .social-share-button {
        flex: 1;
        min-width: auto;
    }
    
    /* Content Wrapper Tablet */
    .content-wrapper {
        flex-direction: row !important;
        gap: 2rem !important;
    }
    
    .sidebar {
        width: 300px !important;
    }
    
    .single-sidebar {
        width: 280px !important;
    }
    
    /* Related Posts Tablet */
    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Dark Mode Toggle Tablet */
    .dark-mode-toggle {
        bottom: 25px !important;
        right: 25px !important;
        width: 55px !important;
        height: 55px !important;
    }
    
    /* Back to Top Tablet */
    .back-to-top {
        bottom: 90px !important;
        right: 25px !important;
        width: 48px !important;
        height: 48px !important;
    }
}

/* ============================================
   DESKTOP - 1024px to 1439px
   ============================================ */
@media (min-width: 1024px) {
    
    /* Hero Section Desktop */
    .hero-section {
        height: 550px !important;
    }
    
    .hero-title {
        font-size: 3rem !important;
    }
    
    /* Posts Grid Desktop */
    .posts-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .post-card.featured-large .post-card-title {
        font-size: 2.25rem !important;
    }
    
    /* Sidebar Desktop */
    .sidebar {
        width: 320px !important;
    }
    
    /* Related Posts Desktop */
    .related-posts-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    /* Categories Grid */
    .categories-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* ============================================
   LARGE DESKTOP - 1440px and above
   ============================================ */
@media (min-width: 1440px) {
    
    .container {
        max-width: 1400px;
        padding: 0 2.5rem;
    }
    
    /* Hero Section Large */
    .hero-section {
        height: 600px !important;
    }
    
    .hero-title {
        font-size: 3.5rem !important;
    }
    
    /* Sidebar Large */
    .sidebar {
        width: 380px !important;
    }
    
    .single-sidebar {
        width: 300px !important;
    }
}

/* ============================================
   EXTRA LARGE SCREENS - 1920px and above
   ============================================ */
@media (min-width: 1920px) {
    
    .container {
        max-width: 1600px;
    }
    
    body {
        font-size: 18px;
    }
}

/* ============================================
   LANDSCAPE MOBILE PHONES
   ============================================ */
@media (max-width: 767px) and (orientation: landscape) {
    
    .hero-section {
        height: 300px !important;
    }
    
    .hero-title {
        font-size: 1.5rem !important;
    }
    
    .hero-excerpt {
        display: none;
    }
}

/* ============================================
   TOUCH DEVICES - Hover Effects
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    
    /* Disable complex hover effects on touch devices */
    .post-card:hover {
        transform: none;
    }
    
    .post-card:active {
        transform: scale(0.98);
    }
    
    .category-card:hover {
        transform: none;
    }
    
    .category-card:active {
        transform: scale(0.98);
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    
    /* Hide non-essential elements */
    .dark-mode-toggle,
    .back-to-top,
    .breaking-news-ticker,
    .social-share-wrapper,
    .newsletter-widget,
    .sidebar,
    .breadcrumbs,
    .pagination,
    .comments-area,
    .related-posts {
        display: none !important;
    }
    
    /* Optimize content for printing */
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
    }
    
    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    .post-card,
    .widget {
        page-break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd;
    }
    
    a {
        text-decoration: underline;
        color: black !important;
    }
    
    /* Show URLs for links */
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.9em;
        color: #666;
    }
}

/* ============================================
   ACCESSIBILITY - Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .ticker-wrapper {
        animation: none !important;
    }
}

/* ============================================
   HIGH CONTRAST MODE
   ============================================ */
@media (prefers-contrast: high) {
    
    :root {
        --text-primary: #000000;
        --text-secondary: #333333;
        --border-color: #000000;
    }
    
    .post-card,
    .widget {
        border: 2px solid black;
    }
}

/* ============================================
   DARK COLOR SCHEME PREFERENCE
   ============================================ */
@media (prefers-color-scheme: dark) {
    
    /* Auto dark mode if user hasn't set preference */
    body:not(.dark-mode-set) {
        background: var(--dark-bg-primary);
        color: var(--dark-text-primary);
    }
}
