/* Tipografi & tema LP Ma'arif NU — light default, dark via class pada <html> */

:root {
  --maarif-font: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --maarif-bg: #f4f6f8;
  --maarif-surface: #ffffff;
  --maarif-text: #1e293b;
  --maarif-text-muted: #64748b;
  --maarif-border: #e2e8f0;
  --maarif-accent: #15803d;
}

html.dark {
  color-scheme: dark;
  --maarif-bg: #0c1017;
  --maarif-surface: #161d28;
  --maarif-text: #e8eef6;
  --maarif-text-muted: #94a3b8;
  --maarif-border: #2a3544;
  --maarif-accent: #4ade80;
}

html {
  font-family: var(--maarif-font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: inherit;
  line-height: inherit;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  letter-spacing: -0.02em;
}

/* ——— Dark: override utilitas Tailwind yang dipakai di seluruh situs ——— */

html.dark body.bg-gray-50,
html.dark body.bg-gray-100 {
  background-color: var(--maarif-bg) !important;
  color: var(--maarif-text) !important;
}

html.dark .bg-white {
  background-color: var(--maarif-surface) !important;
}

html.dark .bg-gray-50 {
  background-color: #121820 !important;
}

html.dark .bg-gray-100 {
  background-color: var(--maarif-bg) !important;
}

html.dark .bg-gray-200 {
  background-color: #1f2937 !important;
}

html.dark .bg-green-50,
html.dark .bg-green-50\/50,
html.dark .bg-green-50\/60 {
  background-color: rgba(22, 101, 52, 0.15) !important;
}

html.dark .bg-amber-50 {
  background-color: rgba(180, 83, 9, 0.15) !important;
}

html.dark .bg-red-50 {
  background-color: rgba(185, 28, 28, 0.12) !important;
}

html.dark .text-gray-900,
html.dark .text-gray-800 {
  color: var(--maarif-text) !important;
}

html.dark .text-gray-700 {
  color: #cbd5e1 !important;
}

html.dark .text-gray-600 {
  color: #94a3b8 !important;
}

html.dark .text-gray-500 {
  color: #7c8a9e !important;
}

html.dark .text-gray-400 {
  color: #64748b !important;
}

html.dark .text-green-800,
html.dark .text-green-900 {
  color: #86efac !important;
}

html.dark .text-green-700 {
  color: #4ade80 !important;
}

html.dark .text-red-600,
html.dark .text-red-700,
html.dark .text-red-800 {
  color: #fca5a5 !important;
}

html.dark .text-amber-600,
html.dark .text-amber-800,
html.dark .text-amber-900 {
  color: #fcd34d !important;
}

html.dark .border-gray-100,
html.dark .border-gray-200,
html.dark .border-gray-300 {
  border-color: var(--maarif-border) !important;
}

html.dark .border-green-100,
html.dark .border-green-200,
html.dark .border-green-300 {
  border-color: rgba(74, 222, 128, 0.25) !important;
}

html.dark .border-amber-200 {
  border-color: rgba(251, 191, 36, 0.35) !important;
}

html.dark .border-red-200 {
  border-color: rgba(248, 113, 113, 0.35) !important;
}

html.dark .divide-gray-100 > :not([hidden]) ~ :not([hidden]) {
  border-color: var(--maarif-border) !important;
}

html.dark .hover\:bg-gray-50:hover {
  background-color: #1a222d !important;
}

html.dark input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html.dark select,
html.dark textarea {
  background-color: #1a222d !important;
  border-color: var(--maarif-border) !important;
  color: var(--maarif-text) !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #64748b !important;
}

html.dark input:read-only,
html.dark .read-only\:bg-gray-100:read-only {
  background-color: #141a24 !important;
  color: #94a3b8 !important;
}

html.dark select:disabled,
html.dark .disabled\:bg-gray-100:disabled {
  background-color: #141a24 !important;
}

html.dark .shadow-lg,
html.dark .shadow-xl {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45) !important;
}

html.dark thead.bg-green-50 {
  background-color: rgba(22, 101, 52, 0.2) !important;
}

html.dark .berita-konten h1,
html.dark .berita-konten h2,
html.dark .berita-konten h3,
html.dark .berita-konten h4 {
  color: #86efac !important;
}

html.dark .berita-konten blockquote {
  color: #94a3b8 !important;
  border-left-color: #4ade80 !important;
}

html.dark .berita-konten a {
  color: #4ade80 !important;
}

html.dark .berita-konten th {
  background: rgba(22, 101, 52, 0.2) !important;
}

html.dark .berita-konten th,
html.dark .berita-konten td {
  border-color: var(--maarif-border) !important;
}

html.dark .berita-konten hr {
  border-top-color: var(--maarif-border) !important;
}

/* Tombol toggle tema */
.maarif-theme-toggle {
  position: fixed;
  z-index: 9999;
  bottom: 1.25rem;
  right: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  font-family: var(--maarif-font);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  color: #14532d;
  background: #ffffff;
  border: 1px solid #bbf7d0;
  border-radius: 9999px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

.maarif-theme-toggle:hover {
  transform: translateY(-1px);
  border-color: #86efac;
}

.maarif-theme-toggle:focus-visible {
  outline: 2px solid #22c55e;
  outline-offset: 2px;
}

html.dark .maarif-theme-toggle {
  color: #ecfdf5;
  background: #1a222d;
  border-color: #334155;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
}

html.dark .maarif-theme-toggle:hover {
  border-color: #4ade80;
}

.maarif-theme-toggle__icon {
  font-size: 1.1rem;
  line-height: 1;
}

@media (max-width: 480px) {
  .maarif-theme-toggle__label {
    display: none;
  }
  .maarif-theme-toggle {
    padding: 0.65rem;
    border-radius: 50%;
  }
}
