/* LAW_READING_UX_2026: reading aids for /law notes pages */
:root {
  --lr-blue: #1d4ed8; --lr-green: #15803d; --lr-amber: #b45309; --lr-red: #b91c1c;
  --lr-violet: #6d28d9; --lr-teal: #0f766e; --lr-ink: #1f2937; --lr-line: #e5e7eb;
}

/* Hindi typography */
.blk-hi, .notes-section-body [lang="hi"], .lr-hi-missing, .lr-guide-hi {
  font-family: "Noto Sans Devanagari", "Nirmala UI", "Mangal", "Kohinoor Devanagari", system-ui, sans-serif;
  line-height: 1.8;
}
.lr-hide { display: none !important; }
.lr-hindi-only .lr-en-only { display: none !important; }
.lr-hi-missing {
  margin: 0 0 1rem; padding: .6rem .85rem; border-radius: 8px;
  background: #fff7ed; border: 1px dashed #f59e0b; color: #7c2d12; font-size: .92rem;
}
.lr-toc-badge {
  display: inline-block; margin-left: .35rem; padding: 0 .35rem; border-radius: 4px;
  font-size: .62rem; font-weight: 700; letter-spacing: .05em; vertical-align: middle;
  background: #e5e7eb; color: #4b5563;
}
.notes-controls .lr-ctl-link { margin-left: auto; font-size: .88rem; font-weight: 600; }

/* Cross-links */
a.lr-xref {
  color: inherit; font-weight: 600; text-decoration: underline dotted;
  text-decoration-color: var(--lr-blue); text-underline-offset: 3px;
}
a.lr-xref:hover, a.lr-xref:focus { color: var(--lr-blue); text-decoration-style: solid; }
a.lr-xref--ext::after { content: "\2197"; font-size: .75em; margin-left: .1em; }
.lr-flash { animation: lr-flash 1.8s ease-out; border-radius: 6px; }
@keyframes lr-flash { 0% { background: rgba(250, 204, 21, .55); } 100% { background: transparent; } }

/* Floating dock: Back / Contents / Top */
.lr-dock {
  position: fixed; z-index: 900; pointer-events: none;
  right: max(14px, env(safe-area-inset-right));
  bottom: calc(86px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
}
.lr-dock button {
  pointer-events: auto; display: inline-flex; align-items: center; gap: .4rem;
  min-height: 44px; min-width: 44px; padding: 0 1rem; border: 0; border-radius: 999px;
  background: #111827; color: #fff; font: 600 .9rem/1 system-ui, sans-serif;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22); cursor: pointer; opacity: .95;
}
.lr-dock button:hover, .lr-dock button:focus-visible { opacity: 1; outline: 2px solid #93c5fd; outline-offset: 2px; }
.lr-dock button[hidden] { display: none; }
.lr-dock .lr-back {
  background: var(--lr-blue); max-width: min(80vw, 360px);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; line-height: 44px;
}
@media (max-width: 640px) {
  .lr-dock { bottom: calc(78px + env(safe-area-inset-bottom)); }
  .lr-dock button { font-size: .85rem; padding: 0 .85rem; }
}
@media print { .lr-dock, .lr-hi-missing { display: none !important; } }

/* Section headings and blocks */
details.notes-section > summary { font-weight: 700; }
details.notes-section[open] > summary { color: var(--lr-blue); }
.notes-section-body h3 {
  color: var(--lr-ink); border-bottom: 2px solid var(--lr-line);
  padding-bottom: .25rem; margin-top: 1.7rem;
}
.notes-section-body h3.lr-h-exc { color: var(--lr-amber); border-bottom-color: #fdba74; }
.notes-section-body h3.lr-h-case { color: var(--lr-green); border-bottom-color: #86efac; }
.notes-section-body .notes-core { border-left: 4px solid var(--lr-blue); }
.notes-section-body .notes-trap { border-left: 4px solid var(--lr-red); }
.notes-section-body .notes-example { border-left: 4px solid var(--lr-amber); }
.notes-section-body .notes-memory { border-left: 4px solid var(--lr-violet); }
.notes-section-body .notes-practice { border-left: 4px solid var(--lr-teal); }
.notes-section-body .notes-table thead th { background: #f1f5f9; color: #0f172a; }
.notes-section-body .notes-table td:first-child { font-weight: 600; }

/* Case law */
.notes-section-body .callout.lr-case {
  border-left: 4px solid var(--lr-green); background: rgba(21, 128, 61, .06); border-radius: 8px;
}
.callout.lr-case > strong:first-child {
  display: inline; color: var(--lr-green); font-size: 1.06rem; letter-spacing: .01em;
}
.lr-cite {
  display: inline-block; font-style: normal; font-size: .78rem; padding: .05rem .5rem;
  border-radius: 999px; background: rgba(21, 128, 61, .12); color: #14532d; margin: .1rem 0 .35rem;
}
em.lr-caseref { color: var(--lr-green); font-weight: 600; }
.lr-lbl {
  display: inline-block; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase;
  padding: .06rem .42rem; border-radius: 4px; margin-right: .3rem; vertical-align: 1px;
}
.lr-lbl--facts { background: #e0e7ff; color: #3730a3; }
.lr-lbl--issue { background: #f3e8ff; color: #6b21a8; }
.lr-lbl--held, .lr-lbl--ratio, .lr-lbl--rule, .lr-lbl--principle { background: #dcfce7; color: #166534; }
.lr-lbl--why { background: #fef3c7; color: #92400e; }
.lr-lbl--exception { background: #ffedd5; color: #9a3412; }
.lr-lbl--correction, .lr-lbl--note { background: #fee2e2; color: #991b1b; }

/* "How to study law" guide on /law */
.lr-guide {
  margin: 0 0 2.25rem; border: 1px solid #dbeafe; border-radius: 14px;
  background: linear-gradient(180deg, #eff6ff, #ffffff);
}
.lr-guide > summary {
  cursor: pointer; list-style: none; padding: 1rem 1.2rem;
  font-weight: 700; font-size: 1.12rem; color: #1e3a8a;
}
.lr-guide > summary::-webkit-details-marker { display: none; }
.lr-guide > summary::after { content: "+"; float: right; font-weight: 700; }
.lr-guide[open] > summary::after { content: "\2212"; }
.lr-guide-sub { display: block; font-weight: 400; font-size: .9rem; color: #475569; margin-top: .2rem; }
.lr-guide-body { padding: 0 1.2rem 1.3rem; }
.lr-guide-steps {
  counter-reset: lrs; list-style: none; padding: 0; margin: .5rem 0 1rem;
  display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
}
.lr-guide-steps li {
  counter-increment: lrs; position: relative; background: #fff; border: 1px solid var(--lr-line);
  border-radius: 10px; padding: .8rem .9rem .8rem 2.7rem; font-size: .94rem;
}
.lr-guide-steps li::before {
  content: counter(lrs); position: absolute; left: .8rem; top: .8rem; width: 1.45rem; height: 1.45rem;
  border-radius: 50%; background: var(--lr-blue); color: #fff; font-size: .78rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.lr-guide-steps strong { display: block; color: #1e3a8a; margin-bottom: .2rem; }
.lr-guide h3 { font-size: 1rem; color: #1e3a8a; margin: 1.1rem 0 .4rem; }
.lr-guide table { width: 100%; border-collapse: collapse; font-size: .92rem; background: #fff; }
.lr-guide th, .lr-guide td { border: 1px solid var(--lr-line); padding: .45rem .6rem; text-align: left; vertical-align: top; }
.lr-guide th { background: #f1f5f9; }
.lr-guide-flow {
  background: #fff; border: 1px solid var(--lr-line); border-radius: 10px; padding: .75rem .9rem;
  font-size: .92rem; line-height: 1.7;
}
.lr-guide-flow b { color: var(--lr-blue); }
@media (max-width: 640px) { .lr-guide-steps { grid-template-columns: 1fr; } }
