/* ==========================================================
   t1eld blog - stylesheet final
   Isi: tema, dasar, header, daftar artikel, halaman artikel,
   komponen (tag, kartu CTF, daftar isi, callout, kode, spoiler,
   lightbox, navigasi, komentar), 404, footer, responsif, print
   ========================================================== */

/* ---------- Tema ---------- */
:root,
:root[data-theme="light"] {
    --bg-color: #EEEEEE;
    --text-color: #374151;
    --muted-color: #6b7280;
    --heading-color: #111827;
    --accent-color: #0369a1;
    --accent-soft: rgba(3, 105, 161, 0.10);
    --border-color: #d6d6d6;
    --code-bg: #e4e4e4;
    --code-text: #b91c1c;
    --btn-bg: #dcdcdc;

    --note-color: #0369a1;
    --tip-color: #15803d;
    --warn-color: #b45309;
    --danger-color: #b91c1c;

    --tok-comment: #64748b;
    --tok-keyword: #a21caf;
    --tok-string: #15803d;
    --tok-number: #b45309;
    --tok-func: #0369a1;
    --tok-type: #be123c;
    --tok-del: #b91c1c;
    --tok-ins: #15803d;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg-color: #000000;
    --text-color: #f0f6fc;
    --muted-color: #8b949e;
    --heading-color: #ffffff;
    --accent-color: #10b981;
    --accent-soft: rgba(16, 185, 129, 0.12);
    --border-color: #21262d;
    --code-bg: #0d1117;
    --code-text: #34d399;
    --btn-bg: #161b22;

    --note-color: #38bdf8;
    --tip-color: #34d399;
    --warn-color: #fbbf24;
    --danger-color: #fb7185;

    --tok-comment: #8b949e;
    --tok-keyword: #ff7b72;
    --tok-string: #a5d6ff;
    --tok-number: #79c0ff;
    --tok-func: #d2a8ff;
    --tok-type: #7ee787;
    --tok-del: #ffdcd7;
    --tok-ins: #aff5b4;
    color-scheme: dark;
}

:root {
    --page-width: 1400px;   /* lebar situs: 900px = sedang, 1200px = lebar */
    --reading-width: none;  /* batas lebar paragraf artikel. none = selebar halaman; 75ch = nyaman dibaca */
    --mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

/* ---------- Dasar ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    background-color: var(--bg-color);
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--muted-color) transparent;
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-color);
    /* cahaya tipis di atas + kisi titik: nyaris tak terlihat, tidak mengganggu bacaan */
    background-image:
        radial-gradient(ellipse 70% 320px at 50% 0%, var(--accent-soft), transparent),
        radial-gradient(var(--border-color) 1px, transparent 1px);
    background-size: 100% 100%, 24px 24px;
    background-repeat: no-repeat, repeat;
    color: var(--text-color);
    font-family: var(--sans);
    font-size: 1.0625rem;
    line-height: 1.75;
    overflow-wrap: break-word;
    transition: background-color 0.2s ease, color 0.2s ease;
}

body.no-scroll { overflow: hidden; }

::selection { background: var(--accent-color); color: var(--bg-color); }

.container {
    width: 100%;
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 0 max(20px, env(safe-area-inset-left)) 0 max(20px, env(safe-area-inset-right));
}

main.container { flex: 1 0 auto; }

a { color: var(--accent-color); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
    border-radius: 3px;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 300;
    padding: 8px 14px;
    background: var(--accent-color);
    color: var(--bg-color);
    border-radius: 6px;
    font-family: var(--mono);
    font-size: 0.85rem;
}

.skip-link:focus { top: 12px; text-decoration: none; }

/* ---------- Progress bar baca ---------- */
#read-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-color);
    transform: scaleX(0);
    transform-origin: left;
    z-index: 100;
}

/* ---------- Header ---------- */
.site-header {
    border-bottom: 1px solid var(--border-color);
    padding: 36px 0 20px;
    margin-bottom: 40px;
}

.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.site-logo {
    font-family: var(--mono);
    font-size: 1.3rem;
    font-weight: 700;
    white-space: nowrap;
}

.site-logo:hover { text-decoration: none; }
.logo-user { color: var(--accent-color); }
.logo-sep  { color: var(--muted-color); margin-left: 1px; }

.cursor {
    display: inline-block;
    width: 0.6em;
    height: 1.05em;
    margin-left: 6px;
    background: var(--accent-color);
    vertical-align: text-bottom;
    animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.site-desc {
    margin: 6px 0 0;
    font-size: 0.95rem;
    color: var(--muted-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-link {
    font-family: var(--mono);
    font-size: 0.9rem;
    color: var(--muted-color);
}

.nav-link:hover { color: var(--accent-color); text-decoration: none; }

.theme-btn {
    background-color: var(--btn-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 96px;
    transition: border-color 0.2s ease;.github.io/tutorial/umum/2026/11/09/judul-artikel.html" rel="alternate" type="text/html"/>
<id>
https://t1eld.github.io/tutorial/umum/2026/11/09/judul-artikel.html
</id>
<published>2026-11-09T00:00:00+00:00</published>
<updated>2026-11-09T00:00:00+00:00</updated>
<summary>
Halo! Ini adalah isi dari artikel pertama saya di blog GitHub Pages ini.
</summary>
</entry>
<entry>
<title>try something</title>
<link href="https://t1eld.github.io/tutorial/umum/2026/10/27/coba.html" rel="alternate" type="text/html"/>
<id>
https://t1eld.github.io/tutorial/umum/2026/10/27/coba.html
</id>
<published>2026-10-27T00:00:00+00:00</published>.github.io/tutorial/umum/2026/11/09/judul-artikel.html" rel="alternate" type="text/html"/>
<id>
https://t1eld.github.io/tutorial/umum/2026/11/09/judul-artikel.html
</id>
<published>2026-11-09T00:00:00+00:00</published>
<updated>2026-11-09T00:00:00+00:00</updated>
<summary>
Halo! Ini adalah isi dari artikel pertama saya di blog GitHub Pages ini.
</summary>
</entry>
<entry>
<title>try something</title>
<link href="https://t1eld.github.io/tutorial/umum/2026/10/27/coba.html" rel="alternate" type="text/html"/>
<id>
https://t1eld.github.io/tutorial/umum/2026/10/27/coba.html
</id>
<published>2026-10-27T00:00:00+00:00</published>
<updated>2026-10-27T00:00:00+00:00</updated>
<summary>
Artikel ini cuma buat mengetes tampilan. Hapus filenya kalau sudah puas.
</summary>
</entry>
<updated>2026-10-27T00:00:00+00:00</updated>
<summary>
Artikel ini cuma buat mengetes tampilan. Hapus filenya kalau sudah puas.
</summary>
</entry>
}

.theme-btn:hover { border-color: var(--accent-color); }

/* ---------- Judul section + prompt ---------- */
.post-content h2.section-title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    color: var(--heading-color);
}

.prompt { color: var(--accent-color); margin-right: 6px; }

.section-label {
    margin: 0 0 8px;
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted-color);
}

/* ---------- Tag ---------- */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
}

.tag {
    display: inline-block;
    padding: 0 9px;
    font-family: var(--mono);
    font-size: 0.78rem;
    line-height: 1.7;
    color: var(--accent-color);
    background: var(--accent-soft);
    border-radius: 4px;
}

.tag::before { content: "#"; opacity: 0.6; }
.tag .count { margin-left: 6px; opacity: 0.65; }
.tag:hover { text-decoration: none; background: var(--accent-color); color: var(--bg-color); }
.tag:hover::before { opacity: 1; }

.topic-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 6px 0 20px;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--muted-color);
}

/* ---------- Daftar artikel (beranda berbentuk kotak) ---------- */
.post-list { 
    list-style: none; 
    margin: 0; 
    padding: 0; 
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: border-color 0.2s ease;
}

.post-item:hover {
    border-color: var(--accent-color);
}

.post-date {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--muted-color);
    transition: color 0.15s ease;
}

.post-item:hover .post-date { color: var(--accent-color); }
.post-item-body { min-width: 0; }

.post-link {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--heading-color);
    font-family: var(--mono);
}

.post-link:hover { color: var(--accent-color); text-decoration: none; }

.post-excerpt {
    margin: 8px 0 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--muted-color);
}

/* ---------- Search ---------- */
.search {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 14px;
    font-family: var(--mono);
}

.search-label {
    font-size: 0.9rem;
    color: var(--muted-color);
    white-space: nowrap;
}

.search input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    font-family: var(--mono);
    font-size: 0.9rem;
    color: var(--text-color);
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.search input:focus { border-color: var(--accent-color); }

mark {
    padding: 0 2px;
    color: var(--accent-color);
    background: var(--accent-soft);
    border-radius: 3px;
}

.search-empty {
    margin: 16px 0;
    font-family: var(--mono);
    font-size: 0.9rem;
    color: var(--muted-color);
}

/* ---------- Halaman tags ---------- */
.tag-group { margin-top: 28px; scroll-margin-top: 16px; }
.tag-group h3 { margin: 0 0 8px; font-size: 1.1rem; }
.tag-group:target h3 { text-decoration: underline; text-underline-offset: 5px; }
.tag-group .count { color: var(--muted-color); font-weight: 400; font-size: 0.9rem; }

.tag-posts { list-style: none; margin: 0; padding: 0; }
.tag-posts li { display: flex; gap: 20px; padding: 4px 0; }

/* ---------- Halaman artikel ---------- */
.post-header { margin-bottom: 28px; }

.post-title {
    margin: 0 0 8px;
    font-family: var(--mono);
    font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2rem);
    font-weight: 700;
    line-height: 1.25;
    color: var(--heading-color);
}

.post-meta {
    margin: 0;
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--muted-color);
}

.post-content h1,
.post-content h2,
.post-content h3 {
    font-family: var(--mono);
    font-weight: 700;
    color: var(--accent-color);
    line-height: 1.3;
}

.post-content h2 { margin: 2.2em 0 0.6em; font-size: 1.45rem; scroll-margin-top: 16px; }
.post-content h3 { margin: 1.8em 0 0.5em; font-size: 1.15rem; scroll-margin-top: 16px; }
.post-content p  { margin: 0 0 1.2em; }

/* Lebar paragraf artikel diatur lewat --reading-width di atas */
.post-content > p,
.post-content > ul:not([class]),
.post-content > ol,
.post-content > blockquote { max-width: var(--reading-width); }

.post-content ul,
.post-content ol { margin: 0 0 1.2em; padding-left: 1.5em; }
.post-content li { margin-bottom: 0.35em; }

/* List khusus tidak boleh kena gaya list biasa */
.post-content ul.post-list,
.post-content ul.tag-posts,
.post-content ul.related-list { margin: 0; padding: 0; list-style: none; }
.post-content ul.tag-list { margin: 8px 0 0; padding: 0; list-style: none; }
.post-content .topic-row ul.tag-list { margin: 0; }
.post-content .post-list li,
.post-content .tag-list li,
.post-content .tag-posts li,
.post-content .related-list li { margin: 0; }

/* Hanya link polos (tanpa class) yang digarisbawahi */
.post-content a:not([class]) { text-decoration: underline; text-underline-offset: 3px; }

/* Link ke heading */
.anchor {
    margin-left: 0.4em;
    font-weight: 400;
    color: var(--muted-color);
    opacity: 0;
    text-decoration: none;
    transition: opacity 0.15s ease;
}

h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; }
.anchor:hover { color: var(--accent-color); text-decoration: none; }

.post-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.5em auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.post-content img.zoomable { cursor: zoom-in; }

hr { border: 0; border-top: 1px solid var(--border-color); margin: 2.5em 0; }

.post-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.95rem;
}

.post-content th,
.post-content td {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.post-content th { background-color: var(--code-bg); font-family: var(--mono); font-size: 0.85rem; }

.back-link { margin-top: 2.5em; font-family: var(--mono); font-size: 0.9rem; }

/* ---------- Kartu info challenge CTF ---------- */
.ctf-card {
    margin: 18px 0 0;
    padding: 12px 18px;
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-color);
    border-radius: 8px;
    background: var(--code-bg);
}

.ctf-card dl { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0; }

.ctf-card dt {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted-color);
}

.ctf-card dd {
    margin: 0;
    font-family: var(--mono);
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--heading-color);
}

.ctf-card dd.diff-easy   { color: var(--tip-color); }
.ctf-card dd.diff-medium { color: var(--warn-color); }
.ctf-card dd.diff-hard,
.ctf-card dd.diff-insane { color: var(--danger-color); }

/* ---------- Daftar isi ---------- */
.toc {
    margin: 0 0 2em;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--code-bg);
    font-size: 0.95rem;
}

.toc summary {
    cursor: pointer;
    padding: 10px 16px;
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--heading-color);
}

.toc ul { list-style: none; margin: 0; padding: 0 16px 12px; }
.toc li { margin: 0; padding: 2px 0; line-height: 1.5; }
.toc li.toc-sub { padding-left: 1.2em; }
.toc li.toc-sub::before { content: "└ "; color: var(--muted-color); }
.toc a { text-decoration: none; color: var(--text-color); }
.toc a:hover { color: var(--accent-color); }

/* ---------- Callout: > teks  lalu  {: .note} / .tip / .warning ---------- */
blockquote {
    margin: 1.5em 0;
    padding: 0.3em 1.2em;
    border-left: 3px solid var(--muted-color);
    color: var(--muted-color);
}

blockquote p:last-child { margin-bottom: 0; }

blockquote.note,
blockquote.tip,
blockquote.warning {
    --c: var(--note-color);
    padding: 0.8em 1.2em;
    color: var(--text-color);
    border-left-color: var(--c);
    background: color-mix(in srgb, var(--c) 9%, transparent);
    border-radius: 0 8px 8px 0;
}

blockquote.tip     { --c: var(--tip-color); }
blockquote.warning { --c: var(--warn-color); }

blockquote.note::before,
blockquote.tip::before,
blockquote.warning::before {
    display: block;
    margin-bottom: 2px;
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--c);
}

blockquote.note::before    { content: "NOTE"; }
blockquote.tip::before     { content: "TIP"; }
blockquote.warning::before { content: "WARNING"; }

/* ---------- Kode ---------- */
pre, code { font-family: var(--mono); }

code {
    padding: 2px 6px;
    font-size: 0.88em;
    color: var(--code-text);
    background-color: var(--code-bg);
    border-radius: 6px;
}

pre {
    margin: 1.5em 0;
    padding: 16px;
    overflow-x: auto;
    background-color: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.88rem;
    line-height: 1.6;
}

pre code {
    padding: 0;
    font-size: inherit;
    color: var(--text-color);
    background-color: transparent;
}

div.highlighter-rouge {
    margin: 1.5em 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--code-bg);
}

div.highlighter-rouge .highlight { margin: 0; }
div.highlighter-rouge pre { margin: 0; border: 0; border-radius: 0; }

.code-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px 6px 16px;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--muted-color);
}

/* tiga titik ala jendela terminal */
.code-lang { display: flex; align-items: center; }

.code-lang::before {
    content: "";
    width: 9px;
    height: 9px;
    margin-right: 40px;
    border-radius: 50%;
    background: #ff5f56;
    box-shadow: 16px 0 0 #ffbd2e, 32px 0 0 #27c93f;
    opacity: 0.85;
}

.copy-btn {
    background: transparent;
    color: var(--muted-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 2px 10px;
    cursor: pointer;
    font-family: var(--mono);
    font-size: 0.75rem;
}

.copy-btn:hover { color: var(--accent-color); border-color: var(--accent-color); }

/* Syntax highlighting (Rouge) */
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs, .highlight .cp, .highlight .ch { color: var(--tok-comment); font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kc, .highlight .nt, .highlight .ow { color: var(--tok-keyword); }
.highlight .kt, .highlight .nc, .highlight .nn, .highlight .no, .highlight .nv, .highlight .vi, .highlight .vg, .highlight .vc { color: var(--tok-type); }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sc, .highlight .sd, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx, .highlight .sr, .highlight .ss { color: var(--tok-string); }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh, .highlight .mo, .highlight .il { color: var(--tok-number); }
.highlight .nf, .highlight .fm, .highlight .nb, .highlight .na, .highlight .bp { color: var(--tok-func); }
.highlight .gd { color: var(--tok-del); }
.highlight .gi { color: var(--tok-ins); }
.highlight .err { color: inherit; background: none; }

/* ---------- Spoiler (flag diburamkan) ---------- */
.spoiler {
    filter: blur(6px);
    cursor: pointer;
    user-select: none;
    transition: filter 0.2s ease;
}

.spoiler.revealed { filter: none; user-select: text; }
.spoiler:hover:not(.revealed) { filter: blur(5px); }

/* ---------- Lightbox (zoom gambar) ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(2, 6, 23, 0.88);
    cursor: zoom-out;
}

.lightbox[hidden] { display: none; }

.lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* ---------- Navigasi artikel, terkait, komentar ---------- */
.post-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin: 3em 0 0;
    padding-top: 2em;
    border-top: 1px solid var(--border-color);
}

.post-nav-link {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--code-bg);
}

.post-nav-link:hover { border-color: var(--accent-color); text-decoration: none; }
.post-nav-link.next { text-align: right; }

.post-nav-label { font-family: var(--mono); font-size: 0.75rem; color: var(--muted-color); }
.post-nav-title { font-weight: 600; line-height: 1.4; color: var(--heading-color); overflow-wrap: anywhere; }

.related { margin-top: 2.5em; }
.related[hidden] { display: none; }

.related-list li {
    display: flex;
    gap: 16px;
    padding: 4px 0;
}

.related-list time {
    flex: 0 0 6.5rem;
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--muted-color);
}

.comments { margin-top: 3em; }

.heart-icon {
    color: #FF0000;
    font-size: 1.3rem;
    display: inline-block;
    vertical-align: middle;
    margin: 0 2px;
}

/* ---------- 404 ---------- */
.term { font-family: var(--mono); font-size: 0.95rem; line-height: 1.8; }
.term p { margin: 0 0 0.4em; }
.term .err { color: var(--warn-color); }

/* ---------- Tombol kembali ke atas ---------- */
#to-top {
    position: fixed;
    right: max(20px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
    z-index: 90;
    padding: 6px 14px;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--muted-color);
    background: var(--btn-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

#to-top.show { opacity: 1; pointer-events: auto; }
#to-top:hover { color: var(--accent-color); border-color: var(--accent-color); text-decoration: none; }

/* ---------- Footer ---------- */
.site-footer {
    margin-top: 72px;
    padding: 24px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--muted-color);
}

.site-footer p { margin: 0; }
.site-footer a { color: var(--muted-color); }
.site-footer a:hover { color: var(--accent-color); }
.site-footer .footer-links { margin-top: 8px; }

/* ---------- Mobile ---------- */
@media (max-width: 700px) {
    body { font-size: 1rem; }
    .site-header { padding-top: 24px; }
    .header-nav { flex-wrap: wrap; row-gap: 12px; }
    .header-actions { gap: 12px; flex-wrap: wrap; }
    .site-logo { font-size: 1.1rem; }
    .post-title { font-size: 1.5rem; }
    .post-item,
    .tag-posts li,
    .related-list li { flex-direction: column; gap: 2px; }
    .post-date,
    .related-list time { flex-basis: auto; padding-top: 0; }
    .theme-btn { min-width: 0; padding: 7px 12px; }
    .post-nav { grid-template-columns: 1fr; }
    .post-nav-link.next { text-align: left; }
    .ctf-card dl { gap: 8px 22px; }
    .search-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
    .cursor { animation: none; }
}

/* ---------- Tablet ---------- */
@media (max-width: 900px) {
    .site-header { margin-bottom: 32px; }
    .post-date,
    .related-list time { flex-basis: 6rem; }
}

/* ---------- HP kecil ---------- */
@media (max-width: 420px) {
    .container { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
    .site-logo { font-size: 1rem; }
    .cursor { margin-left: 4px; }
    .header-actions { gap: 10px; }
    .nav-link { font-size: 0.85rem; }
    .theme-btn { font-size: 0.8rem; padding: 6px 10px; }
    pre { padding: 12px; font-size: 0.82rem; }
    .code-head { padding-left: 12px; }
    .ctf-card { padding: 10px 14px; }
    .post-content h2 { font-size: 1.3rem; }
    .post-content h3 { font-size: 1.1rem; }
    .toc summary { padding: 9px 14px; }
    .toc ul { padding: 0 14px 10px; }
}

/* ---------- Layar sentuh: target tap lebih besar, anchor selalu terlihat ---------- */
@media (pointer: coarse) {
    .nav-link { display: inline-flex; align-items: center; min-height: 40px; padding: 0 4px; }
    .theme-btn { min-height: 40px; }
    .copy-btn { min-height: 32px; padding: 2px 14px; }
    .toc a { display: inline-block; padding: 3px 0; }
    .tag { line-height: 2; }
    #to-top { padding: 9px 16px; }
}

@media (hover: none) {
    .anchor { opacity: 0.45; }
}

/* ---------- Layar sangat lebar ---------- */
@media (min-width: 1600px) {
    body { font-size: 1.125rem; }
}

/* ---------- Print ---------- */
@media print {
    :root[data-theme] {
        --bg-color: #fff; --text-color: #111; --heading-color: #000;
        --muted-color: #555; --accent-color: #034e7b; --border-color: #ccc;
        --code-bg: #f4f4f4; --code-text: #900;
    }
    body { background-image: none; display: block; font-size: 11pt; }
    .skip-link, #read-progress, #to-top, .header-actions, .cursor, .toc,
    .post-nav, .related, .comments, .copy-btn, .back-link, .search, .topic-row { display: none !important; }
    .spoiler { filter: none; }
    a { color: inherit; }
}
