/* ==========================================================================
   ExamStudyAid, the information and error pages (site v5): the legal documents, the sitemap, the coming-soon page
   and the four error pages (404, 403 for a failed CSRF check, 429, 500). Loaded after site.css; uses its tokens.
   ========================================================================== */

/* ---------- the legal documents (pages/legal_page.html) ---------- */
/* The Markdown's own first heading is the document's title, and the black opening above already carries it as the
   page's h1, so the document's copy of it is not drawn (it stays in the markup: the page's words are the file's, word
   for word, and pages/tests_legal_pages.py compares them). */
.legal-doc > h1:first-child {
  display: none;
}
.legal-page .prose {
  max-width: 76ch;
}
/* pages/legal.py wraps each table in a box that scrolls, so a phone never scrolls sideways */
.legal-doc-table {
  overflow-x: auto;
}
.legal-doc-table table {
  min-width: 540px;
}
.legal-doc .legal-doc-table + * {
  margin-top: 1.4em;
}

/* ---------- the sitemap (pages/sitemap.html) ---------- */
.smap-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.smap-jump-link {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1.5px rgb(245 245 247 / 0.9);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  transition: background-color 0.2s;
}
.smap-jump-link:hover {
  background: rgb(255 255 255 / 0.1);
}
.smap-jump-count {
  font-size: 14px;
  font-weight: 400;
  opacity: 0.8;
}
.smap-sec .sec-title-sm a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.smap-qual span {
  display: block;
}
.smap-subjects {
  margin-top: 14px;
}
.smap-subject {
  min-width: 0;
  padding: 14px 0 16px;
  border-top: 1px solid var(--line);
}
.band-mist .smap-subject {
  border-top-color: var(--line-2);
}
.smap-subject-name {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.smap-subject-name:hover {
  color: var(--blue-text);
}
.smap-res + .smap-res {
  margin-top: 2px;
}
.smap-res-in {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
}
.smap-res-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  font-size: 15.5px;
  font-weight: 500;
}
a.smap-res-link {
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}
a.smap-res-link:hover {
  color: var(--blue-text);
  text-decoration-color: currentColor;
}
/* a locked resource (Premium's) stays in the row as plain words, never a link */
.smap-res-link[data-ui-locked] {
  color: #62656d;
  font-weight: 400;
}
.smap-empty {
  font-size: 18px;
}
@media (pointer: coarse) {
  .smap-subject-name {
    min-height: 44px;
  }
  .smap-res-link {
    min-height: 44px;
    min-width: 44px;
  }
  .smap-jump-link {
    min-height: 44px;
  }
}

/* ---------- the coming-soon page (pages/coming_soon.html) ---------- */
.cs .hero-in {
  max-width: 820px;
}
/* the status, a quiet line with a dot over the headline */
.cs-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 650;
}
.cs-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
}
/* the way on: each live resource a large tile, the library's own icon, the whole tile one link */
.cs-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: clamp(32px, 4vw, 48px);
}
.cs-tile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 0.2s, transform 0.3s var(--ease);
}
.cs-tile:hover {
  box-shadow: inset 0 0 0 1.5px var(--ink);
}
.cs-tile:active {
  transform: scale(0.985);
}
.cs-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue-text);
}
.cs-icon svg {
  width: 22px;
  height: 22px;
}
.cs-name {
  font-size: 18px;
  font-weight: 650;
}
.cs-go {
  width: 18px;
  height: 18px;
  transition: transform 0.3s var(--ease);
}
.cs-tile:hover .cs-go {
  transform: translateX(3px);
}
.cs-more {
  margin-top: 22px;
  font-size: 16px;
}

.err {
  display: grid;
  align-content: center;
  min-height: 100svh;
}
.err .hero-actions {
  margin-top: 14px;
}
.err .hero-in {
  gap: clamp(16px, 2vw, 22px);
}
/* a line of words under the actions: why this happened, who to write to */
.err-why {
  display: grid;
  gap: 6px;
  max-width: 30em;
  margin-top: clamp(20px, 3vw, 36px);
  padding-top: clamp(20px, 3vw, 28px);
  border-top: 1px solid var(--line);
  font-size: 16px;
  line-height: 1.5;
}
.err-why strong {
  font-weight: 650;
}
.err-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
}
.err-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
}
.err-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 28px;
}
.err-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}
.err-links a:hover {
  color: var(--blue-text);
}

/* the 500 page draws no bar of its own (site.js is not loaded, nothing may query): the brand alone, over the black
   opening and scrolling away with it */
.err-bar.gn {
  position: absolute;
}

/* ---------- the 429 page: the clock the wait counts down on, inside a ring that fills as the wait runs out ---------- */
.tma-timer {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: clamp(8px, 1.5vw, 16px);
}
.tma-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 136px;
  height: 136px;
}
.tma-ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.tma-ring-track,
.tma-ring-arc {
  fill: none;
  stroke-width: 3.5;
}
.tma-ring-track {
  stroke: var(--line);
}
.tma-ring-arc {
  stroke: var(--blue);
  stroke-linecap: round;
  stroke-dasharray: 0 100;
}
.tma-time {
  position: relative;
  font-size: 30px;
  font-weight: 620;
  font-stretch: 106%;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.tma-time--words {
  font-size: 22px;
}
.tma-try,
.tma-ready {
  font-size: 17px;
  font-weight: 500;
}
.tma-ready {
  font-weight: 600;
}
