/* =========================================
   Original4D – Blog & Article Global Styles
   Path: /assets/css/blog.css
   Selaras dengan homepage (token & estetika)
   ========================================= */

/* ---------- Design Tokens ---------- */
:root{
  --brand:#ffd700;
  --bg1:#0b2a3a;
  --bg2:#108aa0;
  --text:#eef2f7;
  --muted:rgba(255,255,255,.72);
  --card:rgba(0,0,0,.32);
  --border:rgba(255,255,255,.12);
  --shadow:0 8px 28px rgba(0,0,0,.18);
  --radius:16px;
  --radius-sm:12px;
  --maxw:1100px;                  /* blog a bit slimmer */
  --gut:clamp(16px,4vw,40px);
  --space:clamp(12px,2.2vw,24px);
  --space-lg:clamp(18px,3vw,36px);
  --fs-1:clamp(26px,3vw,40px);
  --fs-2:clamp(18px,2.2vw,24px);
  --fs-3:clamp(14px,1.6vw,16px);
  --header-h:clamp(56px,6vw,72px);

  /* Extra tokens */
  --ring: 0 0 0 3px rgba(255,215,0,.35);
  --surface: rgba(0,0,0,.18);
  --surface-2: rgba(0,0,0,.26);
  --success:#22c55e;
  --warning:#f59e0b;
  --danger:#ef4444;
}

/* ---------- Base ---------- */
*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth;text-size-adjust:100%}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--text);
  background:linear-gradient(135deg,var(--bg1),var(--bg2)) fixed;
}
img{max-width:100%;height:auto;display:block}
a{color:var(--brand);text-decoration:none}
a:hover{text-decoration:underline}
a:focus-visible{outline:none;box-shadow:var(--ring);border-radius:8px}
::selection{background:rgba(255,215,0,.25);color:#fff}

.visually-hidden{
  position:absolute !important;height:1px;width:1px;overflow:hidden;
  clip:rect(1px,1px,1px,1px);white-space:nowrap;clip-path:inset(50%);border:0;padding:0;margin:-1px
}

/* ---------- Global Element Styles (lists, tables, spans) ---------- */
/* Tables (global & safe) */
:where(table){
  width:100%;
  border-collapse:collapse;
  margin:.8rem 0;
  font-size:var(--fs-3);
  background:rgba(0,0,0,.12);
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
}
:where(thead th){
  text-align:left;
  font-weight:700;
  color:#fff;
  background:linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.03));
}
:where(th, td){
  padding:.6rem .65rem;
  border:1px solid var(--border);
  vertical-align:top;
}
:where(tbody tr:nth-child(odd)){background:rgba(255,255,255,.03)}
:where(tbody tr:hover){
  background:rgba(255,255,255,.08);
  transition:background .15s ease;
}

/* Responsive table wrapper + sticky header */
.table-responsive{
  overflow:auto;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:rgba(0,0,0,.14);
  margin:.8rem 0;
}
.table-responsive table{margin:0;min-width:560px;border:0;border-radius:0}
.table-responsive thead th{
  position:sticky; top:0; z-index:1;
  background:rgba(0,0,0,.35);
  backdrop-filter:blur(6px);
  border-bottom:1px solid var(--border);
}

/* Lists (global) */
:where(ul, ol){
  margin:.6rem 0;
  padding-left:1.25rem;
}
:where(li){
  line-height:1.8;
  padding-block:4px;
}
:where(ul) :where(li)::marker{ color:var(--brand); }
:where(ol) :where(li)::marker{ color:var(--brand); font-weight:700; }
/* Compact variant */
.list-compact :where(li){ padding-block:2px; line-height:1.6; }

/* Inline & span-like elements (global) */
:where(span){ color:var(--text); }
.hl,.highlight{
  background:rgba(255,215,0,.16);
  border:1px solid rgba(255,215,0,.28);
  color:#fff;padding:.1em .35em;border-radius:8px;
}
.pill{
  display:inline-block;
  padding:.18rem .5rem;border-radius:999px;
  background:rgba(0,0,0,.28);border:1px solid var(--border);
  font-size:.85em;color:#fff;
}

/* Numeric alignment helper */
.num,.text-right{ text-align:right; font-variant-numeric:tabular-nums; }
.text-center{ text-align:center; }

/* Scrollbar polish (webkit) */
.table-responsive::-webkit-scrollbar{ height:10px; }
.table-responsive::-webkit-scrollbar-track{ background:rgba(255,255,255,.06); border-radius:999px; }
.table-responsive::-webkit-scrollbar-thumb{
  background:rgba(255,255,255,.28);
  border-radius:999px; border:2px solid transparent;
}

/* ---------- Layout Containers ---------- */
.container, .wrap{
  max-width:var(--maxw);
  margin-inline:auto;
  padding-inline:var(--gut);
}
main.wrap, main.container{
  padding:calc(var(--space) + 12px) var(--gut) var(--space);
}

/* ---------- Header / Nav (selaras homepage) ---------- */
header.site-header{
  position:sticky;top:0;z-index:10;
  background:rgba(0,0,0,.35);
  backdrop-filter:blur(8px);
  border-bottom:1px solid var(--border);
}
.nav{
  max-width:var(--maxw);
  margin:auto;
  display:flex;align-items:center;justify-content:space-between;
  gap:12px;padding:10px var(--gut);
  min-height:var(--header-h);
}
.brand{display:flex;align-items:center;gap:10px}
.brand img{display:block;width:160px;height:auto}
.badge{
  display:inline-block;
  background:rgba(0,0,0,.24);
  border:1px solid var(--border);
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  color:#fff;
}

/* ---------- Buttons ---------- */
.btn{
  display:inline-block;
  padding:10px 16px;
  border-radius:28px;
  border:2px solid var(--brand);
  color:#111;
  background:var(--brand);
  font-weight:700;
  text-align:center;
  transition:opacity .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn:hover{opacity:.92}
.btn:active{transform:translateY(1px)}
.btn:focus-visible{outline:none;box-shadow:var(--ring)}
.btn.outline{
  background:transparent;
  color:var(--brand);
  border-color:var(--brand);
}

/* ---------- Headings & text ---------- */
h1{font-size:var(--fs-1);margin:.2rem 0;color:var(--brand);letter-spacing:.2px}
h2{font-size:var(--fs-2);margin:14px 0 8px;color:#fff}
p{font-size:var(--fs-3);line-height:1.7;margin:8px 0}
.lead{color:var(--muted);margin:.2rem 0 1rem}

/* ---------- Cards & Grid (blog list) ---------- */
.grid{display:grid;gap:var(--space);grid-template-columns:1fr}
@media(min-width:860px){ .grid{grid-template-columns:1fr 1fr} }

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:6px;
  transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover{
  transform:translateY(-2px);
  box-shadow:0 10px 36px rgba(0,0,0,.22);
  border-color:rgba(255,255,255,.18);
}
.card h2{margin:0;color:#fff}
.meta{font-size:13px;color:var(--muted)}
.desc{color:#eef2f7}

/* ---------- Skeleton (loading) ---------- */
.skeleton{
  background:linear-gradient(90deg,rgba(255,255,255,.06),rgba(255,255,255,.16),rgba(255,255,255,.06));
  background-size:200% 100%;
  animation:shine 1.2s linear infinite;
  border-radius:8px;min-height:16px
}
@keyframes shine{0%{background-position:200% 0}100%{background-position:-200% 0}}

/* ---------- Search & Toolbar ---------- */
.filters{
  display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:10px 0 18px
}
.search{flex:1;min-width:220px}
.search input{
  width:100%;padding:12px 14px;border-radius:12px;
  border:1px solid var(--border);
  background:rgba(0,0,0,.25);
  color:#fff;outline:none
}
.search input:focus{box-shadow:var(--ring)}

/* ---------- Breadcrumb visual ---------- */
.crumb{
  font-size:14px;color:var(--muted);margin:2px 0 12px
}
.crumb a{color:var(--text);text-decoration:none}
.crumb a:hover{text-decoration:underline}
.crumb .sep{
  display:inline-block;margin:0 6px;color:var(--muted)
}

/* ---------- Last-updated mini ---------- */
.last-updated{
  display:flex;align-items:center;gap:8px;margin-top:6px;
  font-size:12px;color:var(--muted)
}
.last-updated .dot{
  width:8px;height:8px;border-radius:999px;background:var(--brand);
  box-shadow:0 0 0 0 rgba(255,215,0,.6);
  animation:pulse 1.6s ease-out infinite;
}
@keyframes pulse{
  0%{box-shadow:0 0 0 0 rgba(255,215,0,.6)}
  100%{box-shadow:0 0 0 8px rgba(255,215,0,0)}
}

/* ---------- Pagination (optional UI) ---------- */
.pager{
  display:flex;justify-content:center;gap:10px;margin:22px 0;flex-wrap:wrap
}
.pager a, .pager span{
  display:inline-block;padding:8px 12px;border-radius:10px;
  border:1px solid var(--border);background:rgba(0,0,0,.22);
  color:#fff;text-decoration:none
}
.pager .active{background:var(--brand);color:#111;border-color:var(--brand)}

/* ---------- Article page ---------- */
.article-wrap{max-width:800px;margin:0 auto} /* narrower reading width */
.post-header{margin-bottom:14px}
.post-meta{font-size:13px;color:var(--muted)}

.post-content{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:clamp(14px,2.2vw,22px);
}
.post-content h2{margin-top:1rem}
.post-content h3{margin-top:.8rem;color:#fff}
.post-content p, .post-content li{line-height:1.8}
.post-content ol, .post-content ul{padding-left:1.2rem}

/* Callouts / Alerts */
.post-content .callout{
  display:flex;gap:.6rem;align-items:flex-start;
  margin:.9rem 0;padding:.7rem .9rem;border-radius:12px;
  background:rgba(0,0,0,.22);border:1px solid var(--border);
}
.post-content .callout .icon{font-size:1.2em;line-height:1}
.post-content .callout.success{border-color:rgba(34,197,94,.35)}
.post-content .callout.warning{border-color:rgba(245,158,11,.35)}
.post-content .callout.danger{border-color:rgba(239,68,68,.35)}

/* Quotes & code */
.post-content blockquote{
  margin:.8rem 0;padding:.6rem .9rem;
  border-left:4px solid var(--brand);
  background:rgba(0,0,0,.22);color:#fff;border-radius:10px
}
.post-content code{
  background:rgba(0,0,0,.35);
  border:1px solid var(--border);
  padding:.12rem .35rem;border-radius:6px;font-family:ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size:.92em;color:#ffe58a
}
.post-content pre{
  background:rgba(0,0,0,.35);border:1px solid var(--border);
  padding:12px;border-radius:12px;overflow:auto
}

/* Tables inside article (inherits global, adds polish) */
.post-content :where(table){ border-color:var(--border) }
.post-content :where(tfoot td){
  background:rgba(0,0,0,.22);
  color:var(--muted);
  font-weight:600;
}
/* List divider subtle */
.post-content :where(li + li){ border-top:1px dashed rgba(255,255,255,.06) }

/* Figures */
.post-content figure{
  margin:1rem 0;background:rgba(0,0,0,.16);
  border:1px solid var(--border);border-radius:12px;overflow:hidden
}
.post-content figure img{ width:100% }
.post-content figcaption{
  font-size:.9em;color:var(--muted);padding:.5rem .75rem;background:rgba(0,0,0,.18)
}

/* Keyboard key */
kbd{
  background:rgba(255,255,255,.1);
  border:1px solid var(--border);
  border-bottom-width:2px;border-radius:6px;
  padding:.08rem .35rem;font-family:ui-monospace,monospace;font-size:.92em
}

/* Table of contents */
.toc{
  background:rgba(0,0,0,.18);
  border:1px solid var(--border);
  border-radius:12px;padding:.7rem .9rem;margin:1rem 0
}
.toc a{ color:var(--text) }
.toc a:hover{ color:var(--brand) }

/* Post nav */
.post-nav{
  display:flex;justify-content:space-between;gap:10px;margin-top:16px
}
.post-nav a{display:inline-block}

/* ---------- Footer ---------- */
footer.site-footer{
  opacity:.92;text-align:center;padding:28px var(--gut);
  font-size:var(--fs-3)
}

/* ---------- Responsive tweaks ---------- */
@media (max-width:860px){
  .brand img{width:140px}
  .post-nav{flex-direction:column;align-items:flex-start}
}

/* ---------- Utility ---------- */
.center{text-align:center}
.muted{color:var(--muted)}
hr{border:none;border-top:1px solid var(--border);margin:16px 0}

/* ---------- Nice micro-interactions ---------- */
a, .btn, .card{ will-change:transform }
img{ transition:transform .2s ease }
img:hover{ transform:scale(1.01) }
