/* ============================================================================
   style.css — Kronologi Inisiatif Pendigitalan Jabatan Penjara Malaysia
   Reka bentuk: "jurnal korporat" — bersih, formal, profesional.
   ============================================================================ */

:root {
  /* Palet warna teras (tema terang) */
  --green-950: #0d2c1b;
  --green-900: #104026;
  --green-800: #195c38;
  --green-700: #23774a;
  --green-600: #379d67;
  --gold-600: #a9822f;
  --gold-500: #c8a951;
  --gold-400: #ddc27c;
  --gold-100: #f8f1de;

  --bg: #f6f4ee;
  --surface: #ffffff;
  --surface-2: #fbfaf6;
  --border: #e3ddc9;
  --text: #1c1f26;
  --text-muted: #5b6270;
  --text-soft: #838a97;
  --accent: var(--gold-600);
  --accent-strong: var(--green-900);
  --shadow: 0 8px 30px rgba(16, 64, 38, 0.08);
  --shadow-lg: 0 20px 50px rgba(16, 64, 38, 0.16);
  --radius: 10px;
  --serif: "Playfair Display", "Georgia", serif;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --maxw: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1420;
    --surface: #111b2c;
    --surface-2: #0f1929;
    --border: #223252;
    --text: #eef1f6;
    --text-muted: #a7b0c0;
    --text-soft: #7f8aa0;
    --accent: var(--gold-400);
    --accent-strong: var(--gold-400);
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);
  }
}

:root[data-theme="dark"] {
  --bg: #0c1420;
  --surface: #111b2c;
  --surface-2: #0f1929;
  --border: #223252;
  --text: #eef1f6;
  --text-muted: #a7b0c0;
  --text-soft: #7f8aa0;
  --accent: var(--gold-400);
  --accent-strong: var(--gold-400);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; margin: 0 0 .5em; letter-spacing: .01em; }
p { margin: 0 0 1em; }
button { font-family: var(--sans); cursor: pointer; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.hidden { display: none !important; }
::selection { background: var(--gold-400); color: var(--green-950); }

/* ---------- Scrollbar (subtle) ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }

/* ---------- Masthead / Nav ---------- */
.masthead {
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(180deg, var(--green-900), var(--green-950));
  color: #f4f1e6;
  box-shadow: 0 2px 20px rgba(0,0,0,.25);
}
.masthead-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; max-width: var(--maxw); margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--gold-400), var(--gold-600));
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.25);
  flex-shrink: 0;
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-text .eyebrow {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold-400); font-weight: 600;
}
.brand-text .title { font-family: var(--serif); font-size: 19px; font-weight: 700; line-height: 1.15; }
.brand-text .title small { display: block; font-family: var(--sans); font-size: 11.5px; font-weight: 400; color: #c9e3d5; letter-spacing: .04em; margin-top: 2px; }

.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links button.nav-btn {
  background: transparent; border: 1px solid transparent; color: #dfeee6;
  padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
  transition: all .18s ease; letter-spacing: .01em;
}
.nav-links button.nav-btn:hover { background: rgba(255,255,255,.08); }
.nav-links button.nav-btn.active { background: var(--gold-500); color: var(--green-950); }
.visitor-chip {
  display: flex; align-items: center; gap: 8px; margin-left: 10px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  padding: 6px 8px 6px 14px; border-radius: 999px; font-size: 13px;
}
.visitor-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #57d38c; box-shadow: 0 0 0 3px rgba(87,211,140,.2); }
.visitor-chip button {
  background: transparent; border: none; color: #cfe4d9; font-size: 12px;
  padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,.18);
}
.visitor-chip button:hover { background: rgba(255,255,255,.12); color: #fff; }

.masthead-strip {
  background: var(--green-950); border-top: 1px solid rgba(255,255,255,.08);
  font-size: 12.5px; color: #b9d4c6; padding: 6px 0;
}
.masthead-strip .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.masthead-strip strong { color: var(--gold-400); font-weight: 600; }

@media (max-width: 860px) {
  .masthead-top { flex-direction: column; align-items: flex-start; gap: 12px; }
  .nav-links { flex-wrap: wrap; }
}

/* ---------- Hero (Laman Utama) ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1100px 480px at 15% -10%, rgba(200,169,81,.16), transparent 60%),
    linear-gradient(160deg, var(--green-900), var(--green-800) 60%, var(--green-700));
  color: #f6f3ea;
  padding: 76px 0 84px;
}
.hero .container { position: relative; z-index: 2; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold-400); font-weight: 700; margin-bottom: 18px;
  border: 1px solid rgba(221,194,124,.4); padding: 6px 14px; border-radius: 999px;
}
.hero h1 { font-size: clamp(30px, 4.4vw, 52px); max-width: 820px; line-height: 1.12; color: #fff; }
.hero .lede { font-size: 17px; color: #d7ede1; max-width: 680px; }
.hero-stats { display: flex; gap: 34px; margin-top: 40px; flex-wrap: wrap; }
.hero-stat .num { font-family: var(--serif); font-size: 34px; color: var(--gold-400); font-weight: 700; }
.hero-stat .lbl { font-size: 12.5px; color: #b9d4c6; text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; }
.hero-cta { margin-top: 38px; display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px; padding: 13px 26px; font-weight: 700; font-size: 14.5px;
  border: 1px solid transparent; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary { background: var(--gold-500); color: var(--green-950); }
.btn-primary:hover { background: var(--gold-400); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(200,169,81,.35); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.btn-outline-green { background: transparent; color: var(--green-900); border-color: var(--green-900); }
.btn-outline-green:hover { background: var(--green-900); color: #fff; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Section shells ---------- */
.section { padding: 64px 0; }
.section-head { max-width: 720px; margin: 0 auto 40px; text-align: center; }
.section-head .kicker {
  font-size: 12px; text-transform: uppercase; letter-spacing: .16em; color: var(--accent);
  font-weight: 700; margin-bottom: 10px; display: block;
}
.section-head h2 { font-size: clamp(24px, 3vw, 34px); }
.section-head p { color: var(--text-muted); }
.section-alt { background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* ---------- Pengenalan cards ---------- */
.intro-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: start; }
.intro-copy .paragraph { font-size: 16px; color: var(--text); margin-bottom: 16px; }
.intro-copy .paragraph:first-child { font-family: var(--serif); font-size: 20px; color: var(--accent-strong); }
.intro-note {
  background: var(--gold-100); border: 1px solid var(--gold-400);
  border-radius: var(--radius); padding: 14px 16px; font-size: 13.5px; color: #6b5518;
  margin-top: 10px;
}
:root[data-theme="dark"] .intro-note, @media (prefers-color-scheme: dark) { }
.pillar-list { display: flex; flex-direction: column; gap: 14px; }
.pillar {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: flex-start;
}
.pillar .ic { width: 38px; height: 38px; flex-shrink: 0; border-radius: 9px; background: var(--gold-100); display: flex; align-items: center; justify-content: center; }
.pillar .ic svg { width: 20px; height: 20px; color: var(--gold-600); }
.pillar h4 { font-size: 15px; margin-bottom: 3px; }
.pillar p { font-size: 13.5px; color: var(--text-muted); margin: 0; }
@media (max-width: 900px) { .intro-grid { grid-template-columns: 1fr; } }

/* ---------- Coverage band ---------- */
.coverage-band {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  background: var(--green-900); color: #fff; border-radius: 16px; padding: 26px 32px; margin-top: 46px;
}
.coverage-band .txt strong { color: var(--gold-400); }
.coverage-band .txt { font-size: 14.5px; color: #dbeee4; }

/* ---------- Login card ---------- */
.auth-wrap { min-height: calc(100vh - 130px); display: flex; align-items: center; justify-content: center; padding: 60px 20px; }
.auth-card {
  width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-lg); padding: 40px 36px; position: relative; overflow: hidden;
}
.auth-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px;
  background: linear-gradient(90deg, var(--gold-600), var(--gold-400), var(--green-800));
}
.auth-head { text-align: center; margin-bottom: 28px; }
.auth-head .brand-mark { margin: 0 auto 16px; width: 56px; height: 56px; }
.auth-head .brand-mark svg { width: 30px; height: 30px; }
.auth-head h2 { font-size: 22px; margin-bottom: 6px; }
.auth-head p { color: var(--text-muted); font-size: 13.5px; margin: 0; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 7px; }
.field input, .field select {
  width: 100%; padding: 12px 14px; border-radius: 8px; border: 1.5px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 14.5px; transition: border-color .15s ease;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--gold-500); }
.field-hint { font-size: 12px; color: var(--text-soft); margin-top: 6px; }
.auth-foot { margin-top: 20px; text-align: center; font-size: 12.5px; color: var(--text-soft); }
.auth-badge {
  display: flex; gap: 10px; align-items: flex-start; background: var(--gold-100); border: 1px solid var(--gold-400);
  border-radius: 10px; padding: 12px 14px; font-size: 12.5px; color: #6b5518; margin-top: 22px;
}
.auth-badge svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; color: var(--gold-600); }
.form-error { background: #fdecea; border: 1px solid #f3b7ae; color: #9a2f24; font-size: 13px; padding: 10px 12px; border-radius: 8px; margin-bottom: 16px; display:none; }
.form-error.show { display: block; }

/* ---------- Timeline toolbar ---------- */
.timeline-toolbar {
  display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 34px;
}
.tb-field { display: flex; flex-direction: column; gap: 6px; min-width: 150px; }
.tb-field label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.tb-field select, .tb-field input {
  padding: 10px 12px; border-radius: 7px; border: 1.5px solid var(--border); background: var(--surface-2);
  color: var(--text); font-size: 14px;
}
.tb-actions { display: flex; gap: 10px; margin-left: auto; align-self: center; flex-wrap: wrap; }
.tb-count { font-size: 13px; color: var(--text-muted); align-self: center; margin-right: auto; }
.btn-sm { padding: 10px 18px; font-size: 13.5px; }

/* ---------- Timeline list ---------- */
.timeline { position: relative; margin-top: 10px; }
.timeline::before {
  content: ""; position: absolute; left: 27px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(var(--gold-500), var(--border));
}
.year-divider { display: flex; align-items: center; gap: 14px; margin: 34px 0 18px; }
.year-divider:first-child { margin-top: 0; }
.year-divider .yr {
  font-family: var(--serif); font-weight: 700; font-size: 26px; color: var(--accent-strong);
  background: var(--bg); padding-right: 10px; position: relative; z-index: 2; margin-left: -4px;
}
.year-divider .ln { flex: 1; height: 1px; background: var(--border); }

.tl-item { position: relative; padding-left: 64px; margin-bottom: 22px; }
.tl-dot {
  position: absolute; left: 18px; top: 6px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--gold-500); z-index: 2;
  box-shadow: 0 0 0 4px var(--bg);
}
.tl-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: grid; grid-template-columns: 220px 1fr;
  transition: box-shadow .2s ease, transform .2s ease;
}
.tl-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.tl-media {
  background: linear-gradient(135deg, var(--green-800), var(--green-900));
  display: flex; align-items: center; justify-content: center; padding: 20px; min-height: 140px;
}
.tl-media img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.tl-media svg { width: 46px; height: 46px; color: var(--gold-400); }
.tl-body { padding: 20px 24px; }
.tl-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.tl-date {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--green-900); background: var(--gold-100); border: 1px solid var(--gold-400);
  padding: 4px 10px; border-radius: 999px;
}
:root[data-theme="dark"] .tl-date { color: var(--gold-400); background: rgba(200,169,81,.12); }
.tl-cat { font-size: 11.5px; color: var(--text-soft); text-transform: uppercase; letter-spacing: .05em; }
.tl-card h3 { font-size: 18px; margin-bottom: 6px; }
.tl-card p { color: var(--text-muted); font-size: 14.5px; margin: 0; }
@media (max-width: 700px) {
  .tl-card { grid-template-columns: 1fr; }
  .tl-media { min-height: 110px; }
}
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
}
.empty-state svg { width: 48px; height: 48px; color: var(--text-soft); margin: 0 auto 14px; }

/* ---------- Download section ---------- */
.download-card {
  display: flex; align-items: center; gap: 28px; justify-content: space-between; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--green-900), var(--green-800));
  color: #fff; border-radius: 18px; padding: 38px 40px; box-shadow: var(--shadow-lg);
}
.download-card .txt h3 { color: #fff; font-size: 22px; margin-bottom: 8px; }
.download-card .txt p { color: #cfe6da; max-width: 480px; margin: 0; font-size: 14.5px; }
.download-icon-wrap {
  width: 64px; height: 64px; border-radius: 16px; background: rgba(200,169,81,.18);
  border: 1px solid rgba(200,169,81,.4); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.download-icon-wrap svg { width: 32px; height: 32px; color: var(--gold-400); }
.download-options { display: flex; gap: 10px; flex-wrap: wrap; }
.download-summary {
  margin-top: 22px; display: grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); gap: 14px;
}
.ds-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.ds-item .n { font-family: var(--serif); font-size: 24px; color: var(--accent-strong); font-weight: 700; }
.ds-item .l { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }

/* ---------- Carta Organisasi ---------- */
.carta-card {
  background: #ffffff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px;
}
.carta-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 6px; }
.carta-img { display: block; width: 1500px; max-width: none; height: auto; border-radius: 4px; }
.carta-hint { margin-top: 14px; text-align: center; font-size: 13px; color: var(--text-muted); }

/* ---------- Manual page ---------- */
.manual-toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; box-shadow: var(--shadow); margin-bottom: 30px; }
.manual-toc h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 12px; }
.manual-toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 30px; }
.manual-toc li { margin-bottom: 6px; font-size: 14px; }
.manual-toc a { color: var(--green-800); text-decoration: none; font-weight: 600; }
:root[data-theme="dark"] .manual-toc a { color: var(--gold-400); }
.manual-toc a:hover { text-decoration: underline; }
.manual-block { margin-bottom: 44px; }
.manual-block h3 { font-size: 21px; border-bottom: 2px solid var(--gold-400); padding-bottom: 10px; margin-bottom: 16px; }
.manual-block h3 .step-no {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 50%; background: var(--green-900); color: var(--gold-400); font-size: 14px; margin-right: 10px; vertical-align: middle;
}
.manual-block p, .manual-block li { color: var(--text); font-size: 15px; }
.manual-block ul, .manual-block ol { padding-left: 22px; }
.manual-block .tip {
  background: var(--gold-100); border-left: 4px solid var(--gold-500); padding: 12px 16px; border-radius: 6px;
  font-size: 13.5px; color: #6b5518; margin-top: 12px;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--green-950); color: #aac8b8; padding: 40px 0 28px; margin-top: 40px; }
.site-footer .container { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 13px; }
.site-footer strong { color: #e8f4ee; }
.foot-links { display: flex; gap: 18px; }
.foot-links button { background: none; border: none; color: #aac8b8; font-size: 13px; padding: 0; }
.foot-links button:hover { color: #fff; text-decoration: underline; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--green-950); color: #fff; padding: 14px 22px; border-radius: 999px;
  box-shadow: var(--shadow-lg); font-size: 13.5px; display: flex; align-items: center; gap: 10px;
  opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 100; border: 1px solid rgba(200,169,81,.4);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast svg { width: 16px; height: 16px; color: var(--gold-400); }

/* ---------- View transitions ---------- */
.view { animation: fadeUp .35s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
