/* =========================================================
   IBCbetCasino.net — Stylesheet
   Minimalis, fokus keterbacaan, mendukung tema terang & gelap
   ========================================================= */

/* ---------- 1. Token warna ---------- */
:root {
  --bg:            #ffffff;
  --bg-soft:       #f7f8f9;
  --bg-sunken:     #eef0f2;
  --text:          #1a1d21;
  --text-muted:    #5c6570;
  --border:        #e2e6ea;
  --border-strong: #cfd5db;
  --accent:        #0f6b66;
  --accent-hover:  #0b514d;
  --accent-soft:   #e6f2f1;
  --shadow:        0 1px 2px rgba(16, 24, 32, .06);

  --wrap:      72rem;
  --wrap-text: 46rem;

  --step--1: 0.875rem;
  --step-0:  1.0625rem;
  --step-1:  1.25rem;
  --step-2:  1.5rem;
  --step-3:  1.875rem;
  --step-4:  2.25rem;

  --radius:    6px;
  --radius-lg: 10px;

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-head: Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg:            #14171a;
  --bg-soft:       #1a1e22;
  --bg-sunken:     #21262b;
  --text:          #e4e7ea;
  --text-muted:    #9aa3ad;
  --border:        #2a2f35;
  --border-strong: #3a4149;
  --accent:        #4dbdb5;
  --accent-hover:  #6fd0c9;
  --accent-soft:   #16302f;
  --shadow:        0 1px 2px rgba(0, 0, 0, .4);
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

/* Skala teks mengecil di layar kecil agar judul tidak memakan banyak baris */
@media (max-width: 560px) {
  :root {
    --step-0: 1rem;
    --step-1: 1.125rem;
    --step-2: 1.3125rem;
    --step-3: 1.5rem;
    --step-4: 1.75rem;
  }
}

/* Cegah teks/URL panjang merusak layout */
body, .prose, .footer-notice { overflow-wrap: break-word; word-break: break-word; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- 3. Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: .6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: .5rem; top: .5rem; }

/* ---------- 4. Header ---------- */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 62px;
}

.brand {
  display: inline-flex;
  align-items: center;
  margin-right: auto;
  flex: none;
}
.brand:hover { text-decoration: none; }

/* Slot logo — sumber 300x100 (3:1), tampil kecil & tetap proporsional.
   Ubah --logo-h kalau mau lebih besar/kecil; lebar ikut otomatis. */
.brand-logo {
  --logo-h: 36px;
  height: var(--logo-h);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}
@media (max-width: 480px) {
  .brand-logo { --logo-h: 30px; }
}

/* Tukar logo terang/gelap. Kalau cuma punya satu file,
   hapus blok ini dan hapus <img class="brand-logo-dark"> di partial. */
.brand-logo-dark { display: none; }
[data-theme="dark"] .brand-logo-light { display: none; }
[data-theme="dark"] .brand-logo-dark  { display: block; }

.site-nav ul {
  display: flex;
  align-items: center;
  gap: .25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: block;
  padding: .45rem .7rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: var(--step--1);
  font-weight: 500;
}
.site-nav a:hover {
  background: var(--bg-soft);
  color: var(--text);
  text-decoration: none;
}
.site-nav a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
}

.theme-toggle,
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: none;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
}
.theme-toggle:hover,
.nav-toggle:hover { color: var(--text); border-color: var(--border-strong); }

.nav-toggle { display: none; }

.icon-moon { display: none; }
[data-theme="dark"] .icon-sun  { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; order: 3; }
  .theme-toggle { order: 2; }
  .site-nav {
    order: 4;
    display: none;
    width: 100%;
    padding-bottom: .75rem;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav a { padding: .6rem .5rem; font-size: var(--step-0); }
  .header-inner { flex-wrap: wrap; }
}

/* ---------- 5. Konten utama ---------- */
.main { padding-block: 2.5rem 3.5rem; }

@media (max-width: 560px) {
  .main { padding-block: 1.75rem 2.5rem; }
  .wrap { padding-inline: 1rem; }
  .prose h1 { line-height: 1.2; }
  .prose h2 { margin-top: 1.75rem; }
  .note, .toc { padding: .9rem 1rem; }
  .card-grid { gap: .75rem; }
}

.prose { max-width: var(--wrap-text); }

/* ---------- 5b. Layout dua kolom (konten + sidebar) ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 3rem;
  align-items: start;
}
.layout .prose { max-width: var(--wrap-text); }

.sidebar {
  position: sticky;
  top: 78px;               /* tinggi header + sedikit jarak */
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Slot gambar rasio 1:1 */
.side-figure {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-soft);
}
.side-figure img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}
.side-figure figcaption {
  padding: .55rem .75rem;
  font-size: .8125rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.sidebar .toc { margin: 0; }

/* Di bawah 1000px: kembali satu kolom.
   Sidebar naik ke atas konten, gambar disembunyikan agar tidak makan ruang. */
@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    order: -1;
    margin-bottom: 1.75rem;
  }
  .side-figure { display: none; }
}

.prose h1, .prose h2, .prose h3, .prose h4 {
  font-family: var(--font-head);
  line-height: 1.25;
  letter-spacing: -.01em;
  margin: 2.25rem 0 .75rem;
  scroll-margin-top: 5rem;
}
.prose h1 { font-size: var(--step-4); margin-top: 0; }
.prose h2 { font-size: var(--step-3); }
.prose h3 { font-size: var(--step-2); }
.prose h4 { font-size: var(--step-1); font-family: var(--font-body); font-weight: 700; }

.prose p, .prose ul, .prose ol { margin: 0 0 1.15rem; }
.prose li { margin-bottom: .4rem; }
.prose ul, .prose ol { padding-left: 1.35rem; }

.prose > p:first-of-type {
  font-size: var(--step-1);
  color: var(--text-muted);
  line-height: 1.6;
}

.prose blockquote {
  margin: 1.5rem 0;
  padding: .25rem 0 .25rem 1.15rem;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
  font-style: italic;
}

.prose code {
  font-family: var(--font-mono);
  font-size: .875em;
  background: var(--bg-sunken);
  padding: .15em .4em;
  border-radius: 4px;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* ---------- 6. Komponen ---------- */
.page-meta {
  font-size: var(--step--1);
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb {
  font-size: var(--step--1);
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.breadcrumb li + li::before { content: "/"; margin-right: .4rem; opacity: .5; }

.table-wrap { overflow-x: auto; margin: 0 0 1.5rem; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
}
.prose th, .prose td {
  border: 1px solid var(--border);
  padding: .6rem .75rem;
  text-align: left;
  vertical-align: top;
}
.prose th { background: var(--bg-soft); font-weight: 600; }

.note {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin: 0 0 1.5rem;
  font-size: var(--step--1);
}
.note p:last-child { margin-bottom: 0; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.75rem 0;
  padding: 0;
  list-style: none;
}
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  padding: 1.15rem;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 .4rem; font-size: var(--step-1); font-family: var(--font-body); }
.card p  { margin: 0; font-size: var(--step--1); color: var(--text-muted); }

.toc {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
  padding: 1.15rem 1.35rem;
  margin: 0 0 2rem;
  font-size: var(--step--1);
}
.toc h2 {
  font-family: var(--font-body);
  font-size: var(--step-0);
  margin: 0 0 .6rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
}
.toc ol { margin: 0; padding-left: 1.2rem; }
.toc li { margin-bottom: .3rem; }

.post-list { list-style: none; margin: 1.75rem 0 0; padding: 0; }
.post-list li {
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--border);
}
.post-list h3 { margin: 0 0 .3rem; font-size: var(--step-1); font-family: var(--font-body); }
.post-list time { font-size: var(--step--1); color: var(--text-muted); }

/* ---------- 7. Footer ---------- */
.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding-block: 2.75rem 1.75rem;
  font-size: var(--step--1);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2rem;
}
@media (max-width: 800px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 1.75rem; }
  .footer-about { grid-column: 1 / -1; }
}

.footer-brand { display: inline-block; }
.footer-brand .brand-logo { --logo-h: 32px; }
.footer-desc { color: var(--text-muted); margin: .75rem 0 0; max-width: 34ch; }

.footer-head {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin: 0 0 .65rem;
}

.footer-list { list-style: none; margin: 0; padding: 0; }
.footer-list li { margin-bottom: .4rem; }
.footer-list a { color: var(--text); }
.footer-list a:hover { color: var(--accent); }

.footer-notice {
  margin-top: 2.25rem;
  padding: 1.15rem 1.35rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: .8125rem;
  line-height: 1.65;
}
.footer-notice p { margin: 0; }
.footer-notice strong { color: var(--text); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}
.footer-bottom p { margin: 0; }