/* Article Enhancements — Progress bar, Unified Header Card, Position indicators */

/* Scroll Progress Bar */
.article-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--tyre-reviews-blue, #0db1e7);
    z-index: 1001;
    pointer-events: none;
    transition: width 0.1s linear;
}

/* Reading Time & Updated Date */
.article-reading-time,
.article-updated-date {
    white-space: nowrap;
}

/* ========================================
   Unified Article Header Card
   ======================================== */
.article-header-card {
    border-radius: 12px;
    border: none;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

/* --- Title Area --- */
.article-header-card__title-bar {
    padding: 24px 28px 8px;
}

.article-header-card__title {
    /* Reset global h1 styles */
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    /* Card-specific styles */
    color: #1a1a2e;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

/* --- Meta Row --- */
.article-header-card__meta {
    display: flex;
    align-items: center;
    padding: 16px 28px;
    gap: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.article-header-card__author {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.article-header-card__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--tyre-reviews-blue, #0db1e7);
    object-fit: cover;
}

.article-header-card__author-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.article-header-card__attribution {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    line-height: 1.2;
}

.article-header-card__author-name {
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
    font-size: 0.9rem;
}

.article-header-card__author-name:hover {
    color: var(--tyre-reviews-blue, #0db1e7);
    text-decoration: none;
}

/* Details (date, reading time, updated) */
.article-header-card__details {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding-left: 20px;
    border-left: 1px solid #e2e8f0;
}

.article-header-card__detail {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: #64748b;
    background: none;
    padding: 0;
    border-radius: 0;
    white-space: nowrap;
}

.article-header-card__detail + .article-header-card__detail::before {
    content: '\00b7';
    margin-right: 2px;
    color: #cbd5e1;
    font-weight: 700;
}

.article-header-card__detail i {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Social Links */
.article-header-card__social {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

.article-header-card__social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.article-header-card__social a:hover {
    background: var(--tyre-reviews-blue, #0db1e7);
    color: #fff;
}

/* --- Nav Tabs --- */
.article-header-card__nav {
    background: #f8fafc;
    padding: 10px 28px;
    border-bottom: 1px solid #f1f5f9;
}

.article-header-card__nav-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.article-header-card__nav-item {
    flex-shrink: 0;
}

.article-header-card__nav-link {
    display: inline-block;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #475569;
    background: transparent;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.article-header-card__nav-link:hover {
    color: #1e293b;
    background: #e2e8f0;
}

.article-header-card__nav-link--active,
.article-header-card__nav-link--active:link,
.article-header-card__nav-link--active:visited {
    background: var(--tyre-reviews-blue, #0db1e7);
    color: #fff;
    font-weight: 600;
}

.article-header-card__nav-link--active:hover {
    background: var(--tyre-reviews-blue-dark, #0a9bcc);
    color: #fff;
}

/* --- Table of Contents --- */
.article-header-card__toc {
    border-top: 1px solid #f1f5f9;
}

.article-header-card__toc details {
    margin: 0;
}

.article-header-card__toc-summary {
    padding: 12px 28px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    list-style: none;
    color: #475569;
    user-select: none;
}

.article-header-card__toc-summary::-webkit-details-marker {
    display: none;
}

.article-header-card__toc-summary::after {
    content: '\f107';
    font-family: FontAwesome;
    float: right;
    transition: transform 0.2s;
    color: #94a3b8;
}

.article-header-card__toc details[open] > .article-header-card__toc-summary {
    border-bottom: 1px solid #f1f5f9;
}

.article-header-card__toc details[open] > .article-header-card__toc-summary::after {
    transform: rotate(180deg);
}

.article-header-card__toc-list {
    list-style: decimal;
    padding: 12px 28px 12px 52px;
    margin: 0;
}

.article-header-card__toc-list ol {
    list-style: lower-alpha;
    padding: 4px 0 4px 20px;
}

.article-header-card__toc-list li {
    padding: 3px 0;
    font-size: 0.88rem;
    line-height: 1.5;
}

.article-header-card__toc-list a {
    color: #475569;
    text-decoration: none;
}

.article-header-card__toc-list a:hover {
    color: var(--tyre-reviews-blue, #0db1e7);
    text-decoration: none;
}

/* ========================================
   Responsive — Mobile (<=768px)
   ======================================== */
@media (max-width: 768px) {
    .article-header-card__title-bar {
        padding: 16px 16px 6px;
    }

    .article-header-card__title {
        font-size: 1.25rem;
    }

    .article-header-card__meta {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 16px;
        gap: 10px;
    }

    .article-header-card__details {
        padding-left: 0;
        border-left: none;
        border-top: 1px solid #f1f5f9;
        padding-top: 10px;
        width: 100%;
    }

    .article-header-card__detail + .article-header-card__detail::before {
        content: '\00b7';
    }

    .article-header-card__social {
        margin-left: 0;
        border-top: 1px solid #f1f5f9;
        padding-top: 10px;
        width: 100%;
    }

    .article-header-card__nav {
        padding: 6px 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .article-header-card__nav::-webkit-scrollbar {
        display: none;
    }

    .article-header-card__nav-list {
        gap: 2px;
    }

    .article-header-card__nav-link {
        padding: 5px 8px;
        font-size: 0.78rem;
    }

    .article-header-card__toc-summary {
        padding: 10px 16px;
    }

    .article-header-card__toc-list {
        padding: 10px 16px 10px 36px;
    }
}

/* ========================================
   Test Result Position Indicators (legacy)
   ======================================== */
.test-result-position {
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

.test-result-position--gold {
    background-color: #ffd700;
    color: #5a4600;
}

.test-result-position--silver {
    background-color: #e0e0e0;
    color: #424242;
}

.test-result-position--bronze {
    background-color: #cd7f32;
    color: #fff;
}
