/* Blog post specific styles - extends the main style.css */

/* Article-specific styles */
.article-header {
    margin-bottom: 50px;
    text-align: center;
    padding: 40px 0;
    background: linear-gradient(135deg, #ffffff 0%, #ffffff 100%);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.article-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #c44536, #e67e22);
}

.article-header::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://i.pinimg.com/736x/a1/d4/ad/a1d4ad6b5a5f12256b0278b05367c528.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.4;
    -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.2), rgba(0,0,0,0));
    -webkit-mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;

    mask-image: linear-gradient(to top, rgba(0,0,0,0.2), rgba(0,0,0,0));
    mask-size: 100% 100%;
    mask-repeat: no-repeat;
    z-index: 0;
}

.article-header > * {
    position: relative;
    z-index: 3;
}


.article-title {
    font-size: 36px;
    font-weight: 400;
    color: #2c2c2c;
    font-family: 'Georgia', serif;
    letter-spacing: -1px;
    margin-bottom: 20px;
    line-height: 1.3;
}

.article-meta {
    color: #666;
    font-size: 14px;
    font-style: italic;
    margin-bottom: 20px;
}

.article-meta span {
    margin: 0 15px;
}

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

.tag {
    background: linear-gradient(135deg, #ffffff, #ffffff);
    color: #495057;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    text-decoration: none;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.tag:hover {
    background: linear-gradient(135deg, #c44536, #e67e22);
    color: white;
    transform: translateY(-1px);
}

/* Article Content */
.article-content {
    font-size: 17px;
    line-height: 1.8;
    color: #2c2c2c;
    max-width: 900px;
    margin: 0 auto;
}

.article-content h2 {
    font-size: 28px;
    color: #c44536;
    margin: 50px 0 25px 0;
    font-family: 'Georgia', serif;
    font-weight: 400;
    position: relative;
}

.article-content h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, #c44536, #e67e22);
    margin-top: 10px;
}

.article-content h3 {
    font-size: 22px;
    color: #444;
    margin: 35px 0 20px 0;
    font-family: 'Georgia', serif;
    font-weight: 400;
}

.article-content p {
    margin-bottom: 25px;
    text-align: justify;
}

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

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

/* Back link styling */
.back-link {
    color: #c44536 !important;
    font-size: 14px !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.back-link::before {
    content: '← ';
    margin-right: 5px;
}

/* Images */
.image-container {
    margin: 40px 0;
    text-align: center;
    position: relative;
}

.article-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    transition: transform 0.3s ease;
    cursor: zoom-in;
}

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

.article-image.zoomed {
    transform: scale(1.5);
    cursor: zoom-out;
    z-index: 1000;
    position: relative;
}

.image-caption {
    font-size: 14px;
    color: #666;
    font-style: italic;
    margin-top: 15px;
    padding: 0 20px;
}

/* Code blocks */
.code-container {
    margin: 30px 0;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.code-header {
    background: linear-gradient(135deg, #2d3748, #4a5568);
    color: white;
    padding: 12px 20px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-language {
    font-weight: 500;
}

.copy-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: rgba(255,255,255,0.2);
}

.copy-btn.copied {
    background: rgba(76, 175, 80, 0.3);
}

pre[class*="language-"] {
    margin: 0 !important;
    border-radius: 0 !important;
    background: #2d3748 !important;
}

code[class*="language-"] {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
}

/* Inline code */
.article-content code:not([class*="language-"]) {
    background: #f1f3f4;
    color: #c44536;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Line numbers for code blocks */
pre.line-numbers {
    position: relative;
    padding-left: 3.8em;
    counter-reset: linenumber;
}

pre.line-numbers > code {
    position: relative;
    white-space: inherit;
}

.line-numbers .line-numbers {
    position: absolute;
    pointer-events: none;
    top: 0;
    left: 0;
    width: 3em;
    letter-spacing: -1px;
    border-right: 1px solid #4a5568;
    user-select: none;
    counter-reset: linenumber;
}

.line-numbers .line-numbers span {
    pointer-events: none;
    display: block;
    counter-increment: linenumber;
    color: #718096;
    font-size: 13px;
    line-height: 1.5;
    padding-right: 0.8em;
    text-align: right;
}

.line-numbers .line-numbers span::before {
    content: counter(linenumber);
}

/* Blockquotes */
blockquote {
    border-left: 4px solid #c44536;
    margin: 30px 0;
    padding: 20px 30px;
    background: linear-gradient(135deg, #ffffff, #fffaf5);
    font-style: italic;
    position: relative;
    border-radius: 0 8px 8px 0;
}

blockquote::before {
    content: '"';
    font-size: 60px;
    color: #c44536;
    position: absolute;
    top: -10px;
    left: 10px;
    opacity: 0.3;
}

blockquote p {
    margin-bottom: 10px;
}

blockquote cite {
    display: block;
    text-align: right;
    margin-top: 15px;
    font-size: 14px;
    color: #666;
}

blockquote cite::before {
    content: '— ';
}

/* Callout boxes */
.callout {
    margin: 30px 0;
    padding: 20px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.callout-info {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-left: 4px solid #2196f3;
}

.callout-warning {
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    border-left: 4px solid #ff9800;
}

.callout-tip {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    border-left: 4px solid #4caf50;
}

.callout-error {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    border-left: 4px solid #f44336;
}

.callout-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

/* Table of Contents */
.toc {
    background: linear-gradient(135deg, #ffffff, #ffffff);
    border: 0.5px solid #ffffff;
    border-radius: 8px;
    padding: 25px;
    margin: 10px 0;
    float: right;
    width: 250px;
    margin-left: 30px;
    position: relative; /* Needed for overlay positioning */
    overflow: hidden;
}

/* Add image overlay with gradient transparency */
.toc::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://i.pinimg.com/736x/a1/d4/ad/a1d4ad6b5a5f12256b0278b05367c528.jpg'); /* Replace with your image path */
    background-size: cover;
    background-position: center;
    opacity: 0.5;

    /* Gradient mask to fade out the image */
    -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.2), rgba(0,0,0,0));
    -webkit-mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;

    mask-image: linear-gradient(to top, rgba(0,0,0,0.2), rgba(0,0,0,0));
    mask-size: 100% 100%;
    mask-repeat: no-repeat;

    z-index: 0;
}

/* Ensure inner content stays above the overlay */
.toc > * {
    position: relative;
    z-index: 1;
}


.toc h3 {
    color: #c44536;
    font-size: 18px;
    margin-bottom: 15px;
    font-family: 'Georgia', serif;
}

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

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

.toc a {
    color: #495057;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.toc a:hover {
    color: #c44536;
}

.toc a.active {
    color: #c44536;
    font-weight: bold;
}

.toc .toc-level-2 {
    padding-left: 20px;
}

.toc .toc-level-3 {
    padding-left: 40px;
}

/* Footer navigation */
.post-navigation {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px dotted #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-link {
    color: #c44536;
    text-decoration: none;
    padding: 10px 20px;
    border: 2px solid #c44536;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.nav-link:hover {
    background: #c44536;
    color: white;
    transform: translateY(-2px);
}

.nav-prev::before {
    content: '← ';
}

.nav-next::after {
    content: ' →';
}

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

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

.article-content th {
    background: linear-gradient(135deg, #c44536, #e67e22);
    color: white;
    font-weight: 500;
}

.article-content tr:nth-child(even) {
    background: #f8f9fa;
}

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

/* Math expressions */
.math-container {
    margin: 25px 0;
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 8px;
    border-left: 4px solid #c44536;
}

/* Responsive Design */
@media (max-width: 768px) {
    .article-title {
        font-size: 28px;
    }
    
    .toc {
        float: none;
        width: 100%;
        margin-left: 0;
        margin-bottom: 30px;
    }
    
    .post-navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .article-content {
        font-size: 16px;
    }

    .article-image.zoomed {
        transform: scale(1.2);
    }

    .code-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

/* Smooth animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-content > * {
    animation: fadeInUp 0.6s ease forwards;
}

/* Loading states */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Print styles */
@media print {
    .reading-progress,
    nav,
    .post-navigation,
    .copy-btn {
        display: none;
    }
    
    .article-content {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .toc {
        float: none;
        width: 100%;
        page-break-inside: avoid;
    }
}
