section { padding: 2.5rem 0; position: relative; }

.bg-hero {
    background: linear-gradient(135deg, var(--grad-start), var(--grad-end));
    color: #fff;
    padding: 2.5rem 0 4rem;
    position: relative; overflow: hidden;
}
.bg-hero::before {
    content: ''; position: absolute; inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,.09) 1px, transparent 1.5px);
    background-size: 22px 22px;
    pointer-events: none;
    mask-image: linear-gradient(135deg, rgba(0,0,0,.9) 0%, rgba(0,0,0,.35) 60%, transparent 100%);
    -webkit-mask-image: linear-gradient(135deg, rgba(0,0,0,.9) 0%, rgba(0,0,0,.35) 60%, transparent 100%);
}
.bg-hero::after {
    content: ''; position: absolute;
    top: -150px; right: -150px;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,.14), transparent 65%);
    border-radius: 50%; pointer-events: none;
}
.bg-hero .container { position: relative; z-index: 2; }

.pg-breadcrumb {
    display: flex; align-items: center; gap: .5rem;
    font-size: .82rem; color: rgba(255,255,255,.6);
    margin-bottom: 1.25rem; font-weight: 500; flex-wrap: wrap;
}
.pg-breadcrumb a { color: #a5b4fc; text-decoration: none; transition: .2s; }
.pg-breadcrumb a:hover { color: #fff; }
.pg-breadcrumb .sep { opacity: .5; }
.pg-breadcrumb .active { color: rgba(255,255,255,.75); max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pg-title {
    font-size: 2.65rem; font-weight: 800; letter-spacing: -.03em;
    line-height: 1.15; color: #fff; margin-bottom: .75rem;
}
.pg-meta {
    display: flex; flex-wrap: wrap; gap: 1rem;
    font-size: .85rem;
    color: rgba(255,255,255,.75);
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,.1);
}
.pg-meta span { display: inline-flex; align-items: center; gap: .4rem; }
.pg-meta i { color: #a5b4fc; }

.bg-body {
    background-color: #f8fafc;
    background-image:
        radial-gradient(circle, rgba(99,102,241,.09) 1px, transparent 1.5px),
        radial-gradient(circle at 20% 10%, rgba(99,102,241,.04) 0%, transparent 40%),
        radial-gradient(circle at 80% 90%, rgba(168,85,247,.04) 0%, transparent 40%);
    background-size: 26px 26px, 100% 100%, 100% 100%;
    margin-top: -3rem;
    padding-top: 5rem !important;
    position: relative;
    z-index: 3;
}

/* ============================================================
   HERO THUMBNAIL — big banner above the content card
   ============================================================ */
.hero-thumb {
    border-radius: 1.5rem;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 20px 60px rgba(15,23,42,.15);
    position: relative;
    background: #0f172a;
    max-height: 520px;
    animation: fadeInUp .55s ease;
}
.hero-thumb img {
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: cover;
    display: block;
    transition: transform .6s;
}
.hero-thumb:hover img {
    transform: scale(1.02);
}
/* Subtle top gradient so the "featured" mark stays legible if used */
.hero-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15,23,42,.08) 0%, transparent 25%);
    pointer-events: none;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@media (max-width: 768px) {
    .hero-thumb { border-radius: 1.15rem; margin-bottom: 1.5rem; }
    .hero-thumb img { max-height: 320px; }
}

/* Content card */
.content-card {
    background: #fff;
    border-radius: 1.5rem;
    border: 1px solid #f1f5f9;
    box-shadow: 0 12px 40px rgba(15,23,42,.08);
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
}
@media (max-width: 576px) { .content-card { padding: 1.75rem 1.25rem; } }
.content-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 6px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.page-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #334155;
    word-wrap: break-word;
}
.page-content h1, .page-content h2, .page-content h3 {
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -.02em;
    margin-top: 2rem;
    margin-bottom: .85rem;
    line-height: 1.25;
}
.page-content h1 { font-size: 1.85rem; }
.page-content h2 { font-size: 1.5rem; }
.page-content h3 { font-size: 1.25rem; }
.page-content p { margin-bottom: 1.25rem; }
.page-content ul, .page-content ol { margin-bottom: 1.25rem; padding-left: 1.65rem; }
.page-content li { margin-bottom: .5rem; }
.page-content a { color: var(--primary); text-decoration: underline; text-decoration-color: rgba(99,102,241,.35); text-underline-offset: 3px; transition: .2s; }
.page-content a:hover { text-decoration-color: var(--primary); }
.page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 1rem;
    margin: 1.5rem 0;
    box-shadow: 0 8px 24px rgba(15,23,42,.1);
}
.page-content blockquote {
    border-left: 4px solid var(--primary);
    background: linear-gradient(135deg, #eef2ff, #f5f3ff);
    padding: 1.25rem 1.5rem;
    border-radius: 1rem;
    margin: 1.75rem 0;
    font-style: italic;
    color: #475569;
    font-size: 1rem;
}
.page-content code {
    background: #f1f5f9;
    padding: .2rem .45rem;
    border-radius: .35rem;
    font-size: .9em;
    color: #db2777;
    font-family: 'SF Mono', monospace;
}
.page-content pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 1.25rem 1.5rem;
    border-radius: 1rem;
    overflow-x: auto;
    font-size: .88rem;
    margin: 1.5rem 0;
    box-shadow: 0 8px 24px rgba(15,23,42,.15);
}
.page-content pre code { background: transparent; color: inherit; padding: 0; }
.page-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: .92rem;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(15,23,42,.05);
}
.page-content th {
    background: #f8fafc;
    padding: .85rem 1rem;
    text-align: left;
    font-weight: 800;
    color: #0f172a;
    border-bottom: 2px solid #f1f5f9;
}
.page-content td {
    padding: .85rem 1rem;
    border-bottom: 1px solid #f8fafc;
    color: #475569;
}
.page-content hr {
    border: 0;
    border-top: 2px solid #f1f5f9;
    margin: 2rem 0;
}

/* Sidebar */
.sidebar-card {
    background: #fff; border-radius: 1.25rem;
    border: 1px solid #f1f5f9; box-shadow: 0 4px 16px rgba(15,23,42,.05);
    padding: 1.35rem;
    margin-bottom: 1rem;
    position: sticky;
    top: calc(var(--header-h) + var(--subnav-h) + 1rem);
}
.sidebar-card:not(:first-child) { position: static; }
.sidebar-card h6 {
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #94a3b8;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.sidebar-card h6 i { color: var(--primary); }

/* ============================================================
   Related-articles row — with thumbnail
   ============================================================ */
.related-row {
    display: flex;
    gap: .75rem;
    padding: .75rem 0;
    border-bottom: 1px solid #f8fafc;
    text-decoration: none;
    color: inherit;
    transition: .2s;
    align-items: center;
}
.related-row:last-child { border-bottom: 0; }
.related-row:hover { color: var(--primary); }
.related-row .ic {
    width: 52px; height: 52px;
    border-radius: 10px;
    background: linear-gradient(135deg, #eef2ff, #f5f3ff);
    color: var(--primary);
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
    overflow: hidden;
    position: relative;
}
.related-row .ic img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.related-row .ic .fallback-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.related-row .info { flex: 1; min-width: 0; }
.related-row .info .t {
    font-weight: 700;
    color: #0f172a;
    font-size: .88rem;
    margin-bottom: .15rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}
.related-row .info .s { font-size: .72rem; color: #94a3b8; }
.related-row:hover .info .t { color: var(--primary); }

.share-list {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}
.share-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #f8fafc;
    color: #64748b;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem;
    text-decoration: none;
    transition: .2s;
    border: 0;
    cursor: pointer;
}
.share-btn:hover { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(99,102,241,.3); }

.back-btn {
    padding: .6rem 1.35rem;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-weight: 700;
    font-size: .85rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    transition: .2s;
    box-shadow: 0 8px 20px rgba(99,102,241,.25);
}
.back-btn:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 12px 28px rgba(99,102,241,.4); }

.bg-cta {
    background:
        radial-gradient(circle at top right, rgba(255,255,255,.14) 0%, transparent 45%),
        linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff; padding: 3.5rem 0;
    position: relative; overflow: hidden;
}
.bg-cta::before {
    content: ''; position: absolute; inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,.12) 1px, transparent 1.5px);
    background-size: 20px 20px;
    pointer-events: none;
    mask-image: linear-gradient(135deg, transparent 0%, rgba(0,0,0,.85) 50%, rgba(0,0,0,.4) 100%);
    -webkit-mask-image: linear-gradient(135deg, transparent 0%, rgba(0,0,0,.85) 50%, rgba(0,0,0,.4) 100%);
}
.bg-cta .container { position: relative; z-index: 2; }

@media (max-width: 992px) {
    .pg-title { font-size: 2rem; }
    .content-card { padding: 1.75rem 1.25rem; }
    .sidebar-card { position: static; }
}
@media (max-width: 576px) {
    .pg-title { font-size: 1.65rem; }
    .page-content h1 { font-size: 1.5rem; }
    .page-content h2 { font-size: 1.25rem; }
    .page-content { font-size: .98rem; }
}