/* ==========================================================================
   Frontend Blog styles — sits on top of testpaperlive theme + Bootstrap 5
   ========================================================================== */

:root {
    --blog-accent: #1b6fb3;       /* matches tpl blue tones */
    --blog-accent-2: #0d4d82;
    --blog-ink: #1f2733;
    --blog-muted: #6b7280;
    --blog-line: #e8ecf1;
    --blog-bg: #f6f8fb;
}

.blog-main { background: var(--blog-bg); }

/* ---------- Hero ---------- */
.blog-hero {
    background: linear-gradient(135deg, var(--blog-accent-2), var(--blog-accent));
    color: #fff;
    padding: 56px 0 48px;
}
.blog-hero h1 { font-weight: 800; letter-spacing: -.5px; }
.blog-hero p { opacity: .9; max-width: 680px; }
.blog-hero .blog-search {
    max-width: 540px;
    background: #fff;
    border-radius: 50rem;
    padding: 6px 6px 6px 18px;
    box-shadow: 0 12px 30px rgba(0,0,0,.18);
}
.blog-hero .blog-search input { border: none; box-shadow: none; }
.blog-hero .blog-search input:focus { outline: none; box-shadow: none; }
.blog-hero .blog-search .btn { border-radius: 50rem; padding-inline: 22px; background: var(--blog-accent); border: none; }

/* ---------- Breadcrumb ---------- */
.blog-crumb { font-size: .85rem; }
.blog-crumb a { color: var(--blog-muted); text-decoration: none; }
.blog-crumb a:hover { color: var(--blog-accent); }

/* ---------- Section heads ---------- */
.section-head { font-weight: 800; color: var(--blog-ink); letter-spacing: -.4px; }

/* ---------- Category cards ---------- */
.cat-card {
    display: block;
    background: #fff;
    border: 1px solid var(--blog-line);
    border-radius: 16px;
    overflow: hidden;
    height: 100%;
    text-decoration: none;
    color: inherit;
    transition: transform .18s ease, box-shadow .18s ease;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(16,24,40,.12); }
.cat-card .cat-thumb {
    height: 150px;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    display: flex; align-items: center; justify-content: center;
    color: var(--blog-accent); font-size: 2.6rem;
}
.cat-card .cat-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cat-card .cat-body { padding: 18px 18px 20px; }
.cat-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; color: var(--blog-ink); }
.cat-card p { font-size: .88rem; color: var(--blog-muted); margin-bottom: 10px; }
.cat-card .cat-count { font-size: .8rem; color: var(--blog-accent); font-weight: 600; }

/* ---------- Post cards ---------- */
.post-card {
    background: #fff;
    border: 1px solid var(--blog-line);
    border-radius: 16px;
    overflow: hidden;
    height: 100%;
    transition: transform .18s ease, box-shadow .18s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(16,24,40,.12); }
.post-card .post-thumb {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #e0f2fe, #c7d2fe);
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    color: var(--blog-accent); font-size: 2.4rem;
}
.post-card .post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card .post-body { padding: 16px 18px 20px; }
.post-card .post-cat {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
    font-weight: 700; color: var(--blog-accent);
}
.post-card h3 {
    font-size: 1.02rem; font-weight: 700; line-height: 1.35; margin: 6px 0 8px;
}
.post-card h3 a { color: var(--blog-ink); text-decoration: none; }
.post-card h3 a:hover { color: var(--blog-accent); }
.post-card .post-excerpt { font-size: .88rem; color: var(--blog-muted); }
.post-card .post-meta { font-size: .78rem; color: var(--blog-muted); }

.post-card.featured { display: flex; flex-direction: column; }
@media (min-width: 768px) {
    .post-card.featured { flex-direction: row; }
    .post-card.featured .post-thumb { flex: 0 0 46%; aspect-ratio: auto; }
    .post-card.featured h3 { font-size: 1.5rem; }
}

/* ---------- Detail page ---------- */
.article-hero { padding: 40px 0 10px; }
.article-hero .article-cat {
    display: inline-block; font-size: .75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--blog-accent); margin-bottom: 12px;
}
.article-hero h1 { font-weight: 800; letter-spacing: -.5px; color: var(--blog-ink); line-height: 1.2; }
.article-meta { color: var(--blog-muted); font-size: .9rem; }
.article-cover {
    border-radius: 16px; overflow: hidden; margin: 22px 0;
    box-shadow: 0 16px 40px rgba(16,24,40,.14);
}
.article-cover img { width: 100%; height: auto; display: block; }

.article-body { font-size: 1.05rem; line-height: 1.85; color: #2a3340; }
.article-body h2 { font-weight: 800; margin: 1.6rem 0 .8rem; font-size: 1.5rem; }
.article-body h3 { font-weight: 700; margin: 1.3rem 0 .6rem; font-size: 1.2rem; }
.article-body p { margin-bottom: 1.1rem; }
.article-body img { max-width: 100%; border-radius: 12px; margin: 1rem 0; }
.article-body ul, .article-body ol { margin-bottom: 1.1rem; padding-left: 1.4rem; }
.article-body a { color: var(--blog-accent); }
.article-body blockquote {
    border-left: 4px solid var(--blog-accent);
    background: #f1f6fb; padding: 1rem 1.2rem; border-radius: 8px;
    color: #334; margin: 1.2rem 0;
}
.article-body h4 { font-weight: 700; margin: 1.1rem 0 .5rem; font-size: 1.05rem; }
/* Code blocks produced by the editor */
.article-body pre, .article-body pre.ql-syntax {
    background: #0d1117; color: #e6edf3; padding: 1rem 1.2rem;
    border-radius: 8px; overflow-x: auto; margin: 1.2rem 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem;
}
/* Editor indent levels (Quill keeps these as classes) */
.article-body .ql-indent-1 { padding-left: 3em; }
.article-body .ql-indent-2 { padding-left: 6em; }
.article-body .ql-indent-3 { padding-left: 9em; }
.article-body .ql-indent-4 { padding-left: 12em; }
.article-body .ql-indent-5 { padding-left: 15em; }

/* ---------- Sidebar ---------- */
.blog-sidebar .widget {
    background: #fff; border: 1px solid var(--blog-line); border-radius: 14px;
    padding: 18px; margin-bottom: 18px;
}
.blog-sidebar .widget h4 { font-size: 1rem; font-weight: 700; margin-bottom: 14px; }
.blog-sidebar .cat-list a {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; border-bottom: 1px solid var(--blog-line);
    text-decoration: none; color: var(--blog-ink); font-size: .92rem;
}
.blog-sidebar .cat-list a:last-child { border-bottom: none; }
.blog-sidebar .cat-list a:hover { color: var(--blog-accent); }
.blog-sidebar .cat-list .badge { background: #eef2f7; color: var(--blog-muted); }

.recent-item { display: flex; gap: 10px; padding: 8px 0; text-decoration: none; color: inherit; }
.recent-item .r-thumb {
    width: 60px; height: 56px; border-radius: 10px; flex-shrink: 0; object-fit: cover;
    background: linear-gradient(135deg,#e0f2fe,#c7d2fe);
}
.recent-item .r-title { font-size: .85rem; font-weight: 600; color: var(--blog-ink); line-height: 1.3; }
.recent-item:hover .r-title { color: var(--blog-accent); }

/* ---------- Empty state ---------- */
.blog-empty { text-align: center; color: var(--blog-muted); padding: 60px 0; }
.blog-empty i { font-size: 3rem; opacity: .4; }

/* pagination */
.pagination .page-link { color: var(--blog-accent); border-radius: 8px; margin: 0 3px; border-color: var(--blog-line); }
.pagination .active .page-link { background: var(--blog-accent); border-color: var(--blog-accent); }

/* ==========================================================================
   pwskills-style blog home
   ========================================================================== */

/* ---- Hero ---- */
.pw-hero {
    background:
        radial-gradient(900px 380px at 85% -10%, rgba(255,255,255,.18) 0%, transparent 60%),
        linear-gradient(120deg, #4324a8 0%, #1b6fb3 55%, #1597b8 100%);
    color: #fff;
    padding: 64px 0 60px;
    position: relative;
    overflow: hidden;
}
.pw-hero.compact { padding: 44px 0 40px; }
.pw-hero-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25);
    padding: 6px 14px; border-radius: 50rem; font-size: .82rem; font-weight: 600; margin-bottom: 16px;
}
.pw-hero-title { font-weight: 800; font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.12; letter-spacing: -1px; margin-bottom: 14px; }
.pw-hero-title span { color: #ffd45e; }
.pw-hero-sub { opacity: .92; max-width: 560px; font-size: 1.05rem; margin-bottom: 24px; }
.pw-hero-search {
    display: flex; align-items: center; gap: 8px;
    background: #fff; border-radius: 50rem; padding: 7px 7px 7px 18px; max-width: 540px;
    box-shadow: 0 18px 40px rgba(0,0,0,.22);
}
.pw-hero-search i { color: var(--blog-muted); font-size: 1.1rem; }
.pw-hero-search input { flex: 1; border: none; outline: none; font-size: .98rem; color: var(--blog-ink); background: transparent; }
.pw-hero-search button {
    border: none; background: linear-gradient(135deg, #4324a8, #1b6fb3); color: #fff;
    padding: 10px 26px; border-radius: 50rem; font-weight: 600; cursor: pointer;
}
.pw-hero-art {
    aspect-ratio: 1; max-width: 320px; margin-left: auto;
    background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
    border-radius: 28px; display: flex; align-items: center; justify-content: center;
}
.pw-hero-art i { font-size: 7rem; opacity: .9; }

/* ---- Category pills bar ---- */
.pw-cat-bar { background: #fff; border-bottom: 1px solid var(--blog-line); position: sticky; top: 0; z-index: 20; }
.pw-cat-pills { display: flex; gap: 10px; overflow-x: auto; padding: 14px 0; scrollbar-width: none; }
.pw-cat-pills::-webkit-scrollbar { display: none; }
.pw-cat-pills .pill {
    flex: 0 0 auto; padding: 8px 18px; border-radius: 50rem; font-size: .9rem; font-weight: 600;
    text-decoration: none; color: var(--blog-ink); background: #f1f5f9; border: 1px solid var(--blog-line);
    transition: all .15s ease;
}
.pw-cat-pills .pill:hover { background: #e2e8f0; }
.pw-cat-pills .pill.active { background: var(--blog-accent); color: #fff; border-color: var(--blog-accent); }

/* ---- Featured ---- */
.pw-feature { background: #fff; border: 1px solid var(--blog-line); border-radius: 18px; overflow: hidden; transition: box-shadow .18s ease, transform .18s ease; }
.pw-feature:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(16,24,40,.12); }
.pw-feature-thumb { display: block; position: relative; aspect-ratio: 16/9; background: linear-gradient(135deg,#e0f2fe,#c7d2fe); overflow: hidden; }
.pw-feature-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pw-noimg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--blog-accent); font-size: 3rem; }
.pw-chip { position: absolute; left: 14px; top: 14px; background: rgba(0,0,0,.6); color: #fff; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 5px 12px; border-radius: 50rem; }
.pw-feature-body { padding: 20px 22px 24px; }
.pw-feature-body h3 { font-size: 1.4rem; font-weight: 800; line-height: 1.3; margin-bottom: 10px; }
.pw-feature-body h3 a { color: var(--blog-ink); text-decoration: none; }
.pw-feature-body h3 a:hover { color: var(--blog-accent); }
.pw-feature-body p { color: var(--blog-muted); margin-bottom: 12px; }

.pw-meta { font-size: .8rem; color: var(--blog-muted); display: inline-flex; align-items: center; gap: 6px; }
.pw-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: #cbd5e1; display: inline-block; }

/* ---- Mini list ---- */
.pw-mini { display: flex; gap: 14px; background: #fff; border: 1px solid var(--blog-line); border-radius: 14px; padding: 12px; text-decoration: none; transition: box-shadow .15s ease, transform .15s ease; }
.pw-mini:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(16,24,40,.1); }
.pw-mini-thumb { flex: 0 0 110px; height: 84px; border-radius: 10px; overflow: hidden; background: linear-gradient(135deg,#e0f2fe,#c7d2fe); display: flex; align-items: center; justify-content: center; color: var(--blog-accent); font-size: 1.6rem; }
.pw-mini-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pw-mini-body { display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.pw-mini-cat { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--blog-accent); }
.pw-mini-title { font-weight: 700; color: var(--blog-ink); line-height: 1.35; font-size: .95rem; }

/* ---- Sections ---- */
.pw-section { margin-bottom: 48px; }
.pw-explore { text-decoration: none; font-weight: 700; font-size: .9rem; color: var(--blog-accent); white-space: nowrap; }
.pw-explore:hover { color: var(--blog-accent-2); }

/* ==========================================================================
   pwskills.com/blog exact layout (pw2)
   ========================================================================== */
.blog-main.pw2 { background: #fff; }

.pw2-crumb { font-size: .85rem; color: var(--blog-muted); display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.pw2-crumb a { color: var(--blog-muted); text-decoration: none; white-space: nowrap; }
.pw2-crumb a:hover { color: var(--blog-accent); }
.pw2-crumb > span { flex: 0 0 auto; }
.pw2-crumb .current { color: var(--blog-ink); font-weight: 600; }
@media (max-width: 575.98px) {
    /* keep the whole trail on one tidy line; truncate the long current title */
    .pw2-crumb { flex-wrap: nowrap; font-size: .78rem; gap: 6px; }
    .pw2-crumb a { flex: 0 0 auto; }
    .pw2-crumb .current { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

.pw2-title { font-weight: 800; font-size: clamp(1.6rem, 3vw, 2.1rem); color: #111827; letter-spacing: -.5px; margin-bottom: 14px; }
.pw2-intro { color: #4b5563; max-width: 900px; line-height: 1.7; font-size: .98rem; }

.pw2-section-head { font-weight: 800; font-size: clamp(1.4rem, 2.5vw, 1.8rem); color: #111827; letter-spacing: -.4px; }

/* ---- Category colored boxes ---- */
.pw2-cats { }
.pw2-cat {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 22px; border-radius: 14px; text-decoration: none;
    font-weight: 700; color: #1f2937; font-size: 1.02rem;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
    min-height: 64px;
}
.pw2-cat:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(16,24,40,.12); filter: brightness(.98); }
.pw2-cat i { font-size: 1.15rem; color: #374151; opacity: .65; transition: transform .15s ease; }
.pw2-cat:hover i { transform: translateX(3px); opacity: 1; }
/* pastel palette (rotates) */
.pw2-cat.c0 { background: #efeafe; }   /* purple */
.pw2-cat.c1 { background: #fff4d6; }   /* yellow */
.pw2-cat.c2 { background: #fde8ec; }   /* pink/red */
.pw2-cat.c3 { background: #e3f0ff; }   /* blue */
.pw2-cat.c4 { background: #e7f7ee; }   /* green */
.pw2-cat.c5 { background: #eef1f6; }   /* gray */

/* ---- Tags ---- */
.pw2-tagfilter { margin-bottom: 28px; }

/* Desktop: wrapping chip bar */
.pw2-tagbar {
    display: flex; flex-wrap: wrap; gap: 10px;
    padding: 16px;
    background: #faf9ff; border: 1px solid #ece8fb; border-radius: 16px;
}

/* Mobile: custom dropdown (fully styleable option list) */
.pw2-tagdrop { display: none; position: relative; }
.pw2-tagdrop-toggle {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: .8rem 1rem; border-radius: 12px;
    background: #faf9ff; border: 1px solid #e3ddf7; cursor: pointer;
    font-weight: 600; font-size: .95rem; color: #4c1d95;
    box-shadow: 0 2px 8px rgba(16,24,40,.04);
}
.pw2-tagdrop-current { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.pw2-tagdrop-current i { color: #6d28d9; font-size: 1.1rem; flex: 0 0 auto; }
.pw2-tagdrop-current [data-current-label] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw2-tagdrop-caret { color: #6d28d9; transition: transform .2s ease; flex: 0 0 auto; }
.pw2-tagdrop.is-open .pw2-tagdrop-caret { transform: rotate(180deg); }
.pw2-tagdrop.is-open .pw2-tagdrop-toggle { border-color: #c4b5fd; background: #fff; box-shadow: 0 0 0 .2rem rgba(109,40,217,.15); }

.pw2-tagdrop-menu {
    position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 30;
    max-height: 320px; overflow-y: auto;
    padding: 6px; background: #fff;
    border: 1px solid #ece8fb; border-radius: 14px;
    box-shadow: 0 18px 40px rgba(16,24,40,.16);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
}
.pw2-tagdrop.is-open .pw2-tagdrop-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.pw2-tagdrop-item {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 11px 12px; border: 0; border-radius: 10px; background: transparent; cursor: pointer;
    font-weight: 600; font-size: .9rem; color: #374151; text-align: left;
}
.pw2-tagdrop-item + .pw2-tagdrop-item { margin-top: 2px; }
.pw2-tagdrop-item:hover { background: #f5f2ff; color: #4c1d95; }
.pw2-tagdrop-name { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw2-tagdrop-name i { color: #6d28d9; font-size: 1rem; }
.pw2-tagdrop-item.is-active { background: #6d28d9; color: #fff; }
.pw2-tagdrop-item.is-active .pw2-tag-hash { opacity: .7; }
.pw2-tagdrop-item.is-active .pw2-tagdrop-name i { color: #fff; }
.pw2-tagdrop-item.is-active .pw2-tag-count { background: rgba(255,255,255,.22); }

/* Mobile: hide the chip bar, show the dropdown instead */
@media (max-width: 767.98px) {
    .pw2-tagbar { display: none; }
    .pw2-tagdrop { display: block; }
}

/* Inline tag chips (filter buttons + post-detail tag links) */
.pw2-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.pw2-tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 15px; border-radius: 999px;
    background: #fff; color: #4c1d95; font-weight: 600; font-size: .875rem;
    line-height: 1; font-family: inherit; cursor: pointer;
    text-decoration: none; border: 1px solid #e3ddf7;
    transition: background .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.pw2-tag:hover { color: #6d28d9; border-color: #c4b5fd; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(109,40,217,.14); }
.pw2-tag-hash { opacity: .55; font-weight: 700; }
.pw2-tag-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
    background: rgba(109,40,217,.1); color: inherit; font-size: .7rem; font-weight: 700;
}
.pw2-tag.is-active {
    background: #6d28d9; color: #fff; border-color: #6d28d9;
    box-shadow: 0 8px 18px rgba(109,40,217,.28);
}
.pw2-tag.is-active .pw2-tag-hash { opacity: .7; }
.pw2-tag.is-active .pw2-tag-count { background: rgba(255,255,255,.22); }

/* Grid fade while an AJAX filter is loading */
#postGrid { transition: opacity .15s ease; }
#postGrid.is-loading { opacity: .45; pointer-events: none; }

/* ---- Counselling form ---- */
.pw2-counsel { padding: 50px 0; }
.pw2-counsel-card { background: #f3f0ff; border-radius: 22px; padding: 38px; }
.pw2-counsel-icon {
    width: 64px; height: 64px; border-radius: 16px; background: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 1.9rem;
    color: var(--blog-accent); margin-bottom: 16px; box-shadow: 0 8px 20px rgba(67,36,168,.15);
}
.pw2-counsel-title { color: #6d28d9; font-weight: 800; font-size: 1.7rem; margin-bottom: 2px; }
.pw2-counsel-sub { color: #111827; font-weight: 800; font-size: 1.35rem; margin-bottom: 10px; }
.pw2-form .form-control, .pw2-form .form-select { padding: .7rem .9rem; border-radius: 10px; border-color: #e5e7eb; }
.pw2-form .input-group-text { background: #fff; border-color: #e5e7eb; border-radius: 10px 0 0 10px; font-size: .9rem; color: #374151; }
.pw2-submit { background: #c7c2e0; color: #fff; font-weight: 700; padding: .75rem; border-radius: 10px; border: none; transition: background .15s ease; }
.pw2-submit:hover { background: #6d28d9; color: #fff; }

/* ---- SEO content ---- */
.pw2-content { max-width: 1000px; padding-top: 10px; padding-bottom: 20px; }
.pw2-content h2 { font-weight: 800; font-size: 1.55rem; color: #111827; margin: 1.8rem 0 .8rem; letter-spacing: -.3px; }
.pw2-content h3 { font-weight: 700; font-size: 1.25rem; color: #1f2937; margin: 1.4rem 0 .6rem; }
.pw2-content p { color: #4b5563; line-height: 1.8; margin-bottom: 1rem; font-size: .98rem; }

/* ---- FAQ ---- */
.pw2-faq { max-width: 1000px; padding-bottom: 30px; }
.pw2-faq h2 { font-weight: 800; color: #111827; }
.pw2-faq .accordion-item { border: 1px solid var(--blog-line); border-radius: 12px !important; margin-bottom: 12px; overflow: hidden; }
.pw2-faq .accordion-button { font-weight: 600; color: #1f2937; background: #f8fafc; box-shadow: none; }
.pw2-faq .accordion-button:not(.collapsed) { background: #f3f0ff; color: #6d28d9; }
.pw2-faq .accordion-button:focus { box-shadow: none; border-color: transparent; }
.pw2-faq .accordion-body { color: #4b5563; line-height: 1.7; }

/* ==========================================================================
   pwskills category listing (pw3)
   ========================================================================== */
.pw3-hero {
    background: linear-gradient(180deg, #eef4ff 0%, #f7fafe 100%);
    border-bottom: 1px solid #eef2f7;
    padding: 34px 0 30px;
}
.pw3-hero .pw2-title { margin-bottom: 10px; }

/* ---- Cards ---- */
.pw3-card {
    background: #fff;
    border: 1px solid var(--blog-line);
    border-radius: 16px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform .18s ease, box-shadow .18s ease;
}
.pw3-card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(16,24,40,.12); }
.pw3-thumb { display: block; aspect-ratio: 16/10; flex-shrink: 0; overflow: hidden; background: #f1f5f9; }
.pw3-thumb img { width: 100%; height: 100%; object-fit: contain; transition: transform .3s ease; }
.pw3-card:hover .pw3-thumb img { transform: scale(1.04); }
.pw3-noimg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--blog-accent); font-size: 2.4rem; }

.pw3-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.pw3-top { display: flex; align-items: center; justify-content: flex-end; margin-bottom: 10px; }
.pw3-tag { font-size: .68rem; font-weight: 800; letter-spacing: .06em; color: var(--blog-accent); background: #eef4ff; padding: 4px 10px; border-radius: 6px; }
.pw3-share { border: none; background: transparent; color: #94a3b8; font-size: 1.05rem; cursor: pointer; line-height: 1; padding: 2px; }
.pw3-share:hover { color: var(--blog-accent); }

.pw3-title { font-size: 1.02rem; font-weight: 700; line-height: 1.4; margin: 0 0 16px; flex: 1; }
.pw3-title a { color: #1f2733; text-decoration: none; }
.pw3-title a:hover { color: var(--blog-accent); }

.pw3-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--blog-line); padding-top: 12px; }
.pw3-read { font-size: .85rem; font-weight: 700; color: #1f2733; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.pw3-read:hover { color: var(--blog-accent); }
.pw3-read i { transition: transform .15s ease; }
.pw3-read:hover i { transform: translateX(3px); }
.pw3-date { font-size: .76rem; color: var(--blog-muted); }

/* ---- Load more ---- */
.pw3-loadmore {
    border: 1px solid var(--blog-line);
    background: #fff;
    color: var(--blog-accent);
    font-weight: 700;
    font-size: .9rem;
    padding: 10px 28px;
    border-radius: 50rem;
    cursor: pointer;
    transition: all .15s ease;
}
.pw3-loadmore:hover { background: var(--blog-accent); color: #fff; border-color: var(--blog-accent); }
.pw3-loadmore:disabled { opacity: .6; cursor: default; }

/* ==========================================================================
   pw.live article / detail page (pw4)
   ========================================================================== */
.pw4-head {
    background: linear-gradient(180deg, #f4f6fb 0%, #fbfcfe 100%);
    border-bottom: 1px solid #eef2f7;
    padding: 26px 0 24px;
}
.pw4-title { font-weight: 800; font-size: clamp(1.5rem, 3vw, 2.05rem); color: #111827; line-height: 1.25; letter-spacing: -.5px; margin-bottom: 12px; }
.pw4-excerpt { color: #4b5563; max-width: 880px; line-height: 1.7; font-size: .98rem; margin-bottom: 16px; }

.pw4-byline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.pw4-author { display: flex; align-items: center; gap: 8px; color: #374151; font-size: .9rem; font-weight: 500; }
.pw4-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.pw4-avatar-fallback { display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#4324a8,#1b6fb3); color: #fff; font-weight: 700; font-size: .85rem; }
.pw4-sep { color: #cbd5e1; }
.pw4-share {
    border: 1px solid var(--blog-line); background: #fff; color: #374151;
    border-radius: 8px; padding: 7px 16px; font-size: .85rem; font-weight: 600; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
}
.pw4-share:hover { color: var(--blog-accent); border-color: var(--blog-accent); }

/* author name + designation */
.pw4-author-meta { display: inline-flex; flex-direction: column; line-height: 1.25; }
.pw4-author-name { font-weight: 600; color: #1f2733; }
.pw4-author-pos { font-size: .78rem; color: var(--blog-muted); font-weight: 500; }
.pw4-date { color: #374151; }

/* social share button group */
.pw4-share-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pw4-share-label { font-size: .85rem; font-weight: 600; color: #374151; display: inline-flex; align-items: center; gap: 5px; }
.pw4-share-label .uil-share-alt { color: var(--blog-accent); }
.pw4-share-btn {
    width: 38px; height: 38px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--blog-line); background: #fff; color: #475569;
    font-size: 1.05rem; line-height: 1; cursor: pointer; text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
.pw4-share-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16,24,40,.16); color: #fff; }
.pw4-share-btn.s-wa:hover   { background: #25d366; border-color: #25d366; }
.pw4-share-btn.s-fb:hover   { background: #1877f2; border-color: #1877f2; }
.pw4-share-btn.s-tw:hover   { background: #0f1419; border-color: #0f1419; }
.pw4-share-btn.s-tg:hover   { background: #229ed9; border-color: #229ed9; }
.pw4-share-btn.s-copy:hover { background: var(--blog-accent); border-color: var(--blog-accent); }

/* cover */
.pw4-cover { border-radius: 16px; overflow: hidden; margin-bottom: 22px; box-shadow: 0 14px 36px rgba(16,24,40,.12); }
.pw4-cover img { width: 100%; height: auto; display: block; }

/* sidebar */
.pw4-sidebar { position: sticky; top: 84px; }
.pw4-promo {
    background: linear-gradient(150deg, #4324a8, #1b6fb3);
    color: #fff; border-radius: 16px; padding: 22px; margin-bottom: 18px;
}
.pw4-promo-badge { display: inline-block; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.25); font-size: .72rem; font-weight: 700; padding: 4px 12px; border-radius: 50rem; margin-bottom: 12px; }
.pw4-promo h4 { font-weight: 800; font-size: 1.2rem; margin-bottom: 8px; }
.pw4-promo p { opacity: .9; font-size: .9rem; margin-bottom: 14px; }
.pw4-promo-btn { display: inline-flex; align-items: center; gap: 6px; background: #ffd45e; color: #1f2733; font-weight: 700; font-size: .88rem; padding: 9px 18px; border-radius: 50rem; text-decoration: none; }
.pw4-promo-btn:hover { background: #fff; color: var(--blog-accent); }

.pw4-widget { background: #fff; border: 1px solid var(--blog-line); border-radius: 14px; padding: 18px; margin-bottom: 18px; }
.pw4-widget h4 { font-size: 1rem; font-weight: 700; margin-bottom: 14px; }
.pw4-recent { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--blog-line); text-decoration: none; }
.pw4-recent:last-child { border-bottom: none; }
.pw4-recent img, .pw4-recent-noimg { width: 96px; height: 60px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: linear-gradient(135deg,#e0f2fe,#c7d2fe); display: flex; align-items: center; justify-content: center; color: var(--blog-accent); }
.pw4-recent-body { display: flex; flex-direction: column; gap: 3px; }
.pw4-recent-cat { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--blog-accent); }
.pw4-recent-title { font-size: .85rem; font-weight: 600; color: #1f2733; line-height: 1.35; }
.pw4-recent:hover .pw4-recent-title { color: var(--blog-accent); }

/* Trending courses carousel (main column, above Related Articles) */
.tc-carousel { position: relative; }
.tc-track {
    display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory;
    scroll-behavior: smooth; padding: 2px 2px 6px; margin: -2px;
    -ms-overflow-style: none; scrollbar-width: none;
}
.tc-track::-webkit-scrollbar { display: none; }

/* 3 cards per view on desktop; gap is 18px → subtract 2 gaps across 3 cards */
.tc-card {
    flex: 0 0 calc((100% - 36px) / 3); scroll-snap-align: start;
    display: flex; flex-direction: column; background: #fff;
    border: 1px solid var(--blog-line); border-radius: 14px; overflow: hidden;
    text-decoration: none; transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}
.tc-card:hover { border-color: var(--blog-accent); box-shadow: 0 8px 22px rgba(15,23,42,.10); transform: translateY(-3px); }
.tc-card-img { display: block; width: 100%; aspect-ratio: 4 / 3; background: #f1f5f9; }
.tc-card-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tc-card-noimg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--blog-accent); font-size: 2rem; }
.tc-card-body { display: flex; flex-direction: column; gap: 5px; padding: 14px 14px 16px; flex: 1 1 auto; }
.tc-card-title { font-size: 1rem; font-weight: 700; color: var(--blog-accent); line-height: 1.32; }
.tc-card-by { font-size: .82rem; color: #6b7280; line-height: 1.35; }
.tc-card-price { font-size: 1.02rem; color: #1f2733; margin-top: 4px; font-weight: 700; }
.tc-card-price del { color: #9ca3af; font-weight: 400; margin-left: 7px; font-size: .86rem; }
.tc-card-cta {
    margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 5px;
    background: var(--blog-accent); color: #fff; font-weight: 700; font-size: .86rem;
    padding: 7px 16px; border-radius: 999px; transition: background .15s ease;
}
.tc-card:hover .tc-card-cta { background: #1f2733; }

/* Prev / next arrows */
.tc-arrow {
    position: absolute; top: 32%; transform: translateY(-50%); z-index: 4;
    width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--blog-line);
    background: #fff; color: #1f2733; display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; cursor: pointer; box-shadow: 0 4px 14px rgba(15,23,42,.14);
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.tc-arrow:hover { background: var(--blog-accent); color: #fff; box-shadow: 0 6px 18px rgba(15,23,42,.2); }
.tc-prev { left: -18px; }
.tc-next { right: -18px; }
.tc-has-nav .tc-track { scroll-padding-left: 2px; }

@media (max-width: 991.98px) {
    .tc-card { flex-basis: calc((100% - 18px) / 2); }      /* 2 per view */
    .tc-prev { left: -10px; } .tc-next { right: -10px; }
}
@media (max-width: 575.98px) {
    .tc-card { flex-basis: 78%; }                          /* ~1.3 per view */
    .tc-arrow { display: none; }                           /* swipe on mobile */
}

/* Featured course (single, prominent horizontal card) */
.fc-feature {
    display: flex; gap: 20px; align-items: stretch; background: #fff;
    border: 1px solid var(--blog-line); border-radius: 16px; overflow: hidden;
    text-decoration: none; transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}
.fc-feature:hover { border-color: var(--blog-accent); box-shadow: 0 10px 28px rgba(15,23,42,.12); transform: translateY(-3px); }
.fc-feature-img { flex: 0 0 240px; background: linear-gradient(135deg,#e0f2fe,#c7d2fe); }
.fc-feature-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fc-feature-noimg { width: 100%; height: 100%; min-height: 160px; display: flex; align-items: center; justify-content: center; color: var(--blog-accent); font-size: 3rem; }
.fc-feature-body { display: flex; flex-direction: column; gap: 8px; padding: 22px 24px; flex: 1 1 auto; min-width: 0; }
.fc-feature-title { font-size: 1.3rem; font-weight: 800; color: var(--blog-accent); line-height: 1.3; }
.fc-feature-by { font-size: .9rem; color: #6b7280; }
.fc-feature-price { font-size: 1.25rem; color: #1f2733; font-weight: 800; margin-top: 2px; }
.fc-feature-price del { color: #9ca3af; font-weight: 400; margin-left: 9px; font-size: .92rem; }
.fc-feature-cta {
    margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
    background: var(--blog-accent); color: #fff; font-weight: 700; font-size: .92rem;
    padding: 8px 18px; border-radius: 999px;
}
@media (max-width: 575.98px) {
    .fc-feature { flex-direction: column; }
    .fc-feature-img { flex-basis: auto; aspect-ratio: 16 / 9; }
}

/* Sidebar variant — always vertical so it fits the narrow column */
.fc-feature--side { flex-direction: column; gap: 0; }
.fc-feature--side .fc-feature-img { flex-basis: auto; aspect-ratio: 16 / 9; }
.fc-feature--side .fc-feature-body { padding: 16px 16px 18px; gap: 6px; }
.fc-feature--side .fc-feature-title { font-size: 1.05rem; }
.fc-feature--side .fc-feature-price { font-size: 1.1rem; }

/* article body tables (for content like the screenshot) */
.article-body table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; font-size: .95rem; }
.article-body th, .article-body td { border: 1px solid var(--blog-line); padding: 10px 12px; text-align: left; }
.article-body thead th { background: #eef4ff; color: #1f2733; font-weight: 700; }
.article-body iframe { width: 100%; aspect-ratio: 16/9; border: none; border-radius: 12px; margin: 1rem 0; }

/* app banner */
.pw4-app { padding: 20px 0 10px; }
.pw4-app-card { background: linear-gradient(150deg, #eef0ff, #e7f0ff); border-radius: 22px; padding: 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.pw4-app-text h3 { font-weight: 800; color: #111827; margin-bottom: 14px; }
.pw4-app-text ul { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; }
.pw4-app-text li { color: #374151; font-size: .92rem; display: flex; align-items: center; gap: 8px; }
.pw4-app-text li i { color: #16a34a; }
.pw4-app-badges { display: flex; gap: 10px; }
.pw4-app-badges img { height: 42px; }
.pw4-app-art { font-size: 6rem; color: var(--blog-accent); opacity: .85; }
@media (max-width: 767.98px) { .pw4-app-art { display: none; } }

/* ── Per-post popup / floating ads ── */
.tpl-ad{position:fixed;z-index:1080;opacity:0;visibility:hidden;transition:opacity .35s ease, transform .35s ease;}
.tpl-ad.show{opacity:1;visibility:visible;}
.tpl-ad-box{position:relative;box-shadow:0 10px 40px rgba(0,0,0,.25);border-radius:8px;background:#fff;line-height:0;}
.tpl-ad-box img{display:block;width:100%;height:auto;border-radius:8px;}
.tpl-ad-close{position:absolute;top:-12px;right:-12px;width:30px;height:30px;border-radius:50%;
    border:none;background:#111;color:#fff;font-size:16px;line-height:30px;text-align:center;cursor:pointer;
    box-shadow:0 2px 8px rgba(0,0,0,.3);z-index:2;}
.tpl-ad-close:hover{background:#dc3545;}

/* Top / bottom = wide banner, centered horizontally. */
.tpl-ad.pos-top,.tpl-ad.pos-bottom{left:50%;transform:translateX(-50%) translateY(var(--off,0));width:calc(100% - 24px);max-width:980px;}
.tpl-ad.pos-top{top:14px;--off:-140%;}
.tpl-ad.pos-bottom{bottom:14px;--off:140%;}
.tpl-ad.pos-top.show,.tpl-ad.pos-bottom.show{transform:translateX(-50%) translateY(0);}

/* Left / right = side panel, vertically centered. */
.tpl-ad.pos-left,.tpl-ad.pos-right{top:50%;transform:translateY(-50%) translateX(var(--off,0));width:300px;max-width:42vw;}
.tpl-ad.pos-left{left:14px;--off:-140%;}
.tpl-ad.pos-right{right:14px;--off:140%;}
.tpl-ad.pos-left.show,.tpl-ad.pos-right.show{transform:translateY(-50%) translateX(0);}

/* Center = modal-style with dim backdrop. */
.tpl-ad.pos-center{inset:0;width:100%;display:flex;align-items:center;justify-content:center;
    background:rgba(0,0,0,.6);padding:16px;transform:none;}
.tpl-ad.pos-center .tpl-ad-box{max-width:600px;width:100%;transform:scale(.92);transition:transform .35s ease;}
.tpl-ad.pos-center.show .tpl-ad-box{transform:scale(1);}

@media (max-width:575.98px){
    .tpl-ad.pos-left,.tpl-ad.pos-right{width:78vw;max-width:78vw;}
}

/* ==========================================================================
   Table of Contents + reading progress (article detail page)
   ========================================================================== */
.reading-progress { position: fixed; top: 0; left: 0; width: 100%; height: 3px; background: transparent; z-index: 1080; pointer-events: none; }
.reading-progress span { display: block; height: 100%; width: 0; background: var(--blog-accent); transition: width .1s linear; }

.article-toc { border: 1px solid var(--blog-line); background: #fff; border-radius: 14px; padding: .35rem .35rem .55rem; margin: 0 0 1.75rem; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.article-toc-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .5rem; background: none; border: 0; padding: .9rem 1rem .75rem; font-weight: 700; color: var(--blog-ink); cursor: pointer; font-size: 1.02rem; letter-spacing: -.2px; }
.article-toc-head span { display: inline-flex; align-items: center; }
.article-toc-head .uil-list-ul { color: var(--blog-accent); margin-right: .5rem; font-size: 1.15rem; }
.article-toc-caret { transition: transform .25s ease; color: #94a3b8; font-size: 1.1rem; }
.article-toc[data-collapsed="true"] .article-toc-caret { transform: rotate(-90deg); }
.article-toc[data-collapsed="true"] .article-toc-list { display: none; }
.article-toc-list { list-style: none; margin: 0; padding: .35rem .4rem .35rem .4rem; max-height: 65vh; overflow-y: auto; border-top: 1px solid var(--blog-line); }
.article-toc-list li { margin: 0; }
/* every item starts from the SAME left edge — left accent bar always at one fixed x */
.article-toc-list a { position: relative; display: block; color: #475569; text-decoration: none; font-size: .92rem; line-height: 1.4; padding: .5rem .7rem .5rem .85rem; border-radius: 8px; transition: color .15s ease, background-color .15s ease; }
.article-toc-list a::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%) scaleY(0); width: 3px; height: calc(100% - .5rem); border-radius: 3px; background: var(--blog-accent); transition: transform .15s ease; }
/* nested levels distinguished by size/color only — NOT by indentation, so starts stay aligned */
.article-toc-list li.toc-l3 a, .article-toc-list li.toc-l4 a { font-size: .88rem; color: #64748b; }
.article-toc-list a:hover { color: var(--blog-accent); background: #f1f6fb; }
.article-toc-list a.active { color: var(--blog-accent-2); background: #eef5fc; font-weight: 600; }
.article-toc-list a.active::before { transform: translateY(-50%) scaleY(1); }

/* Anchored headings shouldn't hide under the top of the viewport */
.article-body h2, .article-body h3 { scroll-margin-top: 90px; }

/* Auto internal links */
.article-body a.article-autolink { color: var(--blog-accent); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.article-body a.article-autolink:hover { text-decoration-thickness: 2px; }

/* ==========================================================================
   Responsive refinements (mobile-first overrides on top of Bootstrap grid)
   ========================================================================== */

/* ---- Tablets and below (< 992px) ---- */
@media (max-width: 991.98px) {
    .pw-hero { padding: 48px 0 44px; }
    .pw-hero-art { max-width: 240px; margin: 24px auto 0; }
    .pw4-sidebar { position: static; top: auto; margin-top: 28px; }
    .pw2-counsel { padding: 40px 0; }
    .pw2-counsel-card { padding: 30px; }
    .pw4-app-card { padding: 28px; }
}

/* ---- Phones (< 768px) ---- */
@media (max-width: 767.98px) {
    .pw-hero { padding: 40px 0 36px; }
    .pw-hero-sub { font-size: 1rem; }
    .pw-hero-art { display: none; }

    .pw2-title { margin-bottom: 12px; }
    .pw2-intro { font-size: .95rem; }

    /* Category colour boxes: a touch tighter */
    .pw2-cat { padding: 16px 18px; font-size: .98rem; min-height: 58px; }

    /* Counselling form card */
    .pw2-counsel { padding: 32px 0; }
    .pw2-counsel-card { padding: 22px 18px; border-radius: 18px; }
    .pw2-counsel-title { font-size: 1.45rem; }
    .pw2-counsel-sub { font-size: 1.15rem; }

    /* Article detail */
    .pw4-head { padding: 22px 0 20px; }
    .pw4-byline { gap: 10px; }
    .pw4-share { padding: 6px 14px; }
    .article-body { font-size: 1rem; line-height: 1.75; }
    .article-body h2 { font-size: 1.3rem; }
    .article-body h3 { font-size: 1.12rem; }
    .pw4-cover { border-radius: 12px; margin-bottom: 18px; }

    /* SEO content + FAQ blocks */
    .pw2-content h2 { font-size: 1.35rem; }
    .pw2-content h3 { font-size: 1.15rem; }
    .pw2-content p, .pw2-faq .accordion-body { font-size: .95rem; }

    /* App banner: stack the layout, center it */
    .pw4-app-card { flex-direction: column; text-align: center; gap: 16px; padding: 24px 20px; border-radius: 18px; }
    .pw4-app-text ul { display: inline-grid; text-align: left; }
    .pw4-app-badges { flex-wrap: wrap; justify-content: center; }

    /* Related articles grid already collapses via Bootstrap cols */
    .pw3-hero { padding: 26px 0 22px; }
}

/* ---- Small phones (< 576px) ---- */
@media (max-width: 575.98px) {
    .pw2-counsel-card { padding: 20px 16px; }
    .pw2-counsel-icon { width: 54px; height: 54px; font-size: 1.6rem; }
    .pw2-counsel-title { font-size: 1.3rem; }
    .pw2-counsel-sub { font-size: 1.05rem; }

    .pw4-byline { flex-direction: column; align-items: flex-start; }
    .pw4-share-group { width: 100%; }

    .pw4-app-badges img { height: 38px; }
    .pw4-promo, .pw4-widget { padding: 16px; }

    .article-toc-head { font-size: .95rem; padding: .75rem .85rem; }
    .article-toc-list a { font-size: .9rem; }

    /* Wide editor tables: let them scroll instead of breaking the layout */
    .article-body table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Pagination wraps neatly */
    .pagination { flex-wrap: wrap; gap: 4px; }
    .pagination .page-link { margin: 0; }
}
