body {
  font-family: Arial, sans-serif;
  line-height: 1.7;
  margin: 2rem;
  background: #f9f9f9;
  color: #333;
  max-width: 900px;
}

h1,
h2,
h3 {
  color: #005b96;
}

img {
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
  border: 1px solid #ccc;
}

blockquote {
  background: #eee;
  padding: 1rem;
  border-left: 4px solid #005b96;
  font-style: italic;
}

ul,
ol {
  margin-bottom: 1rem;
}

a {
  color: #005b96;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.small {
  font-size: 0.9em;
  color: #555;
}

dl.glosarium dt {
  font-weight: bold;
}

h2 {
  color: #005b96;
  font-size: 1.6em;
  border-bottom: 2px solid #005b96;
  padding-bottom: 0.2em;
  margin-top: 2em;
}

h3 {
  color: #333;
  font-size: 1.3em;
  margin-top: 1.5em;
  border-left: 4px solid #005b96;
  padding-left: 0.5em;
}

.code-container {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  font-size: 12px;
  background: #0056b3;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.copy-btn:hover {
  background: #003f7f;
}

pre code {
  display: block;
  max-height: 400px;
  overflow-y: auto;
  overflow-x: auto;
  padding: 12px;
  background: #f7f7f7;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

@media print {

  /* Hilangkan navigasi */
  nav,
  .print-hide,
  .no-print,
  div[style*="grid-template-columns"],
  div[style*="justify-content: space-between"] {
    display: none !important;
  }

  /* Set background putih polos */
  body {
    background: white !important;
    color: #000 !important;
  }

  /* Margin halaman cetak */
  @page {
    margin: 1.5cm;
  }

  /* Perbesar judul */
  h1 {
    font-size: 24pt;
    color: #000;
    margin-top: 0;
  }

  h2 {
    font-size: 18pt;
    color: #000;
  }

  h3 {
    font-size: 14pt;
    color: #000;
  }

  h4 {
    font-size: 12pt;
    color: #000;
  }

  /* Perbaiki font body */
  body,
  p,
  li,
  td,
  th {
    font-size: 11pt;
    line-height: 1.5;
  }

  /* Pastikan gambar tidak keluar margin */
  img {
    max-width: 100% !important;
    height: auto !important;
    page-break-inside: avoid;
  }

  /* Hindari page break di tengah heading */
  h2,
  h3,
  h4 {
    page-break-after: avoid;
    page-break-inside: avoid;
  }

  /* Tabel tetap proporsional */
  table {
    width: 100% !important;
    border-collapse: collapse;
  }

  /* Glosarium dan daftar pustaka rapi */
  dl.glosarium {
    font-size: 10pt;
  }

  pre, pre code {
    max-height: none !important;
    height: 100% !important;
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #000 !important;
    white-space: pre-wrap;   /* supaya panjang baris bisa turun ke bawah */
    word-wrap: break-word;   /* pecah kata panjang */
    overflow: visible !important;
  }
}

.metadata-container {
  display: flex;
  align-items: center;
  background: #e0ecf5;
  padding: 1rem;
  border: 1px solid #b3cde0;
  border-radius: 8px;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.metadata-container img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  object-position: left top;
  border-radius: 4px;
  margin-right: 1rem;
}

.metadata-container .metadata-text {
  flex: 1;
}

.metadata-container .metadata-text h2 {
  margin: 0;
  color: #005b96;
}

/* Navigasi default (horizontal) */
.navigation-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #ccc;
  gap: 0.5rem;
}

.navigation-container a {
  display: inline-block;
  text-align: center;
  background-color: #005b96;
  color: #fff;
  padding: 0.5rem 1rem;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
}

.navigation-container a:nth-child(2) {
  background-color: #ddd;
  color: #333;
}

/* Responsive: Mobile <= 600px */
@media (max-width: 600px) {
  .metadata-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .metadata-container img {
    margin-right: 0;
    margin-bottom: 1rem;
  }

  .navigation-container {
    flex-direction: column;
    align-items: stretch;
  }

  .navigation-container a {
    width: 100%;
  }
}