/* ==========================================================
   Hukum Syariah Indonesia — biru · putih · emas
   ========================================================== */
:root {
  --navy-900: #071d3d;
  --navy-800: #0b2a55;
  --navy-700: #123a72;
  --blue-600: #1d4f96;
  --blue-500: #2a64b8;
  --blue-100: #e6eefa;
  --blue-50: #f3f7fd;
  --gold-600: #a87b12;
  --gold-500: #c9a227;
  --gold-400: #ddb84a;
  --gold-200: #f3e3a8;
  --gold-50: #fdf8e8;
  --white: #ffffff;
  --ink: #13233d;
  --muted: #5a6b85;
  --line: #dfe6f1;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(11, 42, 85, .06), 0 2px 8px rgba(11, 42, 85, .05);
  --shadow: 0 6px 24px rgba(11, 42, 85, .10);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --arab: "Amiri", "Traditional Arabic", "Scheherazade New", serif;
  --container: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--blue-50);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--blue-600); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold-400); outline-offset: 2px; border-radius: 6px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold-500); color: var(--navy-900); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(11, 42, 85, .96);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid rgba(221, 184, 74, .35);
}
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--white); margin-right: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-family: var(--serif); font-size: 22px; letter-spacing: .3px; }
.brand-text small { font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--gold-400); font-weight: 600; }
.nav { display: flex; gap: 4px; }
.nav a {
  color: rgba(255, 255, 255, .82); text-decoration: none; font-weight: 500; font-size: 15px;
  padding: 8px 14px; border-radius: 999px; transition: background .2s, color .2s;
}
.nav a:hover { color: var(--white); background: rgba(255, 255, 255, .08); }
.nav a.active { color: var(--navy-900); background: var(--gold-400); }
.lang { display: flex; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .15); }
.lang button {
  border: 0; background: none; color: rgba(255, 255, 255, .8); font-size: 13px; font-weight: 700;
  padding: 5px 11px; border-radius: 999px; cursor: pointer; letter-spacing: .5px;
}
.lang button.active { background: var(--white); color: var(--navy-800); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: var(--white);
  background:
    radial-gradient(1100px 420px at 85% -10%, rgba(221, 184, 74, .22), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, rgba(42, 100, 184, .45), transparent 60%),
    linear-gradient(160deg, var(--navy-800), var(--navy-900));
  padding: 64px 0 88px;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cpath d='M30 0l8.8 21.2L60 30l-21.2 8.8L30 60l-8.8-21.2L0 30l21.2-8.8z' fill='none' stroke='%23f3d77a' stroke-width='1'/%3E%3C/svg%3E");
}
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.2fr .8fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--gold-200);
  padding: 6px 14px; border: 1px solid rgba(221, 184, 74, .45); border-radius: 999px; background: rgba(221, 184, 74, .08);
}
.hero h1 { font-family: var(--serif); font-size: clamp(38px, 6vw, 64px); line-height: 1.02; margin: 18px 0 14px; letter-spacing: .3px; }
.hero h1 span { color: var(--gold-400); display: block; }
.hero p.lead { font-size: 18px; color: rgba(255, 255, 255, .82); max-width: 560px; margin: 0 0 28px; }
.hero-emblem { justify-self: center; width: min(320px, 80%); filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .35)); }
.hero-emblem img { width: 100%; height: auto; }

.searchbar {
  display: flex; align-items: center; gap: 8px; background: var(--white); border-radius: 999px;
  padding: 6px 6px 6px 18px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); max-width: 600px;
  border: 2px solid transparent; transition: border-color .2s;
}
.searchbar:focus-within { border-color: var(--gold-400); }
.searchbar svg { width: 20px; height: 20px; flex: none; stroke: var(--muted); fill: none; stroke-width: 2; }
.searchbar input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; padding: 10px 4px; font-size: 16px; color: var(--ink); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  border: 0; border-radius: 999px; padding: 11px 22px; font-weight: 600; font-size: 15px; text-decoration: none;
  transition: transform .15s, box-shadow .2s, background .2s;
}
.btn:active { transform: translateY(1px); }
.btn-gold { background: linear-gradient(135deg, var(--gold-400), var(--gold-600)); color: var(--white); box-shadow: 0 4px 14px rgba(168, 123, 18, .35); }
.btn-gold:hover { box-shadow: 0 6px 20px rgba(168, 123, 18, .45); }
.btn-blue { background: var(--navy-800); color: var(--white); }
.btn-blue:hover { background: var(--navy-700); }
.btn-ghost { background: var(--white); color: var(--navy-800); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--gold-400); }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

.examples { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; color: rgba(255, 255, 255, .7); }
.chip {
  display: inline-block; border: 1px solid rgba(255, 255, 255, .25); color: var(--white); background: rgba(255, 255, 255, .06);
  padding: 4px 12px; border-radius: 999px; text-decoration: none; font-size: 13px; cursor: pointer; transition: background .2s, border-color .2s;
}
.chip:hover { background: rgba(221, 184, 74, .18); border-color: var(--gold-400); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 32px; max-width: 560px; }
.stat { border-left: 2px solid var(--gold-500); padding: 2px 0 2px 14px; }
.stat b { display: block; font-family: var(--serif); font-size: 30px; line-height: 1; color: var(--white); }
.stat span { font-size: 13px; color: rgba(255, 255, 255, .7); }

/* ---------- Section ---------- */
.section { padding: 56px 0; }
.section.tight { padding-top: 0; }
.overlap { margin-top: -48px; position: relative; z-index: 2; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-head h2 { font-family: var(--serif); font-size: clamp(28px, 3.4vw, 38px); line-height: 1.1; margin: 0; color: var(--navy-800); }
.section-head p { margin: 6px 0 0; color: var(--muted); }
.ornament { display: block; width: 56px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--gold-400), var(--gold-600)); margin-bottom: 12px; }

/* ---------- Category cards ---------- */
.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.cat {
  position: relative; display: flex; flex-direction: column; text-decoration: none; color: var(--ink);
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s, border-color .2s; overflow: hidden;
}
.cat::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--navy-700), var(--blue-500)); }
.cat:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--gold-400); }
.cat:hover::before { background: linear-gradient(90deg, var(--gold-400), var(--gold-600)); }
.cat-icon {
  width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 16px;
  background: radial-gradient(circle at 30% 30%, var(--navy-700), var(--navy-900)); color: var(--gold-400);
  border: 2px solid var(--gold-400); font-size: 26px; line-height: 1;
}
.cat-icon svg { width: 30px; height: 30px; stroke: var(--gold-400); fill: none; stroke-width: 1.6; }
.cat-icon.small { width: 44px; height: 44px; font-size: 20px; margin: 0; }
.cat-icon.small svg { width: 22px; height: 22px; }
.cat h3 { font-family: var(--serif); font-size: 26px; margin: 0; color: var(--navy-800); line-height: 1.1; }
.cat .sub { font-size: 13px; color: var(--gold-600); font-weight: 600; margin: 4px 0 10px; }
.cat p { font-size: 14px; color: var(--muted); margin: 0 0 16px; flex: 1; }
.cat .more { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 600; color: var(--navy-700); border-top: 1px dashed var(--line); padding-top: 12px; }
.cat .more svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; transition: transform .2s; }
.cat:hover .more svg { transform: translateX(4px); }

/* ---------- Features ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { display: flex; gap: 14px; align-items: flex-start; background: var(--white); border-radius: var(--radius); padding: 20px; border: 1px solid var(--line); }
.feature .fi { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--gold-50); border: 1px solid var(--gold-200); }
.feature .fi svg { width: 22px; height: 22px; stroke: var(--gold-600); fill: none; stroke-width: 2; }
.feature h3 { margin: 0 0 2px; font-size: 16px; color: var(--navy-800); }
.feature p { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------- Page header ---------- */
.page-head {
  color: var(--white); padding: 40px 0 72px;
  background: radial-gradient(800px 300px at 90% -20%, rgba(221, 184, 74, .2), transparent 60%), linear-gradient(160deg, var(--navy-800), var(--navy-900));
}
.page-head h1 { font-family: var(--serif); font-size: clamp(32px, 5vw, 48px); margin: 8px 0 6px; line-height: 1.1; }
.page-head p { margin: 0; color: rgba(255, 255, 255, .8); max-width: 720px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--gold-200); text-decoration: none; font-size: 14px; font-weight: 500; }
.crumb svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.crumb:hover { color: var(--white); }
.page-head .head-row { display: flex; align-items: center; gap: 18px; }
.page-head .cat-icon { margin: 0; flex: none; }

/* ---------- Book list ---------- */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 20px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; text-decoration: none; padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
  color: var(--navy-800); background: var(--white); border: 1px solid var(--line); white-space: nowrap;
}
.tab.active { background: var(--navy-800); color: var(--white); border-color: var(--navy-800); }
.books { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.book {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 10px; transition: border-color .2s, box-shadow .2s;
}
.book:hover { border-color: var(--gold-400); box-shadow: var(--shadow); }
.book-top { display: flex; align-items: flex-start; gap: 14px; }
.book-mark {
  flex: none; width: 46px; height: 58px; border-radius: 4px 10px 10px 4px; position: relative;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-900)); box-shadow: inset 4px 0 0 var(--gold-500);
  display: grid; place-items: center; color: var(--gold-400); font-family: var(--serif); font-weight: 700; font-size: 20px;
}
.book h3 { margin: 0; font-family: var(--serif); font-size: 24px; line-height: 1.15; color: var(--navy-800); }
.tag { display: inline-block; font-size: 12px; font-weight: 600; color: var(--gold-600); background: var(--gold-50); border: 1px solid var(--gold-200); padding: 1px 10px; border-radius: 999px; margin-top: 6px; }
.book p { margin: 0; color: var(--muted); font-size: 15px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }
.links .btn { padding: 9px 16px; font-size: 14px; }
.btn small { font-weight: 500; opacity: .75; font-size: 12px; }
.badge { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; }
.badge.web { background: var(--blue-100); color: var(--blue-600); }
.badge.pdf { background: #fde8e6; color: #b3261e; }
.badge.store { background: #e5f5ec; color: #18794e; }
.btn-blue .badge, .btn-gold .badge { background: rgba(255, 255, 255, .18); color: var(--white); }

/* ---------- Search page ---------- */
.search-panel { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; border: 1px solid var(--line); }
.search-panel .searchbar { box-shadow: none; border: 1px solid var(--line); max-width: none; background: var(--blue-50); }
.search-panel .searchbar:focus-within { border-color: var(--gold-500); background: var(--white); }
.scopes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.scopes > span { font-size: 13px; color: var(--muted); font-weight: 600; margin-right: 2px; }
.scope { border: 1px solid var(--line); background: var(--white); color: var(--navy-800); padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; }
.scope.active { background: var(--navy-800); border-color: var(--navy-800); color: var(--white); }
.tips { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

.results { margin-top: 26px; display: grid; gap: 22px; }
.status { text-align: center; color: var(--muted); padding: 40px 0; }
.spinner { width: 28px; height: 28px; margin: 0 auto 10px; border-radius: 50%; border: 3px solid var(--blue-100); border-top-color: var(--gold-500); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.group { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; background: linear-gradient(90deg, var(--blue-50), var(--white)); border-bottom: 1px solid var(--line); }
.group-head h3 { margin: 0; font-size: 16px; color: var(--navy-800); display: flex; align-items: center; gap: 8px; }
.group-head .count { font-size: 13px; color: var(--muted); white-space: nowrap; }
.hit { display: block; padding: 14px 18px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: background .15s; }
.hit:last-child { border-bottom: 0; }
.hit:hover { background: var(--gold-50); }
.hit-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; color: var(--blue-600); margin-bottom: 4px; }
.hit-top .pg { color: var(--gold-600); white-space: nowrap; }
.hit p { margin: 0; font-size: 14.5px; color: #34445e; overflow-wrap: anywhere; }
mark { background: var(--gold-200); color: var(--navy-900); padding: 0 2px; border-radius: 3px; }
.more-btn { display: block; width: 100%; border: 0; border-top: 1px solid var(--line); background: var(--white); padding: 12px; font-weight: 600; color: var(--navy-700); cursor: pointer; }
.more-btn:hover { background: var(--blue-50); }

.surah-card { padding: 20px 18px; }
.surah-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.surah-title h4 { margin: 0; font-family: var(--serif); font-size: 28px; color: var(--navy-800); line-height: 1.1; }
.surah-title .ar { font-family: var(--arab); font-size: 30px; color: var(--gold-600); }
.surah-title small { display: block; color: var(--muted); font-size: 13px; }
.verse { padding: 16px 0; border-top: 1px solid var(--line); }
.verse:first-of-type { margin-top: 14px; }
.verse .ar { font-family: var(--arab); font-size: 28px; line-height: 2.1; direction: rtl; text-align: right; color: var(--navy-900); }
.verse .tr { color: #34445e; font-size: 15px; margin-top: 6px; display: flex; gap: 10px; }
.vnum {
  flex: none; width: 30px; height: 30px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700;
  color: var(--navy-800); background: var(--gold-50); border: 1px solid var(--gold-400); border-radius: 50%;
}
.surah-card .links { margin-top: 10px; }

/* ---------- Footer ---------- */
.footer { background: var(--navy-900); color: rgba(255, 255, 255, .75); padding: 36px 0 28px; margin-top: 40px; border-top: 3px solid var(--gold-500); }
.footer-inner { display: grid; gap: 10px; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand strong { color: var(--white); font-family: var(--serif); font-size: 20px; }
.footer-brand p { margin: 0; font-size: 14px; }
.footer-note, .footer-copy { margin: 0; font-size: 13px; color: rgba(255, 255, 255, .55); }

/* ---------- Bottom nav (HP) ---------- */
.bottom-nav { display: none; }

/* ---------- Responsif ---------- */
@media (max-width: 1024px) {
  .cats { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-emblem { display: none; }
}
@media (max-width: 760px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .container { padding: 0 16px; }
  .topbar-inner { height: 60px; gap: 12px; }
  .nav { display: none; }
  .brand-text strong { font-size: 19px; }
  .hero { padding: 40px 0 72px; }
  .hero p.lead { font-size: 16px; }
  .stats { gap: 8px; }
  .stat b { font-size: 24px; }
  .stat span { font-size: 12px; }
  .searchbar { padding-left: 14px; }
  .searchbar .btn span { display: none; }
  .searchbar .btn { padding: 11px 14px; }
  .cats, .books, .features { grid-template-columns: 1fr; }
  .cats { gap: 12px; }
  .cat { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0 14px; padding: 16px; }
  .cat .cat-icon { margin: 0; width: 52px; height: 52px; font-size: 22px; }
  .cat .cat-text { flex: 1; min-width: 0; }
  .cat h3 { font-size: 22px; }
  .cat .sub { margin: 2px 0 0; }
  .cat p { flex-basis: 100%; margin: 12px 0; }
  .cat .more { flex-basis: 100%; }
  .section { padding: 40px 0; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .page-head { padding: 28px 0 64px; }
  .book h3 { font-size: 21px; }
  .verse .ar { font-size: 24px; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--white); border-top: 1px solid var(--line); box-shadow: 0 -4px 20px rgba(11, 42, 85, .08);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 10px; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 600; position: relative; }
  .bottom-nav svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .bottom-nav a.active { color: var(--navy-800); }
  .bottom-nav a.active::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold-500); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
