/* Capa final: jurisprudencia usa la misma geometría visual que el comparador normativo. */
:root {
  --juris-ink: #18222b;
  --juris-muted: #66737f;
  --juris-line: #dce2e7;
  --juris-paper: #ffffff;
  --juris-surface: #f4f6f7;
  --juris-nav: #101820;
  --juris-teal: #087f75;
  --juris-teal-soft: #e8f5f3;
  --juris-blue: #315f8d;
  --juris-blue-soft: #edf4fa;
  --juris-amber: #ad6a00;
  --juris-amber-soft: #fff5df;
  --juris-red: #a9342f;
  --juris-red-soft: #fff0ef;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

body { color: var(--juris-ink); background: var(--juris-surface); font-family: Inter, "Segoe UI", Arial, sans-serif; }

.juris-topbar {
  min-height: 156px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "editorial actions";
  align-items: center;
  gap: 16px;
  padding: 16px 22px;
  background: var(--juris-nav);
  border-bottom: 3px solid #d4a72c;
}
.juris-topbar .juris-brand { display: none; }
.juris-topbar .header-button-grid { grid-area: editorial; width: auto; flex: none; margin: 0; }
.juris-topbar .juris-topbar-actions { grid-area: actions; margin: 0; }
.juris-topbar .header-brand-button { height: 121px; }

.juris-shell {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  max-width: none;
  min-height: calc(100vh - 156px);
  margin: 0;
}
.juris-sidebar {
  min-width: 0;
  height: calc(100vh - 156px);
  overflow: hidden;
  padding: 22px 20px 14px;
  border-right: 1px solid var(--juris-line);
  border-bottom: 0;
  background: #fbfcfc;
}
.juris-sidebar h1 { margin: 0; font-family: Georgia, serif; font-size: 26px; font-weight: 600; }
.juris-stats { display: flex; gap: 13px; margin: 15px 0; }
.juris-stats div { padding: 0; border: 0; background: transparent; }
.juris-stats strong { color: var(--juris-ink); font-size: 14px; }
.juris-stats span { color: var(--juris-muted); font-size: 11px; }
.juris-search { max-width: none; margin: 0 0 10px; }
.juris-topic-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  max-height: calc(100vh - 330px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 8px 20px;
}
.juris-topic-group { display: contents; }
.juris-topic-group > h3 { margin: 8px 8px 2px; color: #60737a; font-size: 10px; }
.juris-topic-button {
  width: 100%;
  min-height: 56px;
  padding: 9px 28px 9px 12px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0;
  background: transparent;
}
.juris-topic-button:hover { background: #f0f4f4; border-color: transparent; }
.juris-topic-button.active { background: var(--juris-teal-soft); border-left-color: var(--juris-teal); }

.juris-workspace { min-width: 0; max-width: none; padding: 30px clamp(24px, 4vw, 62px) 70px; background: var(--juris-paper); }
.juris-workspace-header { align-items: flex-start; padding-bottom: 0; border-bottom: 0; }
.juris-workspace-header h2 { margin: 0; max-width: 820px; font-family: Georgia, serif; font-size: clamp(27px, 3vw, 40px); font-weight: 500; line-height: 1.08; }
.juris-context, .juris-cases { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--juris-line); }
.juris-context h3, .juris-cases h3 { font-family: Inter, "Segoe UI", Arial, sans-serif; }
.juris-context-grid { gap: 12px; }
.juris-context-card { border-color: var(--juris-line); background: #fbfcfc; border-radius: 6px; box-shadow: none; }
.juris-context-card:hover { transform: none; box-shadow: none; }
.juris-case-card { border-color: var(--juris-line); border-radius: 6px; box-shadow: 0 4px 16px rgba(20, 30, 38, .06); }
.juris-case-card:hover { transform: none; box-shadow: 0 7px 20px rgba(20, 30, 38, .09); }
.juris-note { border-radius: 6px; }
.juris-cross-actions { justify-content: flex-start; }

@media (min-width: 721px) and (max-width: 1360px) {
  .juris-topbar { min-height: 212px; grid-template-columns: 1fr; grid-template-areas: "editorial" "actions"; }
  .juris-topbar .header-button-grid { width: 100%; grid-template-columns: repeat(3, minmax(0, 290px)); }
  .juris-topbar .juris-topbar-actions { justify-content: flex-end; }
  .juris-shell { min-height: calc(100vh - 212px); }
  .juris-sidebar { height: calc(100vh - 212px); }
}

@media (max-width: 720px) {
  .juris-topbar { position: sticky; top: 0; z-index: 50; min-height: 162px; display: block; padding: 52px 12px 10px; }
  .juris-topbar .header-button-grid { display: flex; width: 100%; overflow-x: auto; gap: 9px; }
  .juris-topbar .juris-topbar-actions { position: absolute; top: 8px; right: 12px; display: flex; gap: 8px; }
  .juris-shell { display: block; min-height: 0; }
  .juris-sidebar { width: 100%; height: auto; max-height: none; overflow: visible; padding: 18px 14px 12px; border-right: 0; border-bottom: 1px solid var(--juris-line); }
  .juris-topic-list { display: flex; max-height: none; overflow-x: auto; overflow-y: hidden; gap: 8px; padding: 0 0 10px; }
  .juris-topic-button { flex: 0 0 min(76vw, 260px); min-height: 72px; padding: 10px 32px 10px 12px; border: 1px solid var(--juris-line); border-bottom: 3px solid transparent; border-radius: 6px; background: #fff; }
  .juris-topic-button.active { border-left-color: var(--juris-line); border-bottom-color: var(--juris-teal); }
  .juris-workspace { padding: 22px 14px max(52px, env(safe-area-inset-bottom)); }
}

@media print {
  .juris-topbar, .juris-sidebar, .juris-cross-actions { display: none !important; }
  .juris-shell { display: block; min-height: 0; }
  .juris-workspace { padding: 0; }
}
