/* Perpustakaan Daerah Nusantara — style.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #4a148c;
  --primary-dark: #38006b;
  --primary-light: #7b1fa2;
  --accent: #f3e5f5;
  --bg: #fdf5ff;
  --white: #ffffff;
  --text: #1a1a2e;
  --text-muted: #5c5c7a;
  --border: #e1bee7;
  --card-bg: #ffffff;
  --shadow: 0 2px 12px rgba(74,20,140,0.10);
  --shadow-hover: 0 6px 24px rgba(74,20,140,0.18);
  --radius: 12px;
  --radius-sm: 6px;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
}

/* ===== DEMO BAR ===== */
.demo-bar {
  background: #1a1a2e;
  color: #e0e0e0;
  text-align: center;
  padding: 8px 16px;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
}
.demo-bar a {
  color: #ce93d8;
  text-decoration: none;
  font-weight: 600;
  margin: 0 4px;
}
.demo-bar a:hover { text-decoration: underline; }

/* ===== HEADER & NAV ===== */
header {
  background: var(--primary);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--white);
}
.logo-icon {
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-text { font-size: 0.95rem; font-weight: 700; line-height: 1.2; }
.logo-sub { font-size: 0.72rem; opacity: 0.8; font-weight: 400; }

/* Mobile nav checkbox hack */
#nav-toggle { display: none; }
.nav-toggle-label {
  display: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle-label span {
  display: block; width: 24px; height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all 0.3s;
}
nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
}
nav ul li a {
  display: block;
  padding: 8px 12px;
  color: rgba(255,255,255,0.88);
  text-decoration: none;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
}
nav ul li a:hover,
nav ul li a.active {
  background: rgba(255,255,255,0.18);
  color: var(--white);
}

@media (max-width: 768px) {
  .nav-toggle-label { display: flex; }
  nav {
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--primary-dark);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }
  #nav-toggle:checked ~ nav { max-height: 360px; }
  nav ul { flex-direction: column; padding: 12px 20px 16px; gap: 2px; }
  nav ul li a { padding: 10px 14px; font-size: 0.95rem; }
}

/* ===== PAGE HEADER ===== */
.page-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  padding: 56px 20px 48px;
  text-align: center;
}
.page-header h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; margin-bottom: 10px; }
.page-header p { font-size: 1.05rem; opacity: 0.88; max-width: 560px; margin: 0 auto; }

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #7b1fa2 50%, #9c27b0 100%);
  color: var(--white);
  padding: 72px 20px 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -40px; left: -40px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}
.hero-inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  padding: 4px 16px;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 16px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.hero p {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  opacity: 0.9;
  margin-bottom: 32px;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.2s;
  border: 2px solid transparent;
}
.btn-white {
  background: var(--white);
  color: var(--primary);
  border-color: var(--white);
}
.btn-white:hover { background: var(--accent); }
.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.7);
}
.btn-outline:hover { background: rgba(255,255,255,0.15); }
.btn-primary {
  background: var(--primary);
  color: var(--white);
}
.btn-primary:hover { background: var(--primary-dark); }

/* ===== SECTIONS ===== */
.section { padding: 64px 20px; }
.section-alt { background: var(--accent); }
.container { max-width: 1100px; margin: 0 auto; }
.section-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}
.section-sub {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 40px;
}
.divider {
  width: 48px; height: 4px;
  background: linear-gradient(90deg, var(--primary), #ce93d8);
  border-radius: 2px;
  margin: 12px 0 36px;
}

/* ===== STATS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  margin-top: 40px;
}
.stat-card {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  color: var(--white);
}
.stat-number {
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label { font-size: 0.85rem; opacity: 0.85; }

/* ===== CARDS ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card-icon {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  padding: 28px 24px 20px;
  display: flex; align-items: center; gap: 14px;
  color: var(--white);
}
.card-icon svg { flex-shrink: 0; }
.card-icon-title { font-size: 1.05rem; font-weight: 700; }
.card-body { padding: 20px 24px; }
.card-body p { font-size: 0.9rem; color: var(--text-muted); }
.card-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--primary); font-weight: 600; font-size: 0.88rem;
  text-decoration: none; margin-top: 14px;
}
.card-link:hover { text-decoration: underline; }

/* ===== NEWS CARDS ===== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.news-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.news-thumb {
  height: 150px;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
}
.news-thumb-1 { background: linear-gradient(135deg, #e1bee7, #ce93d8); }
.news-thumb-2 { background: linear-gradient(135deg, #b39ddb, #9575cd); }
.news-thumb-3 { background: linear-gradient(135deg, #c5cae9, #7986cb); }
.news-thumb-4 { background: linear-gradient(135deg, #d1c4e9, #ab47bc); }
.news-thumb-5 { background: linear-gradient(135deg, #f8bbd0, #e91e63); }
.news-thumb-6 { background: linear-gradient(135deg, #b2dfdb, #26a69a); }
.news-thumb-7 { background: linear-gradient(135deg, #ffe082, #ffa000); }
.news-thumb-8 { background: linear-gradient(135deg, #c8e6c9, #388e3c); }
.news-body { padding: 18px 20px; }
.news-cat {
  display: inline-block;
  background: var(--accent);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}
.news-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; line-height: 1.35; }
.news-date { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 8px; }
.news-excerpt { font-size: 0.85rem; color: var(--text-muted); }

/* ===== ANNOUNCEMENT LIST ===== */
.announcement-list { display: flex; flex-direction: column; gap: 14px; }
.announcement-item {
  background: var(--card-bg);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
}
.announcement-item:hover { transform: translateX(4px); }
.ann-date-box {
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  text-align: center;
  flex-shrink: 0;
  min-width: 52px;
}
.ann-day { font-size: 1.3rem; font-weight: 900; line-height: 1; }
.ann-month { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em; }
.ann-content { flex: 1; }
.ann-num { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; font-family: monospace; }
.ann-title { font-size: 0.92rem; font-weight: 700; margin-bottom: 4px; }
.ann-desc { font-size: 0.83rem; color: var(--text-muted); }
.ann-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-new { background: #e8f5e9; color: #388e3c; }
.badge-info { background: var(--accent); color: var(--primary); }
.badge-urgent { background: #ffebee; color: #c62828; }

/* ===== SERVICE GRID ===== */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
}
.service-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  border-top: 4px solid var(--primary);
  transition: transform 0.2s, box-shadow 0.2s;
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.service-icon {
  width: 52px; height: 52px;
  background: var(--accent);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.service-title { font-size: 1.05rem; font-weight: 800; color: var(--primary); margin-bottom: 8px; }
.service-desc { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 14px; }
.service-detail { font-size: 0.83rem; }
.service-detail dt { font-weight: 700; color: var(--text); margin-top: 8px; }
.service-detail dd { color: var(--text-muted); margin-left: 12px; }
.tag {
  display: inline-block;
  background: #e8f5e9;
  color: #388e3c;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
  margin-top: 10px;
}
.tag-free { background: #e8f5e9; color: #2e7d32; }
.tag-paid { background: #fff3e0; color: #e65100; }

/* ===== PROFILE ===== */
.visi-misi {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 32px;
}
@media (max-width: 640px) { .visi-misi { grid-template-columns: 1fr; } }
.vm-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.vm-card h3 {
  color: var(--primary);
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 10px;
}
.vm-card p { color: var(--text-muted); font-size: 0.92rem; }
.vm-card ul { list-style: none; padding: 0; }
.vm-card ul li {
  padding: 6px 0 6px 22px;
  position: relative;
  font-size: 0.88rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.vm-card ul li:last-child { border-bottom: none; }
.vm-card ul li::before {
  content: '';
  position: absolute;
  left: 0; top: 13px;
  width: 10px; height: 10px;
  background: var(--primary);
  border-radius: 50%;
}

.org-chart {
  margin-top: 40px;
  text-align: center;
}
.org-box {
  display: inline-block;
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-sm);
  padding: 14px 28px;
  font-weight: 700;
  font-size: 0.92rem;
  min-width: 200px;
  margin-bottom: 0;
}
.org-line {
  width: 2px;
  height: 28px;
  background: var(--border);
  margin: 0 auto;
}
.org-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.org-sub {
  background: var(--accent);
  border: 2px solid var(--primary);
  color: var(--primary);
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 0.82rem;
  font-weight: 700;
  min-width: 150px;
  text-align: center;
}
.org-h-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 0;
}

.pejabat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 32px;
}
.pejabat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px;
  text-align: center;
}
.avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  font-size: 1.6rem;
  color: var(--white);
  font-weight: 900;
}
.pejabat-name { font-weight: 800; font-size: 0.92rem; margin-bottom: 4px; }
.pejabat-nip { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 4px; }
.pejabat-jabatan { font-size: 0.8rem; color: var(--primary); font-weight: 600; }

/* ===== HISTORY ===== */
.timeline { position: relative; padding-left: 32px; margin-top: 24px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 8px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  margin-bottom: 28px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -28px; top: 4px;
  width: 14px; height: 14px;
  background: var(--primary);
  border-radius: 50%;
  border: 3px solid var(--bg);
}
.timeline-year {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 4px;
}
.timeline-text { font-size: 0.88rem; color: var(--text-muted); }

/* ===== CONTACT ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
@media (max-width: 700px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info { display: flex; flex-direction: column; gap: 20px; }
.contact-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.contact-icon {
  width: 44px; height: 44px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.contact-label { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.contact-value { font-size: 0.92rem; font-weight: 600; }
.jam-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 0.85rem; }
.jam-table td { padding: 6px 0; border-bottom: 1px solid var(--border); }
.jam-table td:last-child { text-align: right; font-weight: 600; color: var(--primary); }

/* ===== FORM ===== */
.form-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}
.form-title { font-size: 1.2rem; font-weight: 800; color: var(--primary); margin-bottom: 20px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--white);
  color: var(--text);
  transition: border-color 0.2s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { min-height: 110px; resize: vertical; }
.form-submit {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 12px 32px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
}
.form-submit:hover { background: var(--primary-dark); }

/* ===== MAP PLACEHOLDER ===== */
.map-placeholder {
  background: linear-gradient(135deg, #e8eaf6, #d1c4e9);
  border-radius: var(--radius);
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 20px;
  border: 2px dashed var(--border);
}

/* ===== FOOTER ===== */
footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.82);
  padding: 48px 20px 28px;
  margin-top: 0;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}
@media (max-width: 700px) { .footer-inner { grid-template-columns: 1fr; gap: 28px; } }
.footer-brand { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.footer-brand-icon {
  width: 40px; height: 40px; background: rgba(255,255,255,0.12);
  border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.footer-brand-name { font-size: 0.95rem; font-weight: 700; color: var(--white); }
.footer-brand-sub { font-size: 0.73rem; opacity: 0.7; }
.footer-desc { font-size: 0.82rem; line-height: 1.6; margin-top: 4px; }
.footer-col h4 { color: var(--white); font-size: 0.88rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { color: rgba(255,255,255,0.72); text-decoration: none; font-size: 0.82rem; }
.footer-col ul li a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 20px;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.78rem;
  opacity: 0.65;
}

/* ===== UTILITY ===== */
.text-center { text-align: center; }
.mt-40 { margin-top: 40px; }
.mb-0 { margin-bottom: 0; }
.inline-icon { vertical-align: middle; display: inline-block; margin-right: 6px; }

/* ===== INFO BOX ===== */
.info-box {
  background: var(--accent);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  margin-bottom: 28px;
  font-size: 0.88rem;
  color: var(--primary-dark);
}
.info-box strong { display: block; margin-bottom: 4px; font-size: 0.92rem; }

/* ===== HERO STATS STRIPE ===== */
.stats-stripe {
  background: var(--primary-dark);
  color: var(--white);
  padding: 32px 20px;
}
.stats-stripe .stats-grid { margin-top: 0; }

/* ===== BACK LINK ===== */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--primary); text-decoration: none; font-size: 0.85rem; font-weight: 600;
  margin-bottom: 24px;
}
.back-link:hover { text-decoration: underline; }
