/* =========================
   DARK MODE
========================= */

.navbar {
  position: sticky;
  top: 0;
  z-index: 999;
}

/* kasih jarak konten dari navbar */
.page,
.page-container {
  padding-top: 40px;
}

body.dark .legal-page {
  color: #d1d5db;
}

body.dark .legal-page h1,
body.dark .legal-page h2 {
  color: #f3f4f6;
}

body.dark .legal-note {
  background: rgba(59, 130, 246, 0.15);
  border-left: 4px solid #3b82f6;
}

.page-container {
  max-width: 820px;
  margin: 80px auto;
  padding: 40px 28px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 35px rgba(0,0,0,0.08);
  line-height: 1.7;
}

.page-container h1 {
  font-size: 32px;
  margin-bottom: 20px;
  color: #0f172a;
}

.page-container h2 {
  font-size: 20px;
  margin-top: 28px;
  margin-bottom: 10px;
  color: #1e3a8a;
}

.page-container p {
  color: #374151;
  margin-bottom: 12px;
}

.page-container ul {
  padding-left: 20px;
  margin-bottom: 15px;
}

.page-container li {
  margin-bottom: 6px;
}

.page-back {
  display: inline-block;
  margin-top: 30px;
  text-decoration: none;
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: white;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  transition: 0.3s;
}

.page-back:hover {
  opacity: 0.85;
}

/* ===== BACKGROUND HALAMAN ===== */
body {
  background: linear-gradient(135deg, #e8e8ea, #fdfdfd);
  margin: 0;
  font-family: "Playfair Display", serif;
}

/* ===== HEADER LEGAL ===== */
.legal-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  background: rgba(9, 37, 104, 0.9);
  backdrop-filter: blur(10px);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  z-index: 100;
}

.nav-brand{
  text-decoration:none;
  color:inherit;
  display:flex;
  align-items:center;
  flex-shrink:0;
}

.nav-brand-glass{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  border-radius:16px;
  background:rgba(255,255,255,0.10);
  border:1px solid rgba(255,255,255,0.18);
  box-shadow:0 12px 30px rgba(0,0,0,0.22);
  backdrop-filter: blur(12px);
  box-sizing:border-box;
}

.nav-brand-icon{
  width:22px;
  height:22px;
  border-radius:8px;
}

.nav-brand-text{
  font-weight:900;
  letter-spacing:0.01em;
  white-space:nowrap;
  background: linear-gradient(90deg,#38bdf8,#a78bfa,#f472b6);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
  -webkit-text-fill-color:transparent;
}

@media (max-width: 768px){
  .legal-header{
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
  }

  .legal-back{
    flex-shrink: 0;
    order: 1;
  }

  .legal-title{
    order: 2;
    margin-left: auto;
  }

  .nav-brand{
    flex-shrink: 0;
    justify-content: flex-end;
  }

  .nav-brand-glass{
    padding: 8px 12px;
  }

  .nav-brand-text{
    font-size: 14px;
  }
}

.legal-back {
  color: #e2e8ef;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.scroll-to-top{
  position: fixed;

  left: 18px;          /* pindah ke kiri */
  bottom: 26px;

  width: 42px;         /* lebih kecil */
  height: 36px;

  border: none;
  border-radius: 10px; /* bukan bulat */

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;

  background: linear-gradient(135deg,#ef4444,#dc2626); /* merah modern */

  color: white;

  box-shadow:
    0 6px 16px rgba(0,0,0,0.25),
    0 3px 8px rgba(239,68,68,0.35);

  opacity: 0;
  visibility: hidden;

  transform: translateY(14px);
  transition: all 0.28s ease;

  z-index: 999;
  pointer-events: none;
}

/* icon */
.scroll-to-top svg{
  width: 16px;
  height: 16px;
}

/* muncul */
.scroll-to-top.show{
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* hover */
.scroll-to-top:hover{
  transform: translateY(-2px);
  box-shadow:
    0 10px 22px rgba(0,0,0,0.3),
    0 6px 14px rgba(239,68,68,0.45);
}

/* klik */
.scroll-to-top:active{
  transform: scale(0.95);
}

.site-footer {
  background: #0b2c5f;
  text-align: center;
  padding: 25px 15px;
  font-size: 15px;
  color: #e7eaed;
  font-family: "Source Serif 4", serif;
}

.footer-links {
  margin-bottom: 10px;
}

.footer-links a {
  color: #cbd5e1;
  margin: 0 10px;
  text-decoration: none;
  font-size: 13px;
}

.footer-links a:hover {
  color: #fff;
}

.footer-copy {
  opacity: 0.8;
}

/* AUTO RTL SAAT GOOGLE SET ARAB */
html[lang="ar"] body {
  direction: rtl;
  text-align: right;
}

html[lang="ar"] .hero,
html[lang="ar"] .navbar,
html[lang="ar"] .quick-menu,
html[lang="ar"] .article-content {
  text-align: right;
}

/* Header legal: back tetap kiri, Islamic Portal kanan (tidak ikut RTL) */
html[lang="ar"] .legal-header {
  direction: ltr;
  text-align: left;
}

html[lang="ar"] .legal-back {
  order: 1;
}

html[lang="ar"] .legal-title {
  order: 2;
  margin-left: auto;
}

/* Rapiin spacing Arabic di nav-brand (jangan dempetan) */
html[lang="ar"] .nav-brand-glass {
  padding: 10px 16px;
  gap: 12px;
  min-width: fit-content;
}

html[lang="ar"] .nav-brand-text {
  padding-inline: 4px;
  letter-spacing: 0.02em;
}