/* ==========================================================
   Lawtopia — Design tokens
   Palette: orange + white only (neutral ink for text)
   ========================================================== */
:root {
  /* Brand */
  --lt-orange: #E2571A;
  --lt-orange-hot: #FF6B2C;
  --lt-orange-deep: #B8410F;
  --lt-orange-ink: #7A2B08;
  --lt-orange-tint: #FFF6F1;
  --lt-orange-tint-2: #FFEADF;

  /* Neutrals */
  --lt-paper: #FFFFFF;
  --lt-ink: #171310;
  --lt-muted: #6B5A50;
  --lt-faint: #9B8A7F;
  --lt-rule: rgba(23, 19, 16, 0.10);
  --lt-rule-warm: rgba(226, 87, 26, 0.22);

  /* Type */
  --lt-font-display: "Amiri", "Times New Roman", serif;
  --lt-font-body: "IBM Plex Sans Arabic", "Cairo", system-ui, sans-serif;

  /* Elevation */
  --lt-shadow-sm: 0 1px 2px rgba(23, 19, 16, .05);
  --lt-shadow: 0 18px 44px -24px rgba(23, 19, 16, .28);
  --lt-shadow-lg: 0 40px 90px -46px rgba(122, 43, 8, .45);

  /* Rhythm */
  --lt-section: clamp(4rem, 9vw, 7.5rem);
  --lt-radius: 4px;

  /* App-wide aliases (used by shared student pages) */
  --bg: #FFFFFF;
  --text: var(--lt-ink);
  --card: #FFFFFF;
  --border: var(--lt-rule);
  --accent: var(--lt-orange);
  --hdr-bg: rgba(255, 255, 255, 0.86);

  /* Scrollbar */
  --scroll-size: 11px;
  --scroll-size-h: 11px;
  --scroll-track: #FFF1E9;
  --scroll-thumb: #E2571A;
  --scroll-thumb-soft: #FF8A4C;
  --scroll-thumb-hover: #B8410F;
  --scroll-thumb-active: #94330A;
  --scroll-edge: rgba(226, 87, 26, .18);
}

html[data-theme="dark"] {
  --lt-paper: #100D0B;
  --lt-ink: #F6EFEA;
  --lt-muted: #B8A498;
  --lt-faint: #8A7568;
  --lt-orange: #FF7A3C;
  --lt-orange-hot: #FF9057;
  --lt-orange-deep: #FFA06B;
  --lt-orange-ink: #FFC5A3;
  --lt-orange-tint: #1A120D;
  --lt-orange-tint-2: #241710;
  --lt-rule: rgba(246, 239, 234, 0.12);
  --lt-rule-warm: rgba(255, 122, 60, 0.26);
  --lt-shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --lt-shadow: 0 18px 44px -24px rgba(0, 0, 0, .8);
  --lt-shadow-lg: 0 40px 90px -46px rgba(0, 0, 0, .9);

  --bg: #100D0B;
  --text: var(--lt-ink);
  --card: #171210;
  --border: var(--lt-rule);
  --hdr-bg: rgba(16, 13, 11, 0.86);

  --scroll-track: #1C1512;
  --scroll-thumb: #FF7A3C;
  --scroll-thumb-soft: #E2571A;
  --scroll-thumb-hover: #FF9057;
  --scroll-thumb-active: #FF7A3C;
}

/* ---------- Base ---------- */
body.lawtopia-platform {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--lt-font-body);
  background: var(--lt-paper);
  color: var(--lt-ink);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  max-width: 100%;
}
body.lawtopia-platform > .lt-foot {
  margin-top: auto;
}
body.lawtopia-platform *,
body.lawtopia-platform *::before,
body.lawtopia-platform *::after { box-sizing: border-box; }

body.lawtopia-platform img,
body.lawtopia-platform video,
body.lawtopia-platform iframe { max-width: 100%; height: auto; }

body.lt-loading, html.lt-loading body { overflow: hidden !important; }

.lt-shell {
  width: min(1200px, calc(100% - 3rem));
  margin-inline: auto;
}
.lt-shell--narrow { width: min(880px, calc(100% - 3rem)); }

.lt-sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* Selection */
body.lawtopia-platform ::selection {
  background: var(--lt-orange);
  color: #fff;
}

/* Focus */
body.lawtopia-platform a:focus-visible,
body.lawtopia-platform button:focus-visible,
body.lawtopia-platform input:focus-visible,
body.lawtopia-platform select:focus-visible {
  outline: 2px solid var(--lt-orange);
  outline-offset: 3px;
}

/* Legacy grid/glow from old theme only */
body.lawtopia-platform::before,
body.lawtopia-platform::after { display: none !important; content: none !important; }

/* ---------- Scrollbar ---------- */
body.lawtopia-platform,
body.lawtopia-platform * {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}
body.lawtopia-platform::-webkit-scrollbar,
body.lawtopia-platform *::-webkit-scrollbar {
  width: var(--scroll-size);
  height: var(--scroll-size-h);
}
body.lawtopia-platform::-webkit-scrollbar-track,
body.lawtopia-platform *::-webkit-scrollbar-track { background: var(--scroll-track); }
body.lawtopia-platform::-webkit-scrollbar-thumb,
body.lawtopia-platform *::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--scroll-thumb-soft), var(--scroll-thumb));
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
body.lawtopia-platform::-webkit-scrollbar-thumb:hover,
body.lawtopia-platform *::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
