/* ===========================================================================
   Article / blog engine styling. Self-contained; loaded site-wide from _Host.
   =========================================================================== */
:root {
    --art-ink: #1a1d21;
    --art-muted: #5b636b;
    --art-line: #e6e9ec;
    --art-accent: #2f6fed;
    --art-accent-dark: #1f4fb0;
    --art-bg-soft: #f7f9fb;
    --art-radius: 14px;
    --art-shadow: 0 6px 22px rgba(20, 30, 50, 0.08);
}

/* ---------- Index ---------- */
.articles-index {
    max-width: 1120px;
    margin: 0 auto;
    padding: 8px 16px 64px;
}
.articles-hero {
    position: relative;
    padding: 28px 0 18px;
    border-bottom: 1px solid var(--art-line);
    margin-bottom: 24px;
}
.articles-hero h1 {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 8px;
    color: var(--art-ink);
}
.articles-hero-sub {
    font-size: 1.12rem;
    color: var(--art-muted);
    max-width: 760px;
    margin: 0;
}
.rss-link {
    position: absolute;
    top: 32px;
    right: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #b85c00;
    border: 1px solid #f0c089;
    border-radius: 6px;
    padding: 2px 7px;
    text-decoration: none;
}

.articles-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
}
.article-search {
    flex: 1 1 260px;
    max-width: 360px;
    border: 1px solid var(--art-line);
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.article-search:focus {
    border-color: var(--art-accent);
    box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.12);
}
.tag-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip {
    border: 1px solid var(--art-line);
    background: #fff;
    color: var(--art-muted);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.tag-chip:hover { border-color: var(--art-accent); color: var(--art-accent); }
.tag-chip.active { background: var(--art-accent); border-color: var(--art-accent); color: #fff; }

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 26px;
}
.article-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--art-line);
    border-radius: var(--art-radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--art-shadow);
    border-color: #d4dae1;
    text-decoration: none;
    color: inherit;
}
.article-card-media {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--art-bg-soft);
    overflow: hidden;
}
.article-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.play-badge {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 54px; height: 54px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.55);
    color: #fff; font-size: 1.3rem;
    border-radius: 50%;
}
.article-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.article-card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-tag {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--art-accent-dark);
    background: rgba(47, 111, 237, 0.08);
    border-radius: 5px;
    padding: 2px 7px;
    text-decoration: none;
}
.article-card-title { font-size: 1.18rem; font-weight: 700; margin: 0; line-height: 1.3; color: var(--art-ink); }
.article-card-summary { font-size: 0.92rem; color: var(--art-muted); margin: 0; flex: 1; }
.article-card-meta { font-size: 0.78rem; color: #97a0a8; margin-top: 4px; }

.articles-empty { color: var(--art-muted); padding: 40px 0; text-align: center; }

/* ---------- Detail ---------- */
.article-page { max-width: 760px; margin: 0 auto; padding: 8px 18px 72px; }
.article-breadcrumb { font-size: 0.82rem; color: var(--art-muted); margin: 8px 0 18px; }
.article-breadcrumb a { color: var(--art-accent); text-decoration: none; }
.article-breadcrumb span { margin: 0 6px; color: #c2c8ce; }

.article-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--art-ink);
    margin: 0 0 14px;
}
.article-meta { font-size: 0.86rem; color: var(--art-muted); display: flex; flex-wrap: wrap; gap: 8px; }
.article-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }

.video-embed {
    position: relative;
    aspect-ratio: 16 / 9;
    margin: 26px 0;
    border-radius: var(--art-radius);
    overflow: hidden;
    box-shadow: var(--art-shadow);
    background: #000;
}
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.article-hero-img { width: 100%; border-radius: var(--art-radius); margin: 26px 0; box-shadow: var(--art-shadow); }

/* Body typography */
.article-body { font-size: 1.12rem; line-height: 1.75; color: #24292e; }
.article-body h2 { font-size: 1.6rem; font-weight: 750; margin: 38px 0 12px; letter-spacing: -0.01em; color: var(--art-ink); }
.article-body h3 { font-size: 1.28rem; font-weight: 700; margin: 30px 0 10px; color: var(--art-ink); }
.article-body p { margin: 0 0 18px; }
.article-body a { color: var(--art-accent); text-decoration: underline; text-underline-offset: 2px; }
.article-body ul, .article-body ol { margin: 0 0 18px; padding-left: 1.5em; }
.article-body li { margin: 6px 0; }
.article-body img { max-width: 100%; border-radius: 10px; margin: 12px 0; border: 1px solid var(--art-line); }
.article-body blockquote {
    margin: 22px 0; padding: 4px 20px;
    border-left: 4px solid var(--art-accent);
    background: var(--art-bg-soft);
    color: #3a4148; font-style: italic; border-radius: 0 8px 8px 0;
}
.article-body code {
    background: #f0f2f5; border-radius: 5px; padding: 1px 6px;
    font-size: 0.9em; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.article-body pre {
    background: #0f172a; color: #e2e8f0; padding: 16px 18px;
    border-radius: 10px; overflow-x: auto; margin: 0 0 20px;
}
.article-body pre code { background: none; padding: 0; color: inherit; }
.article-body table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 0.96rem; }
.article-body th, .article-body td { border: 1px solid var(--art-line); padding: 8px 12px; text-align: left; }
.article-body th { background: var(--art-bg-soft); }

/* Share + CTA + related */
.article-share {
    display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
    margin: 36px 0 0; padding-top: 18px; border-top: 1px solid var(--art-line);
    font-size: 0.9rem; color: var(--art-muted);
}
.article-share a, .article-share button {
    color: var(--art-accent); text-decoration: none; font-weight: 600;
    background: none; border: 1px solid var(--art-line); border-radius: 8px;
    padding: 5px 12px; cursor: pointer; font-size: 0.85rem;
}
.article-share a:hover, .article-share button:hover { border-color: var(--art-accent); }

.article-cta {
    display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between;
    margin: 36px 0; padding: 24px 26px;
    background: linear-gradient(135deg, #eff5ff, #f7f9fb);
    border: 1px solid #dbe6fb; border-radius: var(--art-radius);
}
.article-cta h3 { margin: 0 0 6px; font-size: 1.25rem; color: var(--art-ink); }
.article-cta p { margin: 0; color: var(--art-muted); font-size: 0.95rem; }
.article-cta-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-primary, .btn-secondary {
    display: inline-block; padding: 10px 20px; border-radius: 9px;
    font-weight: 700; text-decoration: none; font-size: 0.95rem; white-space: nowrap;
}
.btn-primary { background: var(--art-accent); color: #fff; }
.btn-primary:hover { background: var(--art-accent-dark); color: #fff; }
.btn-secondary { background: #fff; color: var(--art-accent); border: 1px solid #cdd9ef; }
.btn-secondary:hover { border-color: var(--art-accent); }

.article-related { margin-top: 40px; }
.article-related h3 { font-size: 1.2rem; margin: 0 0 16px; color: var(--art-ink); }
.article-related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.article-related-card {
    display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--art-ink);
    border: 1px solid var(--art-line); border-radius: 10px; overflow: hidden; transition: border-color .15s;
}
.article-related-card:hover { border-color: var(--art-accent); color: var(--art-ink); text-decoration: none; }
.article-related-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.article-related-card span { padding: 0 12px 12px; font-size: 0.9rem; font-weight: 600; }

.article-backlink { margin-top: 34px; }
.article-backlink a { color: var(--art-accent); text-decoration: none; }

@media (max-width: 640px) {
    .articles-hero h1 { font-size: 1.9rem; }
    .article-header h1 { font-size: 1.9rem; }
    .article-body { font-size: 1.05rem; }
    .rss-link { position: static; display: inline-block; margin-top: 10px; }
}
