/* ========================================
   ARTICLE 3-COLUMN LAYOUT - FINAL CLEAN VERSION
   All fixes consolidated and organized
   ======================================== */

/* ========================================
   RESPONSIVE LAYOUT
   ======================================== */

/* Mobile: Stack everything */
@media (max-width: 1023px) {
    .article-content-wrapper .grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 2rem !important;
    }
}

/* Desktop: Fluid 3-column that auto-scales */
@media (min-width: 1024px) {
    /* Flexible container */
    .article-single .container {
          max-width: min(95vw, 1600px) !important;
        width: 100% !important;
        margin: 0 auto !important;
        padding: 0 clamp(1rem, 2vw, 2rem) !important;
    }
    
    /* Flexible 3-column grid */
    .article-content-wrapper .grid {
        display: grid !important;
        grid-template-columns: minmax(180px, 15%) minmax(0, 1fr) minmax(240px, 22%) !important;
        gap: clamp(1rem, 2vw, 3rem) !important;
        align-items: start !important;
        max-width: 100% !important;
    }
    
    /* Prevent overflow */
    .article-content-wrapper,
    .article-single {
        overflow-x: hidden !important;
    }
    
    body {
        overflow-x: hidden !important;
    }
}

/* Smaller fonts on narrow screens */
@media (min-width: 1024px) and (max-width: 1279px) {
    .toc-widget,
    .price-tracker-widget,
    .share-widget,
    .top-picks-sidebar {
        font-size: 0.9rem !important;
    }
    
    .top-pick-card {
        padding: 0.75rem !important;
    }
}

/* ========================================
   UNIFIED PAGE SCROLL (NO SIDEBAR SCROLLBARS)
   ======================================== */

.article-sidebar-left,
.top-picks-sidebar,
.article-sidebar-inner {
    position: static !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
}

.article-sidebar-left::-webkit-scrollbar,
.top-picks-sidebar::-webkit-scrollbar {
    display: none !important;
}

.article-content-wrapper .grid > * {
    position: static !important;
    overflow: visible !important;
    height: auto !important;
}

/* ========================================
   TOP PICKS SIDEBAR - FIX CROPPED IMAGES
   ======================================== */

/* Fix trophy/emoji icon size */
.top-picks-sidebar .deal-icon,
.top-picks-sidebar h2 img,
.top-picks-sidebar svg:not(.star),
.top-picks-sidebar .emoji {
    max-width: 40px !important;
    max-height: 40px !important;
    width: 40px !important;
    height: 40px !important;
}

/* Remove aspect-square constraint */
.top-picks-sidebar div.aspect-square,
.top-picks-sidebar .w-full.aspect-square {
    aspect-ratio: auto !important;
    height: auto !important;
    min-height: 240px !important;
}

/* Product images - full, not cropped */
.top-picks-sidebar div.aspect-square img,
.top-picks-sidebar .w-full.aspect-square img,
.top-pick-card img,
.top-picks-sidebar img:not(.emoji) {
    width: 100% !important;
    height: auto !important;
    max-height: 300px !important;
    object-fit: contain !important;
    aspect-ratio: auto !important;
    display: block !important;
}

/* Card height flexibility */
.top-pick-card,
.deal-card {
    height: auto !important;
}
/* ========================================
   HIDE DUPLICATE TOP PICKS IN MAIN CONTENT
   ======================================== */

/* Top Picks should ONLY show in right sidebar, not in article body */
.article-body .article-top-picks,
.article-body section[class*="top-picks"],
.article-body [class*="top-picks-section"],
.article-content .article-top-picks,
.prose .article-top-picks {
    display: none !important;
}
/* ========================================
   ARTICLE CONTENT - BEAUTIFUL IMAGES
   ======================================== */

.article-body img:not(.emoji),
.prose img:not(.emoji) {
    max-width: 750px !important;
    width: auto !important;
    height: auto !important;
    margin: 2rem auto !important;
    display: block !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.wp-block-image {
    margin: 2rem 0 !important;
}

.wp-block-image img {
    max-width: 750px !important;
    margin: 0 auto !important;
}

/* ========================================
   ARTICLE TYPOGRAPHY
   ======================================== */

.article-body,
.prose {
    font-size: 1.125rem !important;
    line-height: 1.8 !important;
    color: #1f2937 !important;
}

.article-body h2,
.prose h2 {
    font-size: 2rem !important;
    font-weight: 800 !important;
    color: #111827 !important;
    margin-top: 3rem !important;
    margin-bottom: 1.25rem !important;
    line-height: 1.3 !important;
}

.article-body h3,
.prose h3 {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #1f2937 !important;
    margin-top: 2.5rem !important;
    margin-bottom: 1rem !important;
}

.article-body p,
.prose p {
    margin-bottom: 1.5rem !important;
    line-height: 1.8 !important;
}

.article-body ul,
.article-body ol,
.prose ul,
.prose ol {
    margin: 1.5rem 0 !important;
    padding-left: 2rem !important;
}

.article-body li,
.prose li {
    margin-bottom: 0.75rem !important;
    line-height: 1.7 !important;
}

.article-body a,
.prose a {
    color: #2563eb !important;
    text-decoration: underline !important;
    font-weight: 500 !important;
    transition: color 0.2s ease !important;
}

.article-body a:hover,
.prose a:hover {
    color: #1d4ed8 !important;
}

.article-body strong,
.prose strong {
    font-weight: 700 !important;
    color: #111827 !important;
}

.article-body blockquote,
.prose blockquote {
    border-left: 4px solid #667eea !important;
    padding-left: 1.5rem !important;
    margin: 2rem 0 !important;
    font-style: italic !important;
    color: #4b5563 !important;
}

/* ========================================
   COMPARISON TABLES
   ======================================== */

.article-body table,
.prose table {
    width: 100% !important;
    margin: 2rem 0 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.article-body thead,
.prose thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.article-body th,
.prose th {
    color: black !important;
    font-weight: 700 !important;
    padding: 1rem !important;
    text-align: left !important;
}

.article-body td,
.prose td {
    padding: 1rem !important;
    border-bottom: 1px solid #e5e7eb !important;
}

.article-body tbody tr:nth-child(even),
.prose tbody tr:nth-child(even) {
    background: #f9fafb !important;
}

.article-body tbody tr:hover,
.prose tbody tr:hover {
    background: #f3f4f6 !important;
}

/* ========================================
   FEATURED PRODUCTS SECTION (BOTTOM)
   ======================================== */

.featured-products img {
    max-width: 180px !important;
    max-height: 180px !important;
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    margin: 0 auto !important;
    border-radius: 8px !important;
}

.featured-products .grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
}

.featured-product-card {
    display: flex !important;
    flex-direction: column !important;
    background: white !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 12px !important;
    padding: 1.5rem !important;
    height: auto !important;
}

.featured-product-card .w-32,
.featured-product-card > a > div {
    width: 100% !important;
    max-width: 180px !important;
    height: auto !important;
    margin: 0 auto 1rem !important;
}

.featured-product-card a[href*="amazon"] {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    padding: 0.75rem 1.5rem !important;
}

/* ========================================
   MOBILE RESPONSIVENESS
   ======================================== */

@media (max-width: 767px) {
    .article-body,
    .prose {
        font-size: 1rem !important;
    }
    
    .article-body h2,
    .prose h2 {
        font-size: 1.5rem !important;
    }
    
    .article-body h3,
    .prose h3 {
        font-size: 1.25rem !important;
    }
    
    .featured-products .grid {
        grid-template-columns: 1fr !important;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .article-sidebar-left,
    .top-picks-sidebar {
        display: none !important;
    }
    
    .article-content-wrapper .grid {
        grid-template-columns: 1fr !important;
    }
}

/* ========================================
   TOP PICKS CARDS - PREMIUM DESIGN
   ======================================== */

/* Card container */
.top-pick-card {
    background: white !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 16px !important;
    padding: 1.25rem !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: visible !important;
}

.top-pick-card:hover {
    border-color: #3b82f6 !important;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.15) !important;
    transform: translateY(-4px) !important;
}

/* Rank badge - make it pop */
.top-pick-card .rank-badge,
.top-pick-card [class*="badge"] {
    position: absolute !important;
    top: -12px !important;
    left: 12px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
    z-index: 10 !important;
}

/* Product image container */
.top-pick-card .product-image,
.top-pick-card > a:first-child {
    display: block !important;
    margin-bottom: 1rem !important;
}

.top-pick-card img {
    width: 100% !important;
    height: auto !important;
    max-height: 240px !important;
    object-fit: contain !important;
    padding: 0.75rem !important;
    background: #f9fafb !important;
    border-radius: 12px !important;
    transition: transform 0.3s ease !important;
}

.top-pick-card:hover img {
    transform: scale(1.05) !important;
}

/* Product title - NO truncation */
.top-pick-card h3,
.top-pick-card .product-title {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #111827 !important;
    line-height: 1.4 !important;
    margin-bottom: 0.75rem !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important; /* Show 3 lines max */
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    min-height: 3.6em !important; /* Reserve space for 3 lines */
}

/* Rating stars */
.top-pick-card .rating,
.top-pick-card [class*="stars"] {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    margin-bottom: 0.75rem !important;
}

.top-pick-card .rating .stars {
    color: #fbbf24 !important;
    font-size: 1rem !important;
}

.top-pick-card .rating .score {
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    color: #6b7280 !important;
}

/* Price section */
.top-pick-card .price-section {
    margin-bottom: 1rem !important;
}

.top-pick-card .current-price {
    font-size: 1.75rem !important;
    font-weight: 800 !important;
    color: #059669 !important;
    line-height: 1 !important;
}

.top-pick-card .original-price {
    font-size: 0.875rem !important;
    color: #9ca3af !important;
    text-decoration: line-through !important;
    margin-left: 0.5rem !important;
}

/* Save badge - make it exciting */
.top-pick-card .save-badge {
    display: inline-block !important;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: white !important;
    padding: 0.25rem 0.75rem !important;
    border-radius: 9999px !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    margin-top: 0.5rem !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3) !important;
}

/* CTA Button - make it irresistible */
.top-pick-card .cta-button,
.top-pick-card a[href*="amazon"] {
    display: block !important;
    width: 100% !important;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
    color: white !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    padding: 0.875rem 1.5rem !important;
    border-radius: 12px !important;
    text-align: center !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3) !important;
    border: none !important;
}

.top-pick-card .cta-button:hover,
.top-pick-card a[href*="amazon"]:hover {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%) !important;
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4) !important;
    transform: translateY(-2px) !important;
}

.top-pick-card .cta-button::after {
    content: ' →' !important;
    margin-left: 0.5rem !important;
}

/* Add subtle divider before button */
.top-pick-card .price-section::after {
    content: '' !important;
    display: block !important;
    height: 1px !important;
    background: linear-gradient(to right, transparent, #e5e7eb, transparent) !important;
    margin: 1rem 0 !important;
}

/* Top Picks Sidebar - Price Alert Button Styling */
.top-picks-sidebar .pc-alert-btn {
    width: 100%;
    padding: 10px 16px;
    font-size: 13px;
    border-radius: 8px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
    border: 2px solid #f59e0b !important;
    color: #92400e !important;
}

.top-picks-sidebar .pc-alert-btn:hover {
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%) !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.top-picks-sidebar .pc-alert-icon {
    width: 16px;
    height: 16px;
}

.top-picks-sidebar .pc-alert-count {
    font-size: 10px;
    padding: 2px 5px;
}
/* ========================================
   END OF ARTICLE 3-COLUMN LAYOUT
   ======================================== */