/* /moex/quarters/ (pipeline/pages/moexq.py, js/moexq.js): the Moscow Exchange companies by quarter. A cell
   holds two lines, the amount and under it the change against a year earlier; the head of a column holds
   two buttons the same way, one sorts by the amount, the other by the change. The table is .stk-table of
   css/stocks.css. */
.mq-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 24px 0 12px; }
.mq-years { max-width: 100%; }
.mq-sub { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 12px; }
.mq-sub .note { margin: 0; }
.mq-q { font-size: 15.5px; padding: 10px 16px; min-width: min(100%, 260px); }

.mq-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mq-table { transition: opacity 0.15s; }
.mq-table.is-loading { opacity: 0.45; }
.mq-table th, .mq-table td { padding: 9px 10px; vertical-align: top; }
.mq-table td { min-width: 92px; }
.mq-table thead th { vertical-align: bottom; white-space: nowrap; }
.mq-table th[aria-sort]::after { content: none; }   /* the arrow stands beside the button that sorts */
.mq-table thead button { display: block; margin-left: auto; font-weight: 600; color: var(--ink-2); }
.mq-table thead .mq-name button { margin-left: 0; }
.mq-table thead button.mq-yy { margin-top: 3px; font-size: 13px; font-weight: 500; color: var(--muted); }
.mq-table thead button[data-dir] { color: var(--ink); }
.mq-table thead button[data-dir="d"]::after { content: " ↓"; }
.mq-table thead button[data-dir="a"]::after { content: " ↑"; }
.mq-table thead .mq-name small { display: block; margin: 3px 0 0; font-size: 12.5px; }
.mq-table th[scope="row"] { text-align: left; white-space: normal; font-weight: 500; line-height: 1.25; min-width: 170px; max-width: 260px; }
.mq-table th[scope="row"] a { font-weight: 600; text-decoration: none; }
.mq-table th[scope="row"] a:hover { text-decoration: underline; }
.mq-table th[scope="row"] small { display: block; margin: 3px 0 0; font-size: 12.5px; letter-spacing: 0.03em; color: var(--muted); }
.mq-tag { display: inline-block; margin-left: 7px; padding: 1px 7px; border-radius: 999px; background: var(--track); color: var(--ink-2); font-size: 11.5px; letter-spacing: 0; }
.mq-v, .mq-c { display: block; }
.mq-v { font-weight: 500; color: var(--ink); }
.mq-c { margin-top: 2px; font-size: 13.5px; font-weight: 500; color: var(--muted); }
.mq-neg, .mq-dn { color: var(--bad); }
.mq-up { color: var(--good); }
.mq-cum { border-left: 1px solid var(--border); }      /* from here on: counted from the start of the year */
.mq-table col.mq-on { background: var(--hover); }       /* the column the table is sorted by */
.mq-table tbody tr[hidden] { display: none; }

/* A wide screen holds the whole table: the page scrolls, and the head row stays under the site's menu
   (overflow: clip keeps the rounded corners without making a scroll box, which would hold the head row). */
@supports (overflow: clip) {
  @media (min-width: 1100px) {
    .mq-wrap { overflow: clip; }
    .mq-table thead th { top: 64px; }
  }
}
/* A narrower one: the table scrolls in its own box, both ways; the head row and the names stay in place. */
@media (max-width: 1099.98px) {
  .mq-wrap { overflow: auto; max-height: calc(100vh - 84px); max-height: calc(100dvh - 84px); overscroll-behavior-x: contain; }
  .mq-table th, .mq-table td { padding: 9px 8px; }
  .mq-table td { min-width: 84px; }
  .mq-table th[scope="row"] { min-width: 150px; }
  .mq-table thead th { z-index: 2; }
  .mq-table thead th:first-child { position: sticky; left: 0; z-index: 3; }
  .mq-table th[scope="row"] { position: sticky; left: 0; z-index: 1; background: var(--surface); }
  .mq-table thead th:first-child, .mq-table th[scope="row"] { box-shadow: 1px 0 0 var(--border); }   /* the edge the periods slide under */
  .mq-table tbody tr:hover th[scope="row"] { background: var(--hover); }
}
@media (max-width: 640px) {
  .mq-bar { margin-top: 18px; }
  .mq-years { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .mq-years::-webkit-scrollbar { display: none; }
  .mq-q { width: 100%; }
  .mq-table th, .mq-table td { padding: 8px 8px; }
  .mq-table td { min-width: 84px; }
  .mq-table th[scope="row"] { min-width: 128px; max-width: 150px; font-size: 13.5px; }
}
