/**
 * DaNi Puzzle Article Page Styles - IMPROVED VERSION
 *
 * Design Improvements:
 * 1. Fixed typography hierarchy (removed duplicate H1)
 * 2. Selective emoji stars (only on key sections)
 * 3. Handcrafted warmth added to content boxes
 * 4. CTA hierarchy and variety
 * 5. Product cards with images and badges
 * 6. Mobile-optimized padding (70% traffic priority)
 * 7. Gift psychology emphasized in tables
 *
 * Matches main site aesthetic: Playful, handcrafted, emotional
 */

/* ============================================
   1. ARTICLE HERO SECTION - IMPROVED
   ============================================ */

.article-hero {
    background: linear-gradient(135deg, #FF1493, #FF69B4);
    color: white;
    padding: 100px 0 60px; /* Reduced from 120px - less wasteful */
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
}

.article-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(138, 43, 226, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

/* FIX: Hero title should NOT have stars - it's the page title */
.article-title {
    font-family: 'Amatic SC', cursive;
    font-size: clamp(2.5rem, 6vw, 4.5rem); /* Slightly smaller for better mobile */
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.3);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.95);
    font-family: 'Caveat', cursive;
    font-size: 1.3rem;
}

/* ============================================
   2. ARTICLE CONTENT AREA - HANDCRAFTED WARMTH
   ============================================ */

.article-content-wrapper {
    background: linear-gradient(135deg, #FFF5F7 0%, #FFFFFF 50%); /* Softer background */
    padding: 60px 0 80px;
    position: relative;
}

/* Wavy divider between hero and content */
.article-content-wrapper::before {
    content: '';
    position: absolute;
    top: -30px;
    left: 0;
    right: 0;
    height: 30px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 30"><path fill="%23FFF5F7" d="M0,10 Q300,25 600,10 T1200,10 L1200,30 L0,30 Z"/></svg>') no-repeat;
    background-size: cover;
}

.article-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 50px 60px;
    background: white;
    border-radius: 25px;
    box-shadow:
        0 20px 60px rgba(255, 20, 147, 0.08),
        0 0 0 3px rgba(255, 20, 147, 0.05); /* Subtle pink border glow */
    position: relative;
}

/* Handcrafted corner decorations */
.article-content::before,
.article-content::after {
    content: '✦';
    position: absolute;
    font-size: 2rem;
    color: rgba(255, 20, 147, 0.2);
    font-family: 'Amatic SC', cursive;
}

.article-content::before {
    top: 20px;
    left: 20px;
}

.article-content::after {
    bottom: 20px;
    right: 20px;
    content: '✧';
}

/* ============================================
   3. TYPOGRAPHY SYSTEM - IMPROVED HIERARCHY
   ============================================ */

/* FIX: First H1 in content should be visually REMOVED/HIDDEN
   (it's duplicate of hero title) */
.article-content > h1:first-of-type {
    display: none; /* Hide duplicate H1 */
}

/* H2 - Only add stars to KEY sections, not all */
.article-content h2 {
    font-family: 'Amatic SC', cursive;
    font-size: 2.8rem;
    font-weight: 700;
    color: #FF1493;
    line-height: 1.3;
    margin-top: 50px;
    margin-bottom: 25px;
    position: relative;
}

/* Remove default stars from ALL h2 */
.article-content h2::after {
    display: none;
}

/* Add stars ONLY to h2 containing "★★★" in text */
.article-content h2:has-text("★★★")::after,
.article-content h2[data-highlight]::after {
    content: '✦ ✦ ✦';
    display: block;
    font-size: 0.9rem;
    color: #FF69B4;
    margin-top: 12px;
    letter-spacing: 8px;
    text-align: center;
}

/* H3 - Softer purple, playful */
.article-content h3 {
    font-family: 'Amatic SC', cursive;
    font-size: 2rem;
    font-weight: 700;
    color: #8A2BE2;
    line-height: 1.4;
    margin-top: 35px;
    margin-bottom: 18px;
    position: relative;
    padding-left: 25px;
}

/* Fun arrow before H3 */
.article-content h3::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #FF69B4;
    font-size: 1.5rem;
}

/* Paragraphs - Better readability */
.article-content p {
    font-family: 'Nunito', sans-serif;
    font-size: 1.15rem; /* Slightly larger */
    line-height: 1.85; /* More breathing room */
    color: #333;
    margin-bottom: 28px;
}

/* Lead paragraph - Introduction emphasis */
.article-content > p:first-of-type,
.article-content .lead {
    font-size: 1.3rem;
    line-height: 1.8;
    color: #444;
    font-weight: 400;
    margin-bottom: 40px;
    padding-bottom: 35px;
    border-bottom: 3px dashed #FF69B4; /* Handcrafted dashed border */
    position: relative;
}

/* Heart decoration on lead paragraph border */
.article-content > p:first-of-type::after,
.article-content .lead::after {
    content: '♥';
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    color: #FF1493;
    padding: 0 15px;
    font-size: 1.5rem;
}

/* ============================================
   4. CTA HIERARCHY - IMPROVED VARIETY
   ============================================ */

/* Primary CTA (main article CTA) */
.article-cta-box {
    background: linear-gradient(135deg, #FF1493, #FF69B4);
    color: white;
    border-radius: 30px;
    padding: 45px 40px;
    margin: 60px 0;
    text-align: center;
    box-shadow: 0 20px 50px rgba(255, 20, 147, 0.35);
    position: relative;
    overflow: hidden;
}

/* Sparkle decoration */
.article-cta-box::before {
    content: '✨';
    position: absolute;
    top: 15px;
    right: 30px;
    font-size: 2.5rem;
    opacity: 0.4;
}

.article-cta-box h3 {
    color: white;
    margin-top: 0;
    margin-bottom: 18px;
    font-size: 2.8rem;
    padding-left: 0; /* Remove h3 padding */
}

.article-cta-box h3::before {
    display: none; /* Remove arrow */
}

.article-cta-box h3::after {
    display: none;
}

.article-cta-box p {
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 30px;
    font-size: 1.15rem;
}

.article-cta-button {
    display: inline-block;
    background: white;
    color: #FF1493;
    padding: 20px 45px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    font-family: 'Nunito', sans-serif;
}

.article-cta-button:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    background: #FFF5F7;
}

/* Secondary inline CTAs (within content) */
.article-content a[href*="wa.me"] {
    display: inline-block;
    background: linear-gradient(135deg, #25D366, #128C7E); /* WhatsApp green */
    color: white;
    padding: 14px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    margin: 20px 0;
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.3);
}

.article-content a[href*="wa.me"]::after {
    display: none; /* Remove underline effect */
}

.article-content a[href*="wa.me"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(37, 211, 102, 0.5);
    background: linear-gradient(135deg, #2EE276, #149E88);
    color: white;
}

/* Tertiary text links (regular article links) */
.article-content a:not([href*="wa.me"]) {
    color: #FF1493;
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
    font-weight: 600;
    border-bottom: 2px dotted rgba(255, 20, 147, 0.4); /* Dotted underline */
}

.article-content a:not([href*="wa.me"]):hover {
    color: #8A2BE2;
    border-bottom-color: rgba(138, 43, 226, 0.6);
}

.article-content a:not([href*="wa.me"])::after {
    display: none; /* Remove animated underline */
}

/* ============================================
   5. TABLES - GIFT PSYCHOLOGY EMPHASIS
   ============================================ */

.article-content table {
    width: 100%;
    margin: 40px 0;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    border: 3px solid #FF69B4;
}

.article-content table thead {
    background: linear-gradient(135deg, #FF1493, #FF69B4);
    color: white;
}

.article-content table thead th {
    padding: 20px;
    text-align: left;
    font-family: 'Amatic SC', cursive;
    font-weight: 700;
    font-size: 1.4rem;
    text-align: center;
}

.article-content table tbody tr {
    border-bottom: 2px dashed #FFF0F5;
    transition: all 0.3s ease;
}

/* A4 row highlight (42.3% most popular) */
.article-content table tbody tr:nth-child(2) {
    background: linear-gradient(135deg, #FFF0F5, #FFFFFF);
    position: relative;
}

/* "Most Popular" badge for A4 row */
.article-content table tbody tr:nth-child(2) td:first-child::after {
    content: '⭐ Самый популярный';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.article-content table tbody tr:hover {
    background: #FFF5F7;
    transform: scale(1.01);
}

.article-content table tbody td {
    padding: 18px 20px;
    font-size: 1.05rem;
    color: #333;
    text-align: center;
}

.article-content table tbody td:first-child {
    font-weight: 700;
    color: #FF1493;
    font-size: 1.1rem;
    text-align: left;
    position: relative;
}

/* ============================================
   6. LISTS - HANDCRAFTED BULLETS
   ============================================ */

.article-content ul,
.article-content ol {
    margin: 30px 0;
    padding-left: 0;
    list-style: none;
}

.article-content ul li,
.article-content ol li {
    position: relative;
    padding-left: 45px;
    margin-bottom: 18px;
    font-size: 1.15rem;
    line-height: 1.8;
}

/* Pink gradient heart bullets */
.article-content ul li::before {
    content: '♥';
    position: absolute;
    left: 0;
    top: 3px;
    font-size: 1.3rem;
    color: #FF1493;
}

/* Checkmark for positive lists */
.article-content ul.checklist li::before,
.article-content ul li:has-text("✓")::before {
    content: '✓';
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    top: 5px;
}

/* Numbered lists with gradient circles */
.article-content ol {
    counter-reset: article-counter;
}

.article-content ol li::before {
    counter-increment: article-counter;
    content: counter(article-counter);
    position: absolute;
    left: 0;
    top: 5px;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #FF1493, #FF69B4);
    border-radius: 50%;
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-family: 'Nunito', sans-serif;
    box-shadow: 0 4px 12px rgba(255, 20, 147, 0.3);
}

/* ============================================
   7. PRODUCT CARDS - WITH IMAGES & BADGES
   ============================================ */

.article-related {
    margin-top: 60px;
}

.article-related-title {
    font-family: 'Amatic SC', cursive;
    font-size: 3.2rem;
    font-weight: 700;
    color: #FF1493;
    text-align: center;
    margin-bottom: 45px;
}

.article-related-title::after {
    content: '✦ ✦ ✦';
    display: block;
    font-size: 1.2rem;
    color: #FF69B4;
    margin-top: 15px;
    letter-spacing: 10px;
}

.article-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.related-article-card {
    background: white;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
    text-decoration: none;
    display: block;
    border: 3px solid transparent;
    position: relative;
}

/* A4 card gets "Most Popular" badge */
.related-article-card:nth-child(1)::before {
    content: '⭐ ХИТ ПРОДАЖ';
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
    font-family: 'Nunito', sans-serif;
}

.related-article-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 60px rgba(255, 20, 147, 0.25);
    border-color: #FF69B4;
}

/* Product image placeholder */
.related-article-card::after {
    content: '🧩';
    display: block;
    font-size: 5rem;
    text-align: center;
    padding: 40px 0 20px;
    background: linear-gradient(135deg, #FFF5F7, #FFF);
}

.related-article-content {
    padding: 30px;
    text-align: center;
}

.related-article-content h3 {
    font-family: 'Amatic SC', cursive;
    font-size: 3rem;
    color: #FF1493;
    margin: 0 0 15px 0;
    padding-left: 0;
}

.related-article-content h3::before {
    display: none; /* Remove arrow */
}

/* Price styling */
.related-article-content > div:first-of-type {
    font-family: 'Amatic SC', cursive;
    font-size: 2.8rem;
    font-weight: 700;
    color: #FF1493;
    margin-bottom: 20px;
}

.related-article-content p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* Button in product cards */
.related-article-content .article-button {
    display: inline-block;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    padding: 14px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.3);
    font-size: 1.05rem;
}

.related-article-content .article-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(37, 211, 102, 0.5);
    color: white;
}

/* ============================================
   8. BLOCKQUOTES - TESTIMONIAL STYLE
   ============================================ */

.article-content blockquote {
    font-family: 'Caveat', cursive;
    font-size: 1.6rem;
    font-style: italic;
    color: #8A2BE2;
    margin: 45px 0;
    padding: 35px 45px;
    background: linear-gradient(135deg, #F0E6FF, #FFF);
    border-left: 6px solid #8A2BE2;
    border-radius: 0 20px 20px 0;
    position: relative;
    box-shadow: 0 10px 30px rgba(138, 43, 226, 0.1);
}

.article-content blockquote::before {
    content: '"';
    font-family: 'Amatic SC', cursive;
    font-size: 6rem;
    color: rgba(138, 43, 226, 0.15);
    position: absolute;
    top: -5px;
    left: 15px;
    line-height: 1;
}

.article-content blockquote p {
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

/* ============================================
   9. MOBILE OPTIMIZATION (70% TRAFFIC!)
   ============================================ */

@media (max-width: 768px) {
    /* Hero - Reduced padding for mobile */
    .article-hero {
        padding: 80px 0 50px;
    }

    .article-title {
        font-size: 2.2rem;
        line-height: 1.25;
    }

    .article-meta {
        gap: 12px;
        font-size: 1.1rem;
    }

    /* Content - GENEROUS mobile padding */
    .article-content {
        padding: 35px 25px; /* More generous than before */
        border-radius: 20px;
        margin: 0 15px; /* Side margins for breathing room */
    }

    /* Typography - Mobile sizes */
    .article-content h2 {
        font-size: 2.3rem;
        margin-top: 40px;
        margin-bottom: 20px;
    }

    .article-content h3 {
        font-size: 1.8rem;
        margin-top: 30px;
    }

    .article-content p {
        font-size: 1.08rem;
        line-height: 1.8;
        margin-bottom: 25px;
    }

    /* Lead paragraph */
    .article-content > p:first-of-type,
    .article-content .lead {
        font-size: 1.2rem;
        padding-bottom: 30px;
        margin-bottom: 35px;
    }

    /* Lists - Better mobile spacing */
    .article-content ul li,
    .article-content ol li {
        padding-left: 40px;
        font-size: 1.08rem;
        margin-bottom: 16px;
    }

    /* Tables - Horizontal scroll */
    .article-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 0.95rem;
    }

    .article-content table thead th,
    .article-content table tbody td {
        padding: 14px 12px;
        font-size: 0.95rem;
    }

    /* Hide "Most Popular" badge on mobile (too cramped) */
    .article-content table tbody tr:nth-child(2) td:first-child::after {
        display: none;
    }

    /* CTAs - Full width on mobile */
    .article-cta-box {
        padding: 35px 25px;
        border-radius: 20px;
        margin: 40px 0;
    }

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

    .article-cta-button {
        display: block;
        width: 100%;
        padding: 18px 20px;
        font-size: 1.15rem;
    }

    /* Inline WhatsApp CTAs */
    .article-content a[href*="wa.me"] {
        display: block;
        text-align: center;
        padding: 16px 25px;
        font-size: 1.08rem;
    }

    /* Product cards - Stack on mobile */
    .article-related-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .related-article-card {
        border-radius: 20px;
    }

    .related-article-content {
        padding: 25px 20px;
    }

    /* Blockquotes - Compact mobile */
    .article-content blockquote {
        padding: 25px 30px;
        font-size: 1.4rem;
        border-radius: 0 15px 15px 0;
    }

    .article-content blockquote::before {
        font-size: 4rem;
        top: 0;
        left: 10px;
    }
}

/* ============================================
   10. PRINT STYLES
   ============================================ */

@media print {
    .article-hero,
    .article-cta-box,
    .related-article-card,
    .article-button {
        display: none;
    }

    .article-content {
        max-width: 100%;
        box-shadow: none;
        padding: 0;
        border-radius: 0;
    }

    .article-content a[href*="wa.me"] {
        display: none;
    }
}

/* ============================================
   11. ACCESSIBILITY ENHANCEMENTS
   ============================================ */

.article-content a:focus,
.article-cta-button:focus,
.article-button:focus {
    outline: 3px solid #FF1493;
    outline-offset: 4px;
}

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

/* ============================================
   12. UTILITY CLASSES
   ============================================ */

.handwritten {
    font-family: 'Caveat', cursive;
    font-size: 1.5em;
    color: #8A2BE2;
}

.gradient-text {
    background: linear-gradient(135deg, #FF1493, #FF69B4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Highlight box for key information */
.highlight-box {
    background: linear-gradient(135deg, #FFF0F5, #FFF);
    border: 3px dashed #FF69B4;
    border-radius: 20px;
    padding: 30px;
    margin: 35px 0;
    position: relative;
}

.highlight-box::before {
    content: '💡';
    position: absolute;
    top: -18px;
    left: 30px;
    background: white;
    padding: 5px 12px;
    border-radius: 50%;
    font-size: 1.8rem;
    box-shadow: 0 4px 15px rgba(255, 20, 147, 0.2);
}

/* ============================================
   END OF IMPROVED ARTICLE STYLES
   ============================================ */
