/* ==========================================================================
   Acellus CyberSchool: Legal Pages
   Loaded after site.css on the pages under /legal/. site.css carries the tokens, base,
   header, buttons and footer; this adds the document reader.
   ========================================================================== */

/* ---------- Base, as the reader needs it ---------- */
/* The mobile document bar sits under the header, so anchors clear both */
:root { --docbar-h: 0px; }
html { scroll-padding-top: calc(var(--header-h) + var(--docbar-h) + 24px); }
button { font: inherit; }
/* The reader's icons are smaller and a touch heavier than the landing pages' */
.icon { width: 20px; height: 20px; flex: none; stroke-width: 1.8; }
.icon-tile .icon { width: 24px; height: 24px; stroke-width: 1.6; }
/* The hidden sprite of <symbol>s takes no space (a class, as the CSP blocks style="") */
.icon-sprite { position: absolute; }

/* ---------- Page hero (navy) ---------- */
.legal-hero {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--navy);
  padding-block: clamp(40px, 6vw, 72px) clamp(40px, 5vw, 64px);
}
.legal-hero::after {
  content: ""; position: absolute; z-index: -1; right: -10%; top: -60%;
  width: min(60vw, 820px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(12, 113, 195, .38) 0%, rgba(12, 113, 195, .1) 42%, transparent 68%);
  pointer-events: none;
}
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 20px; font-size: 13.5px; font-weight: 500; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs [aria-current] { color: rgba(255, 255, 255, .7); }
.crumbs .sep { color: rgba(255, 255, 255, .4); }
.legal-title {
  max-width: 22em;
  font-size: clamp(28px, 3.8vw, 44px); line-height: 1.12; letter-spacing: -.005em;
}
.legal-hero .lede { max-width: 40em; margin-top: 18px; font-size: clamp(16px, 1.5vw, 18px); line-height: 1.6; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 10px 12px; margin-top: 24px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16);
  color: rgba(255, 255, 255, .9); font-size: 13px; font-weight: 500; line-height: 1.4;
}
.chip .icon { width: 16px; height: 16px; color: var(--sky-light); }

/* ---------- Hub: document cards ---------- */
.hub { padding-block: clamp(48px, 7vw, 88px); background: var(--cloud); }
.doc-list { display: grid; gap: 20px; }
.doc-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 24px;
  padding: clamp(22px, 3vw, 32px);
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  text-decoration: none; color: var(--body); box-shadow: var(--shadow);
  transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.doc-card:hover { border-color: var(--blue); transform: translateY(-2px); box-shadow: var(--shadow-lg); color: var(--body); }
.doc-card h2 { font-size: clamp(18px, 2vw, 22px); line-height: 1.3; }
.doc-card p { margin: 6px 0 0; font-size: 15px; line-height: 1.6; }
.doc-card .doc-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tag { padding: 3px 10px; border-radius: 999px; background: var(--sky-wash); color: var(--navy); font-size: 12.5px; font-weight: 600; }
.doc-card .go { color: var(--blue); font-weight: 600; font-size: 14.5px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 679px) {
  .doc-card { grid-template-columns: auto minmax(0, 1fr); }
  .doc-card .go { grid-column: 2; }
}
.hub-note { margin-top: 32px; font-size: 14.5px; color: var(--slate); }

/* ---------- Reader layout ---------- */
.reader { background: var(--white); }
.reader-grid {
  display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: clamp(32px, 4vw, 64px);
  padding-block: clamp(32px, 4vw, 56px) clamp(56px, 7vw, 96px);
  align-items: start;
}

/* Toolbar: reading mode, defined terms, print */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px;
  margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line);
}
.seg { display: inline-flex; padding: 4px; border-radius: 10px; background: var(--sky-wash); }
.seg button {
  min-height: 38px; padding: 8px 16px; border: 0; border-radius: 7px; background: transparent;
  color: var(--navy); font-size: 14px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.seg button[aria-pressed="true"] { background: var(--white); color: var(--blue); box-shadow: 0 1px 3px rgba(0, 24, 86, .14); }
.tools-right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--field);
  transition: background-color .18s var(--ease); flex: none;
}
.switch .track::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform .18s var(--ease);
}
.switch input:checked + .track { background: var(--blue); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 3px solid var(--blue); outline-offset: 2px; }
.tool-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-btn); background: var(--white);
  color: var(--navy); font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.tool-btn:hover { border-color: var(--blue); color: var(--blue); }

/* ---------- Sidebar ---------- */
.sidebar { position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100vh - var(--header-h) - 48px); display: flex; flex-direction: column; }
.sidebar-scroll { overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; margin-right: -6px; scrollbar-width: thin; }
.side-label { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--slate); }

.search { position: relative; margin-bottom: 18px; }
.search input {
  width: 100%; min-height: 44px; padding: 10px 38px 10px 40px;
  border: 1px solid var(--field); border-radius: var(--radius-btn); background: var(--white);
  font: 500 14.5px/1.4 var(--font); color: var(--ink);
}
.search input::placeholder { color: var(--slate); font-weight: 400; }
.search input:focus { outline: 3px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.search > .icon { position: absolute; left: 12px; top: 12px; color: var(--slate); pointer-events: none; }
.search-clear {
  position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; border: 0; border-radius: 6px;
  background: transparent; color: var(--slate); cursor: pointer; display: grid; place-items: center;
}
.search-clear:hover { background: var(--sky-wash); color: var(--navy); }
.search-clear[hidden] { display: none; }
.search-status { margin: -8px 0 14px; font-size: 13px; color: var(--slate); min-height: 0; }
.search-status:empty { display: none; }

.toc { counter-reset: none; }
.toc li + li { margin-top: 2px; }
.toc a {
  display: grid; grid-template-columns: 2.1em minmax(0, 1fr) auto; align-items: baseline; gap: 4px;
  padding: 8px 10px; border-radius: 8px;
  color: var(--ink); font-size: 14px; font-weight: 500; line-height: 1.4; text-decoration: none;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.toc a:hover { background: var(--sky-wash); color: var(--navy); }
.toc a.no-num { grid-template-columns: minmax(0, 1fr) auto; }
.toc .n { color: var(--slate); font-weight: 600; font-variant-numeric: tabular-nums; }
.toc a[aria-current="true"] { background: var(--sky-tint); color: var(--navy); font-weight: 600; box-shadow: inset 3px 0 0 var(--blue); }
.toc a[aria-current="true"] .n { color: var(--blue); }
.toc .hits { padding: 0 7px; border-radius: 999px; background: var(--gold-wash); color: var(--gold-deep); font-size: 12px; font-weight: 700; }
.toc .hits:empty { display: none; }
.toc li.is-dim a { opacity: .38; }
.toc .toc-exhibit { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }

.other-docs { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.other-docs li + li { margin-top: 4px; }
.other-docs a {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--ink); font-size: 14px; font-weight: 500; line-height: 1.4; text-decoration: none;
}
.other-docs a:hover { background: var(--sky-wash); color: var(--navy); }
.other-docs a[aria-current="page"] { color: var(--navy); font-weight: 600; }
.other-docs .icon { margin-top: 1px; color: var(--blue); width: 18px; height: 18px; }
.other-docs .all { margin-top: 10px; padding-left: 10px; font-size: 14px; }

/* Mobile document bar + contents drawer */
.doc-bar { display: none; }
.sidebar-close { display: none; }
@media (max-width: 1023px) {
  :root { --docbar-h: 56px; }
  .reader-grid { grid-template-columns: minmax(0, 1fr); padding-top: 24px; }
  .doc-bar {
    position: sticky; top: var(--header-h); z-index: 40;
    display: block; background: var(--white); border-bottom: 1px solid var(--line);
    box-shadow: 0 10px 20px -18px rgba(0, 24, 86, .5);
  }
  .doc-bar .wrap { display: flex; align-items: center; gap: 12px; height: var(--docbar-h); }
  .doc-bar-btn {
    display: flex; flex: 1; min-width: 0; align-items: center; gap: 10px; height: 44px; padding: 0 12px;
    border: 1px solid var(--line); border-radius: var(--radius-btn); background: var(--cloud);
    color: var(--navy); font-size: 14px; font-weight: 600; cursor: pointer; text-align: left;
  }
  .doc-bar-btn .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .doc-bar-btn .c { color: var(--slate); font-weight: 500; white-space: nowrap; }
  .doc-bar-progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--blue); transition: width .3s var(--ease); }

  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 70; top: 0; max-height: none;
    width: min(88vw, 360px); padding: 20px var(--gutter) 24px;
    background: var(--white); box-shadow: 20px 0 60px -20px rgba(0, 24, 86, .45);
    transform: translateX(-104%); visibility: hidden;
    transition: transform .28s var(--ease), visibility 0s linear .28s;
  }
  .sidebar.is-open { transform: none; visibility: visible; transition: transform .28s var(--ease); }
  .sidebar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
  .sidebar-close {
    display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--white); color: var(--navy); cursor: pointer;
  }
  .scrim { position: fixed; inset: 0; z-index: 65; background: rgba(6, 16, 40, .5); }
  .scrim[hidden] { display: none; }
}
@media (min-width: 1024px) {
  .sidebar-head .side-label { margin-bottom: 10px; }
  .scrim { display: none; }
}

/* ---------- Document body ---------- */
.doc { max-width: 760px; color: #414B5C; font-size: 16.5px; line-height: 1.8; }
.progress-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; font-size: 13px; font-weight: 600; color: var(--slate); }
.progress-track { flex: 1; height: 4px; border-radius: 999px; background: var(--sky-wash); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--blue); border-radius: inherit; transition: width .35s var(--ease); }
.reader[data-mode="full"] .progress-row { display: none; }

.clause { scroll-margin-top: calc(var(--header-h) + var(--docbar-h) + 24px); }
.reader[data-mode="paged"] .clause:not(.is-current) { display: none; }
.reader[data-mode="paged"] .clause.is-current { animation: clause-in .35s var(--ease); }
@keyframes clause-in { from { opacity: 0; transform: translateY(8px); } }
.reader[data-mode="full"] .clause + .clause { margin-top: 48px; padding-top: 44px; border-top: 1px solid var(--line); }

.clause-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.clause-head h2 {
  display: flex; gap: .55em; align-items: baseline;
  font-size: clamp(22px, 2.4vw, 28px); line-height: 1.25; letter-spacing: -.005em;
}
.clause-head h2 .num { color: var(--blue); font-variant-numeric: tabular-nums; }
.clause-tools { display: flex; align-items: center; gap: 10px; flex: none; padding-top: 4px; }
.copy-link {
  display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--white); color: var(--slate); cursor: pointer; position: relative;
}
.copy-link:hover { color: var(--blue); border-color: var(--blue); }
.copy-link .icon { width: 16px; height: 16px; }
.copy-link[data-copied]::after {
  content: "Link copied"; position: absolute; right: 0; top: calc(100% + 6px);
  padding: 4px 8px; border-radius: 6px; background: var(--navy); color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap;
}

/* A numbered paragraph with no heading (Section 1): the number leads the text, as in the source */
.clause-head--bare { justify-content: flex-end; margin-bottom: 8px; }
.num-lead { margin-right: .2em; color: var(--blue); font-weight: 600; font-size: 1.25em; }
.doc p { margin-bottom: 1.1em; }

/* The opening notices a document asks to be read first, set apart in a panel */
.notice {
  padding: clamp(20px, 3vw, 28px) clamp(20px, 3vw, 32px);
  border-radius: var(--radius); background: var(--gold-wash); border-left: 4px solid var(--gold);
  color: var(--ink); font-size: 15.5px; line-height: 1.7;
}
.notice p { margin-bottom: .9em; }
.notice p:first-child { color: var(--navy); font-weight: 600; }

/* Bulleted lists written as bullets in the source */
.bullets { margin: 0 0 1.1em; }
.bullets > li { position: relative; padding-left: 1.6em; }
.bullets > li + li { margin-top: .6em; }
.bullets > li::before { content: ""; position: absolute; left: .35em; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }

/* Closing address and version */
.doc-end { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.doc-end address { font-style: normal; color: var(--ink); font-weight: 500; line-height: 1.6; }
.doc-end .version { margin-top: 16px; padding-top: 0; border-top: 0; }

/* A version code carried in a document's title line */
.title-code { display: block; margin-top: 10px; font-size: .5em; font-weight: 600; letter-spacing: .12em; color: var(--sky-light); }
.doc .caps { letter-spacing: .01em; }
.doc strong.lead { color: var(--navy); }

/* Lettered and roman subsections: the markers are part of the text, so they are written out, not counted */
.subs { margin: 0 0 1.1em; }
.subs > li { display: grid; grid-template-columns: 2em minmax(0, 1fr); gap: 0 .5em; }
.subs > li + li { margin-top: 1em; }
.subs > li > .m { color: var(--navy); font-weight: 600; font-variant-numeric: tabular-nums; }
.subs > li > div > p:last-child { margin-bottom: 0; }
.subs .subs { margin-top: 1em; margin-bottom: 0; }
.subs .subs > li > .m { color: var(--slate); }
.doc > .clause > .subs:last-child, .clause-body > :last-child { margin-bottom: 0; }

/* Exhibit A */
.exhibit-head { text-align: left; }
.exhibit-head h2 { display: block; }
.exhibit-head h2 span { display: block; }
.exhibit-head h2 .sub { margin-top: 4px; font-size: .72em; color: var(--slate); letter-spacing: .06em; }
.defs { margin: 0; }
.defs > div { padding: 18px 0; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + var(--docbar-h) + 24px); }
.defs > div:target, .defs > div.is-flash { animation: flash 1.8s var(--ease); }
@keyframes flash { 0%, 40% { background: var(--gold-wash); } 100% { background: transparent; } }
.defs dt { display: none; }
.defs dd { margin: 0; }
.defs .term-name { color: var(--navy); font-weight: 600; }
.version { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14.5px; font-weight: 600; color: var(--navy); }

/* Defined terms in the text */
.term {
  display: inline; padding: 0; margin: 0; border: 0; background: none;
  font: inherit; color: inherit; letter-spacing: inherit; text-align: inherit; cursor: help;
  text-decoration: underline dotted var(--blue); text-decoration-thickness: 1.5px; text-underline-offset: .22em;
  border-radius: 2px;
}
.term:hover { background: var(--sky-wash); color: var(--navy); }
.term[aria-expanded="true"] { background: var(--sky-tint); color: var(--navy); }
.terms-off .term { text-decoration: none; cursor: text; pointer-events: none; }
.terms-off .term:hover { background: none; }

.popover {
  position: absolute; z-index: 60; width: min(420px, calc(100vw - 32px));
  padding: 18px 20px 16px; border-radius: var(--radius);
  background: var(--white); border: 1px solid var(--line); box-shadow: 0 24px 48px -20px rgba(0, 24, 86, .45);
  font-size: 14.5px; line-height: 1.65; color: var(--body);
}
.popover[hidden] { display: none; }
.popover-label { margin: 0 0 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-deep); }
.popover-body { max-height: 240px; overflow-y: auto; }
.popover-body dd { margin: 0; }
.popover-body .term-name { color: var(--navy); font-weight: 600; }
.popover-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13.5px; }
.popover-foot a { font-weight: 600; text-decoration: none; }
.popover-close { border: 0; background: none; color: var(--slate); font-weight: 600; font-size: 13.5px; cursor: pointer; padding: 4px; }
.popover-close:hover { color: var(--navy); }

mark { background: #FCE8A6; color: var(--ink); border-radius: 2px; padding: 0 1px; }
mark.is-active { background: var(--gold-light); box-shadow: 0 0 0 2px var(--gold-light); }

/* Previous / next */
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 48px; }
.reader[data-mode="full"] .pager { display: none; }
.pager button {
  display: flex; flex-direction: column; gap: 4px; min-height: 84px; padding: 16px 20px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--white);
  text-align: left; cursor: pointer; color: var(--navy);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}
.pager button:hover { border-color: var(--blue); box-shadow: var(--shadow); transform: translateY(-1px); }
.pager .dir { font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); }
.pager .ttl { font-size: 15.5px; font-weight: 600; line-height: 1.35; }
.pager .next { grid-column: 2; text-align: right; align-items: flex-end; }
.pager button[hidden] { display: none; }
.pager-hint { margin-top: 14px; font-size: 13px; color: var(--slate); text-align: center; }
.reader[data-mode="full"] .pager-hint { display: none; }
@media (max-width: 559px) { .pager { grid-template-columns: minmax(0, 1fr); } .pager .next { grid-column: 1; } }
@media (hover: none) { .pager-hint { display: none; } }

.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 30;
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px;
  border: 0; background: var(--navy); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 12px 24px -10px rgba(0, 24, 86, .6);
}
.to-top[hidden] { display: none; }

/* ---------- Print: always the full agreement, no site chrome ---------- */
@media print {
  .site-header, .site-footer, .doc-bar, .sidebar, .toolbar, .pager, .pager-hint, .progress-row, .clause-tools, .to-top, .popover, .scrim, .skip-link { display: none !important; }
  .legal-hero { background: none; padding: 0 0 16px; }
  .legal-hero::after, .crumbs, .doc-meta { display: none; }
  .legal-hero .legal-title, .title-code { color: #000; }
  .notice { background: none; border-left-width: 2px; }
  .reader-grid { display: block; padding: 0; }
  .doc { max-width: none; color: #000; font-size: 11pt; line-height: 1.5; }
  .reader .clause { display: block !important; animation: none !important; }
  .clause + .clause { margin-top: 18px !important; padding-top: 0 !important; border-top: 0 !important; }
  .clause-head h2, .clause-head h2 .num, .subs > li > .m, .doc strong.lead, .defs .term-name { color: #000; }
  .term { text-decoration: none; }
  mark { background: none; box-shadow: none; }
  a { color: #000; }
}
