/* JOSJIS.MY.ID — gaya Wikipedia, tema terang & gelap
   Selector diberi scope (.article, body.page) supaya menang atas preflight Tailwind CDN. */

:root {
  --serif: "Source Serif 4", "Linux Libertine", Georgia, Times, serif;
  --bg: #ffffff;
  --surface: #f8f9fa;
  --surface-2: #eaecf0;
  --text: #202122;
  --muted: #54595d;
  --border: #a2a9b1;
  --link: #3366cc;
  --link-hover: #2a4b8d;
  --visited: #795cb2;
  color-scheme: light;
}

html.dark {
  --bg: #101418;
  --surface: #1b1f23;
  --surface-2: #27292d;
  --text: #eaecf0;
  --muted: #a2a9b1;
  --border: #54595d;
  --link: #88a3e8;
  --link-hover: #aab9ef;
  --visited: #b79ee3;
  color-scheme: dark;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

body.page {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
  text-decoration: none;
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.2;
  cursor: pointer;
}
.theme-btn:hover {
  background: var(--surface-2);
}
.theme-btn .icon-sun {
  display: none;
}
html.dark .theme-btn .icon-sun {
  display: inline-block;
}
html.dark .theme-btn .icon-moon {
  display: none;
}

/* Judul artikel */
.article {
  padding-top: 1.5rem;
}
.article .firstHeading {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 5vw, 2.5rem);
  line-height: 1.2;
}
.article .tagline {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.article .title-rule {
  margin: 0.9rem 0 1.25rem;
  border: 0;
  border-top: 1px solid var(--border);
}

/* Layout: lead -> infobox -> isi (mobile), infobox di kanan (desktop) */
.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "lead" "info" "rest";
}
.page-grid .lead { grid-area: lead; }
.page-grid .infobox { grid-area: info; }
.page-grid .page-rest { grid-area: rest; }

@media (min-width: 768px) {
  .page-grid {
    grid-template-columns: minmax(0, 1fr) 280px;
    grid-template-areas: "lead info" "rest info";
    grid-template-rows: auto 1fr;
    column-gap: 2rem;
  }
}

/* Teks */
.article p {
  margin: 0.6rem 0 0.9rem;
}
.article .lead {
  margin-top: 0;
}
.article a {
  color: var(--link);
  text-decoration: none;
}
.article a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}
.article a[rel~="nofollow"]:visited {
  color: var(--visited);
}
.article sup.ref {
  font-size: 0.75em;
  line-height: 0;
}
.article sup.ref a {
  text-decoration: none;
}

.article h2 {
  margin: 1.8rem 0 0.7rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.6rem;
  line-height: 1.3;
}

.article ul {
  margin: 0.4rem 0 0.9rem;
  padding-left: 1.5rem;
  list-style: disc;
}
.article li {
  margin: 0.2rem 0;
}

/* Infobox */
.article .infobox {
  align-self: start;
  margin: 0.25rem 0 1.25rem;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.875rem;
  line-height: 1.5;
}
.infobox .ib-title {
  padding: 0.5rem;
  background: var(--surface-2);
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
}
.infobox table {
  width: 100%;
}
.infobox th,
.infobox td {
  padding: 0.35rem 0.6rem;
  vertical-align: top;
  text-align: left;
}
.infobox th {
  width: 38%;
  font-weight: 700;
}

/* Referensi */
.article ol.refs {
  margin: 0.4rem 0;
  padding-left: 1.6rem;
  list-style: decimal;
  font-size: 0.9rem;
}
.refs li:target {
  background: var(--surface-2);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
