/*
 * Legis Orbis modern article layout.
 * system-ui only, everywhere. Falls back to the theme's own --los-*
 * tokens (Phase 2/7 shell) when present, so the palette stays in one
 * source of truth if that stylesheet loads first; otherwise uses the
 * literal hex values below.
 */
.lo-article-view {
	--lo-navy: var(--los-navy, #0B1B3A);
	--lo-navy-2: var(--los-navy-2, #12264B);
	--lo-navy-3: var(--los-navy-3, #1B3769);
	--lo-gold: var(--los-gold, #D9A94A);
	--lo-gold-soft: var(--los-gold-soft, #F3D68A);
	--lo-gold-ink: var(--los-gold-ink, #8A6318);
	--lo-cream: var(--los-cream, #F7F4EE);
	--lo-cream-2: var(--los-cream-2, #EEE9DF);
	--lo-paper: var(--los-paper, #FFFDF9);
	--lo-ink: var(--los-ink, #101C35);
	--lo-ink-2: var(--los-ink-2, #34445F);
	--lo-muted: var(--los-muted, #66748C);
	--lo-blue: var(--los-blue, #4F8EF7);
	--lo-teal: var(--los-teal, #38D9C0);
	--lo-green: var(--los-green, #2E8B62);
	--lo-line: var(--los-line, #E1DDD4);
	--lo-body-size: 18px;
	font-family: system-ui;
	color: var(--lo-ink);
	background: var(--lo-cream);
}
.lo-article-view * { box-sizing: border-box; font-family: system-ui; }
.lo-article-view a { color: inherit; }
.lo-article-view button { cursor: pointer; font: inherit; }
.lo-article-view :focus-visible { outline: 3px solid var(--lo-gold); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
	.lo-article-view * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* Breadcrumb */
.lo-breadcrumb { max-width: 1180px; margin: 0 auto; padding: 16px 24px 0; font-size: 13px; color: var(--lo-muted); }
.lo-breadcrumb a { text-decoration: none; }
.lo-breadcrumb a:hover, .lo-breadcrumb a:focus-visible { color: var(--lo-gold-ink); }
.lo-breadcrumb span[aria-hidden] { margin: 0 6px; }

/* Hero */
.lo-article-hero { color: #fff; background: linear-gradient(135deg, var(--lo-navy), #142d5a 68%, #1b4265); padding: 28px 24px 34px; }
.lo-article-top { max-width: 1180px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 22px; justify-content: space-between; align-items: flex-start; }
.lo-article-labels { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.lo-article-label { display: inline-flex; align-items: center; padding: 7px 10px; color: var(--lo-gold-soft); background: rgba(217,169,74,.13); border: 1px solid rgba(243,214,138,.26); border-radius: 6px; font-size: 10px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.lo-article-label.lo-label-blue { color: #dbe7ff; background: rgba(79,142,247,.16); border-color: rgba(79,142,247,.3); }
.lo-article-hero h1 { margin: 0 0 10px; font-size: clamp(26px, 4vw, 40px); line-height: 1.14; letter-spacing: -.02em; max-width: 42ch; }
.lo-article-dek { margin: 0 0 16px; max-width: 62ch; color: rgba(255,255,255,.82); font-size: 16px; line-height: 1.6; }
.lo-article-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: rgba(255,255,255,.72); font-size: 13px; }
.lo-article-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lo-small-action { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; color: #fff; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.22); border-radius: 10px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.lo-small-action:hover, .lo-small-action.is-saved { color: var(--lo-gold-soft); border-color: var(--lo-gold); background: rgba(217,169,74,.12); }

/* Layout grid */
.lo-article-shell { padding: 34px 24px 60px; }
.lo-article-grid { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 1fr 300px; gap: 34px; align-items: start; }
@media (max-width: 960px) { .lo-article-grid { grid-template-columns: 1fr; } }

/* Case at a glance */
.lo-glance { margin-bottom: 34px; padding: 23px; background: var(--lo-paper); border: 1px solid var(--lo-line); border-left: 4px solid var(--lo-gold); border-radius: 15px; box-shadow: 0 7px 24px rgba(11,27,58,.04); }
.lo-glance-head { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.lo-glance-head h2 { margin: 0; font-size: 17px; }
.lo-glance-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.lo-copy-citation { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 7px 9px; border: 1px solid var(--lo-line); background: transparent; border-radius: 7px; color: var(--lo-gold-ink); font-size: 11px; font-weight: 850; }
.lo-glance-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px 22px; margin: 0; }
@media (max-width: 560px) { .lo-glance-grid { grid-template-columns: 1fr; } }
.lo-glance-item dt { margin: 0; color: var(--lo-muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.lo-glance-item dd { margin: 4px 0 0; font-size: 14px; line-height: 1.4; }

/* Key holding */
.lo-key-holding { margin-bottom: 30px; padding: 18px 22px; background: #eff8f6; border-left: 4px solid var(--lo-green); border-radius: 0 12px 12px 0; }
.lo-key-holding h2 { margin: 0 0 6px; color: #187461; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.lo-key-holding p { margin: 0; font-size: 17px; font-weight: 650; line-height: 1.5; color: #173e3a; }

/* Article body — justified per spec; headings/lists/tables/blockquotes stay left-aligned */
.lo-article-content { font-size: var(--lo-body-size); }
.lo-article-body { text-align: justify; text-justify: inter-word; hyphens: auto; line-height: 1.75; }
.lo-article-body h2, .lo-article-body h3, .lo-article-body ul, .lo-article-body ol, .lo-article-body table, .lo-article-body blockquote { text-align: left; hyphens: none; }
.lo-article-body h2 { margin: 34px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--lo-line); font-size: 24px; scroll-margin-top: 90px; }
.lo-article-body h3 { margin: 24px 0 8px; font-size: 18px; scroll-margin-top: 90px; }
.lo-article-body p { margin: 0 0 16px; }
.lo-article-body a { color: var(--lo-gold-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.lo-article-body blockquote { margin: 28px 0; padding: 20px 23px; background: var(--lo-paper); border-left: 4px solid var(--lo-gold); border-radius: 0 12px 12px 0; font-style: italic; }
.lo-article-body table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.lo-article-body th, .lo-article-body td { padding: 10px 12px; border-bottom: 1px solid var(--lo-line); text-align: left; vertical-align: top; }
@media (max-width: 640px) { .lo-article-body table { display: block; overflow-x: auto; } }

/* Timeline */
.lo-timeline { display: grid; gap: 0; margin: 20px 0 30px; padding: 5px 0 5px 16px; border-left: 2px solid var(--lo-gold); }
.lo-timeline-item { position: relative; padding: 8px 0 8px 18px; }
.lo-timeline-item::before { content: ""; position: absolute; left: -25px; top: 16px; width: 10px; height: 10px; border: 3px solid var(--lo-gold); border-radius: 50%; background: var(--lo-cream); }
.lo-timeline-date { color: var(--lo-gold-ink); font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 3px; }
.lo-timeline-text { font-size: 15px; line-height: 1.5; text-align: left; }

/* Issues table */
.lo-issue-table th { padding: 11px 13px; color: #fff; background: var(--lo-navy); text-align: left; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.lo-issue-table td { padding: 12px 13px; border-bottom: 1px solid var(--lo-line); }
@media (max-width: 640px) {
	.lo-issue-table, .lo-issue-table thead, .lo-issue-table tbody, .lo-issue-table th, .lo-issue-table td, .lo-issue-table tr { display: block; }
	.lo-issue-table thead { display: none; }
	.lo-issue-table tr { margin-bottom: 14px; padding: 12px; border: 1px solid var(--lo-line); border-radius: 10px; }
}

/* Author card + disclaimer */
.lo-article-end { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--lo-line); }
.lo-author-card { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 20px; }
.lo-avatar img { border-radius: 50%; }
.lo-author-card p { margin: 4px 0 0; color: var(--lo-muted); font-size: 13px; line-height: 1.5; }
.lo-legal-disclaimer { position: relative; overflow: hidden; margin-top: 19px; padding: 22px 24px 21px 76px; color: var(--lo-ink-2); background: linear-gradient(135deg, rgba(217,169,74,.12), rgba(79,142,247,.07)); border: 1px solid rgba(217,169,74,.35); border-radius: 16px; text-align: left; }
.lo-disclaimer-icon { position: absolute; left: 22px; top: 22px; width: 38px; height: 38px; display: grid; place-items: center; color: var(--lo-navy); background: linear-gradient(135deg, var(--lo-gold-soft), var(--lo-gold)); border-radius: 12px; font-weight: 900; font-size: 20px; }
.lo-disclaimer-title { margin: 0 0 10px; color: var(--lo-ink); font-size: 17px; font-weight: 800; text-align: left; text-transform: none; }
.lo-legal-disclaimer p { margin: 0; color: var(--lo-ink-2); font-size: 14px; line-height: 1.72; text-align: left; word-spacing: normal; hyphens: none; }
@media (max-width: 640px) { .lo-legal-disclaimer { padding: 20px 18px 19px 67px; } .lo-disclaimer-icon { left: 17px; top: 20px; } }

/* Related */
.lo-related { margin-top: 34px; }
.lo-related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.lo-related-card { display: block; padding: 16px; border: 1px solid var(--lo-line); border-radius: 12px; background: var(--lo-paper); }
.lo-related-card:hover, .lo-related-card:focus-visible { border-color: var(--lo-gold); }
.lo-related-card span { display: block; margin-bottom: 6px; color: var(--lo-gold-ink); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }

/* Sidebar */
.lo-article-sidebar { position: sticky; top: 90px; display: grid; gap: 14px; align-self: start; }
@media (max-width: 960px) { .lo-article-sidebar { position: static; } }
.lo-sidebar-card { padding: 18px; background: var(--lo-paper); border: 1px solid var(--lo-line); border-radius: 14px; }
.lo-sidebar-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--lo-muted); }
.lo-toc { display: grid; gap: 6px; font-size: 13px; }
.lo-toc a { padding: 6px 8px; border-radius: 8px; text-decoration: none; color: var(--lo-ink-2); }
.lo-toc a.lo-toc-sub { padding-left: 18px; font-size: 12px; }
.lo-toc a:hover, .lo-toc a.active, .lo-toc a:focus-visible { color: var(--lo-gold-ink); background: rgba(217,169,74,.11); font-weight: 750; }
.lo-progress-track { height: 6px; border-radius: 4px; background: var(--lo-cream-2); overflow: hidden; }
.lo-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--lo-gold), var(--lo-gold-soft)); transition: width .15s ease; }
.lo-side-highlight { margin-bottom: 12px; font-size: 13px; line-height: 1.55; color: var(--lo-ink-2); }
.lo-side-highlight b { display: block; margin-bottom: 6px; color: var(--lo-gold-ink); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.lo-pdf-link { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 11px; color: var(--lo-navy); background: var(--lo-gold-soft); border-radius: 9px; font-size: 13px; font-weight: 850; text-decoration: none; }
.lo-sidebar-copy { margin: 0 0 12px; font-size: 13px; color: var(--lo-muted); line-height: 1.5; }
.lo-primary-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; width: 100%; padding: 0 14px; color: var(--lo-navy); background: linear-gradient(135deg, var(--lo-gold-soft), var(--lo-gold)); border: 0; border-radius: 10px; font-weight: 800; font-size: 13px; }
.lo-reading-controls { display: flex; gap: 7px; }
.lo-reading-controls button { min-width: 44px; min-height: 44px; }

/* Citation modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 18px; background: rgba(4,10,24,.72); }
.modal-backdrop[hidden] { display: none; }
.citation-modal { width: min(700px, 100%); max-height: 86vh; overflow: auto; padding: 25px; color: var(--lo-ink); background: var(--lo-paper); border: 1px solid var(--lo-line); border-radius: 20px; box-shadow: 0 30px 90px rgba(0,0,0,.3); }
.modal-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.modal-top h2 { margin: 0 0 4px; font-size: 19px; }
.modal-top p { margin: 0; color: var(--lo-muted); font-size: 13px; }
.modal-close { min-width: 40px; min-height: 40px; border: 1px solid var(--lo-line); background: transparent; border-radius: 10px; font-size: 18px; color: var(--lo-muted); }
.citation-form .field { display: grid; gap: 6px; margin-bottom: 14px; }
.citation-form label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--lo-muted); }
.citation-form select, .citation-form input { min-height: 44px; padding: 0 12px; border: 1px solid var(--lo-line); border-radius: 10px; background: var(--lo-cream); color: var(--lo-ink); }
.citation-details-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 16px; }
@media (max-width: 560px) { .citation-details-grid { grid-template-columns: 1fr; } }
.citation-output-wrap { margin: 16px 0; padding: 16px; background: var(--lo-cream); border-radius: 12px; }
.citation-output-label { margin-bottom: 6px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--lo-gold-ink); }
.citation-output { margin: 0; font-size: 14px; line-height: 1.6; }
.citation-actions { display: flex; justify-content: flex-end; }
.secondary-btn { min-height: 44px; padding: 0 18px; border: 1px solid var(--lo-line); background: transparent; border-radius: 10px; font-weight: 750; color: var(--lo-ink); }
.citation-note { margin: 14px 0 0; font-size: 12px; color: var(--lo-muted); line-height: 1.5; }

/* Print preview modal */
.print-preview-backdrop { position: fixed; inset: 0; z-index: 130; display: grid; place-items: center; padding: 18px; background: rgba(4,10,24,.78); }
.print-preview-backdrop[hidden] { display: none; }
.print-preview-shell { display: flex; flex-direction: column; width: min(980px, 100%); height: min(92vh, 900px); overflow: hidden; background: #dfe3e9; border-radius: 18px; box-shadow: 0 30px 100px rgba(0,0,0,.38); }
.print-preview-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 15px 18px; color: #fff; background: var(--lo-navy); }
.print-preview-toolbar strong { display: block; font-size: 13px; }
.print-preview-toolbar span { display: block; margin-top: 3px; color: rgba(255,255,255,.6); font-size: 11px; }
.print-preview-frame { flex: 1; width: 100%; min-height: 0; border: 0; background: #dfe3e9; }
.print-preview-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; background: var(--lo-paper); }
.print-preview-actions .primary-btn, .print-preview-actions .secondary-btn { min-height: 44px; }
.primary-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; color: var(--lo-navy); background: linear-gradient(135deg, var(--lo-gold-soft), var(--lo-gold)); border: 0; border-radius: 10px; font-weight: 800; font-size: 13px; }

@media (max-width: 480px) {
	.print-preview-backdrop, .print-preview-shell { border-radius: 0; }
	.citation-modal { padding: 18px; }
}
