/* ===== MODERN BLOG POST DESIGN ===== */

/* ===== VARIABLES ===== */
:root {
    --post-primary: #2563eb;
    --post-primary-light: #3b82f6;
    --post-secondary: #64748b;
    --post-accent: #f59e0b;
    --post-success: #10b981;
    --post-danger: #ef4444;
    --post-text: #1e293b;
    --post-text-light: #64748b;
    --post-bg: #ffffff;
    --post-bg-alt: #f8fafc;
    --post-border: #e2e8f0;
    --post-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --post-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --post-radius: 0.75rem;
    --post-radius-sm: 0.5rem;
    --post-spacing: 1.5rem;
}

/* ===== MAIN LAYOUT ===== */
.post-main {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
    position: relative;
    padding: 2rem 1rem;
}

/* ===== READING PROGRESS ===== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--post-primary) 0%, var(--post-primary-light) 100%);
    z-index: 1000;
    transition: width 0.2s ease;
}

/* ===== POST HEADER ===== */
.post-article {
    max-width: 900px;
    margin: 0 auto;
    background: var(--post-bg);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.05);
    border-radius: var(--post-radius);
    overflow: hidden;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.post-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 3rem 2rem 2rem;
    border-bottom: 1px solid var(--post-border);
    position: relative;
}

.post-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(37, 99, 235, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(245, 158, 11, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.post-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--post-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.post-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    color: var(--post-text);
    line-height: 1.1;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    color: var(--post-text-light);
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

.post-author,
.post-date,
.post-read-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-author::before { content: '👤'; }
.post-date::before { content: '📅'; }
.post-read-time::before { content: '⏱️'; }

/* ===== POST CONTENT ===== */
.post-content {
    padding: 3rem 2rem;
    background: var(--post-bg);
}

.post-content .container {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* ===== FEATURED IMAGE ===== */
.post-image {
    margin: 2rem 0 3rem;
    text-align: center;
}

.post-image img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: var(--post-radius);
    box-shadow: var(--post-shadow-lg);
    transition: transform 0.3s ease;
}

.post-image img:hover {
    transform: scale(1.02);
}

/* ===== TYPOGRAPHY ===== */
.post-intro {
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--post-text-light);
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--post-bg-alt);
    border-left: 4px solid var(--post-primary);
    border-radius: 0 var(--post-radius-sm) var(--post-radius-sm) 0;
    font-style: italic;
}

.post-content h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--post-text);
    margin: 3rem 0 1.5rem;
    line-height: 1.3;
    position: relative;
    padding-bottom: 0.5rem;
}

.post-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 3rem;
    height: 3px;
    background: var(--post-primary);
    border-radius: 2px;
}

.post-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--post-text);
    margin: 2.5rem 0 1rem;
    line-height: 1.4;
}

.post-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--post-text);
    margin: 2rem 0 1rem;
    line-height: 1.4;
}

.post-content p {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--post-text);
    margin-bottom: 1.5rem;
}

.post-content ul,
.post-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.post-content li {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--post-text);
    margin-bottom: 0.5rem;
}

.post-content ul li {
    position: relative;
}

.post-content ul li::marker {
    content: '▸';
    color: var(--post-primary);
    font-weight: bold;
}

.post-content a {
    color: var(--post-primary);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.post-content a:hover {
    border-bottom-color: var(--post-primary);
    color: var(--post-primary-light);
}

.post-content blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background: var(--post-bg-alt);
    border-left: 4px solid var(--post-accent);
    border-radius: 0 var(--post-radius-sm) var(--post-radius-sm) 0;
    font-style: italic;
    font-size: 1.125rem;
    color: var(--post-text-light);
}

.post-content code {
    background: #f1f5f9;
    color: #e11d48;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.post-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: var(--post-radius-sm);
    overflow-x: auto;
    margin: 2rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.post-content pre code {
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
}

/* ===== POST FEATURE GRID ===== */
.post-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.post-feature-item {
    background: var(--post-bg-alt);
    padding: 2rem;
    border-radius: var(--post-radius);
    border: 1px solid var(--post-border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.post-feature-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--post-primary) 0%, var(--post-primary-light) 100%);
}

.post-feature-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--post-shadow-lg);
    border-color: var(--post-primary);
}

.post-feature-item h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--post-text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-feature-item p {
    color: var(--post-text-light);
    line-height: 1.6;
    margin: 0;
}

/* ===== POST CTA ===== */
.post-cta {
    background: linear-gradient(135deg, var(--post-primary) 0%, var(--post-primary-light) 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: var(--post-radius);
    text-align: center;
    margin: 3rem 0;
    position: relative;
    overflow: hidden;
}

.post-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="2" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
    opacity: 0.3;
}

.post-cta h2 {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.post-cta p {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.post-cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    color: var(--post-primary);
    padding: 1rem 2rem;
    border-radius: 2rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.125rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.post-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    color: var(--post-primary-light);
}

/* ===== SPECIAL COMPONENTS ===== */
.tip-box {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 1px solid #93c5fd;
    border-left: 4px solid var(--post-primary);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 var(--post-radius-sm) var(--post-radius-sm) 0;
    position: relative;
}

.tip-box::before {
    content: '💡';
    position: absolute;
    top: -0.5rem;
    left: 1rem;
    background: var(--post-primary);
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.tip-box h4 {
    color: var(--post-primary);
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.tip-box p {
    color: #1e40af;
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
}

.warning-box {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #fbbf24;
    border-left: 4px solid var(--post-accent);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 var(--post-radius-sm) var(--post-radius-sm) 0;
    position: relative;
}

.warning-box::before {
    content: '⚠️';
    position: absolute;
    top: -0.5rem;
    left: 1rem;
    background: var(--post-accent);
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.warning-box h4 {
    color: #92400e;
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.warning-box p {
    color: #92400e;
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
}

.call-to-action {
    background: linear-gradient(135deg, var(--post-primary) 0%, var(--post-primary-light) 100%);
    color: white;
    padding: 2.5rem;
    margin: 3rem 0;
    border-radius: var(--post-radius);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.call-to-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="cta-dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23cta-dots)"/></svg>');
    pointer-events: none;
}

.call-to-action h3 {
    color: white;
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.call-to-action p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 2rem 0;
    font-size: 1.125rem;
    position: relative;
    z-index: 1;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 1rem 2rem;
    border-radius: 2rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 1;
}

.cta-button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.cta-button::after {
    content: '→';
    transition: transform 0.3s ease;
}

.cta-button:hover::after {
    transform: translateX(4px);
}

/* ===== FLOATING ACTIONS ===== */
.floating-actions {
    position: fixed;
    right: 2rem;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 100;
}

.floating-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--post-primary);
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: var(--post-shadow-lg);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-btn:hover {
    background: var(--post-primary-light);
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.floating-btn.scroll-top {
    background: var(--post-success);
}

.floating-btn.scroll-top:hover {
    background: #059669;
}

.floating-btn.share {
    background: var(--post-accent);
}

.floating-btn.share:hover {
    background: #d97706;
}

/* ===== RELATED POSTS ===== */
.related-posts {
    background: var(--post-bg-alt);
    padding: 4rem 0;
    margin-top: 4rem;
}

.related-posts .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.related-posts h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--post-text);
    margin-bottom: 3rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.related-post {
    background: var(--post-bg);
    border-radius: var(--post-radius);
    padding: 2rem;
    box-shadow: var(--post-shadow);
    border: 1px solid var(--post-border);
    transition: all 0.3s ease;
    text-align: center;
}

.related-post:hover {
    transform: translateY(-4px);
    box-shadow: var(--post-shadow-lg);
    border-color: var(--post-primary);
}

.related-post-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.related-post h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--post-text);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.related-post h3 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.related-post h3 a:hover {
    color: var(--post-primary);
}

.related-post p {
    color: var(--post-text-light);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

/* ===== ARTICLE NAVIGATION ===== */
.article-navigation {
    background: var(--post-bg);
    border: 1px solid var(--post-border);
    border-radius: var(--post-radius);
    padding: 2rem;
    margin: 3rem 0;
}

.article-nav-title {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--post-text);
    margin-bottom: 2rem;
}

.nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.nav-link {
    display: block;
    /* padding: 1.5rem; */
    background: var(--post-bg-alt);
    /* border: 1px solid var(--post-border); */
    border-radius: var(--post-radius-sm);
    text-decoration: none;
    color: var(--post-text);
    transition: all 0.3s ease;
}

.nav-link:hover {
    border-color: var(--post-primary);
    transform: translateY(-2px);
    box-shadow: var(--post-shadow);
}

.nav-link-label {
    font-size: 0.875rem;
    color: var(--post-text-light);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-link-title {
    font-weight: 600;
    color: var(--post-text);
    font-size: 1.1rem;
    line-height: 1.4;
}

/* ===== SOCIAL SHARE ===== */
.social-share {
    background: var(--post-bg);
    border: 1px solid var(--post-border);
    border-radius: var(--post-radius);
    padding: 2rem;
    margin: 3rem 0;
    text-align: center;
}

.social-share h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--post-text);
    margin-bottom: 1.5rem;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--post-border);
    background: var(--post-bg);
    color: var(--post-text);
    border-radius: 2rem;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.share-btn:hover {
    background: var(--post-primary);
    color: white;
    border-color: var(--post-primary);
    transform: translateY(-1px);
}

.share-btn.twitter:hover { background: #1da1f2; border-color: #1da1f2; }
.share-btn.facebook:hover { background: #4267b2; border-color: #4267b2; }
.share-btn.linkedin:hover { background: #0077b5; border-color: #0077b5; }

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .post-content .container {
        padding: 0 1.5rem;
    }

    .related-posts .container {
        padding: 0 1.5rem;
    }
}

@media (max-width: 768px) {
    .post-header {
        padding: 2rem 0 1.5rem;
    }

    .post-title {
        font-size: 2rem;
    }

    .post-meta {
        gap: 1rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .post-content .container {
        padding: 0 1rem;
    }

    .post-content {
        padding: 2rem 0;
    }

    .post-intro {
        font-size: 1.125rem;
        padding: 1rem;
    }

    .post-content h2 {
        font-size: 1.5rem;
        margin: 2rem 0 1rem;
    }

    .post-content h3 {
        font-size: 1.25rem;
        margin: 1.5rem 0 0.75rem;
    }

    .post-content p,
    .post-content li {
        font-size: 1rem;
    }

    .tip-box,
    .warning-box {
        margin: 1.5rem -1rem;
        border-radius: 0;
        border-left: none;
        border-top: 4px solid var(--post-primary);
    }

    .tip-box::before,
    .warning-box::before {
        top: -1rem;
        left: 50%;
        transform: translateX(-50%);
    }

    .call-to-action {
        margin: 2rem -1rem;
        border-radius: 0;
        padding: 2rem 1rem;
    }

    .floating-actions {
        right: 1rem;
        bottom: 1rem;
    }

    .floating-btn {
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
    }

    .related-posts {
        padding: 3rem 0;
    }

    .related-posts .container {
        padding: 0 1rem;
    }

    .related-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .related-post {
        padding: 1.5rem;
    }

    .article-navigation {
        margin: 2rem -1rem;
        border-radius: 0;
        padding: 1.5rem 1rem;
    }

    .nav-links {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .social-share {
        margin: 2rem -1rem;
        border-radius: 0;
        padding: 1.5rem 1rem;
    }

    .share-buttons {
        gap: 0.75rem;
    }

    .share-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .post-title {
        font-size: 1.75rem;
    }

    .post-content h2 {
        font-size: 1.375rem;
    }

    .post-content h3 {
        font-size: 1.125rem;
    }

    .cta-button {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }

    .share-buttons {
        flex-direction: column;
        align-items: center;
    }

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

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --post-text: #f1f5f9;
        --post-text-light: #94a3b8;
        --post-bg: #0f172a;
        --post-bg-alt: #1e293b;
        --post-border: #334155;
    }

    .post-header {
        background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    }

    .post-content code {
        background: #334155;
        color: #fbbf24;
    }

    .tip-box {
        background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
        border-color: #3b82f6;
    }

    .tip-box h4,
    .tip-box p {
        color: #dbeafe;
    }

    .warning-box {
        background: linear-gradient(135deg, #92400e 0%, #b45309 100%);
        border-color: #f59e0b;
    }

    .warning-box h4,
    .warning-box p {
        color: #fef3c7;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .floating-actions,
    .social-share,
    .article-navigation {
        display: none;
    }

    .post-header {
        background: none;
        color: black;
    }

    .post-title {
        color: black;
    }

    .post-content {
        font-size: 12pt;
        line-height: 1.5;
    }

    .post-content a {
        color: black;
        text-decoration: underline;
    }
}
