/* Shared Article Styles for datawithprats.com */
/* Consistent with portfolio site aesthetic */

/* Color Palette */
:root {
    --deep-burgundy: #5D1924;
    --olive-green: #6E6F4F;
    --chocolate-brown: #3E3222;
    --rusty-terracotta: #83422E;
    --moss-green: #484D2D;
    --champagne-taupe: #98946F;
    --paper-cream: #F5F0E6;
    --paper-warm: #EDE4D3;
}

/* Reset and Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Special Elite', 'Georgia', serif;
    line-height: 1.8;
    color: #333;
    background-color: var(--chocolate-brown);
    min-height: 100vh;
}

/* Article Container */
.article-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Article Header */
.article-header {
    background: var(--paper-cream);
    background-image:
        linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    background-blend-mode: overlay;
    padding: 40px;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    transform: rotate(-0.5deg);
}

.article-header::before {
    display: none;
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--rusty-terracotta);
    text-decoration: none;
    font-size: 0.95rem;
    margin-bottom: 20px;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--deep-burgundy);
}

.back-link svg {
    margin-right: 8px;
}

.article-title {
    font-family: 'Caveat', cursive;
    font-size: 2.8rem;
    color: var(--deep-burgundy);
    margin-bottom: 15px;
    line-height: 1.2;
}

.article-subtitle {
    font-family: 'Indie Flower', cursive;
    font-size: 1.3rem;
    color: var(--rusty-terracotta);
    margin-bottom: 20px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 20px;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.article-tag {
    display: inline-block;
    padding: 4px 12px;
    background-color: var(--olive-green);
    color: #ffffff;
    border-radius: 4px;
    font-size: 0.85rem;
    transform: rotate(-1deg);
}

/* Article Content */
.article-content {
    background: var(--paper-cream);
    background-image:
        linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    background-blend-mode: overlay;
    padding: 50px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
}

.article-content::before {
    display: none;
}

/* Typography */
.article-content h2 {
    font-family: 'Caveat', cursive;
    font-size: 2.2rem;
    color: var(--deep-burgundy);
    margin: 50px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--champagne-taupe);
}

.article-content h2:first-child {
    margin-top: 0;
}

.article-content h3 {
    font-family: 'Caveat', cursive;
    font-size: 1.6rem;
    color: var(--rusty-terracotta);
    margin: 35px 0 15px 0;
}

.article-content h4 {
    font-family: 'Indie Flower', cursive;
    font-size: 1.3rem;
    color: var(--olive-green);
    margin: 25px 0 10px 0;
}

.article-content p {
    margin-bottom: 20px;
    font-size: 1.05rem;
    color: var(--chocolate-brown);
}

.article-content strong {
    color: var(--deep-burgundy);
}

.article-content em {
    font-style: italic;
}

/* Links */
.article-content a {
    color: var(--rusty-terracotta);
    text-decoration: underline;
    text-decoration-color: var(--champagne-taupe);
    text-underline-offset: 3px;
    transition: all 0.3s ease;
}

.article-content a:hover {
    color: var(--deep-burgundy);
    text-decoration-color: var(--rusty-terracotta);
}

/* Lists */
.article-content ul,
.article-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.article-content li {
    margin-bottom: 10px;
}

.article-content ul li {
    list-style-type: disc;
}

.article-content ol li {
    list-style-type: decimal;
}

/* Blockquotes */
.article-content blockquote {
    margin: 30px 0;
    padding: 20px 25px;
    background-color: var(--paper-warm);
    border-left: 4px solid var(--rusty-terracotta);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--chocolate-brown);
}

.article-content blockquote p {
    margin-bottom: 0;
}

/* Code Blocks */
.article-content code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    background-color: var(--paper-warm);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--deep-burgundy);
}

.article-content pre {
    margin: 25px 0;
    padding: 25px;
    background-color: #2d2d2d;
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.article-content pre code {
    background-color: transparent;
    padding: 0;
    color: #f8f8f2;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Syntax Highlighting (basic) */
.article-content pre .keyword { color: #66d9ef; }
.article-content pre .string { color: #e6db74; }
.article-content pre .comment { color: #75715e; }
.article-content pre .number { color: #ae81ff; }
.article-content pre .function { color: #a6e22e; }

/* Tables */
.article-content table {
    width: 100%;
    margin: 25px 0;
    border-collapse: collapse;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.article-content th,
.article-content td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #E5D7C0;
}

.article-content th {
    background-color: var(--rusty-terracotta);
    color: var(--paper-cream);
    font-family: 'Indie Flower', cursive;
    font-weight: normal;
    font-size: 1.1rem;
}

.article-content tr:last-child td {
    border-bottom: none;
}

.article-content tr:hover {
    background-color: #f5efe6;
}

/* Images and Figures */
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    margin: 10px 0;
}

.article-content figure {
    margin: 30px 0;
    text-align: center;
}

.article-content figcaption {
    margin-top: 12px;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

/* Callout Boxes */
.callout {
    margin: 30px 0;
    padding: 20px 25px;
    border-radius: 8px;
    position: relative;
}

.callout-info {
    background-color: #e8f4f8;
    border-left: 4px solid #3498db;
}

.callout-tip {
    background-color: #e8f8e8;
    border-left: 4px solid #27ae60;
}

.callout-warning {
    background-color: #fef8e8;
    border-left: 4px solid #f39c12;
}

.callout-title {
    font-family: 'Indie Flower', cursive;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 10px;
}

/* Math/Formula Styling */
.formula-explanation {
    margin: 15px 0 10px 0;
    padding: 15px 20px;
    background-color: var(--paper-warm);
    border-left: 4px solid var(--rusty-terracotta);
    border-radius: 4px;
    font-size: 0.95rem;
    color: var(--chocolate-brown);
    font-style: italic;
}

.formula {
    margin: 25px 0;
    padding: 20px;
    background-color: #fff;
    border: 1px solid var(--champagne-taupe);
    border-radius: 8px;
    text-align: left;
    font-family: 'Times New Roman', serif;
    font-size: 1.1rem;
    overflow-x: auto;
    line-height: 1.8;
}

.formula strong {
    color: var(--rusty-terracotta);
    font-weight: bold;
}

.formula em {
    color: #666;
    font-style: italic;
}

.formula small {
    color: #888;
    font-size: 0.9em;
}

/* Horizontal Rule */
.article-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--champagne-taupe), var(--rusty-terracotta), var(--champagne-taupe), transparent);
    margin: 40px 0;
}

/* Article Footer */
.article-footer {
    background: var(--paper-cream);
    background-image:
        linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    background-blend-mode: overlay;
    padding: 40px;
    border-radius: 12px;
    margin-top: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    transform: rotate(0.5deg);
}

.article-footer::before {
    display: none;
}

.article-footer h3 {
    font-family: 'Caveat', cursive;
    font-size: 1.8rem;
    color: var(--deep-burgundy);
    margin-bottom: 20px;
}

/* Related Articles */
.related-articles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.related-article-card {
    background-color: var(--paper-warm);
    padding: 20px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--chocolate-brown);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.related-article-card h4 {
    font-family: 'Caveat', cursive;
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: var(--deep-burgundy);
}

.related-article-card p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0;
}

/* Author Section */
.author-section {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background-color: var(--paper-warm);
    border-radius: 8px;
    margin-top: 30px;
}

.author-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--rusty-terracotta);
}

.author-info h4 {
    font-family: 'Caveat', cursive;
    font-size: 1.4rem;
    color: var(--deep-burgundy);
    margin-bottom: 5px;
}

.author-info p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0;
}

/* Navigation */
.article-nav {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 30px;
}

.nav-link {
    flex: 1;
    padding: 20px;
    background-color: var(--paper-warm);
    border-radius: 8px;
    text-decoration: none;
    color: var(--chocolate-brown);
    transition: all 0.3s ease;
}

.nav-link:hover {
    background-color: var(--rusty-terracotta);
    color: var(--paper-cream);
}

.nav-link.prev {
    text-align: left;
}

.nav-link.next {
    text-align: right;
}

.nav-label {
    font-size: 0.85rem;
    color: #666;
    display: block;
    margin-bottom: 5px;
}

.nav-link:hover .nav-label {
    color: #E5D7C0;
}

.nav-title {
    font-family: 'Caveat', cursive;
    font-size: 1.2rem;
}

/* Table of Contents */
.toc {
    background-color: var(--paper-warm);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.toc h4 {
    font-family: 'Caveat', cursive;
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--deep-burgundy);
}

.toc ul {
    list-style: none;
    padding-left: 0;
}

.toc li {
    margin-bottom: 8px;
}

.toc a {
    color: var(--rusty-terracotta);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.toc a:hover {
    color: var(--deep-burgundy);
    text-decoration: underline;
}

/* CTA Box */
.cta-box {
    background: linear-gradient(135deg, var(--rusty-terracotta) 0%, var(--deep-burgundy) 100%);
    color: var(--paper-cream);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    margin: 40px 0;
}

.cta-box h3 {
    font-family: 'Caveat', cursive;
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--paper-cream);
}

.cta-box p {
    margin-bottom: 20px;
    color: var(--paper-warm);
}

.cta-button {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--paper-cream);
    color: var(--rusty-terracotta);
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background-color: var(--paper-warm);
    transform: translateY(-2px);
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(to right, var(--rusty-terracotta), var(--deep-burgundy));
    z-index: 1000;
    transition: width 0.1s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .article-container {
        padding: 20px 15px;
    }

    .article-header,
    .article-content,
    .article-footer {
        padding: 25px 20px;
        transform: none;
    }

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

    .article-subtitle {
        font-size: 1.1rem;
    }

    .article-content h2 {
        font-size: 1.8rem;
    }

    .article-content h3 {
        font-size: 1.4rem;
    }

    .article-content pre {
        padding: 15px;
        font-size: 0.85rem;
    }

    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .article-nav {
        flex-direction: column;
    }

    .author-section {
        flex-direction: column;
        text-align: center;
    }
}

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

    .article-content {
        padding: 20px 15px;
    }

    .article-content h2 {
        font-size: 1.5rem;
    }

    .article-content pre code {
        font-size: 0.8rem;
    }

    .related-articles {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .reading-progress,
    .back-link,
    .article-nav,
    .cta-box {
        display: none;
    }

    body {
        background: white;
    }

    .article-header,
    .article-content,
    .article-footer {
        box-shadow: none;
        transform: none;
    }

    .article-content pre {
        background-color: #f5f5f5;
        color: #333;
    }
}
