/* =========================================================
   Blog Single (Article) — theme-consistent with the site.
   Uses the .dark class (not prefers-color-scheme) so it
   matches the rest of the pages reliably.
   ========================================================= */

.ip-article-page {
    --ip-bg: #0b1220;
    --ip-surface: #06172C;
    --ip-surface-2: #0e2038;
    --ip-border: rgba(255, 255, 255, .08);
    --ip-text: #f1f5f9;
    --ip-muted: #94a3b8;
    --ip-primary: #007BFF;
    --ip-primary-soft: rgba(0, 123, 255, .14);
    --ip-gold: #F4A641;
    --ip-radius: 18px;

    padding-block: 24px 64px;
    color: var(--ip-text);
}

/* Light-mode fallback (site is dark by default, but keep it sane) */
html:not(.dark) .ip-article-page {
    --ip-bg: #f6f8fb;
    --ip-surface: #ffffff;
    --ip-surface-2: #f2f5fa;
    --ip-border: #e6eaf0;
    --ip-text: #0f172a;
    --ip-muted: #64748b;
    --ip-primary-soft: rgba(0, 123, 255, .08);
}

.ip-article-page a { text-decoration: none; }

/* ---------- Breadcrumb ---------- */
.ip-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--ip-muted);
    margin-bottom: 22px;
}
.ip-breadcrumb a { color: var(--ip-muted); transition: color .2s; }
.ip-breadcrumb a:hover { color: var(--ip-primary); }
.ip-breadcrumb .sep { opacity: .5; font-size: 11px; }
.ip-breadcrumb .current { color: var(--ip-text); font-weight: 600; }

/* ---------- Layout ---------- */
.ip-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px;
    align-items: start;
}
@media (max-width: 991px) {
    .ip-grid { grid-template-columns: 1fr; }
    .ip-sidebar { order: 2; }
}

/* ---------- Hero ---------- */
.ip-hero {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    aspect-ratio: 16 / 8;
    margin-bottom: 26px;
    background: var(--ip-surface);
}
.ip-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ip-hero::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(4, 12, 26, 0) 35%, rgba(4, 12, 26, .82) 100%);
}
.ip-hero .ip-cat {
    position: absolute; top: 18px; right: 18px; z-index: 2;
    background: var(--ip-primary); color: #fff;
    font-size: 12px; font-weight: 700;
    padding: 7px 15px; border-radius: 10px;
}
.ip-hero .ip-hero-meta {
    position: absolute; inset-inline: 22px; bottom: 18px; z-index: 2;
    display: flex; flex-wrap: wrap; gap: 16px;
    color: #e2e8f0; font-size: 13px;
}
.ip-hero .ip-hero-meta span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Article card ---------- */
.ip-card {
    background: var(--ip-surface);
    border: 1px solid var(--ip-border);
    border-radius: var(--ip-radius);
    padding: 26px;
}
@media (max-width: 575px) { .ip-card { padding: 18px; } }

.ip-title {
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 800;
    line-height: 1.7;
    color: var(--ip-text);
    margin-bottom: 16px;
}
.ip-meta-row {
    display: flex; flex-wrap: wrap; align-items: center; gap: 18px;
    padding-bottom: 18px; margin-bottom: 22px;
    border-bottom: 1px solid var(--ip-border);
    color: var(--ip-muted); font-size: 13.5px;
}
.ip-meta-row .m { display: inline-flex; align-items: center; gap: 7px; }
.ip-meta-row .stars { color: var(--ip-gold); letter-spacing: 2px; }

.ip-lead {
    font-size: 16px;
    line-height: 2.1;
    color: var(--ip-text);
    background: var(--ip-primary-soft);
    border-inline-start: 3px solid var(--ip-primary);
    padding: 16px 18px;
    border-radius: 12px;
    margin-bottom: 24px;
}

/* ---------- Article body ---------- */
.ip-body {
    font-size: 15.5px;
    line-height: 2.35;
    color: var(--ip-text);
    word-break: break-word;
}
.ip-body > *:first-child { margin-top: 0; }
.ip-body h2 {
    font-size: 21px; font-weight: 800; margin: 34px 0 14px;
    color: var(--ip-text); scroll-margin-top: 90px;
    position: relative; padding-inline-start: 14px;
}
.ip-body h2::before {
    content: ""; position: absolute; inset-inline-start: 0; top: 6px; bottom: 6px;
    width: 4px; border-radius: 4px; background: var(--ip-primary);
}
.ip-body h3 { font-size: 18px; font-weight: 700; margin: 26px 0 12px; color: var(--ip-text); scroll-margin-top: 90px; }
.ip-body p { margin: 0 0 16px; color: color-mix(in srgb, var(--ip-text) 82%, transparent); }
.ip-body a { color: var(--ip-primary); text-decoration: underline; text-underline-offset: 3px; }
.ip-body ul, .ip-body ol { margin: 0 0 18px; padding-inline-start: 22px; }
.ip-body li { margin-bottom: 8px; }
.ip-body img { max-width: 100%; height: auto; border-radius: 14px; margin: 18px 0; }
.ip-body blockquote {
    margin: 22px 0; padding: 14px 18px;
    border-inline-start: 4px solid var(--ip-gold);
    background: var(--ip-surface-2); border-radius: 10px;
}
.ip-body table { width: 100%; border-collapse: collapse; margin: 18px 0; overflow: hidden; border-radius: 10px; }
.ip-body th, .ip-body td { border: 1px solid var(--ip-border); padding: 10px 12px; text-align: start; }
.ip-body th { background: var(--ip-surface-2); }

/* ---------- Embeds (rendered from shortcodes) ---------- */
.article-embed { margin: 26px 0; }

.article-quote {
    background: var(--ip-surface-2);
    border-inline-start: 4px solid var(--ip-gold);
    border-radius: 14px; padding: 20px 22px;
}
.article-quote blockquote { font-size: 17px; line-height: 2.1; color: var(--ip-text); font-weight: 500; }
.article-quote figcaption { margin-top: 10px; color: var(--ip-gold); font-size: 14px; }

.article-cta {
    display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
    background: linear-gradient(135deg, #0e2038, #0b3160);
    border: 1px solid var(--ip-border);
    border-radius: 16px; padding: 22px 24px;
}
.article-cta .cta-title { font-weight: 800; font-size: 18px; color: #fff; }
.article-cta .cta-sub { color: var(--ip-muted); font-size: 13px; margin-top: 3px; }
.article-cta .cta-btn {
    background: var(--ip-primary); color: #fff; font-weight: 700;
    padding: 12px 26px; border-radius: 12px; white-space: nowrap; transition: transform .15s, box-shadow .2s;
}
.article-cta .cta-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0, 123, 255, .35); }

.article-products .ip-embed-title,
.article-related .ip-embed-title,
.article-toc .ip-embed-title {
    display: flex; align-items: center; gap: 8px;
    font-weight: 800; font-size: 16px; color: var(--ip-text); margin-bottom: 14px;
}
.article-products .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.ip-product-card {
    display: flex; flex-direction: column; gap: 8px;
    background: var(--ip-surface-2); border: 1px solid var(--ip-border);
    border-radius: 16px; padding: 16px; transition: transform .15s, border-color .2s;
}
.ip-product-card:hover { transform: translateY(-3px); border-color: var(--ip-primary); }
.ip-product-card .name { font-weight: 700; color: var(--ip-text); }
.ip-product-card .bal { font-size: 13px; color: var(--ip-muted); }
.ip-product-card .price { margin-top: auto; font-weight: 800; color: var(--ip-text); display: flex; align-items: baseline; gap: 6px; }
.ip-product-card .price .old { text-decoration: line-through; color: var(--ip-muted); font-size: 13px; font-weight: 500; }
.ip-product-card .price .cur { font-size: 12px; color: var(--ip-muted); font-weight: 500; }
.ip-product-card .buy { text-align: center; background: var(--ip-primary); color: #fff; font-weight: 700; font-size: 14px; padding: 9px; border-radius: 11px; margin-top: 4px; }

.article-related { background: var(--ip-surface-2); border: 1px solid var(--ip-border); border-radius: 16px; padding: 18px 20px; }
.article-related .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.ip-related-item { display: flex; gap: 12px; align-items: center; background: var(--ip-surface); border: 1px solid var(--ip-border); border-radius: 13px; padding: 10px; transition: border-color .2s; }
.ip-related-item:hover { border-color: var(--ip-primary); }
.ip-related-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; flex: 0 0 auto; }
.ip-related-item .t { font-weight: 600; color: var(--ip-text); font-size: 14px; line-height: 1.7; }
.ip-related-item .d { color: var(--ip-muted); font-size: 12px; margin-top: 3px; }

.article-audio {
    background: linear-gradient(135deg, #06172C, #0b2b4d);
    border: 1px solid var(--ip-border); border-radius: 16px; padding: 16px 20px;
}
.article-audio .ip-embed-title { color: #fff; }
.article-audio audio { width: 100%; margin-top: 8px; }

.article-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.article-gallery img { width: 100%; height: 130px; object-fit: cover; border-radius: 12px; }

.article-toc {
    background: var(--ip-surface-2); border: 1px solid var(--ip-border);
    border-radius: 16px; padding: 18px 20px; margin-bottom: 26px;
}
.article-toc ol { margin: 0; padding-inline-start: 20px; }
.article-toc li { margin: 6px 0; }
.article-toc li.lvl-3 { padding-inline-start: 16px; }
.article-toc a { color: var(--ip-primary); }
.article-toc a:hover { text-decoration: underline; }

/* ---------- FAQ ---------- */
.ip-faq { margin-top: 34px; }
.ip-faq h2 { font-size: 20px; font-weight: 800; margin-bottom: 16px; color: var(--ip-text); }
.ip-faq-item { border: 1px solid var(--ip-border); border-radius: 14px; margin-bottom: 12px; overflow: hidden; background: var(--ip-surface-2); }
.ip-faq-q {
    width: 100%; text-align: start; background: none; border: 0; cursor: pointer;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 18px; font-weight: 700; color: var(--ip-text); font-size: 15px;
}
.ip-faq-q .chev { transition: transform .25s; color: var(--ip-primary); flex: 0 0 auto; }
.ip-faq-item.open .ip-faq-q .chev { transform: rotate(-180deg); }
.ip-faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.ip-faq-a-inner { padding: 0 18px 16px; color: color-mix(in srgb, var(--ip-text) 78%, transparent); line-height: 2.1; font-size: 14.5px; }

/* ---------- Tags / PDF ---------- */
.ip-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.ip-tag { background: var(--ip-surface-2); border: 1px solid var(--ip-border); color: var(--ip-muted); font-size: 13px; padding: 6px 13px; border-radius: 999px; transition: all .2s; }
.ip-tag:hover { color: var(--ip-primary); border-color: var(--ip-primary); }
.ip-pdf-btn {
    display: inline-flex; align-items: center; gap: 9px; margin-top: 24px;
    background: var(--ip-primary-soft); border: 1px solid var(--ip-primary);
    color: var(--ip-primary); font-weight: 700; padding: 12px 22px; border-radius: 12px; transition: all .2s;
}
.ip-pdf-btn:hover { background: var(--ip-primary); color: #fff; }

/* ---------- Sidebar ---------- */
.ip-side-card { background: var(--ip-surface); border: 1px solid var(--ip-border); border-radius: var(--ip-radius); padding: 20px; margin-bottom: 20px; }
.ip-side-card .head { font-size: 16px; font-weight: 800; color: var(--ip-text); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

.ip-author { text-align: center; }
.ip-author .av { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; margin: 0 auto 12px; border: 3px solid var(--ip-primary-soft); display: block; }
.ip-author .nm { font-weight: 800; color: var(--ip-text); font-size: 17px; }
.ip-author .role { color: var(--ip-primary); font-size: 13px; margin-top: 3px; }
.ip-author .bio { color: var(--ip-muted); font-size: 13.5px; line-height: 2; margin-top: 12px; }
.ip-author .socials { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.ip-author .socials a {
    width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--ip-surface-2); border: 1px solid var(--ip-border); color: var(--ip-muted); font-size: 18px; transition: all .2s;
}
.ip-author .socials a:hover { background: var(--ip-primary); color: #fff; border-color: var(--ip-primary); }

.ip-share { display: flex; align-items: center; gap: 8px; }
.ip-share input { flex: 1; min-width: 0; background: var(--ip-surface-2); border: 1px solid var(--ip-border); color: var(--ip-muted); border-radius: 10px; padding: 9px 12px; font-size: 12px; direction: ltr; }
.ip-share button { background: var(--ip-primary); color: #fff; border: 0; border-radius: 10px; padding: 9px 16px; font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; }

.ip-mini { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--ip-border); }
.ip-mini:last-child { border-bottom: 0; }
.ip-mini img { width: 62px; height: 62px; border-radius: 12px; object-fit: cover; flex: 0 0 auto; }
.ip-mini .t { font-weight: 600; color: var(--ip-text); font-size: 13.5px; line-height: 1.8; transition: color .2s; }
.ip-mini:hover .t { color: var(--ip-primary); }
.ip-mini .d { color: var(--ip-muted); font-size: 12px; margin-top: 4px; }

.ip-consult { background: linear-gradient(135deg, #0b3160, #06172C); text-align: center; }
.ip-consult .ic { width: 52px; height: 52px; border-radius: 14px; background: var(--ip-primary-soft); color: var(--ip-primary); display: inline-flex; align-items: center; justify-content: center; font-size: 26px; margin-bottom: 12px; }
.ip-consult p { color: var(--ip-text); font-weight: 600; margin-bottom: 14px; }
.ip-consult a { display: inline-block; background: var(--ip-primary); color: #fff; font-weight: 700; padding: 11px 26px; border-radius: 12px; transition: transform .15s; }
.ip-consult a:hover { transform: translateY(-2px); }

/* =========================================================
   Blog Listing
   ========================================================= */
.ip-blog-list {
    --ip-bg: #0b1220;
    --ip-surface: #06172C;
    --ip-surface-2: #0e2038;
    --ip-border: rgba(255, 255, 255, .08);
    --ip-text: #f1f5f9;
    --ip-muted: #94a3b8;
    --ip-primary: #007BFF;
    --ip-primary-soft: rgba(0, 123, 255, .14);
    --ip-gold: #F4A641;
    padding-block: 24px 64px;
    color: var(--ip-text);
}
html:not(.dark) .ip-blog-list {
    --ip-bg: #f6f8fb; --ip-surface: #fff; --ip-surface-2: #f2f5fa;
    --ip-border: #e6eaf0; --ip-text: #0f172a; --ip-muted: #64748b;
    --ip-primary-soft: rgba(0, 123, 255, .08);
}
.ip-blog-list a { text-decoration: none; }

.ip-list-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 26px; }
.ip-list-head h1 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; color: var(--ip-text); }
.ip-list-head h1 span { color: var(--ip-primary); }
.ip-list-head .sub { color: var(--ip-muted); font-size: 14px; margin-top: 6px; }

/* Featured hero */
.ip-feat {
    position: relative; display: block; border-radius: 24px; overflow: hidden;
    aspect-ratio: 21 / 9; margin-bottom: 30px; background: var(--ip-surface);
}
.ip-feat img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.ip-feat:hover img { transform: scale(1.04); }
.ip-feat::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4,12,26,0) 30%, rgba(4,12,26,.9) 100%); }
.ip-feat .cap { position: absolute; inset-inline: 26px; bottom: 22px; z-index: 2; max-width: 720px; }
.ip-feat .cap .badge2 { display: inline-block; background: var(--ip-primary); color: #fff; font-size: 12px; font-weight: 700; padding: 6px 14px; border-radius: 9px; margin-bottom: 12px; }
.ip-feat .cap h2 { color: #fff; font-size: clamp(18px, 2.4vw, 26px); font-weight: 800; line-height: 1.8; }
.ip-feat .cap .meta { color: #cbd5e1; font-size: 13px; margin-top: 10px; display: flex; gap: 16px; flex-wrap: wrap; }
.ip-feat .cap .meta span { display: inline-flex; align-items: center; gap: 6px; }

/* Card grid */
.ip-list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.ip-post-card {
    display: flex; flex-direction: column; background: var(--ip-surface);
    border: 1px solid var(--ip-border); border-radius: var(--ip-radius, 18px);
    overflow: hidden; transition: transform .18s, border-color .2s, box-shadow .2s;
}
.ip-post-card:hover { transform: translateY(-4px); border-color: var(--ip-primary); box-shadow: 0 16px 34px rgba(0,0,0,.28); }
.ip-post-card .thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.ip-post-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.ip-post-card:hover .thumb img { transform: scale(1.06); }
.ip-post-card .thumb .cat { position: absolute; top: 12px; right: 12px; background: rgba(4,12,26,.72); color: #fff; font-size: 11px; font-weight: 700; padding: 5px 12px; border-radius: 8px; backdrop-filter: blur(4px); }
.ip-post-card .body { padding: 16px 18px; display: flex; flex-direction: column; flex: 1; }
.ip-post-card .body h3 { font-size: 16px; font-weight: 700; color: var(--ip-text); line-height: 1.8; margin-bottom: 8px; }
.ip-post-card .body p { color: var(--ip-muted); font-size: 13.5px; line-height: 1.9; margin-bottom: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ip-post-card .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--ip-border); color: var(--ip-muted); font-size: 12.5px; }
.ip-post-card .foot .rd { color: var(--ip-primary); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }

.ip-empty { text-align: center; color: var(--ip-muted); padding: 60px 0; }

.ip-pager { margin-top: 34px; display: flex; justify-content: center; }
