/* ============================================================
   ARTICLE PAGE — THE SHARP LENS
   Extends main.css with article-specific components
   ============================================================ */

/* Article width variable */
:root {
    --article-width: 720px;
}

/* ============================================================
   NARROW CONTAINER
   ============================================================ */
.container--narrow {
    max-width: var(--article-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.breadcrumbs {
    padding: var(--space-md) 0;
    font-size: 0.72rem;
    color: var(--ink-muted);
    border-bottom: 1px solid var(--border-light);
}
.breadcrumbs a { transition: color 0.2s; }
.breadcrumbs a:hover { color: var(--accent-red); }
.breadcrumbs__sep { margin: 0 6px; opacity: 0.4; }

/* ============================================================
   READING PROGRESS BAR
   ============================================================ */
.progress-bar {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--accent-red);
    z-index: 1000;
    transition: width 0.1s linear;
}

/* ============================================================
   ARTICLE HEADER (Compact — Atlantic style)
   ============================================================ */
.article-header {
    padding: var(--space-3xl) 0 var(--space-2xl);
    border-bottom: 1px solid var(--border);
}
.article-header__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    align-items: center;
}
.article-header__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.article-header__title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3.2vw, 2.6rem);
    font-weight: 700;
    line-height: 1.18;
    margin-bottom: var(--space-lg);
    color: var(--ink);
}
.article-header__excerpt {
    font-size: 1.1rem;
    color: var(--ink-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-lg);
    font-weight: 300;
}
.article-header__meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: 0.82rem;
    color: var(--ink-muted);
}
.article-header__author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.article-header__author-name {
    font-weight: 600;
    color: var(--ink);
}
.article-header__meta-sep { opacity: 0.3; }
.article-header__meta-details {
    font-size: 0.72rem;
    color: var(--ink-muted);
}

.article-header__img-wrap {
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 4/3;
    position: relative;
}
.article-header__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.article-header__img-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 14px;
    background: rgba(0,0,0,0.6);
    font-size: 0.7rem;
    color: rgba(255,255,255,0.7);
    font-style: italic;
}

/* ============================================================
   SHARE BAR
   ============================================================ */
.share-bar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.72rem;
    color: var(--ink-muted);
    max-width: 1060px;
    margin: 0 auto;
}
.share-bar__label {
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.share-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-muted);
    transition: all 0.2s;
}
.share-btn:hover {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}

/* ============================================================
   ARTICLE BODY LAYOUT (content + TOC sidebar)
   ============================================================ */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: var(--space-3xl);
    padding: var(--space-2xl) 0 var(--space-3xl);
    max-width: 1060px;
    margin: 0 auto;
}

/* TABLE OF CONTENTS — Sticky Sidebar */
.toc {
    position: sticky;
    top: calc(var(--nav-height) + var(--space-xl));
    align-self: start;
}
.toc__title {
    font-family: var(--font-display);
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--ink);
}
.toc__list { list-style: none; }
.toc__item { margin-bottom: 2px; }
.toc__link {
    display: block;
    padding: 8px 12px;
    font-size: 0.8rem;
    color: var(--ink-secondary);
    border-left: 2px solid transparent;
    transition: all 0.2s;
    line-height: 1.35;
}
.toc__link:hover {
    color: var(--accent-red);
    background: var(--paper-warm);
    border-left-color: var(--accent-red);
}
.toc__link.active {
    color: var(--accent-red);
    font-weight: 600;
    border-left-color: var(--accent-red);
    background: rgba(196, 30, 58, 0.04);
}

/* ARTICLE PROSE */
.article-body {
    font-size: 1.08rem;
    line-height: 1.8;
    color: var(--ink-secondary);
}
.article-body h2 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--ink);
    margin: var(--space-2xl) 0 var(--space-lg);
    line-height: 1.25;
    scroll-margin-top: calc(var(--nav-height) + var(--space-xl));
}
.article-body h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ink);
    margin: var(--space-xl) 0 var(--space-md);
    line-height: 1.3;
}
.article-body p {
    margin-bottom: var(--space-lg);
}
.article-body a {
    color: var(--accent-red);
    text-decoration: underline;
    text-decoration-color: rgba(196,30,58,0.3);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s;
}
.article-body a:hover {
    text-decoration-color: var(--accent-red);
}
.article-body blockquote {
    margin: var(--space-xl) 0;
    padding: var(--space-lg) var(--space-xl);
    border-left: 3px solid var(--accent-red);
    background: var(--paper-warm);
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-style: italic;
    line-height: 1.6;
    color: var(--ink);
    border-radius: 0 4px 4px 0;
}
.article-body blockquote cite {
    display: block;
    margin-top: var(--space-md);
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-style: normal;
    color: var(--ink-muted);
    font-weight: 600;
}
.article-body figure {
    margin: var(--space-2xl) 0;
}
.article-body figure img {
    border-radius: 4px;
    width: 100%;
}
.article-body figcaption {
    font-size: 0.78rem;
    color: var(--ink-muted);
    margin-top: var(--space-sm);
    font-style: italic;
    padding-left: var(--space-sm);
    border-left: 2px solid var(--border);
}
.article-body ul,
.article-body ol {
    margin-bottom: var(--space-lg);
    padding-left: var(--space-xl);
}
.article-body li {
    margin-bottom: var(--space-sm);
}

/* Pull Quote */
.pull-quote {
    margin: var(--space-2xl) calc(-1 * var(--space-xl));
    padding: var(--space-xl);
    text-align: center;
    border-top: 2px solid var(--accent-gold);
    border-bottom: 2px solid var(--accent-gold);
}
.pull-quote__text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ink);
    font-style: italic;
}
.pull-quote__attr {
    font-family: var(--font-body);
    font-size: 0.82rem;
    color: var(--ink-muted);
    margin-top: var(--space-md);
    font-style: normal;
    font-weight: 600;
}

/* Article Tags */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-2xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border);
}
.article-tags__label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-muted);
    display: flex;
    align-items: center;
    margin-right: var(--space-sm);
}
.tag {
    background: var(--paper-warm);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--ink-secondary);
    transition: all 0.2s;
    cursor: pointer;
}
.tag:hover {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}

/* ============================================================
   RELATED ARTICLES
   ============================================================ */
.related-section {
    padding: var(--space-3xl) 0;
    background: var(--paper-warm);
    border-top: 1px solid var(--border);
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-xl);
}
.related-card { cursor: pointer; }
.related-card__img-wrap {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    aspect-ratio: 16/10;
    margin-bottom: var(--space-md);
}
.related-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s;
}
.related-card:hover .related-card__img { transform: scale(1.06); }
.related-card__cat {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.related-card__title {
    font-family: var(--font-display);
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 6px;
    transition: color 0.2s;
}
.related-card:hover .related-card__title { color: var(--accent-red); }
.related-card__meta { font-size: 0.72rem; color: var(--ink-muted); }

/* ============================================================
   ARTICLE RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .article-layout {
        grid-template-columns: 1fr;
        max-width: var(--article-width);
    }
    .toc {
        position: static;
        margin-bottom: var(--space-2xl);
        padding: var(--space-lg);
        background: var(--paper-warm);
        border-radius: 6px;
        border: 1px solid var(--border);
        order: -1;
    }
    .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .article-header__grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
    .article-header__img-wrap { order: -1; }
    .article-header__title { font-size: 1.6rem; }
    .article-body h2 { font-size: 1.3rem; }
    .pull-quote { margin-left: 0; margin-right: 0; }
    .pull-quote__text { font-size: 1.2rem; }
    .related-grid { grid-template-columns: 1fr 1fr; gap: var(--space-md); }
}
@media (max-width: 480px) {
    .article-header { padding: var(--space-xl) 0 var(--space-lg); }
    .article-body { font-size: 1rem; }
    .related-grid { grid-template-columns: 1fr; }
    .share-bar { flex-wrap: wrap; }
}
@media print {
    .progress-bar, .share-bar, .toc { display: none !important; }
    .article-layout { grid-template-columns: 1fr; }
}
