/* ════════════════════════════════════════════════════════════════
   ARTICLE DETAIL PAGE STYLESHEET (css/article.css)
   Clean editorial typography, syntax-highlighted code blocks,
   callout boxes, interactive comment section, and dark mode.
════════════════════════════════════════════════════════════════ */

/* Reading Progress Bar */
.reading-progress-bar {
    position: fixed;
    top: 36px;
    left: 0;
    height: 3.5px;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    z-index: 1050;
    transition: width 0.1s linear;
}

/* Article Page Container */
.article-page-wrapper {
    padding-top: 140px;
    padding-bottom: 5rem;
    min-height: 100vh;
}

.article-container {
    max-width: 840px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Breadcrumbs & Back Link */
.article-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.article-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-full);
    background: rgba(37, 99, 235, 0.08);
}

.article-back-link:hover {
    background: rgba(37, 99, 235, 0.16);
    transform: translateX(-3px);
}

[data-theme="dark"] .article-back-link {
    background: rgba(59, 130, 246, 0.14);
}

/* Article Header */
.article-header {
    margin-bottom: 2.5rem;
}

.article-badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--primary-color);
    color: #ffffff;
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}

.article-main-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4.2vw, 2.85rem);
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-main);
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.article-deck {
    font-size: 1.22rem;
    line-height: 1.65;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
}

/* Meta Row (Author, Date, Read Time, Share) */
.article-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.25rem;
    padding: 1.25rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2.5rem;
}

.article-author-info {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.article-author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.article-author-name {
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.98rem;
}

.article-post-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.2rem;
}

.article-post-date span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.article-share-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.article-share-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.article-share-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Featured Hero Image */
.article-featured-hero {
    margin-bottom: 3rem;
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    position: relative;
}

.article-featured-hero img {
    width: 100%;
    max-height: 460px;
    object-fit: cover;
    display: block;
}

.article-hero-caption {
    padding: 0.65rem 1rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    background: var(--bg-card);
    text-align: center;
    border-top: 1px solid var(--border-color);
}

/* ════════════════════════════════════════════════════════════════
   ARTICLE BODY EDITORIAL TYPOGRAPHY ("farihiisa isticmaal")
════════════════════════════════════════════════════════════════ */
.article-body {
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.85;
    color: var(--text-main);
}

.article-lead {
    font-size: 1.25rem;
    line-height: 1.75;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 2rem;
    padding-left: 1.25rem;
    border-left: 3px solid var(--primary-color);
}

.article-body p {
    margin-bottom: 1.65rem;
    color: var(--text-main);
}

.article-body h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    letter-spacing: -0.015em;
    position: relative;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.article-body h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 2.25rem;
    margin-bottom: 1rem;
}

.article-body ul, 
.article-body ol {
    margin: 1.5rem 0 2rem 1.5rem;
}

.article-body li {
    margin-bottom: 0.75rem;
    line-height: 1.75;
}

.article-body strong {
    color: var(--text-main);
    font-weight: 700;
}

.article-body a {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 500;
}

.article-body a:hover {
    color: var(--primary-dark);
}

/* Callout Box */
.article-callout {
    display: flex;
    gap: 1.25rem;
    background: rgba(37, 99, 235, 0.05);
    border: 1px solid rgba(37, 99, 235, 0.22);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin: 2rem 0;
}

[data-theme="dark"] .article-callout {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.25);
    border-left-color: var(--primary-color);
}

.callout-icon {
    font-size: 1.4rem;
    color: var(--primary-color);
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.callout-content p:last-child {
    margin-bottom: 0;
}

.callout-content strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
    color: var(--primary-color);
}

/* Modern Syntax-Highlighted Code Blocks */
.code-block-wrapper {
    background: #0d1117;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin: 2.25rem 0;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: #161b22;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.code-mac-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.code-mac-dots span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
}

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.code-lang-label {
    font-family: monospace;
    font-size: 0.78rem;
    color: #8b949e;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.copy-code-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #c9d1d9;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: var(--transition);
}

.copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.code-block-wrapper pre {
    margin: 0;
    padding: 1.5rem;
    overflow-x: auto;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.95rem;
    line-height: 1.65;
    color: #e6edf3;
}

.code-keyword { color: #ff7b72; font-weight: 600; }
.code-func { color: #d2a8ff; }
.code-string { color: #a5d6ff; }
.code-comment { color: #8b949e; font-style: italic; }
.code-tag { color: #7ee787; }
.code-attr { color: #79c0ff; }
.code-bool { color: #ffa657; }

/* Blockquote */
.article-body blockquote {
    margin: 2.25rem 0;
    padding: 1.5rem 1.75rem;
    background: var(--bg-alt);
    border-left: 4px solid var(--primary-color);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    color: var(--text-main);
    font-size: 1.15rem;
}

.article-body blockquote cite {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    font-style: normal;
    font-weight: 600;
    color: var(--text-muted);
}

/* Key Takeaways Card */
.article-takeaways {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin: 3rem 0;
    box-shadow: var(--shadow-sm);
}

.article-takeaways h3 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 1.25rem;
}

.takeaway-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.takeaway-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
    line-height: 1.65;
}

.takeaway-list li i {
    color: #10b981;
    margin-top: 0.3rem;
    flex-shrink: 0;
}

/* Claps & Feedback Bar */
.article-interaction-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.5rem 0;
    margin: 3rem 0 2rem;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.clap-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.clap-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
    transform: scale(1.04);
}

.clap-btn.active i {
    color: #ef4444;
    animation: heartPulse 0.4s ease;
}

@keyframes heartPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

/* Author Bio Card */
.article-author-card {
    display: flex;
    gap: 1.75rem;
    align-items: center;
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin: 3rem 0;
}

.author-card-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 3px solid var(--primary-color);
}

.author-card-details h4 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 0.4rem;
    color: var(--text-main);
}

.author-card-details p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.author-card-socials {
    display: flex;
    gap: 0.75rem;
}

.author-card-socials a {
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: var(--transition);
}

.author-card-socials a:hover {
    color: var(--primary-color);
}

/* Next / Prev Article Navigation */
.article-nav-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 3rem 0;
}

.nav-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-decoration: none;
    transition: var(--transition);
}

.nav-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.nav-card-label {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.nav-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.4;
}

/* ════════════════════════════════════════════════════════════════
   INTERACTIVE COMMENTS SECTION (Sida Sawirka 2aad ku cad)
════════════════════════════════════════════════════════════════ */
.article-comments-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    margin: 3.5rem 0;
    box-shadow: var(--shadow-sm);
}

.comments-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.comments-header h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.35rem;
}

.comments-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

/* Comment Form */
.comment-form {
    margin-bottom: 3rem;
}

.comment-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.comment-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.comment-input-group label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
}

.comment-input-group input,
.comment-input-group textarea {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-alt);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition);
}

.comment-input-group input:focus,
.comment-input-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.comment-input-group textarea {
    resize: vertical;
    min-height: 120px;
}

.comment-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 0.85rem 1.75rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

.comment-submit-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-blue);
}

/* Comments Feed */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.comment-item {
    display: flex;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--bg-alt);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    animation: fadeIn 0.4s ease;
}

.comment-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
}

.comment-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.comment-user-name {
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.95rem;
}

.comment-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.comment-text {
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* Toast Notification */
.comment-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #10b981;
    color: #ffffff;
    padding: 0.85rem 1.5rem;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 99999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.comment-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .article-page-wrapper {
        padding-top: 100px;
    }
    .article-main-title {
        font-size: 2rem;
    }
    .comment-form-row {
        grid-template-columns: 1fr;
    }
    .article-nav-cards {
        grid-template-columns: 1fr;
    }
    .article-author-card {
        flex-direction: column;
        text-align: center;
    }
    .article-comments-section {
        padding: 1.5rem;
    }
}
