/* IIPL Global Styles */
body {
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: 'Inter', sans-serif;
  opacity: 0;
  animation: global-fade-in 0.4s ease-out forwards;
}

.page-transition {
  animation: page-fade-in 0.3s ease-out;
}

@media print {
  .no-print { display: none !important; }
  .print-only { display: block !important; }
}

.doc-canvas-container {
  position: relative;
  overflow: hidden;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #cbd5e1;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.no-scrollbar {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

/* IIPL Scholarly & Diplomatic Article Typography */
.article-body-content {
  color: #334155;
  line-height: 1.85;
}

.article-body-content h1 {
  font-size: 1.875rem;
  font-weight: 900;
  color: #0f172a;
  margin-top: 2.25rem;
  margin-bottom: 1rem;
  letter-spacing: -0.025em;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.5rem;
}

.article-body-content h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  margin-top: 2rem;
  margin-bottom: 0.875rem;
  letter-spacing: -0.02em;
}

.article-body-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

.article-body-content h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #334155;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.article-body-content p {
  margin-bottom: 1.25rem;
}

.article-body-content strong,
.article-body-content b {
  font-weight: 700;
  color: #0f172a;
}

.article-body-content em,
.article-body-content i {
  font-style: italic;
  color: #1e293b;
}

.article-body-content u {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: #6366f1;
}

.article-body-content s,
.article-body-content del {
  text-decoration: line-through;
  color: #94a3b8;
}

.article-body-content blockquote,
.article-body-content .treaty-clause,
.article-body-content .treaty-quote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-left: 4px solid #4f46e5;
  background: #f8fafc;
  border-radius: 0 1rem 1rem 0;
  font-style: italic;
  color: #1e293b;
}

.article-body-content blockquote p {
  margin-bottom: 0;
}

.article-body-content ul {
  list-style-type: disc;
  padding-left: 1.75rem;
  margin: 1.25rem 0;
}

.article-body-content ol {
  list-style-type: decimal;
  padding-left: 1.75rem;
  margin: 1.25rem 0;
}

.article-body-content li {
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

.article-body-content hr {
  margin: 2.5rem 0;
  border: 0;
  border-top: 1px solid #e2e8f0;
}

.article-body-content table {
  width: 100%;
  margin: 1.75rem 0;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.article-body-content th {
  background-color: #f1f5f9;
  color: #0f172a;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border: 1px solid #cbd5e1;
  text-align: left;
}

.article-body-content td {
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
}

.article-body-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85em;
  background-color: #f1f5f9;
  color: #334155;
  padding: 0.2rem 0.4rem;
  border-radius: 0.375rem;
  border: 1px solid #e2e8f0;
}

.font-academic-serif {
  font-family: 'Merriweather', 'Georgia', 'Cambria', 'Times New Roman', serif;
}

@media print {
  nav,
  .no-print,
  .article-reading-bar,
  header {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .article-body-content {
    font-size: 11pt !important;
    line-height: 1.6 !important;
    color: black !important;
  }
}

/* -------------------------------------------------------------
 * DIPLOMATIC RTL (RIGHT-TO-LEFT) OPTIMIZATION
 * Arabic & Urdu Typography & Automatic Layout Mirroring
 * ------------------------------------------------------------- */
[dir="rtl"] {
  text-align: right;
  direction: rtl;
}

[dir="rtl"] body {
  font-family: 'Noto Sans Arabic', 'Amiri', 'Segoe UI', Tahoma, sans-serif;
}

html[lang="ar"] {
  font-family: 'Amiri', 'Noto Sans Arabic', 'Traditional Arabic', 'Segoe UI', Tahoma, sans-serif;
}

html[lang="ur"] {
  font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Urdu Typesetting', 'Segoe UI', Tahoma, sans-serif;
  line-height: 1.9;
}

[dir="rtl"] .rtl-flip {
  transform: scaleX(-1);
}

[dir="rtl"] .mr-2 {
  margin-right: 0 !important;
  margin-left: 0.5rem !important;
}

[dir="rtl"] .ml-2 {
  margin-left: 0 !important;
  margin-right: 0.5rem !important;
}

[dir="rtl"] .mr-3 {
  margin-right: 0 !important;
  margin-left: 0.75rem !important;
}

[dir="rtl"] .ml-3 {
  margin-left: 0 !important;
  margin-right: 0.75rem !important;
}

[dir="rtl"] .pr-4 {
  padding-right: 0 !important;
  padding-left: 1rem !important;
}

[dir="rtl"] .pl-4 {
  padding-left: 0 !important;
  padding-right: 1rem !important;
}

/* -------------------------------------------------------------
 * AUTOMATED LOW-BANDWIDTH / DATA SAVER MODE
 * Ultra-lightweight rendering for field missions & slow connectivity
 * ------------------------------------------------------------- */
.low-bandwidth-mode {
  --tw-backdrop-blur: none !important;
}

.low-bandwidth-mode * {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

.low-bandwidth-mode .backdrop-blur-md,
.low-bandwidth-mode .backdrop-blur-lg,
.low-bandwidth-mode .backdrop-blur-xl,
.low-bandwidth-mode .backdrop-blur-2xl {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background-color: rgba(255, 255, 255, 0.98) !important;
}

.low-bandwidth-mode .shadow-2xl,
.low-bandwidth-mode .shadow-xl {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}