/* Tenung — satu stylesheet untuk semua halaman. Mobile-first, tanpa framework. Tema biru. */

:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #e7eef8;
  --ink: #142033;
  --muted: #55657d;
  --line: #d5dfec;
  --brand: #1d4f91;
  --brand-2: #3b7dd8;
  --brand-ink: #ffffff;
  --brand-soft: #dbe7f7;
  --accent: #b7791f;
  --good: #1f7a46;
  --mid: #b7791f;
  --bad: #b3361f;
  --focus: #3b7dd8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 35, 70, .06), 0 4px 16px rgba(15, 35, 70, .07);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c131e;
    --surface: #131c2a;
    --surface-2: #1a2638;
    --ink: #e3ebf6;
    --muted: #9badc6;
    --line: #26354b;
    --brand: #79aaf0;
    --brand-2: #4f8ee6;
    --brand-ink: #071a33;
    --brand-soft: #172d4d;
    --accent: #e3b45c;
    --good: #5fcf8e;
    --mid: #e3b45c;
    --bad: #f08a72;
    --focus: #8fbaf7;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.65 var(--font);
  overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; }

a { color: var(--brand); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.25; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 16px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- Header & navigasi ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  border-top: 4px solid var(--brand);
}
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; padding-block: 10px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font: 700 1.35rem/1 var(--font-display); letter-spacing: .01em;
  padding-block: 6px;
}
.brand-mark { width: 32px; height: 32px; fill: var(--brand); }
.brand-mark .brand-core { fill: var(--accent); }

.nav {
  display: flex; gap: 2px;
  overflow-x: auto; scrollbar-width: none;
  margin-inline: -16px; padding-inline: 16px; padding-bottom: 4px;
  flex: 1 1 100%;
  -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent);
          mask-image: linear-gradient(90deg, #000 90%, transparent);
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: none;
  padding: 8px 10px; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: .93rem;
  white-space: nowrap;
}
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--brand-ink); background: var(--brand); }

.menu-toggle {
  margin-left: auto; display: inline-grid; place-items: center;
  width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); cursor: pointer;
}
.menu-toggle[hidden] { display: none; }
.menu-toggle svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.menu-open .menu-toggle path { d: path("M6 6l12 12M18 6L6 18"); }

/* Mobile/tablet dengan JavaScript: menu disembunyikan di balik tombol hamburger.
   Tanpa JavaScript, menu tetap tampil sebagai baris yang bisa digeser. */
@media (max-width: 1079.98px) {
  .has-toggle .nav { display: none; }
  .has-toggle.menu-open .nav {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px;
    margin: 4px 0 6px; padding: 8px 0 0; border-top: 1px solid var(--line);
    overflow: visible; -webkit-mask-image: none; mask-image: none;
  }
  .has-toggle .nav a { padding: 12px 14px; border-radius: 10px; color: var(--ink); }
  .has-toggle .nav a[aria-current="page"] { color: var(--brand-ink); }
}

@media (min-width: 1080px) {
  .menu-toggle { display: none; }
  .nav { flex: 1 1 auto; justify-content: flex-end; margin: 0; padding: 0; -webkit-mask-image: none; mask-image: none; }
}

/* ---------- Hero & formulir ---------- */
.hero { padding: 28px 0 8px; }
.hero .lead { color: var(--muted); font-size: 1.05rem; max-width: 62ch; }

.date-form {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px; margin-top: 16px;
}
.date-group { border: 0; margin: 0; padding: 0; min-width: 0; flex: 1 1 280px; }
.date-group legend { font-weight: 600; font-size: .9rem; color: var(--muted); padding: 0; margin-bottom: 6px; }
.date-fields { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) 5.5rem; gap: 8px; }
.date-fields.month-fields { grid-template-columns: minmax(0, 1fr) 5.5rem; }

select, input[type="number"], button, .btn {
  font: inherit; font-size: 1rem;
  min-height: 46px; border-radius: 10px;
}
select, input[type="number"] {
  width: 100%; padding: 8px 10px;
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--line);
}
select:focus, input:focus { border-color: var(--focus); }
.date-form button, .btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 22px; border: 0; cursor: pointer;
  background: var(--brand); color: var(--brand-ink); font-weight: 700;
  text-decoration: none;
  flex: 1 1 100%;
}
.date-form button:hover, .btn:hover { filter: brightness(1.08); }
@media (min-width: 640px) { .date-form button { flex: 0 0 auto; } }

/* Pilihan cara hitung (mis. tiga ramalan jodoh) */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.tabs a {
  display: block; padding: 8px 14px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .93rem;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
}
.tabs a:hover { border-color: var(--brand); }
.tabs a[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

/* ---------- Tata letak konten ---------- */
.layout { display: grid; gap: 20px; padding-block: 20px 8px; }
.layout > * { min-width: 0; }
.stack { display: grid; gap: 20px; align-content: start; }
@media (min-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; }
}

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
@media (min-width: 640px) { .card { padding: 24px 28px; } }
.card > h2 { color: var(--brand); }
.card > :last-child { margin-bottom: 0; }
.card-more { display: inline-block; margin-top: 12px; font-weight: 600; }
.teaser p { color: var(--muted); }
.teaser h2 { font-size: 1.12rem; }

.eyebrow { display: block; font: 600 .78rem/1.2 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }

.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.summary li { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.summary .k { display: block; font-size: .8rem; color: var(--muted); }
.summary .v { display: block; font-weight: 700; font-size: 1.05rem; }

.headline { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.headline h2 { margin: 0; color: var(--brand); }
.headline p { margin: 2px 0 0; color: var(--muted); }
.symbol {
  flex: none; width: 88px; height: 88px; object-fit: contain;
  background: #fff; border-radius: 16px; padding: 6px; border: 1px solid var(--line);
}
@media (min-width: 640px) { .symbol { width: 112px; height: 112px; } }

.facts { margin: 0; display: grid; gap: 14px; }
.facts > div { padding-top: 14px; border-top: 1px solid var(--line); }
.facts > div:first-child { padding-top: 0; border-top: 0; }
.facts dt { font-weight: 700; margin-bottom: 2px; }
.facts dd { margin: 0; color: var(--ink); }
.facts dd p { margin: .6em 0 0; }

.verdict {
  border-radius: 12px; padding: 16px 18px; margin: 16px 0 0;
  background: var(--surface-2); border-left: 4px solid var(--accent);
}
.verdict.baik { border-left-color: var(--good); }
.verdict.sedang { border-left-color: var(--mid); }
.verdict.buruk { border-left-color: var(--bad); }
.verdict strong { font-family: var(--font-display); font-size: 1.15rem; }
.verdict p:last-child { margin-bottom: 0; }
.note { color: var(--muted); font-size: .92rem; margin: 12px 0 0; }

.pair { display: grid; gap: 10px; margin: 0 0 4px; padding: 0; list-style: none; }
@media (min-width: 640px) { .pair { grid-template-columns: 1fr 1fr; } }
.pair li { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.pair .k { display: block; font-size: .8rem; color: var(--muted); }
.pair .v { display: block; font-weight: 700; }
.pair .n { display: block; font-size: .88rem; color: var(--muted); }

/* Daftar jam baik */
.time-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.time-list li {
  padding: 12px 14px; border-radius: 12px; background: var(--brand-soft); color: var(--ink);
  font-weight: 700; font-variant-numeric: tabular-nums; text-align: center;
}

/* Daftar tanggal hari baik */
.day-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
@media (min-width: 640px) { .day-list { grid-template-columns: 1fr 1fr; } }
.day-list li { padding: 10px 14px; border-radius: 12px; background: var(--surface-2); }
.day-list .d { display: block; font-weight: 700; }
.day-list .w { display: block; font-size: .88rem; color: var(--muted); }
.empty { color: var(--muted); }

.chip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip-list a {
  display: block; padding: 6px 12px; border-radius: 999px; font-size: .9rem; text-decoration: none;
  background: var(--surface-2); color: var(--ink);
}
.chip-list a:hover { background: var(--brand-soft); }
.chip-list a[aria-current="page"] { background: var(--brand); color: var(--brand-ink); }

.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 16px; }
.pager a {
  padding: 10px 16px; border-radius: 10px; text-decoration: none; font-weight: 600;
  background: var(--surface); border: 1px solid var(--line);
}
.pager a:hover { border-color: var(--brand); }

/* ---------- Iklan ---------- */
.ad { overflow: hidden; }
.ad ins { width: 100%; }
/* Slot yang tidak terisi iklan tidak meninggalkan ruang kosong. */
.ad:has(ins[data-ad-status="unfilled"]) { display: none; }
ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
@media (max-width: 959.98px) {
  .ad-desktop { display: none; }
}
main > .ad { margin-block: 12px; }

/* ---------- Kalender ---------- */
.calendar h2 { font-size: 1.05rem; }
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cal-nav {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  text-decoration: none; font-size: 1.5rem; line-height: 1; color: var(--ink); background: var(--surface-2);
}
.cal-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-dow { font-size: .75rem; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-day a, .cal-day span {
  display: grid; place-items: center; aspect-ratio: 1; min-height: 36px;
  border-radius: 8px; text-decoration: none; color: var(--ink); font-size: .92rem;
}
.cal-day a:hover { background: var(--surface-2); }
.sun, .cal-day.sun a, .cal-day.sun span { color: var(--bad); }
.cal-day.is-marked a, .cal-day.is-marked span { background: var(--brand-soft); font-weight: 700; }
.cal-day.is-active a { background: var(--brand); color: var(--brand-ink); font-weight: 700; }

/* ---------- Penulis ---------- */
.author { display: grid; gap: 20px; align-items: start; }
.author img { border-radius: 12px; width: 180px; }
@media (min-width: 640px) { .author { grid-template-columns: 180px 1fr; } }

/* ---------- Tautan terkait ---------- */
.related { padding-block: 12px 8px; }
.related h2 { font-size: 1.15rem; }
.related-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.related-grid a {
  display: block; height: 100%; padding: 14px 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink);
  transition: border-color .15s, transform .15s;
}
.related-grid a:hover { border-color: var(--brand); transform: translateY(-1px); }
.related-grid strong { display: block; color: var(--brand); }
.related-grid span { display: block; color: var(--muted); font-size: .9rem; }

/* ---------- Teks panjang (kebijakan privasi) ---------- */
.prose h2 { margin-top: 1.4em; font-size: 1.15rem; color: var(--brand); }
.prose h2:first-child { margin-top: 0; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 32px; background: var(--surface); border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; }
.footer-inner { padding-block: 24px; }
.footer-brand { font: 700 1.1rem var(--font-display); color: var(--ink); margin-bottom: 4px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.copyright { margin: 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

@media print {
  .site-header nav, .menu-toggle, .ad, .date-form, .tabs, .related, .calendar, .site-footer { display: none !important; }
  .card { box-shadow: none; border: 0; padding: 0; }
}
