/* The legal pages (/legal/, /legal/privacy, terms, lgpl, cookies, refund), in the Frae deck look: the Ink ground with the contour field behind it (next/field.js, as on every
   Frae page), the title, the dates and a contents list on the Ink, and the document on a Paper sheet that scrolls inside the slide (the way the Saksham terms do).
   Palette: the Frae pack only: Ink #171717, Paper #F7F4ED, Vermilion #E5483F (as a hairline and as list markers, never as text: on Paper the type is Ink), Paper Rule #E3DED2,
   Ink Muted #57544D (6.88:1 on Paper). The words are exactly the originals' (tools/build-legal.cjs fails otherwise). Type: Inter, and Noto Serif Devanagari for Hindi. */

.lg .frame { justify-content: stretch; }
.lg-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(240px, .72fr) minmax(0, 2fr); gap: clamp(24px, 4.5vw, 72px); align-items: stretch; width: 100%; }
.lg-side { display: flex; flex-direction: column; min-height: 0; padding-top: clamp(4px, 1.4vh, 16px); }

.lg-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-size: var(--t-label); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); text-decoration: none; transition: color .3s ease; }
.lg-back::before { content: ""; width: .6em; height: .6em; border-left: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg); margin-right: 2px; }   /* the arrow, drawn: the type's Latin subset has none */
.lg-back:hover, .lg-back:focus-visible { color: var(--fg); }
.lg h1 { margin-top: clamp(12px, 2.2vh, 24px); font-family: var(--display); font-weight: 600; font-size: clamp(32px, 3.7vw, 58px); line-height: 1.04; letter-spacing: -.03em; color: var(--fg); text-wrap: balance; }
.lg-meta { margin-top: 8px; font-size: var(--t-dense); line-height: 1.5; color: var(--fg-3); }
.lg-meta:first-of-type { margin-top: clamp(12px, 2vh, 20px); }

.lg-toc { margin-top: clamp(16px, 3vh, 30px); min-height: 0; overflow-y: auto; border-top: 1px solid var(--line); padding-top: 10px; scrollbar-width: thin; scrollbar-color: var(--fg-3) transparent; }
.lg-toc ol { list-style: none; margin: 0; padding: 0; }
.lg-toc a { display: block; padding: 6px 0 6px 14px; border-left: 2px solid transparent; font-size: var(--t-dense); line-height: 1.35; color: var(--fg-2); text-decoration: none; transition: color .3s ease, border-color .3s ease; }
.lg-toc a:hover, .lg-toc a:focus-visible, .lg-toc a[aria-current="true"] { color: var(--fg); border-left-color: var(--vermilion); }

/* the sheet: Paper, whatever the slide's tone (as the cover's panel is) */
.lg-sheet { --fg: var(--ink); --fg-2: #3A3833; --fg-3: var(--ink-muted); --line: var(--paper-rule); --accent-text: var(--ink);
  min-height: 0; display: flex; background: var(--paper); color: var(--ink); }
.lg-doc { flex: 1; min-width: 0; overflow-y: auto; padding: clamp(20px, 3vw, 44px) clamp(20px, 3.4vw, 54px); scrollbar-width: thin; scrollbar-color: var(--vermilion) var(--paper-rule); }
.lg-doc:focus-visible { outline: 2px solid var(--ink); outline-offset: -4px; }
.lg-notice { margin-bottom: clamp(20px, 3vh, 32px); padding: clamp(14px, 1.6vw, 22px) clamp(16px, 1.8vw, 26px); background: #EFEBE1; border: 1px solid var(--paper-rule); border-left: 3px solid var(--vermilion); font-size: var(--t-dense); line-height: 1.65; color: var(--ink); }
.lg-notice strong { font-weight: 600; }
.lg-body section { scroll-margin-top: 4px; }
.lg-body section + section { margin-top: clamp(22px, 3.4vh, 36px); }
.lg-body h2 { font-family: var(--display); font-weight: 600; font-size: clamp(19px, 1.7vw, 25px); line-height: 1.25; letter-spacing: -.02em; color: var(--ink); margin-bottom: 10px; }
.lg-body p, .lg-body li { font-size: var(--t-body); line-height: 1.7; color: #3A3833; max-width: 76ch; }
.lg-body p + p, .lg-body p + ul, .lg-body ul + p, .lg-body ul + ul { margin-top: 10px; }
.lg-body ul { padding-left: 1.3em; }
.lg-body li::marker { color: var(--vermilion); }
.lg-body li + li { margin-top: 6px; }
.lg-body strong { color: var(--ink); font-weight: 600; }
.lg-body a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--vermilion); overflow-wrap: anywhere; }
.lg-body a:hover, .lg-body a:focus-visible { background: var(--paper-rule); }

/* the index page */
.lg-index .frame { justify-content: center; }
.lg-index .frame > div { width: 100%; }
.lg-index h1 { max-width: 14ch; }
.lg-index .lede { margin-top: clamp(12px, 2vh, 22px); max-width: 60ch; }
.lg-list { margin-top: clamp(20px, 3.4vh, 40px); max-width: 920px; border-top: 1px solid var(--line); }
.lg-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 20px; align-items: baseline; padding: clamp(12px, 1.9vh, 20px) 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--fg); transition: padding-left .4s var(--ease), border-color .3s ease; }
.lg-item::after { content: ""; grid-column: 2; grid-row: 1 / 3; align-self: center; width: .6em; height: .6em; border-top: 1.8px solid currentColor; border-right: 1.8px solid currentColor; transform: rotate(45deg); color: var(--fg-3); transition: color .3s ease, transform .4s var(--ease); }
.lg-item__t { font-family: var(--display); font-weight: 600; font-size: clamp(19px, 1.9vw, 28px); letter-spacing: -.02em; line-height: 1.2; }
.lg-item__s { font-size: var(--t-dense); line-height: 1.5; color: var(--fg-2); }
.lg-item:hover, .lg-item:focus-visible { padding-left: 10px; border-bottom-color: var(--vermilion); }
.lg-item:hover::after, .lg-item:focus-visible::after { color: var(--vermilion); transform: translateX(4px) rotate(45deg); }
.lg-contact { margin-top: clamp(16px, 2.6vh, 30px); max-width: 60ch; font-size: var(--t-dense); line-height: 1.6; color: var(--fg-2); }
.lg-contact a { color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--accent); }

@media (max-width: 900px) {
  .lg-grid { grid-template-columns: 1fr; gap: 14px; grid-template-rows: auto minmax(0, 1fr); }
  .lg-side { padding-top: 0; }
  .lg-toc { display: none; }
  .lg h1 { font-size: clamp(28px, 8vw, 40px); margin-top: 8px; }
  .lg-meta { margin-top: 4px; }
  .lg-doc { padding: 18px 16px; }
}
@media (max-height: 700px) and (min-width: 901px) { .lg-toc a { padding: 3px 0 3px 14px; } }
html[lang="hi"] .lg h1, html[lang="hi"] .lg-body h2 { letter-spacing: 0; line-height: 1.3; }
html[lang="hi"] .lg-back { letter-spacing: 0; text-transform: none; }
@media (prefers-reduced-motion: reduce) { .lg-item, .lg-item::after { transition: none; } }
