/* =========================
   THEME
========================= */

:root{

    --font:1.05rem;

    --line:1.9;

    --bg:#ffffff;

    --text:#111827;

    --muted:#64748b;

    --accent:#2563eb;

    --surface:#f8fafc;

    --border:#e2e8f0;

}

/* =========================
   BODY
========================= */

body{

    background:var(--bg);

    color:var(--text);

}

/* =========================
   PROGRESS
========================= */

#progressBar{

    position:fixed;

    top:0;

    left:0;

    height:4px;

    width:0;

    background:var(--accent);

    z-index:99999;

}

/* =========================
   HEADER
========================= */

.km-read-header{

    position:relative;

    width:100%;

    aspect-ratio:1600 / 600;

    background-size:cover;

    background-position:center;

}

.km-read-overlay{

    position:absolute;

    inset:0;

    background:
        linear-gradient(
            to bottom,
            rgba(0,0,0,.15),
            rgba(0,0,0,.45)
        );

}

.km-read-header-inner{

    position:relative;

    z-index:2;

    max-width:860px;

    margin:auto;

    height:100%;

    display:flex;

    align-items:flex-start;

    padding:24px;

}

.km-rubrik-icon{

    height:48px;

    width:auto;

    filter:
        drop-shadow(
            0 4px 10px
            rgba(0,0,0,.3)
        );

}

/* =========================
   WRAPPER
========================= */

.km-read-wrapper{

    display:flex;

    justify-content:center;

    padding:0 5vw 80px;

}

/* =========================
   ARTICLE
========================= */

.km-read-article{

    width:100%;

    max-width:860px;

}

/* =========================
   TOPBAR
========================= */

.km-read-topbar{

    display:flex;

    justify-content:flex-end;

    margin:24px 0;

}

/* =========================
   BOOKMARK
========================= */

.km-bookmark-btn{

    border:none;

    background:#fff;

    color:#0f172a;

    padding:12px 18px;

    border-radius:999px;

    font-weight:700;

    cursor:pointer;

    box-shadow:
        0 8px 24px
        rgba(0,0,0,.08);

}

.km-bookmark-btn.active{

    background:#fff7ed;

    color:#c2410c;

}

/* =========================
   AUDIO
========================= */

.km-audio-player{

    background:var(--surface);

    border:1px solid var(--border);

    border-radius:20px;

    padding:18px;

    margin-bottom:32px;

}

.km-audio-info{

    font-size:.9rem;

    font-weight:700;

    color:var(--muted);

    margin-bottom:12px;

}

.km-audio-player audio{

    width:100%;

}

/* =========================
   CONTENT
========================= */

.km-article-html{

    font-size:var(--font);

    line-height:var(--line);

    overflow-wrap:break-word;

}

/* heading */

.km-article-html h1,
.km-article-html h2,
.km-article-html h3,
.km-article-html h4{

    line-height:1.3 !important;

    margin-top:1.5em;

    margin-bottom:.7em;

    color:var(--accent);

}

/* =========================
   TITLE
========================= */

.km-article-title-wrap{

    margin-bottom:36px;

}

.km-article-rubrik{

    display:inline-flex;

    background:#eff6ff;

    color:#2563eb;

    padding:6px 14px;

    border-radius:999px;

    font-size:12px;

    font-weight:700;

    margin-bottom:18px;

}

.km-article-title{

    font-size:clamp(
        2rem,
        5vw,
        3.5rem
    );

    line-height:1.15;

    font-weight:800;

    color:#0f172a;

    margin:0 0 20px;

}

.km-article-meta{

    display:flex;

    flex-wrap:wrap;

    gap:16px;

    color:#64748b;

    font-size:14px;

}


/* paragraph */

.km-article-html p{

    margin:0 0 1.5em;

    text-align:justify;

}

/* =========================
   AUTOFLOW
========================= */

.km-article-html .autoflow-wrapper{

    column-count:2 !important;

    column-gap:40px !important;

    column-rule:
        1px solid var(--border)
        !important;

    margin-bottom:24px;

}

/* images */

.km-article-html img{

    max-width:100% !important;

    height:auto !important;

    border-radius:18px;

    break-inside:avoid;

}

/* arab */

.km-article-html .st-arab-mushaf{

    direction:rtl !important;

    text-align:right !important;

    font-size:1.7em !important;

    line-height:2 !important;

    display:block;

    margin:1.5em 0;

}

/* box */

.km-article-html .st-box{

    background:var(--surface);

    border-radius:20px;

    padding:24px;

    margin:30px 0;

}

/* quote */

.km-article-html blockquote{

    margin:2em 0;

    padding:20px 24px;

    background:var(--surface);

    border-left:
        4px solid var(--accent);

    border-radius:14px;

}

/* =========================
   FOOTER
========================= */

.km-read-footer{

    margin-top:50px;

}

.km-footer-logo{

    width:140px;

}

.km-footer-line{

    height:2px;

    background:var(--border);

    margin:18px 0;

}

.km-footer-edition{

    color:var(--muted);

    font-size:.9rem;

}

/* =========================
   MOBILE
========================= */

@media(max-width:768px){

    .km-read-wrapper{

        padding:0 14px 60px;

    }

    .km-read-header{

        height:240px;

        aspect-ratio:auto;

    }

    .km-rubrik-icon{

        height:40px;

    }

    .km-article-html{

        font-size:1rem;

    }

    .km-article-html .autoflow-wrapper{

        column-count:1 !important;

        column-gap:0 !important;

        column-rule:none !important;

    }

}

/* =========================
   FORCE CLEAN AUTOFLOW
========================= */

.km-article-html .autoflow-wrapper{

    background:transparent !important;

    border:none !important;

    box-shadow:none !important;

    padding:0 !important;

    margin:0 0 24px !important;

    overflow:visible !important;

    height:auto !important;

}

/* hapus wrapper dalam */

.km-article-html .autoflow-wrapper > div{

    background:transparent !important;

    border:none !important;

    box-shadow:none !important;

    padding:0 !important;

    margin:0 !important;

}

/* semua section */

.km-article-html section{

    background:transparent !important;

    border:none !important;

    box-shadow:none !important;

}

/* =========================
   FOOTNOTE
========================= */

#footnoteTooltip{

    position:fixed;

    max-width:320px;

    background:#0f172a;

    color:#fff;

    padding:14px 16px;

    border-radius:16px;

    font-size:13px;

    line-height:1.7;

    z-index:999999;

    box-shadow:
        0 12px 32px
        rgba(0,0,0,.25);

    display:none;

}

/* ref */

.footnote-ref{

    color:#2563eb;

    cursor:pointer;

    font-weight:700;

}

/* =========================
   FOOTNOTE
========================= */

#footnoteTooltip{

    position:fixed;

    max-width:340px;

    background:#0f172a;

    color:#fff;

    padding:14px 16px;

    border-radius:18px;

    font-size:13px;

    line-height:1.7;

    z-index:999999;

    box-shadow:
        0 16px 40px
        rgba(0,0,0,.28);

    display:none;

}

[data-footnote]{

    color:#2563eb;

    cursor:pointer;

    font-weight:700;

}

/* =========================
   THREADS
========================= */

.km-article-threads{

    margin-top:60px;

}

/* top */

.km-threads-top{

    display:flex;

    align-items:center;

    justify-content:space-between;

    gap:16px;

    margin-bottom:24px;

}

/* title */

.km-threads-title{

    font-size:22px;

    font-weight:800;

    color:#0f172a;

}

/* button */

.km-new-thread-btn{

    display:inline-flex;

    align-items:center;

    justify-content:center;

    background:#2563eb;

    color:#fff;

    text-decoration:none;

    padding:12px 18px;

    border-radius:14px;

    font-weight:700;

}

/* list */

.km-thread-list{

    display:flex;

    flex-direction:column;

    gap:16px;

}

/* item */

.km-thread-item{

    display:flex;

    gap:14px;

    background:#fff;

    border-radius:22px;

    padding:18px;

    text-decoration:none;

    color:inherit;

    transition:.2s;

    box-shadow:
        0 6px 24px
        rgba(0,0,0,.05);

}

.km-thread-item:hover{

    transform:
        translateY(-2px);

}

/* avatar */

.km-thread-avatar{

    width:48px;

    height:48px;

    border-radius:50%;

    background:#2563eb;

    color:#fff;

    display:flex;

    align-items:center;

    justify-content:center;

    font-weight:800;

    flex-shrink:0;

}

/* body */

.km-thread-body{

    flex:1;

}

/* name */

.km-thread-name{

    font-size:13px;

    color:#64748b;

    margin-bottom:6px;

}

/* title */

.km-thread-thread-title{

    font-size:17px;

    font-weight:800;

    color:#0f172a;

    margin-bottom:10px;

}

/* preview */

.km-thread-preview{

    color:#475569;

    line-height:1.7;

    margin-bottom:12px;

}

/* meta */

.km-thread-meta{

    font-size:13px;

    color:#94a3b8;

}

/* empty */

.km-thread-empty{

    background:#fff;

    border-radius:18px;

    padding:24px;

    text-align:center;

    color:#64748b;

}