/* Rangkuman Biologi — Logolymp Edu
   Semua warna ada di :root, jadi gampang disesuaikan dengan brand utama. */

:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #f2f0ea;
  --text: #1d2321;
  --muted: #5b6662;
  --line: #e3e1da;
  --brand: #1f7a5a;        /* hijau daun */
  --brand-ink: #0c5440;
  --brand-soft: #e3f3ec;
  --accent: #e8803a;       /* oranye */
  --accent-soft: #fdeee2;
  --info: #2f6fb0;
  --info-soft: #e5eef8;
  --warn: #b3412f;
  --warn-soft: #fae9e5;
  --radius: 14px;
  --maxw: 760px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141816;
    --surface: #1c211f;
    --surface-2: #1f2925;
    --text: #e8ece9;
    --muted: #a1ada8;
    --line: #2d3934;
    --brand: #4fbf93;
    --brand-ink: #7fdcbb;
    --brand-soft: #18342a;
    --accent: #f2a066;
    --accent-soft: #3a2a1d;
    --info: #7fb2e8;
    --info-soft: #1a2a3b;
    --warn: #ef8a78;
    --warn-soft: #3a211c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141816;
  --surface: #1c211f;
  --surface-2: #1f2925;
  --text: #e8ece9;
  --muted: #a1ada8;
  --line: #2d3934;
  --brand: #4fbf93;
  --brand-ink: #7fdcbb;
  --brand-soft: #18342a;
  --accent: #f2a066;
  --accent-soft: #3a2a1d;
  --info: #7fb2e8;
  --info-soft: #1a2a3b;
  --warn: #ef8a78;
  --warn-soft: #3a211c;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-ink); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  max-width: 1100px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.logo svg { width: 28px; height: 28px; }
.logo small { font-weight: 600; color: var(--muted); }
.site-header nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.site-header nav a { white-space: nowrap; padding: 6px 10px; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: 15px; font-weight: 600; }
.site-header nav a:hover { background: var(--surface-2); color: var(--text); }
.theme-btn { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; width: 36px; height: 36px; cursor: pointer; font-size: 16px; }
@media (max-width: 560px) { .site-header nav a.hide-sm { display: none; } .logo small { display: none; } }

/* reading progress */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; transform: scaleX(0); transform-origin: 0 50%; background: var(--accent); z-index: 20; pointer-events: none; will-change: transform; }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.wide { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* ---------- home ---------- */
.hero { padding: 56px 0 28px; }
.hero .kicker { display: inline-block; background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; font-size: 14px; padding: 4px 12px; border-radius: 999px; }
.hero h1 { font-size: clamp(32px, 6vw, 52px); line-height: 1.1; letter-spacing: -0.03em; margin: 16px 0 12px; }
.hero p { font-size: 19px; color: var(--muted); max-width: 640px; margin: 0; }
.hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: center; }
@media (max-width: 760px) { .hero-grid { grid-template-columns: 1fr; } .hero-art { max-width: 320px; } }

.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 28px 0 8px; }
.how div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; font-size: 15px; color: var(--muted); }
.how b { display: block; color: var(--text); font-size: 16px; }

.unit { margin: 40px 0; }
.unit-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; border-bottom: 2px solid var(--line); padding-bottom: 8px; margin-bottom: 14px; }
.unit-head .num { font-weight: 800; color: var(--accent); font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; }
.unit-head h2 { margin: 0; font-size: 24px; letter-spacing: -0.02em; }
.unit-head p { margin: 0; color: var(--muted); font-size: 15px; flex-basis: 100%; }
.chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.ch-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--text); transition: transform .15s, border-color .15s; }
a.ch-card:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--text); }
.ch-card .n { font-size: 13px; font-weight: 700; color: var(--brand); }
.ch-card h3 { margin: 2px 0 4px; font-size: 17px; line-height: 1.35; }
.ch-card p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.ch-card.soon { opacity: .6; border-style: dashed; }
.ch-card.soon .n::after { content: " · segera"; color: var(--muted); font-weight: 600; }

/* ---------- chapter ---------- */
.ch-hero { padding: 40px 0 8px; }
.crumbs { font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.ch-hero h1 { font-size: clamp(30px, 5.5vw, 44px); line-height: 1.12; letter-spacing: -0.03em; margin: 10px 0 10px; }
.ch-hero .lead { font-size: 19px; color: var(--muted); margin: 0 0 16px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.meta span { background: var(--surface-2); border-radius: 999px; padding: 3px 10px; color: var(--muted); }

.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin: 24px 0; font-size: 15px; }
.toc b { display: block; margin-bottom: 4px; }
.toc ol { margin: 0; padding-left: 20px; }
.toc a { text-decoration: none; color: var(--text); }
.toc a:hover { color: var(--brand); }

article h2 { font-size: 27px; letter-spacing: -0.02em; line-height: 1.25; margin: 48px 0 12px; scroll-margin-top: 70px; }
article h3 { font-size: 20px; margin: 30px 0 8px; scroll-margin-top: 70px; }
article p, article li { max-width: 70ch; }
article ul, article ol { padding-left: 22px; }
article li { margin: 4px 0; }
article strong { color: var(--text); }
.term { background: var(--brand-soft); color: var(--brand-ink); padding: 0 4px; border-radius: 4px; font-weight: 600; }

.box { border-radius: var(--radius); padding: 14px 18px; margin: 22px 0; border: 1px solid transparent; }
.box > :first-child { margin-top: 0; }
.box > :last-child { margin-bottom: 0; }
.box .label { display: block; font-weight: 800; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 4px; }
.box.tip { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 25%, transparent); }
.box.tip .label { color: var(--brand-ink); }
.box.osn { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.box.osn .label { color: var(--accent); }
.box.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.box.warn .label { color: var(--warn); }
.box.fun { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.box.fun .label { color: var(--info); }

figure { margin: 26px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
figure svg { display: block; margin: 0 auto; width: 100%; }
figcaption { font-size: 14px; color: var(--muted); margin-top: 10px; line-height: 1.5; }

.table-wrap { overflow-x: auto; margin: 20px 0; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 15px; background: var(--surface); }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-weight: 700; }
tr:last-child td { border-bottom: 0; }

/* quiz */
.quiz { counter-reset: q; }
.quiz details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 10px 0; }
.quiz summary { cursor: pointer; font-weight: 600; list-style: none; }
.quiz summary::-webkit-details-marker { display: none; }
.quiz summary::before { counter-increment: q; content: counter(q) ". "; color: var(--brand); font-weight: 800; }
.quiz summary::after { content: "Lihat jawaban ▾"; display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 4px; }
.quiz details[open] summary::after { content: "Tutup ▴"; }
.quiz .ans { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }

.summary { background: var(--surface); border: 2px solid var(--brand); border-radius: var(--radius); padding: 16px 20px; margin: 30px 0; }
.summary h2 { margin-top: 0; font-size: 22px; }

.refs { font-size: 15px; color: var(--muted); }
.refs li { margin: 6px 0; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 48px 0 24px; }
.pager a { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; text-decoration: none; color: var(--text); font-weight: 700; }
.pager a small { display: block; color: var(--muted); font-weight: 600; font-size: 13px; }
.pager a:hover { border-color: var(--brand); }
.pager .next { text-align: right; grid-column: 2; }

.site-footer { border-top: 1px solid var(--line); margin-top: 56px; padding: 24px 0 40px; font-size: 14px; color: var(--muted); }
.site-footer a { color: var(--muted); }

/* svg helpers (ikut tema) */
.s-line { stroke: var(--text); }
.s-muted { fill: var(--muted); }
.s-text { fill: var(--text); font-family: var(--font); }
.s-brand { fill: var(--brand); }
.s-brand-soft { fill: var(--brand-soft); }
.s-accent { fill: var(--accent); }
.s-accent-soft { fill: var(--accent-soft); }
.s-info { fill: var(--info); }
.s-info-soft { fill: var(--info-soft); }
.s-warn { fill: var(--warn); }
.s-surface { fill: var(--surface-2); }

/* gambar lebar: bisa digeser di layar HP biar teksnya tetap kebaca */
figure.fig-scroll { overflow-x: auto; }
figure.fig-scroll svg { min-width: 620px; }

/* CTA program (sama seperti di laman /konten/) */
.cta { background: var(--brand); color: #fff; border-radius: 20px; padding: 28px 24px; margin: 48px 0 8px; }
.cta h2 { color: #fff; margin: 0 0 8px; font-size: 26px; letter-spacing: -0.02em; line-height: 1.25; }
.cta p { margin: 0 0 18px; color: rgba(255,255,255,.9); max-width: 60ch; }
.cta .btns { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-block; padding: 10px 18px; border-radius: 999px; font-weight: 700; text-decoration: none; font-size: 16px; }
.cta .btn-primary { background: var(--accent); color: #fff; }
.cta .btn-primary:hover { color: #fff; filter: brightness(1.05); }
.cta .btn-ghost { border: 2px solid rgba(255,255,255,.7); color: #fff; }
.cta .btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
:root[data-theme="dark"] .cta { background: var(--brand-soft); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cta { background: var(--brand-soft); } }

/* ---------- Logolymp sidebar menu (built by /assets/site.js, same menu as the rest of logolymp.com) ---------- */
:root { --side: 252px; }
html.en [data-l="id"], html:not(.en) [data-l="en"] { display: none !important; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 24px 16px 18px; overflow-y: auto; z-index: 30; line-height: 1.6; font-size: 16px; }
.side .brand { display: flex; flex-direction: column; text-decoration: none; padding: 0 10px 20px; color: var(--text); }
.side .brand small { color: var(--muted); font-size: 12.5px; }
.side .brand .logo { width: 150px; height: auto; display: block; margin: 0 0 6px -2px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side .lnk { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 8px 10px; border-radius: 9px; font-size: 14.5px; color: var(--muted); }
.side .lnk:hover { background: var(--bg); color: var(--text); }
.side .lnk.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.side .lnk svg { width: 18px; height: 18px; flex: none; }
.side .sep { height: 1px; background: var(--line); margin: 14px 10px; }
.side .ext .lnk::after { content: "↗"; margin-left: auto; font-size: 12px; opacity: .6; }
.side-foot { margin-top: auto; padding: 16px 10px 0; display: flex; flex-direction: column; gap: 12px; }
.side .lang { display: inline-flex; align-self: flex-start; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.side .lang button { border: 0; background: none; color: var(--muted); padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.side .lang button.on { background: var(--text); color: var(--bg); }
.side-foot .soc { display: flex; gap: 12px; font-size: 13px; }
.side-foot .soc a { text-decoration: none; color: var(--muted); }
.side-foot .soc a:hover { color: var(--text); text-decoration: underline; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .side .brand .logo { background: #f7f6f2; border-radius: 10px; padding: 4px 8px; } }
:root[data-theme="dark"] .side .brand .logo { background: #f7f6f2; border-radius: 10px; padding: 4px 8px; }
/* the recap header carries its own menu button, so site.js's mobile top bar stays hidden */
.topbar { display: none !important; }
.scrim { display: none; }
.rb-menu { display: none; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 9px; width: 36px; height: 36px; place-items: center; cursor: pointer; flex: none; padding: 0; }
.rb-menu svg { width: 20px; height: 20px; }
@media (min-width: 901px) {
  body { padding-left: var(--side); }
  .progress { left: var(--side); width: auto; right: 0; }
}
@media (max-width: 900px) {
  .side { transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 25; }
  .rb-menu { display: grid; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }
.home-back { display: inline-block; margin-bottom: 14px; font-size: 15px; font-weight: 600; text-decoration: none; }
.site-header .logo { white-space: nowrap; }
@media (max-width: 420px) { .site-header .logo { font-size: 15px; gap: 6px; } .site-header .inner { gap: 8px; } }
