/*
Theme Name: BPSK Kabupaten Tolitoli
Description: Tema WordPress untuk Badan Penyelesaian Sengketa Konsumen (BPSK) Kabupaten Tolitoli. Dilengkapi formulir pengaduan online, data pengaduan di dasbor, statistik otomatis, dan pengaturan kontak/struktur organisasi lewat Customizer.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: bpsk
*/

:root {
  --primary: #0b3a6f;
  --primary-2: #0f4c8f;
  --primary-dark: #072649;
  --gold: #e0a526;
  --gold-dark: #c08a14;
  --text: #1d2939;
  --muted: #5b6577;
  --bg: #ffffff;
  --bg-alt: #f3f6fa;
  --border: #e2e8f0;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(11, 58, 111, .08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; color: var(--text); background: var(--bg); line-height: 1.65; }
img, iframe { max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.25; color: var(--primary-dark); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: .8rem; }
h3 { font-size: 1.15rem; margin-bottom: .5rem; }
p + p { margin-top: .8rem; }
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(820px, 100% - 32px); }
.muted { color: var(--muted); }
.small { font-size: .85rem; margin-top: .8rem; }
.mt { margin-top: 24px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .8rem 1.5rem; border-radius: 10px; font-weight: 700; font-size: .95rem; border: 2px solid transparent; cursor: pointer; transition: .2s; font-family: inherit; }
.btn-sm { padding: .5rem 1rem; font-size: .85rem; }
.btn-gold { background: var(--gold); color: var(--primary-dark); }
.btn-gold:hover { background: var(--gold-dark); color: #fff; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); }
.btn-outline { border-color: rgba(255,255,255,.6); color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,.12); }
.btn-outline-dark { border-color: var(--primary); color: var(--primary); background: transparent; }

/* Topbar */
.topbar { background: var(--primary-dark); color: #cdd8e6; font-size: .8rem; }
.topbar-inner { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; flex-wrap: wrap; }
.topbar-right { display: flex; gap: 18px; flex-wrap: wrap; }
.topbar a:hover { color: var(--gold); }

/* Header */
.header { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--border); transition: box-shadow .2s; }
.header.scrolled { box-shadow: var(--shadow); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 46px; height: 46px; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.3rem; color: var(--primary); letter-spacing: 1px; }
.brand-text small { font-size: .78rem; color: var(--muted); font-weight: 600; }
.brand.light strong { color: #fff; } .brand.light small { color: #b9c6d8; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav > a, .dropdown > a { padding: .55rem .8rem; border-radius: 8px; font-weight: 600; font-size: .92rem; color: var(--text); }
.nav > a:not(.btn):hover, .nav > a.active, .dropdown > a:hover { color: var(--primary); background: var(--bg-alt); }
.nav .btn { margin-left: 8px; color: var(--primary-dark); }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; top: 100%; left: 0; min-width: 220px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; opacity: 0; visibility: hidden; transform: translateY(6px); transition: .2s; }
.dropdown:hover .dropdown-menu, .dropdown:focus-within .dropdown-menu { opacity: 1; visibility: visible; transform: none; }
.dropdown-menu a { display: block; padding: .5rem .8rem; border-radius: 6px; font-size: .9rem; }
.dropdown-menu a:hover { background: var(--bg-alt); color: var(--primary); }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2.5px; background: var(--primary); margin: 5px 0; border-radius: 2px; transition: .2s; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, var(--primary-2) 100%); color: #fff; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(224,165,38,.25), transparent 70%); }
.hero-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; padding: 80px 0; align-items: center; position: relative; z-index: 1; }
.badge { display: inline-block; background: rgba(224,165,38,.18); color: var(--gold); border: 1px solid rgba(224,165,38,.5); padding: .35rem .9rem; border-radius: 999px; font-size: .8rem; font-weight: 700; margin-bottom: 18px; }
.hero h1 { color: #fff; font-size: clamp(1.9rem, 4.2vw, 3rem); font-weight: 800; margin-bottom: 18px; }
.hero h1 span { color: var(--gold); display: block; }
.hero p { color: #d7e1ee; font-size: 1.05rem; max-width: 560px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0; }
.hero-actions.center { justify-content: center; }
.hero-points { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .9rem; color: #e6edf6; }
.hero-card { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: var(--radius); padding: 28px; backdrop-filter: blur(4px); }
.hero-card h3 { color: #fff; font-size: 1.25rem; }
.hero-card .muted { color: var(--gold); font-size: .85rem; margin-bottom: 14px; }
.hero-card ul { list-style: none; display: grid; gap: 10px; }
.hero-card li { padding-left: 28px; position: relative; color: #e6edf6; font-size: .95rem; }
.hero-card li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--gold); color: var(--primary-dark); font-size: .7rem; font-weight: 800; display: grid; place-items: center; margin-top: 2px; }

/* Stats */
.stats { background: #fff; padding: 0 0 10px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: -40px; position: relative; z-index: 2; }
.stat { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; text-align: center; border-bottom: 4px solid var(--gold); }
.stat strong { display: block; font-size: 1.9rem; color: var(--primary); font-weight: 800; }
.stat span { color: var(--muted); font-size: .9rem; font-weight: 600; }
.stats-note { font-size: .75rem; color: var(--muted); margin-top: 8px; text-align: right; }

/* Sections */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }
.section-dark { background: var(--primary-dark); color: #d7e1ee; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 44px; }
.section-head p { color: var(--muted); }
.section-head.light h2 { color: #fff; }
.eyebrow { display: inline-block; color: var(--gold-dark); font-weight: 800; text-transform: uppercase; letter-spacing: 1.5px; font-size: .78rem; margin-bottom: 8px; }
.section-dark .eyebrow { color: var(--gold); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; box-shadow: 0 2px 8px rgba(11,58,111,.04); transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.feature-list { display: grid; gap: 14px; }
.feature { display: flex; gap: 16px; background: var(--bg-alt); padding: 18px; border-radius: var(--radius); border-left: 4px solid var(--gold); }
.feature .icon { font-size: 1.6rem; }
.feature h4 { margin-bottom: 2px; }
.feature p { color: var(--muted); font-size: .92rem; }

.vm-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 20px; }
.vm-visi { background: var(--primary); color: #fff; border: 0; display: flex; flex-direction: column; justify-content: center; }
.vm-visi h3 { color: var(--gold); font-size: 1.4rem; }
.vm-visi p { font-size: 1.15rem; font-style: italic; }
.card ol { padding-left: 20px; display: grid; gap: 8px; }

.numbered { display: flex; gap: 14px; align-items: flex-start; }
.numbered span { font-size: 1.5rem; font-weight: 800; color: var(--gold); line-height: 1; min-width: 36px; }

/* Org chart */
.org { display: grid; gap: 20px; justify-items: center; }
.org-row { display: flex; justify-content: center; width: 100%; position: relative; }
.org-row:not(:last-child)::after { content: ""; position: absolute; bottom: -20px; left: 50%; width: 2px; height: 20px; background: var(--gold); }
.org-row.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.org-row.three::after { display: none; }
.org-col { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; text-align: center; }
.org-col h4 { color: var(--primary); font-size: .95rem; }
.org-box { background: var(--bg-alt); border-radius: 10px; padding: 12px 20px; text-align: center; min-width: 240px; }
.org-box small { display: block; color: var(--gold-dark); font-weight: 800; text-transform: uppercase; font-size: .72rem; letter-spacing: 1px; }
.org-box span { display: block; font-size: .8rem; color: var(--muted); }
.org-box.lead { background: var(--primary); color: #fff; }
.org-box.lead small { color: var(--gold); } .org-box.lead span { color: #c4d1e3; }
.org-box.secretariat { background: #fff; border: 2px dashed var(--gold); }

/* Services */
.service { text-align: center; border-top: 4px solid var(--primary); }
.service-icon { width: 70px; height: 70px; border-radius: 50%; background: var(--bg-alt); display: grid; place-items: center; font-size: 2rem; margin: 0 auto 14px; }
.service p, .info p { color: var(--muted); font-size: .95rem; }

/* Timeline */
.timeline { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; position: relative; }
.timeline::before { content: ""; position: absolute; top: 26px; left: 8%; right: 8%; height: 2px; background: rgba(224,165,38,.4); }
.step { text-align: center; position: relative; }
.step-num { width: 54px; height: 54px; border-radius: 50%; background: var(--gold); color: var(--primary-dark); font-weight: 800; font-size: 1.3rem; display: grid; place-items: center; margin: 0 auto 14px; position: relative; box-shadow: 0 0 0 6px var(--primary-dark); }
.step h4 { color: #fff; margin-bottom: 6px; }
.step p { font-size: .88rem; }
.callout { margin-top: 44px; background: rgba(255,255,255,.06); border-left: 4px solid var(--gold); padding: 18px 22px; border-radius: 10px; font-size: .95rem; }
.callout strong { color: var(--gold); }

/* Persyaratan */
.checklist { list-style: none; margin-top: 18px; display: grid; gap: 10px; }
.checklist li { padding: 12px 16px 12px 46px; background: var(--bg-alt); border-radius: 10px; position: relative; font-weight: 500; }
.checklist li::before { content: "✓"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: .75rem; display: grid; place-items: center; }
.warn { border-left: 5px solid #d64545; }
.warn h3 { color: #a12b2b; }
.warn ul { padding-left: 20px; display: grid; gap: 6px; margin-top: 10px; }

/* Form */
.form { max-width: 920px; margin: 0 auto; }
.form:hover { transform: none; }
fieldset { border: 0; margin-bottom: 26px; }
legend { font-weight: 800; color: var(--primary); font-size: 1.05rem; margin-bottom: 14px; padding-bottom: 6px; border-bottom: 2px solid var(--gold); width: 100%; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; }
.form-grid .full { grid-column: 1 / -1; }
input, select, textarea { font: inherit; font-weight: 400; padding: .7rem .9rem; border: 1.5px solid var(--border); border-radius: 9px; background: #fff; color: var(--text); transition: border-color .2s; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(15,76,143,.12); }
.invalid { border-color: #d64545 !important; }
.radios { display: flex; gap: 20px; flex-wrap: wrap; font-weight: 500; }
.radios label { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; }
.radios input, .check input { width: auto; }
.form-grid .check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 500; }
.check input { margin-top: 5px; }
.form-error { color: #c23434; font-weight: 600; min-height: 1.2em; margin-bottom: 10px; }
.result { max-width: 640px; margin: 0 auto; text-align: center; }
.result-icon { font-size: 3rem; }
.reg { font-size: 1.6rem; font-weight: 800; color: var(--primary); letter-spacing: 1px; background: var(--bg-alt); padding: 10px; border-radius: 10px; margin: 8px 0 14px; }

/* News */
.news { padding: 0; overflow: hidden; }
.news-thumb { height: 160px; display: grid; place-items: center; font-size: 3.5rem; }
.t1 { background: linear-gradient(135deg, #0b3a6f, #1d6fb8); }
.t2 { background: linear-gradient(135deg, #c08a14, #e8c063); }
.t3 { background: linear-gradient(135deg, #0f766e, #34b3a0); }
.news-body { padding: 22px; }
.news-date { font-size: .78rem; color: var(--gold-dark); font-weight: 700; text-transform: uppercase; }
.news-body p { color: var(--muted); font-size: .92rem; }
.link { display: inline-block; margin-top: 12px; color: var(--primary); font-weight: 700; font-size: .9rem; }

/* Law */
.law-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.law { display: flex; gap: 16px; align-items: center; background: #fff; padding: 16px 20px; border-radius: var(--radius); border: 1px solid var(--border); }
.law span { flex-shrink: 0; min-width: 68px; text-align: center; background: var(--primary); color: var(--gold); font-weight: 800; font-size: .75rem; padding: 8px 6px; border-radius: 8px; }

/* FAQ */
.faq { display: grid; gap: 12px; }
.faq details { border: 1px solid var(--border); border-radius: 12px; background: #fff; overflow: hidden; }
.faq summary { padding: 18px 50px 18px 20px; font-weight: 700; cursor: pointer; list-style: none; position: relative; color: var(--primary-dark); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--gold-dark); transition: .2s; }
.faq details[open] summary::after { content: "−"; }
.faq details[open] summary { background: var(--bg-alt); }
.faq details p { padding: 16px 20px 20px; color: var(--muted); }

/* Contact */
.contact { list-style: none; display: grid; gap: 16px; margin-top: 20px; }
.contact li { display: flex; gap: 16px; }
.contact li > span { width: 46px; height: 46px; flex-shrink: 0; border-radius: 12px; background: var(--primary); color: var(--gold); display: grid; place-items: center; font-size: 1.2rem; }
.contact p { color: var(--muted); }
.map { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); min-height: 380px; }
.map iframe { width: 100%; height: 100%; min-height: 420px; border: 0; display: block; }

/* Footer */
.footer { background: var(--primary-dark); color: #b9c6d8; padding-top: 56px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 40px; padding-bottom: 40px; }
.footer p { margin-top: 14px; font-size: .92rem; max-width: 380px; }
.footer h4 { color: #fff; margin-bottom: 14px; }
.footer-grid a:not(.brand) { display: block; padding: 4px 0; font-size: .92rem; }
.footer-grid a:not(.brand):hover { color: var(--gold); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); text-align: center; padding: 18px 16px; font-size: .85rem; }

.to-top { position: fixed; right: 20px; bottom: 20px; width: 46px; height: 46px; border-radius: 50%; background: var(--gold); color: var(--primary-dark); display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; box-shadow: var(--shadow); opacity: 0; visibility: hidden; transition: .25s; z-index: 40; }
.to-top.show { opacity: 1; visibility: visible; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s, transform .6s; }
.reveal.visible { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 1024px) {
  .nav-toggle { display: block; }
  .nav { position: fixed; inset: 72px 0 auto 0; flex-direction: column; align-items: stretch; background: #fff; padding: 12px 16px 20px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); max-height: calc(100vh - 72px); overflow-y: auto; transform: translateY(-120%); transition: transform .3s; }
  .nav.open { transform: none; }
  .nav .btn { margin: 8px 0 0; }
  .dropdown-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 0 14px; }
  .timeline { grid-template-columns: repeat(3, 1fr); row-gap: 32px; }
  .timeline::before { display: none; }
}
@media (max-width: 860px) {
  .hero-inner, .two-col, .vm-grid, .grid-2, .law-list, .footer-grid { grid-template-columns: 1fr; }
  .hero-inner { padding: 56px 0 72px; gap: 32px; }
  .grid-3, .org-row.three { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 60px 0; }
  .topbar-right span { display: none; }
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; }
  .step { display: grid; grid-template-columns: 54px 1fr; column-gap: 16px; text-align: left; }
  .step-num { margin: 0; grid-row: span 2; }
  .org-box { min-width: 0; width: 100%; }
  .topbar-inner > span:first-child { display: none; }
  .card { padding: 20px; }
}

@media print {
  .topbar, .header, .footer, .to-top, main > section:not(#pengaduan), #formPengaduan, .result .hero-actions, .section-head { display: none !important; }
  .section { padding: 0; }
}

/* ===== Tambahan khusus WordPress ===== */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
img.brand-logo { object-fit: contain; height: 46px; width: auto; }
.footer-grid li { list-style: none; }
.news-thumb { overflow: hidden; }
.news-thumb img { width: 100%; height: 100%; object-fit: cover; }
.news h3 a:hover { color: var(--primary-2); }
.center-link { text-align: center; margin-top: 28px; }
.empty { text-align: center; color: var(--muted); background: var(--bg-alt); padding: 28px; border-radius: var(--radius); }

.page-hero { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff; padding: 56px 0; }
.page-hero h1 { color: #fff; font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
.page-hero .eyebrow { color: var(--gold); }

.entry { font-size: 1.05rem; }
.entry > * + * { margin-top: 1rem; }
.entry h2, .entry h3 { margin-top: 2rem; }
.entry ul, .entry ol { padding-left: 1.4rem; }
.entry a { color: var(--primary-2); text-decoration: underline; }
.entry img { height: auto; border-radius: 10px; }
.entry blockquote { border-left: 4px solid var(--gold); padding: 8px 18px; background: var(--bg-alt); border-radius: 8px; }
.entry-thumb img { width: 100%; border-radius: var(--radius); }
.entry-back { margin-top: 2rem; }
.entry-back a { text-decoration: none; }

.pagination { margin-top: 32px; text-align: center; }
.pagination .nav-links { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pagination .page-numbers { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); background: #fff; }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

.admin-bar .header { top: 32px; }
@media (max-width: 782px) { .admin-bar .header { top: 46px; } }
@media print { .page-hero { display: none; } }
