/* blog-detail.css — single post layout */

:root {
    --bd-primary: #06357A;
    --bd-border: #e2e8f0;
    --bd-radius: 0.75rem;
    --bd-text: #1e293b;
    --bd-muted: #64748b;
}

/* ── Main article card ──────────────────────────── */
.blog-detail-main {
    background: #fff;
    border: 1px solid var(--bd-border);
    border-radius: var(--bd-radius);
    overflow: hidden;
}

.blog-hero-img {
    width: 100%;
    aspect-ratio: 16 / 7;
    object-fit: cover;
    display: block;
}

.blog-body {
    padding: 2.5rem 3rem;
}

@media (max-width: 767px) {
    .blog-body { padding: 1.5rem; }
}

/* ── Author / meta bar ──────────────────────────── */
.blog-author-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.blog-date-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.blog-date-meta__item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--bd-border);
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
}

.blog-date-meta__label {
    color: var(--bd-primary);
    font-weight: 700;
}

/* ── Table of Contents ──────────────────────────── */
.toc-box {
    background: #f8fafc;
    border: 1px solid var(--bd-border);
    border-left: 4px solid var(--bd-primary);
    border-radius: 0 var(--bd-radius) var(--bd-radius) 0;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.toc-box__title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bd-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.toc-box__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-box__list li { margin: 0.3rem 0; }

.toc-box__list a {
    color: #334155;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    transition: color 0.15s;
}

.toc-box__list a:hover { color: var(--bd-primary); }

.toc-box__list a::before {
    content: "—";
    color: var(--bd-primary);
    opacity: 0.35;
    flex-shrink: 0;
    font-size: 0.7rem;
}

.toc-box__list li.toc-h3 a {
    padding-left: 1.25rem;
    font-size: 0.85rem;
    color: var(--bd-muted);
}

/* ── Article body ───────────────────────────────── */
.blog-article-body {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--bd-text);
}

.blog-article-body h2,
.blog-article-body h3 {
    color: var(--bd-primary);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    scroll-margin-top: 80px;
}

.blog-article-body p { margin-bottom: 1.25rem; }

.blog-article-body a {
    color: var(--bd-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.blog-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.blog-article-body blockquote {
    border-left: 4px solid var(--bd-primary);
    padding: 0.75rem 1.25rem;
    background: #f0f6ff;
    border-radius: 0 0.5rem 0.5rem 0;
    margin: 1.5rem 0;
    color: #334155;
}

/* ── Share bar ──────────────────────────────────── */
.blog-share {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.blog-share__label {
    color: #656C73;
    font-weight: 700;
    margin-right: 4px;
}

.blog-share__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--bd-primary);
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.blog-share__link:hover {
    background: var(--bd-primary);
    color: #ffffff;
    transform: translateY(-1px);
}

.blog-share__link:focus-visible {
    outline: 3px solid rgba(6, 53, 122, 0.25);
    outline-offset: 3px;
}

/* ── Prev / Next navigation ─────────────────────── */
.blog-nav-link {
    border: 1px solid var(--bd-border);
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--bd-text);
    transition: border-color 0.15s, background 0.15s;
    height: 100%;
}

.blog-nav-link:hover {
    border-color: var(--bd-primary);
    background: #f0f6ff;
    color: var(--bd-text);
}

.blog-nav-link--next {
    justify-content: flex-end;
    text-align: right;
}

.blog-nav-link i { color: var(--bd-primary); font-size: 1.4rem; }

/* ── Author card ────────────────────────────────── */
.author-card__label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--bd-muted);
    margin-bottom: 0.75rem;
}

.author-card {
    border: 1px solid var(--bd-border);
    border-radius: var(--bd-radius);
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

/* ── Sidebar widgets ────────────────────────────── */
.sidebar-widget {
    background: #fff;
    border: 1px solid var(--bd-border);
    border-radius: var(--bd-radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.sidebar-widget__title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bd-primary);
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--bd-primary);
    display: inline-block;
}

.sidebar-search .form-control {
    border-color: var(--bd-border);
    font-size: 0.9rem;
}

.sidebar-search .btn {
    background: var(--bd-primary);
    border-color: var(--bd-primary);
    color: #fff;
}

.sidebar-post-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-post-list li {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--bd-border);
}

.sidebar-post-list li:last-child { border-bottom: none; }

.sidebar-post-list a {
    color: var(--bd-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    display: block;
    transition: color 0.15s;
}

.sidebar-post-list a:hover { color: var(--bd-primary); }

.sidebar-post__meta {
    font-size: 0.78rem;
    color: var(--bd-muted);
    margin: 0.2rem 0 0;
}

.sidebar-popular-card {
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 0.85rem;
    position: relative;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    display: block;
    text-decoration: none;
}

.sidebar-popular-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(6, 35, 80, 0.85), rgba(6, 35, 80, 0.1));
}

.sidebar-popular-card__body {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0.75rem;
}

.sidebar-popular-card__date {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0.25rem;
}

.sidebar-popular-card__title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
    margin: 0;
}

/* ── Back to top button ─────────────────────────── */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bd-primary);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.2s, transform 0.2s;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(6, 53, 122, 0.35);
}

.back-to-top.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover { background: #0d4ca0; }

/* ── AI Analyze Widget ──────────────────────────── */
.ai-widget {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 998;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.ai-widget__dropdown {
    background: #fff;
    border: 1px solid var(--bd-border);
    border-radius: 0.75rem;
    padding: 0.6rem 0.5rem;
    margin-bottom: 0.6rem;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.13);
    min-width: 170px;
}

.ai-widget__dropdown[hidden] { display: none; }

.ai-widget__label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--bd-muted);
    margin: 0.2rem 0 0.4rem 0.5rem;
}

.ai-widget__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ai-widget__option {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.45rem 0.6rem;
    border: none;
    background: transparent;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--bd-text);
    transition: background 0.15s;
    text-align: left;
}

.ai-widget__option:hover { background: #f1f5f9; }

.ai-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
}

.ai-icon--gpt        { background: #10a37f; color: #fff; }
.ai-icon--claude     { background: #d97706; color: #fff; font-size: 0.9rem; }
.ai-icon--grok       { background: #000;    color: #fff; font-size: 0.7rem; }
.ai-icon--perplexity { background: #1fb8cd; color: #fff; }

.ai-widget__trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bd-primary);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.65rem 1.15rem;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(6, 53, 122, 0.38);
    transition: background 0.2s, transform 0.15s;
    white-space: nowrap;
}

.ai-widget__trigger:hover {
    background: #0d4ca0;
    transform: translateY(-1px);
}

@media (max-width: 575px) {
    .ai-widget { bottom: 1rem; left: 1rem; }
    .ai-widget__trigger .ai-trigger-label { display: none; }
    .ai-widget__trigger { padding: 0.65rem 0.85rem; }
}

/* ── Feature announcement modal ─────────────────── */
@keyframes announce-overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes announce-card-in {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.ai-announce-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: announce-overlay-in 0.2s ease both;
}

.ai-announce-overlay[hidden] { display: none; }

.ai-announce {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 24px 64px rgba(6, 53, 122, 0.2);
    max-width: 430px;
    width: 100%;
    padding: 2rem 2rem 1.75rem;
    position: relative;
    text-align: center;
    animation: announce-card-in 0.25s ease both;
}

.ai-announce__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.15s;
}

.ai-announce__close:hover { color: #475569; }

.ai-announce__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #eef3fb;
    color: var(--bd-primary);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 1.25rem;
}

.ai-announce__icon {
    width: 60px;
    height: 60px;
    background: #eef3fb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    color: var(--bd-primary);
    font-size: 1.4rem;
}

.ai-announce__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--bd-text);
    margin: 0 0 0.55rem;
}

.ai-announce__desc {
    font-size: 0.88rem;
    color: var(--bd-muted);
    line-height: 1.65;
    margin: 0 0 1.4rem;
}

.ai-announce__providers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.ai-announce__providers .ai-icon { width: 32px; height: 32px; font-size: 0.8rem; }

.ai-announce__try {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    background: var(--bd-primary);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
    margin-bottom: 0.75rem;
}

.ai-announce__try:hover { background: #0d4ca0; }

.ai-announce__skip {
    background: none;
    border: none;
    color: var(--bd-muted);
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s;
    padding: 0;
}

.ai-announce__skip:hover { color: var(--bd-text); }
