/* ==========================================================
   Linecraft AI - Long-Form Content Pages
   Shared by every blog article and case study page: the simple
   reading nav, article/case-study layout, typography, callouts,
   sidebars and CTA box. Nav/footer/modal primitives that don't
   change here live in css/base.css.
   File: css/content-page.css
   ========================================================== */

.reading-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 1100;
}

.reading-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent-blue);
}

.content-nav {
    justify-content: space-between;
}

.back-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-muted);
    text-decoration: none;
}

.back-link:hover {
    color: var(--ink-heavy);
}

/* ==========================================================
   Article Header (blog posts)
   ========================================================== */
.article-header {
    padding: 160px 0 40px 0;
}

.a-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--ink-faint);
    margin-bottom: 20px;
}

.a-title {
    font-size: 2.6rem;
    line-height: 1.2;
    color: var(--ink-heavy);
    letter-spacing: -0.02em;
    margin-bottom: 24px;
    max-width: 820px;
}

.a-author-info {
    display: flex;
    flex-direction: column;
}

.a-author-name {
    font-weight: 700;
    color: var(--ink-standard);
    font-size: 0.9rem;
}

.a-author-role {
    font-size: 0.8rem;
    color: var(--ink-muted);
}

.article-hero-img-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px 40px 24px;
}

.a-hero-img {
    width: 100%;
    display: block;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

/* ==========================================================
   Case Study Hero (background image + overlay)
   ========================================================== */
.csd-hero-section {
    position: relative;
    min-height: 360px;
    display: flex;
    align-items: flex-end;
    padding-top: 140px;
    overflow: hidden;
}

.csd-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.csd-hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.csd-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(5, 0, 64, 0.35) 0%, rgba(5, 0, 64, 0.88) 100%);
}

.csd-hero-content {
    position: relative;
    z-index: 1;
    max-width: 1240px;
    margin: 0 auto;
    padding: 60px 24px 48px 24px;
    width: 100%;
}

.csd-subtitle {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: #cbd5e1;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.csd-title {
    font-size: 2.6rem;
    color: #ffffff;
    letter-spacing: -0.02em;
    margin: 12px 0;
}

/* ==========================================================
   Shared Two-Column Layout
   ========================================================== */
.article-body-section,
.csd-body-section {
    padding: 20px 0 100px 0;
}

.article-layout-grid,
.csd-layout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
}

@media (min-width: 1024px) {

    .article-layout-grid,
    .csd-layout-grid {
        grid-template-columns: 240px 1fr;
        max-width: 1120px;
        align-items: start;
    }
}

/* Blog TOC Sidebar */
.a-toc-sidebar {
    display: none;
}

@media (min-width: 1024px) {
    .a-toc-sidebar {
        display: block;
    }
}

.a-toc-sticky {
    position: sticky;
    top: 120px;
}

.a-toc-title {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--ink-faint);
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

.a-toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toc-link {
    display: block;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border-left: 2px solid transparent;
    font-size: 0.82rem;
    color: var(--ink-muted);
    text-decoration: none;
    transition: all 0.15s ease;
}

.toc-link:hover {
    color: var(--ink-heavy);
    background: var(--bg-surface-elevated);
}

.toc-link.active {
    color: var(--ink-heavy);
    font-weight: 600;
    border-left-color: var(--accent-blue);
    background: var(--bg-surface-elevated);
}

/* Case Study Sidebar */
.csd-sticky-panel {
    position: sticky;
    top: 120px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    background: #ffffff;
    border: 1px solid var(--border-standard);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-figma-card);
}

.csd-panel-block h4 {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--ink-faint);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.csd-panel-block p {
    font-size: 0.88rem;
    color: var(--ink-muted);
    line-height: 1.5;
}

.csd-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.csd-tags li {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-blue);
    background: #eff6ff;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}

.csd-results-block {
    border-top: 1px solid var(--border-subtle);
    padding-top: 20px;
}

.csd-results-block .csf-metric-val {
    font-family: var(--font-mono);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent-blue);
    display: block;
}

.csd-results-block .csf-metric-lbl {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--ink-muted);
    display: block;
    margin: 4px 0 10px 0;
}

.csd-results-block p {
    font-weight: 400;
}

/* ==========================================================
   Content Typography (shared by articles & case studies)
   ========================================================== */
.a-content {
    max-width: 720px;
}

.a-content h2 {
    font-size: 1.55rem;
    color: var(--ink-heavy);
    margin: 40px 0 16px 0;
    letter-spacing: -0.01em;
    scroll-margin-top: 120px;
}

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

.a-content h3 {
    font-size: 1.15rem;
    color: var(--ink-heavy);
    margin: 28px 0 10px 0;
}

.a-content h4 {
    font-size: 1rem;
    color: var(--ink-heavy);
    margin: 20px 0 8px 0;
}

.a-content p {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--ink-standard);
    margin-bottom: 20px;
}

.a-content p.a-lead {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--ink-heavy);
}

.a-content p.article-img-text {
    font-size: 0.92rem;
    color: var(--ink-muted);
}

.a-content ul {
    margin: 0 0 20px 20px;
    color: var(--ink-standard);
    line-height: 1.7;
}

.a-content li {
    margin-bottom: 8px;
}

.a-content strong {
    color: var(--ink-heavy);
}

.a-content img.article-img {
    width: 100%;
    display: block;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    margin: 24px 0;
}

.a-quote {
    border-left: 3px solid var(--accent-blue);
    padding: 16px 24px;
    margin: 32px 0;
    font-size: 1.15rem;
    font-style: italic;
    color: var(--ink-heavy);
    background: var(--bg-surface-elevated);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.a-callout {
    background: var(--bg-surface-elevated);
    border-left: 3px solid var(--accent-purple);
    padding: 20px 24px;
    margin: 20px 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.a-callout h4 {
    color: var(--accent-purple);
    margin-bottom: 8px;
    margin-top: 0;
}

.a-callout p {
    margin: 0;
}

.a-subitem-grid {
    display: grid;
    gap: 24px;
    margin: 24px 0;
}

.a-subitem h3,
.a-subitem h4 {
    color: var(--accent-purple);
    margin-bottom: 10px;
}

.a-subitem p {
    margin: 0;
}

.a-author-bio {
    text-align: left;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin: 48px 0 32px 0;
}

.a-author-bio h3 {
    color: var(--ink-heavy);
    margin-bottom: 6px;
    margin-top: 0;
}

.a-author-bio h4 {
    color: var(--accent-purple);
    margin-bottom: 14px;
    margin-top: 0;
    font-size: 1.05rem;
}

.a-author-bio p {
    color: var(--ink-muted);
    font-size: 0.92rem;
    line-height: 1.6;
    margin: 0;
}

.a-cta-box {
    text-align: center;
    background: var(--ink-heavy);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    margin-top: 48px;
}

.a-cta-box h3 {
    color: #ffffff;
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.a-cta-box p {
    color: #cbd5e1;
    margin-bottom: 24px;
}

/* ==========================================================
   Responsive Adaptations
   ========================================================== */
@media (max-width: 992px) {

    .a-title,
    .csd-title {
        font-size: 2rem;
    }
}
