/* =========================================================
   Blog article page — kvmsync Aluminum Lab (matches style.css)
   DOM contract for blog-writer preserved (IDs / key classes).
   ========================================================= */

/* ── Reading progress ── */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: linear-gradient(90deg, var(--accent) 0%, #63a3ff 100%);
    z-index: 60;
    transition: width 0.1s linear;
}

/* ── Article banner (dark header, aligned with page-banner) ── */
.article-page .article-banner {
    position: relative;
    overflow: hidden;
    padding: 5.75rem 0 2.75rem;
    background: linear-gradient(145deg, #080e1a 0%, #0f172a 45%, #111d31 100%);
    color: #fff;
}
@media (min-width: 768px) {
    .article-page .article-banner { padding: 6.25rem 0 3rem; }
}
.article-page .article-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 120% at 80% -10%, rgba(26, 109, 255, 0.22), transparent 55%),
        radial-gradient(ellipse 50% 80% at 5% 80%, rgba(26, 109, 255, 0.1), transparent 50%);
    pointer-events: none;
}
.article-page .article-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(180deg, transparent, rgba(0,0,0,0.35) 40%, transparent);
    pointer-events: none;
}
.article-banner__inner {
    position: relative;
    z-index: 1;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1rem;
}
@media (min-width: 640px) {
    .article-banner__inner { padding: 0 1.5rem; }
}

/* ── Breadcrumb strip (light zone, always visible) ── */
.article-crumb-bar {
    background: rgba(255, 255, 255, 0.55);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}
.article-crumb-bar__inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0.85rem 1rem;
}
@media (min-width: 640px) {
    .article-crumb-bar__inner { padding: 0.9rem 1.5rem; }
}

.site-article-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.55rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--muted);
}
.site-article-breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}
.site-article-breadcrumb a:hover { color: var(--accent); }
.site-article-breadcrumb a i { font-size: 0.85rem; }
.site-article-breadcrumb > i.ph {
    font-size: 0.65rem;
    color: var(--line);
}
.site-article-breadcrumb span {
    color: var(--ink);
    font-weight: 600;
    max-width: 36rem;
    line-height: 1.35;
}

/* Hero meta inside banner */
.site-article-hero {
    max-width: 52rem;
}
.site-article-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 1.15rem;
}
.site-article-tag,
.article-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.7rem;
    border-radius: 9999px;
    background: rgba(26, 109, 255, 0.18);
    border: 1px solid rgba(99, 163, 255, 0.35);
    color: #93c5fd;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.site-article-meta-item {
    font-size: 0.78rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.48);
    font-variant-numeric: tabular-nums;
}
.site-article-meta-dot {
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.65rem;
}
.site-article-title {
    font-family: var(--font-display);
    font-size: clamp(1.65rem, 4.2vw, 2.65rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.1;
    color: #fff;
    margin-bottom: 1rem;
}
.site-article-deck {
    font-size: 1.02rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.55);
    max-width: 44rem;
}

/* ── Body layout ── */
.article-page__body {
    padding-top: 2rem;
}

.site-article-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
}
@media (min-width: 1024px) {
    .site-article-layout {
        grid-template-columns: minmax(0, 1fr) 248px;
        gap: 3rem;
    }
}

/* Mobile TOC */
.site-article-toc-mobile {
    display: block;
    margin-bottom: 1.5rem;
}
@media (min-width: 1024px) {
    .site-article-toc-mobile { display: none; }
}
.site-article-toc-mobile summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.15rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: 0.85rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    list-style: none;
}
.site-article-toc-mobile summary::-webkit-details-marker { display: none; }
.site-article-toc-mobile .site-article-toc {
    margin-top: 0.5rem;
    padding: 0.65rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: 0.85rem;
}

/* ── Article body card ── */
.site-article-body {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
}
.site-article-body-accent { display: none; }
.site-article-body-inner {
    padding: 0;
}

/* ── Prose ── */
.article-body h2 {
    scroll-margin-top: 7rem;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink) !important;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.article-body h3:not(.cta-title) {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink) !important;
    margin-bottom: 0.35rem;
}
.article-body p {
    font-size: 0.92rem;
    line-height: 1.8;
    color: var(--ink-soft);
    margin-bottom: 1rem;
    font-weight: 400;
}
.article-body strong {
    color: var(--ink);
    font-weight: 600;
}
.article-body a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(26, 109, 255, 0.25);
    transition: border-color 0.2s;
}
.article-body a:hover { border-bottom-color: var(--accent); }
.article-body ul,
.article-body ol {
    margin: 0;
    padding: 0;
    list-style: none;
}
.article-body section {
    margin-bottom: 2.5rem;
}
.article-body section:last-child { margin-bottom: 0; }

.article-lead {
    background: rgba(26, 109, 255, 0.05);
    border: 1px solid rgba(26, 109, 255, 0.14);
    border-radius: 1rem;
    padding: 1.2rem 1.35rem;
    margin-bottom: 1.75rem;
    font-size: 0.92rem;
    color: var(--ink-soft);
    line-height: 1.75;
}

.article-body .site-article-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 2.25rem;
}
.article-body .site-article-topic {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--muted);
    background: var(--paper);
    border: 1px solid var(--line);
    padding: 0.32rem 0.7rem;
    border-radius: 9999px;
}

.article-section-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 0.45rem;
    background: var(--ink);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    flex-shrink: 0;
}
.article-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    border-radius: 0.85rem;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #fff;
}
.data-table thead tr { background: var(--paper); }
.data-table th {
    padding: 0.7rem 1rem;
    font-weight: 700;
    text-align: left;
    color: var(--ink);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.data-table td {
    padding: 0.7rem 1rem;
    border-top: 1px solid rgba(15, 23, 42, 0.07);
    color: var(--ink-soft);
    font-weight: 500;
}
.data-table tbody tr:hover {
    background: rgba(26, 109, 255, 0.04);
}
.article-body .overflow-x-auto { margin-bottom: 1.15rem; }

.article-body .rounded-xl.border,
.article-body .article-card-box {
    border-radius: 0.85rem !important;
    border: 1px solid var(--line) !important;
    background: var(--paper) !important;
    padding: 1.15rem !important;
}
.article-body .grid.sm\:grid-cols-2 {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
@media (min-width: 640px) {
    .article-body .grid.sm\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

.article-body li.flex.gap-2,
.article-body li.flex.gap-3 {
    display: flex;
    gap: 0.6rem;
    font-size: 0.92rem;
    color: var(--ink-soft);
    line-height: 1.7;
}
.article-body li.flex.gap-2 span:first-child,
.article-body li.flex.gap-3 span:first-child {
    color: var(--accent);
    font-weight: 800;
    flex-shrink: 0;
}
.article-body ol.space-y-3 li { margin-bottom: 0.7rem; }

/* FAQ */
.article-body details,
.article-faq details {
    border-radius: 0.85rem;
    border: 1px solid var(--line);
    background: var(--paper);
    padding: 0.95rem 1.15rem;
    margin-bottom: 0.65rem;
}
.article-body details summary,
.article-faq summary {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}
.article-body details summary::-webkit-details-marker,
.article-faq summary::-webkit-details-marker { display: none; }
.article-body details p,
.article-faq details p {
    margin-top: 0.7rem;
    margin-bottom: 0;
}
.article-body details i {
    color: var(--muted);
    transition: transform 0.2s;
    flex-shrink: 0;
}
.article-body details[open] i { transform: rotate(180deg); }

.article-body .rounded-xl.p-5 {
    border-radius: 1rem !important;
    padding: 1.35rem !important;
    background: var(--paper) !important;
    border: 1px solid var(--line) !important;
    color: var(--ink-soft);
}

/* In-article CTA — horizontal band, outside card feel */
.article-cta {
    position: relative;
    overflow: hidden;
    margin-top: 2.25rem;
    padding: 1.75rem 1.35rem;
    border-radius: 1.25rem;
    color: #fff;
    background: linear-gradient(135deg, #0b1220 0%, #0f172a 48%, #0d1a2e 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 60px -24px rgba(15, 23, 42, 0.45);
    isolation: isolate;
}
@media (min-width: 768px) {
    .article-cta { padding: 2rem 2.25rem; }
}
.article-cta::before {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -60px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(26, 109, 255, 0.22), transparent 62%);
    pointer-events: none;
    z-index: 0;
}
.article-cta__grid {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}
@media (min-width: 768px) {
    .article-cta__grid {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 2rem;
    }
}
.article-cta__copy { min-width: 0; }
.article-cta__actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex-shrink: 0;
}
@media (min-width: 640px) {
    .article-cta__actions {
        flex-direction: row;
        align-items: center;
    }
}
.article-cta .cta-eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #93c5fd;
    margin-bottom: 0.5rem;
}
.article-cta .cta-title {
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 2.5vw, 1.55rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.25;
    color: #ffffff !important;
    margin-bottom: 0.4rem;
}
.article-cta .cta-desc {
    font-size: 0.88rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.62);
    max-width: 36rem;
}
.article-cta a {
    text-decoration: none;
    border: none;
}
.article-cta .cta-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    height: 2.85rem;
    padding: 0 1.35rem;
    background: #fff;
    color: var(--ink) !important;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 0.75rem;
    transition: transform 0.2s, background 0.2s;
    white-space: nowrap;
}
.article-cta .cta-btn-primary:hover {
    transform: translateY(-1px);
    background: #f1f5f9;
    color: var(--ink) !important;
}
.article-cta .cta-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    height: 2.85rem;
    padding: 0 1.35rem;
    color: #fff !important;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.06);
    transition: background 0.2s;
    white-space: nowrap;
}
.article-cta .cta-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff !important;
}
/* legacy flex wrapper from blog-writer */
.article-cta .flex {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
@media (min-width: 640px) {
    .article-cta .flex { flex-direction: row; }
}

.site-article-back {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 1.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s, gap 0.2s;
}
.site-article-back:hover {
    color: var(--accent);
    gap: 0.55rem;
}

/* ── Sidebar ── */
.site-article-sidebar {
    display: none;
}
@media (min-width: 1024px) {
    .site-article-sidebar {
        display: flex;
        flex-direction: column;
        gap: 0.85rem;
        position: sticky;
        top: 6.5rem;
    }
}
.site-article-panel {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: 1rem;
    padding: 1.15rem;
}
.site-article-panel-title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.85rem;
}
.site-article-toc {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.toc-link,
.site-article-toc-link {
    display: block;
    padding: 0.45rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    border-radius: 0.55rem;
    border-left: 2px solid transparent;
    transition: all 0.18s;
}
.toc-link:hover,
.site-article-toc-link:hover {
    color: var(--ink);
    background: var(--paper);
}
.toc-link.active,
.toc-link.is-active,
.site-article-toc-link.is-active {
    color: var(--accent);
    font-weight: 600;
    background: rgba(26, 109, 255, 0.08);
    border-left-color: var(--accent);
}
.site-article-info dl {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.site-article-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.site-article-info dt {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--muted);
}
.site-article-info dd {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink);
}
.site-article-sidebar-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.8rem 1rem;
    background: var(--ink);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 0.75rem;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}
.site-article-sidebar-cta:hover {
    color: #fff;
    background: #000;
    transform: translateY(-1px);
}

/* ── Bottom purchase dock (full-width dark strip) ── */
#blog-purchase-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    transform: translateY(110%);
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}
#blog-purchase-bar.is-visible { transform: translateY(0); }
#blog-purchase-bar.is-hidden-permanently { display: none; }

.blog-purchase-dock {
    pointer-events: auto;
    background: linear-gradient(180deg, rgba(8, 14, 26, 0) 0%, rgba(8, 14, 26, 0.85) 28%, #080e1a 100%);
    padding: 0.75rem 1rem 1rem;
}
@media (min-width: 640px) {
    .blog-purchase-dock { padding: 1rem 1.5rem 1.25rem; }
}
.blog-purchase-dock__inner {
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, #0f172a 0%, #111d31 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
@media (min-width: 640px) {
    .blog-purchase-dock__inner {
        padding: 0.9rem 1.25rem;
        gap: 1rem;
    }
}
.blog-purchase-dock__brand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.65rem;
    background: rgba(26, 109, 255, 0.18);
    border: 1px solid rgba(99, 163, 255, 0.35);
    color: #93c5fd;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.blog-purchase-dock__copy {
    flex: 1;
    min-width: 0;
}
.blog-purchase-dock__kicker {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #93c5fd;
    margin-bottom: 0.1rem;
}
.blog-purchase-dock__title {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}
.blog-purchase-dock__actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}
.blog-purchase-dock__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    height: 2.5rem;
    padding: 0 1.1rem;
    background: #fff;
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 0.65rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s, transform 0.2s;
}
.blog-purchase-dock__cta:hover {
    color: var(--ink);
    background: #f1f5f9;
    transform: translateY(-1px);
}
.blog-purchase-dock__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.blog-purchase-dock__close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* Mobile floating pill */
#blog-purchase-float {
    position: fixed;
    bottom: 1.25rem;
    right: 1rem;
    z-index: 40;
    transition: opacity 0.3s, transform 0.3s;
}
.blog-purchase-float__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem 0.65rem 0.85rem;
    background: var(--accent);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 9999px;
    text-decoration: none;
    box-shadow: 0 12px 32px rgba(26, 109, 255, 0.45);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.blog-purchase-float__btn i {
    font-size: 1.05rem;
}
.blog-purchase-float__btn:hover {
    color: #fff;
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(26, 109, 255, 0.5);
}
@media (min-width: 1024px) {
    #blog-purchase-float { display: none; }
}
