/* ============================================================
   1. DESIGN TOKENS (CSS Variables)
   ============================================================ */
:root {
  /* Warna Utama */
  --ink: #10333C;
  --ink-soft: #3E5D64;
  --sea: #157A87;
  --sea-dark: #0E5B65;
  --sea-tint: #E4F0F1;
  --brick: #A8402F;
  --brick-dark: #833022;
  --gold: #C08A2E;
  --gold-tint: #F6ECD9;
  --indigo: #4A5C8C;
  --green: #4C7A52;
  --paper: #F6F5F1;
  --paper-card: #FFFFFF;
  --line: #E1DFD7;

  /* Font */
  --font-display: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-label: 'Space Grotesk', 'Inter', sans-serif;

  /* Lainnya */
  --radius: 4px;

  /* Warna Kategori — konsisten di semua halaman */
  --cat-pemerintahan: var(--ink);
  --cat-ekonomi: var(--gold);
  --cat-pendidikan: var(--sea);
  --cat-kesehatan: var(--brick);
  --cat-sosbud: var(--indigo);
  --cat-olahraga: var(--green);
}

/* ============================================================
   2. GLOBAL RESET & BASE
   ============================================================ */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--sea);
  text-decoration: none;
}

a:hover {
  color: var(--sea-dark);
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ============================================================
   3. COMPONENTS
   ============================================================ */

/* ---------- Font Helpers ---------- */
.font-display {
  font-family: var(--font-display);
}

.font-label {
  font-family: var(--font-label);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Line Clamp ---------- */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Pulse Motif ---------- */
.pulse-rule {
  width: 100%;
  height: 14px;
  overflow: hidden;
  opacity: 0.55;
}

.pulse-rule svg {
  width: 100%;
  height: 100%;
  display: block;
}

.pulse-rule path {
  fill: none;
  stroke: var(--sea);
  stroke-width: 1.5;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  display: inline-block;
  flex: none;
  animation: pulse-beat 1.6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .pulse-dot {
    animation: none;
  }
}

@keyframes pulse-beat {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.5);
    opacity: 0.6;
  }
}

/* ---------- Brand Mark ---------- */
.brand-mark {
  width: 38px;
  height: 38px;
  flex: none;
  object-fit: contain;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.28rem;
  color: var(--ink);
  line-height: 1;
}

.brand-name span {
  color: var(--brick);
}

/* ---------- Skip Link ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--gold);
  color: var(--ink);
  padding: 0.5rem 1rem;
  z-index: 2000;
  font-weight: 600;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* ============================================================
   4. HEADER & NAVIGASI
   ============================================================ */
.site-header {
  background: var(--paper-card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--ink);
  background: transparent;
  border: none;
  font-size: 1.15rem;
}

.icon-btn:hover {
  background: var(--sea-tint);
  color: var(--sea-dark);
}

/* ---------- Main Navigation ---------- */
.main-nav-wrap {
  position: relative;
  border-top: 1px solid var(--line);
}

.main-nav {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-right: 1.25rem;
}

.main-nav::-webkit-scrollbar {
  display: none;
}

.main-nav .nav-link {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--ink-soft);
  padding: 0.65rem 0.85rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  flex: none;
}

.main-nav .nav-link.active,
.main-nav .nav-link:hover {
  color: var(--ink);
  border-bottom-color: var(--gold);
}

.main-nav .nav-link.home-link {
  color: var(--brick);
}

.main-nav .nav-link.home-link.active,
.main-nav .nav-link.home-link:hover {
  border-bottom-color: var(--brick);
}

/* isyarat visual scroll di mobile */
.main-nav-wrap::after {
  content: "";
  position: absolute;
  top: 1px;
  right: 0;
  bottom: 0;
  width: 28px;
  background: linear-gradient(90deg, rgba(246, 245, 241, 0), var(--paper-card));
  pointer-events: none;
}

@media (min-width: 992px) {
  .main-nav {
    overflow-x: visible;
    padding-right: 0;
  }
  .main-nav .nav-link-end {
    margin-left: auto;
  }
  .main-nav-wrap::after {
    display: none;
  }
  .header-top {
    padding: 0.9rem 0;
  }
}

/* ============================================================
   5. FOOTER
   ============================================================ */
.site-footer {
  background: var(--ink);
  color: #D9E3E1;
}

.site-footer a {
  color: #D9E3E1;
}

.site-footer a:hover {
  color: #fff;
}

.footer-top {
  padding: 2rem 0 1.25rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff;
}

.footer-tagline {
  font-size: 0.85rem;
  color: #9FB3B0;
  max-width: 32ch;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  font-size: 0.88rem;
}

.footer-heading {
  font-family: var(--font-label);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #7FA6A2;
  margin-bottom: 0.85rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1rem 0;
  font-size: 0.78rem;
  color: #8FA5A2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.footer-bottom .pulse-dot {
  background: var(--gold);
}