.blog-hero {
    padding: 4rem 0 2rem;
    text-align: center
}

.blog-hero h1 {
    margin: 0 0 .8rem;
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    line-height: 1.08
}

.blog-hero p {
    max-width: 720px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.75
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin: 1.5rem 0 3rem
}

.blog-topic-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: .55rem;
    max-width: 920px;
    margin: 0 auto 1.5rem;
}

.blog-topic-nav a {
    padding: .48rem .8rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    background: var(--surface);
    font-size: .88rem;
    font-weight: 700;
    text-decoration: none;
}

.blog-topic-nav a:hover { border-color: var(--accent-2); color: var(--accent-2); }

.blog-card {
    display: flex;
    flex-direction: column;
    padding: 1.35rem;
    border-radius: 1.2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    transition: transform .2s ease, border-color .2s ease
}

.blog-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent)
}

.blog-card .blog-tag {
    display: inline-flex;
    width: max-content;
    padding: .35rem .65rem;
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--accent-2);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em
}

.blog-card h2 {
    font-size: 1.35rem;
    line-height: 1.3;
    margin: 1rem 0 .65rem
}

.blog-card p {
    color: var(--muted);
    line-height: 1.65;
    margin: 0 0 1.2rem
}

.blog-card .blog-meta {
    color: var(--muted);
    font-size: .85rem;
    margin-bottom: 1rem
}

.blog-card .read-more {
    margin-top: auto;
    width: max-content
}

.blog-card-image {
    width: calc(100% + 2.7rem);
    height: 170px;
    margin: -1.35rem -1.35rem 1.15rem;
    object-fit: cover;
    border-radius: 1.2rem 1.2rem 0 0;
    border-bottom: 1px solid var(--border)
}

.blog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .5rem;
    margin: -1rem 0 3.5rem;
    font-weight: 700
}

.blog-pagination a,
.blog-pagination span {
    min-width: 2.6rem;
    min-height: 2.6rem;
    padding: .6rem .9rem;
    border: 1px solid var(--border);
    border-radius: .75rem;
    color: var(--text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .15s ease, box-shadow .2s ease;
    user-select: none;
}

.blog-pagination a:hover {
    border-color: var(--accent-2);
    color: var(--accent-2);
    background: rgba(56, 189, 248, 0.08);
    transform: translateY(-2px);
}

.blog-pagination .is-active {
    background: linear-gradient(135deg, #7c4dff, #38bdf8);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(124, 77, 255, 0.35);
    pointer-events: none;
}

.blog-pagination .is-disabled {
    opacity: .4;
    cursor: not-allowed;
    border-color: var(--border);
    background: transparent;
}

.blog-cta {
    margin: 0 0 3rem;
    padding: 2rem;
    border-radius: 1.4rem;
    background: linear-gradient(135deg, rgba(124, 77, 255, .18), rgba(34, 211, 238, .12));
    border: 1px solid var(--border);
    text-align: center
}

.blog-cta h2 {
    margin: 0 0 .6rem
}

.blog-cta p {
    color: var(--muted);
    line-height: 1.6;
    margin: 0 auto 1rem;
    max-width: 650px
}

.article-shell {
    max-width: 900px;
    margin: 0 auto;
    padding: 3.5rem 0
}

.article-header {
    margin-bottom: 2rem
}

.article-header .blog-tag {
    display: inline-flex;
    padding: .4rem .7rem;
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--accent-2);
    font-size: .8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em
}

.article-header h1 {
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1.12;
    margin: 1rem 0
}

.article-header .article-meta {
    color: var(--muted)
}

.article-content {
    padding: 2rem;
    border-radius: 1.4rem;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow)
}

.article-content h2 {
    font-size: 1.65rem;
    margin: 2rem 0 .75rem
}

.article-content h3 {
    font-size: 1.2rem;
    margin: 1.4rem 0 .5rem
}

.article-content p,
.article-content li {
    color: var(--muted);
    line-height: 1.85
}

.article-content ul,
.article-content ol {
    padding-left: 1.35rem
}

.article-content strong {
    color: var(--text)
}

.article-content a {
    color: var(--accent-2)
}

.article-content table {
    display: block;
    overflow-x: auto;
    width: 100%;
    border-collapse: collapse;
    margin: 1.4rem 0;
    font-size: .94rem;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: .8rem;
}

.article-content th,
.article-content td {
    padding: .75rem;
    vertical-align: top;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.article-content th { color: var(--text); background: var(--surface-strong); }
.article-content tr:last-child td { border-bottom: 0; }
.editorial-note { color: var(--muted); font-size: .92rem; font-style: italic; }

.article-callout {
    margin: 1.5rem 0;
    padding: 1.2rem;
    border-left: 3px solid var(--accent-2);
    border-radius: .8rem;
    background: var(--surface-strong)
}

.article-tip {
    margin: 1.5rem 0;
    padding: 1.25rem 1.5rem;
    border-left: 4px solid #38bdf8;
    border-radius: 0.8rem;
    background: rgba(56, 189, 248, 0.08);
}

.article-tip strong {
    color: #38bdf8;
    display: block;
    margin-bottom: 0.3rem;
}

.blog-toc {
    margin: 1.5rem 0 2rem;
    padding: 1.25rem 1.5rem;
    border-radius: 1rem;
    background: var(--surface-strong);
    border: 1px solid var(--border);
}

.blog-toc h4 {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
    color: var(--text);
}

.blog-toc ul {
    margin: 0;
    padding-left: 1.2rem;
}

.blog-toc li {
    margin-bottom: 0.4rem;
}

.blog-toc a {
    color: var(--accent-2);
    text-decoration: none;
}

.blog-toc a:hover {
    text-decoration: underline;
}

/* Responsive Image Slot & Frame */
.blog-img-frame {
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.blog-img-wrapper {
    position: relative;
    width: 100%;
    max-width: 820px;
    border-radius: 1rem;
    overflow: hidden;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.blog-img-wrapper img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 1rem;
    transition: opacity 0.3s ease;
}

/* Graceful Missing Image Placeholder */
.blog-img-placeholder {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    min-height: 220px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
    border: 2px dashed rgba(56, 189, 248, 0.4);
    border-radius: 1rem;
    text-align: center;
    color: #94a3b8;
}

.blog-img-placeholder-icon {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.blog-img-placeholder-title {
    font-weight: 700;
    color: #f8fafc;
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

.blog-img-placeholder-path {
    font-family: monospace;
    font-size: 0.85rem;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    margin-top: 0.4rem;
}

.blog-img-caption {
    margin-top: 0.65rem;
    font-size: 0.88rem;
    color: var(--muted);
    text-align: center;
    font-style: italic;
}

/* FAQ Section Styling */
.blog-faq-section {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.blog-faq-item {
    margin-bottom: 1.25rem;
    padding: 1.2rem 1.4rem;
    border-radius: 0.9rem;
    background: var(--surface-strong);
    border: 1px solid var(--border);
}

.blog-faq-question {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.blog-faq-answer {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.article-cta {
    margin-top: 2.5rem;
    padding: 2rem;
    border-radius: 1.2rem;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(129, 140, 248, 0.15));
    border: 1px solid rgba(56, 189, 248, 0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

.article-cta h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text);
}

.article-cta p {
    margin: 0;
    max-width: 600px;
}

/* Performance-friendly, official YouTube embed trigger. */
.lite-youtube {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 1.75rem 0;
    overflow: hidden;
    border: 0;
    border-radius: 1rem;
    background: #101828 center / cover no-repeat;
    box-shadow: 0 14px 32px rgba(0, 0, 0, .24);
    cursor: pointer;
}

.lite-youtube::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(3, 7, 18, .05), rgba(3, 7, 18, .72));
}

.lite-youtube.is-loaded::before {
    display: none;
}

.lite-youtube__play {
    position: absolute;
    top: 50%; left: 50%;
    display: grid;
    width: 4.2rem; height: 3rem;
    place-items: center;
    border-radius: .8rem;
    background: #ff0033;
    color: #fff;
    font-size: 1.25rem;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 16px rgba(0,0,0,.35);
}

.lite-youtube__label {
    position: absolute;
    right: 1rem; bottom: .9rem; left: 1rem;
    color: #fff;
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.35;
    text-shadow: 0 1px 3px #000;
}

.lite-youtube iframe { width: 100%; height: 100%; border: 0; }
.lite-youtube:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; }

.article-featured { margin: 0 0 1.75rem; }
.article-featured img { display: block; width: 100%; border-radius: 1rem; border: 1px solid var(--border); }
.article-byline { color: var(--muted); font-size: .92rem; }

.breadcrumb {
    margin-bottom: 1rem
}

.breadcrumb a {
    color: var(--accent-2);
    text-decoration: none
}

@media(max-width:900px) {
    .blog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }
}

@media(max-width:700px) {
    .blog-hero {
        padding: 2.5rem 0 1.5rem
    }

    .blog-grid {
        grid-template-columns: 1fr
    }

    .article-shell {
        padding: 2.3rem 0
    }

    .article-content {
        padding: 1.25rem
    }

    .article-header h1 {
        font-size: 2rem
    }
}
