/* ══════════════════════════════════════════════════
   KTHDIGI Blog – Shared CSS v2.0 PRO (SEO 2026)
   ══════════════════════════════════════════════════ */

/* ── Fonts ── */
@font-face {
    font-family: 'Phudu';
    src: url('https://kth-electric.com/wp-content/fonts/DT-Phudu/DTPhudu-Bold.woff') format('woff');
    font-weight: 700;
    font-display: swap;
}
@font-face {
    font-family: 'Ganh';
    src: url('https://kth-electric.com/wp-content/fonts/Ganh/Ganh%20Type-Regular.otf') format('opentype');
    font-weight: 400;
    font-display: swap;
}

/* ── Reset & Base ── */
*{box-sizing:border-box;margin:0;padding:0}
body{
    font-family:'Ganh',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
    background:#0a0a18;color:#e2e2f0;line-height:1.8;
}
h1,h2,h3,h4,h5,h6,.blog-title,.faq-title,.toc-title{
    font-family:'Phudu',sans-serif !important;
}

/* ── Reading Progress Bar ── */
.reading-progress{
    position:fixed;top:0;left:0;width:0;height:3px;
    background:linear-gradient(90deg,#7C3AED,#E879F9,#F0ABFC);
    z-index:9999;transition:width .1s linear;
    box-shadow:0 0 8px rgba(124,58,237,.5);
}

/* ── Back to Top ── */
.back-to-top{
    position:fixed;bottom:30px;right:30px;
    width:44px;height:44px;border-radius:50%;
    background:linear-gradient(135deg,#7C3AED,#BE185D);
    color:#fff;border:none;cursor:pointer;
    display:flex;align-items:center;justify-content:center;
    font-size:1.2rem;
    box-shadow:0 4px 20px rgba(124,58,237,.4);
    opacity:0;visibility:hidden;
    transition:all .3s ease;z-index:999;
}
.back-to-top.visible{opacity:1;visibility:visible;}
.back-to-top:hover{transform:translateY(-3px);box-shadow:0 6px 25px rgba(124,58,237,.6);}

/* ── Layout ── */
.blog-container{max-width:860px;margin:0 auto;padding:40px 24px 80px}

/* ── Breadcrumb ── */
.blog-breadcrumb{font-size:.8rem;color:rgba(255,255,255,.45);margin-bottom:28px}
.blog-breadcrumb a{color:#C084FC;text-decoration:none}
.blog-breadcrumb a:hover{color:#E879F9}

/* ── Category Tag ── */
.blog-category-tag{
    display:inline-block;
    background:rgba(167,139,250,.15);border:1px solid rgba(167,139,250,.35);
    color:#C084FC;font-size:.75rem;font-weight:700;
    letter-spacing:.1em;text-transform:uppercase;
    padding:4px 14px;border-radius:20px;margin-bottom:18px;
}

/* ── Title ── */
h1.blog-title{
    font-size:clamp(1.8rem,5vw,2.6rem);
    font-weight:900;color:#fff;line-height:1.25;margin-bottom:16px;
}

/* ── Meta ── */
.blog-meta{
    font-size:.82rem;color:rgba(255,255,255,.45);
    margin-bottom:36px;display:flex;gap:16px;flex-wrap:wrap;align-items:center;
}
.blog-meta span{display:flex;align-items:center;gap:5px}

/* ── Lead / Intro ── */
.blog-lead{
    font-size:1.05rem;color:rgba(255,255,255,.75);
    border-left:3px solid #C084FC;padding:16px 20px;
    background:rgba(167,139,250,.07);border-radius:0 10px 10px 0;
    margin-bottom:36px;line-height:1.85;
}

/* ══════════════════════════════════════
   TABLE OF CONTENTS (TOC)
   ══════════════════════════════════════ */
.blog-toc{
    background:linear-gradient(145deg,rgba(20,16,40,.9),rgba(13,11,30,.95));
    border:1px solid rgba(167,139,250,.2);
    border-radius:14px;padding:24px 28px;
    margin:0 0 40px;position:relative;overflow:hidden;
}
.blog-toc::before{
    content:"";position:absolute;top:0;left:0;right:0;height:2px;
    background:linear-gradient(90deg,transparent,rgba(167,139,250,.5),rgba(232,121,249,.5),transparent);
}
.toc-title{
    font-size:1rem;font-weight:800;color:#fff;
    margin-bottom:14px;display:flex;align-items:center;gap:8px;
    cursor:pointer;user-select:none;
}
.toc-title::after{
    content:"▾";font-size:.75rem;color:rgba(255,255,255,.4);
    transition:transform .2s;margin-left:auto;
}
.blog-toc.collapsed .toc-title::after{transform:rotate(-90deg)}
.blog-toc.collapsed .toc-list{display:none}
.toc-list{
    list-style:none;padding:0;margin:0;
    counter-reset:toc-counter;
}
.toc-list li{
    counter-increment:toc-counter;
    margin-bottom:4px;
}
.toc-list li a{
    display:flex;align-items:center;gap:10px;
    color:rgba(255,255,255,.7);text-decoration:none;
    font-size:.88rem;padding:8px 12px;border-radius:8px;
    transition:all .2s;line-height:1.4;
}
.toc-list li a::before{
    content:counter(toc-counter,decimal-leading-zero);
    font-size:.72rem;font-weight:700;color:#C084FC;
    min-width:22px;text-align:center;
    background:rgba(167,139,250,.1);border-radius:4px;
    padding:2px 6px;flex-shrink:0;
}
.toc-list li a:hover{
    background:rgba(167,139,250,.1);color:#E879F9;
}
.toc-list li a.active{
    background:rgba(167,139,250,.15);color:#E879F9;
    border-left:2px solid #E879F9;
}

/* ── Headings ── */
h2{font-size:1.45rem;font-weight:800;color:#E879F9;margin:44px 0 16px}
h2 .heading-anchor{
    color:rgba(255,255,255,.15);text-decoration:none;margin-left:8px;
    font-size:.8em;opacity:0;transition:opacity .2s;
}
h2:hover .heading-anchor{opacity:1}
h3{font-size:1.15rem;font-weight:700;color:#C084FC;margin:28px 0 12px}
h4{font-size:1rem;font-weight:700;color:rgba(255,255,255,.9);margin:20px 0 10px}

/* ── Content ── */
p{color:rgba(255,255,255,.78);margin-bottom:18px;font-size:.95rem}
strong{color:rgba(255,255,255,.95)}
em{color:#E879F9;font-style:italic}
a{color:#C084FC;transition:color .2s}
a:hover{color:#E879F9}

/* ── Highlight Box ── */
.highlight-box{
    background:rgba(167,139,250,.1);border:1px solid rgba(167,139,250,.25);
    border-radius:12px;padding:20px 24px;margin:28px 0;
}
.highlight-box h4{color:#E879F9;margin-bottom:10px;font-size:1rem}

/* ── Info Grid ── */
.info-grid{
    display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
    gap:16px;margin:28px 0;
}
.info-card{
    background:rgba(13,11,30,.8);border:1px solid rgba(167,139,250,.2);
    border-radius:12px;padding:18px;text-align:center;
    transition:border-color .2s,transform .2s;
}
.info-card:hover{border-color:rgba(167,139,250,.4);transform:translateY(-2px)}
.info-card .icon{font-size:2rem;margin-bottom:10px}
.info-card h4{color:#C084FC;font-size:.9rem;font-weight:700;margin-bottom:6px}
.info-card p{font-size:.8rem;color:rgba(255,255,255,.6);margin:0}

/* ── Lists ── */
ol,ul{padding-left:22px;color:rgba(255,255,255,.75);margin-bottom:18px}
ol li,ul li{margin-bottom:8px;font-size:.93rem;line-height:1.7}

/* ── Table ── */
table{width:100%;border-collapse:collapse;margin:24px 0;font-size:.88rem}
th{background:rgba(167,139,250,.2);color:#E879F9;text-align:left;padding:10px 14px}
td{padding:10px 14px;border-bottom:1px solid rgba(167,139,250,.1);color:rgba(255,255,255,.75)}
tr:hover td{background:rgba(167,139,250,.05)}

/* ── FAQ Section ── */
.faq-section{margin:54px 0}
.faq-title{font-size:1.4rem;font-weight:800;color:#fff;margin-bottom:24px}
.faq-item{
    border:1px solid rgba(167,139,250,.2);border-radius:10px;
    margin-bottom:10px;background:rgba(13,11,30,.6);
}
.faq-q{
    width:100%;padding:16px 20px;background:transparent;border:none;
    text-align:left;font-size:.92rem;font-weight:700;
    color:rgba(255,255,255,.9);cursor:pointer;
    display:flex;justify-content:space-between;align-items:center;gap:12px;
    font-family:'Ganh',-apple-system,BlinkMacSystemFont,sans-serif;
}
.faq-q:hover{color:#E879F9}
.faq-a{padding:0 20px 16px;font-size:.88rem;color:rgba(255,255,255,.68);line-height:1.75;display:none}
.faq-item.open .faq-a{display:block}
.faq-item.open .faq-q{color:#E879F9}

/* ── CTA Box ── */
.cta-box{
    background:linear-gradient(135deg,rgba(167,139,250,.2),rgba(232,121,249,.12));
    border:1px solid rgba(192,132,252,.4);border-radius:16px;
    padding:30px 28px;text-align:center;margin:50px 0;
}
.cta-box h3{color:#fff;font-size:1.25rem;margin-bottom:10px}
.cta-box p{color:rgba(255,255,255,.7);margin-bottom:20px;font-size:.9rem}
.cta-btn{
    display:inline-block;background:linear-gradient(135deg,#7C3AED,#BE185D);
    color:#fff;font-size:.92rem;font-weight:700;
    padding:13px 30px;border-radius:28px;text-decoration:none;
    transition:opacity .2s,transform .2s;
}
.cta-btn:hover{opacity:.88;transform:translateY(-1px)}

/* ── Related Posts ── */
.related-posts{margin:50px 0}
.related-posts h3{color:#E879F9;font-size:1.1rem;margin-bottom:18px}
.related-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}
.related-card{
    display:block;background:rgba(13,11,30,.65);
    border:1px solid rgba(167,139,250,.16);border-radius:12px;
    padding:16px;text-decoration:none;transition:all .2s;
}
.related-card:hover{border-color:rgba(192,132,252,.5);transform:translateY(-3px)}
.related-card .rc-tag{font-size:.7rem;color:#C084FC;font-weight:700;text-transform:uppercase;letter-spacing:.08em;margin-bottom:6px}
.related-card .rc-title{font-size:.88rem;color:rgba(255,255,255,.85);font-weight:700;line-height:1.4}

/* ── Images ── */
figure{margin:2rem 0}
figure img,.blog-hero-img,.blog-infographic{
    width:100%;height:auto;border-radius:12px;
    box-shadow:0 4px 20px rgba(0,0,0,.4);border:1px solid rgba(255,255,255,.1);
}
figcaption{
    text-align:center;font-size:.78rem;color:rgba(255,255,255,.4);
    margin-top:8px;font-style:italic;
}

/* ── Blockquote ── */
blockquote{
    border-left:3px solid #7C3AED;padding:16px 20px;
    background:rgba(124,58,237,.06);border-radius:0 10px 10px 0;
    margin:24px 0;font-style:italic;color:rgba(255,255,255,.7);
}
blockquote cite{display:block;font-size:.8rem;color:#C084FC;margin-top:8px;font-style:normal}

/* ── Responsive ── */
@media(max-width:600px){
    .blog-meta{gap:10px}
    .blog-toc{padding:18px 20px}
    .toc-list li a{font-size:.82rem;padding:6px 10px}
}