/* The synopsis page (synopsis.html / synopsis-page.js). Tokens from style.css. */
:root {
  --var-bg: color-mix(in srgb, var(--chg) 22%, transparent);
  --minor: color-mix(in srgb, var(--chg) 75%, transparent);
  --rh: 1.9rem;
  --box: #d23a2a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --box: #ff6a55; --minor: color-mix(in srgb, var(--chg) 60%, transparent);
    --var-bg: color-mix(in srgb, var(--chg) 25%, transparent); }
}

body.syn-page { display: block; height: auto; min-height: 100%; }
.syn-page .bar { position: sticky; top: 0; z-index: 5; }
.syn-page .pick .ta { font-size: .9rem; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
#synTa { width: 4.5em; font: inherit; font-size: .9rem; padding: 4px 6px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--bg); color: var(--ink); }
.syn-links { margin-inline-start: auto; display: flex; gap: 14px; font-size: .95rem; }

.syn-wits { position: relative; font-size: .9rem; }
.syn-wits summary { cursor: pointer; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); list-style: none; }
.syn-wits summary::-webkit-details-marker { display: none; }
.syn-wits summary::after { content: " ▾"; color: var(--muted); }
.syn-wits.narrowed summary { border-color: var(--accent); }
.syn-wits-pop { position: absolute; inset-inline-start: 0; top: calc(100% + 4px); z-index: 6; min-width: 15rem;
  display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgb(0 0 0 / .15); }
.syn-wits-pop label { cursor: pointer; white-space: nowrap; }

.syn { padding: 8px 16px 60px; display: block; }
.syn-status { color: var(--muted); font-size: .9rem; margin: 4px 0 6px; }
.syn-rules { max-width: 52rem; margin: 6px 0 10px; padding: 4px 16px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--panel); font-size: .92rem; line-height: 1.6; }
.syn-rules[hidden] { display: none; }
.k-var-sample { background: var(--var-bg); padding: 0 4px; border-radius: 3px; }
.k-minor-sample { background: var(--minor); padding: 0 4px; border-radius: 3px; }
.syn-empty { color: var(--muted); font-size: .9rem; }

/* a block: its heading, then bands of word columns, right to left */
.sb { margin: 0 0 18px; scroll-margin-top: 70px; overflow-anchor: auto; }
.sb-h { font-size: .98rem; margin: 10px 0 4px; padding-bottom: 3px; border-bottom: 1px solid var(--line); }
.sb-h span { color: var(--muted); font-weight: normal; margin-inline-start: 6px; font-size: .9rem; }
.sb-h small { color: var(--muted); font-weight: normal; }

.band { display: flex; margin: 0 0 10px; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.bc { flex: none; display: flex; flex-direction: column; min-width: 0; }
.cell { height: var(--rh); line-height: var(--rh); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0 4px; text-align: center; }
.cell.ta { height: 1.1rem; line-height: 1.1rem; font-size: .68rem; color: var(--muted); text-align: start;
  overflow: visible; font-family: var(--ui); }
.cell.ta.turn { color: var(--accent); font-weight: 600; }
.bc.lab { position: relative; z-index: 1; background: var(--bg); border-inline-end: 1px solid var(--line); }
.bc.lab .cell { text-align: start; font-size: .8rem; color: var(--muted); padding-inline-end: 6px; }
.bc.lab .short { display: none; }
.cell.w { font-family: var(--hebrew); font-size: 1.15rem; cursor: zoom-in; border-radius: 3px; }
.cell.w:hover, .cell.w:focus-visible { background: color-mix(in srgb, var(--sel) 70%, transparent); outline: none; }
.cell.w .fill { color: var(--muted); font-size: .8em; }
.cell.om { color: var(--muted); }
.cell.nx { color: color-mix(in srgb, var(--muted) 45%, transparent); }
.cell.fill { color: var(--muted); }
.bc.var .cell:not(.ta) { background: var(--var-bg); }
.bc.var .cell.minor { background: var(--minor); }
.bc.var .cell.om.minor { color: var(--ink); }
.bc.focus { outline: 2px solid var(--accent); outline-offset: -1px; border-radius: 3px; }
.bc.focus .cell.ta { color: var(--accent); }
.cell.here { box-shadow: inset 0 -3px 0 var(--accent); }

/* the word on its page */
dialog.wm { max-width: calc(100vw - 16px); width: fit-content; padding: 0; overflow: hidden; }
.wm-hd { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line);
  font-size: .92rem; }
.wm-title { flex: 1; min-width: 0; }
.wm-title span { color: var(--muted); margin-inline-start: 6px; }
.wm-link { white-space: nowrap; }
.wm-x { font: inherit; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink);
  cursor: pointer; padding: 2px 9px; }
.wm-body { padding: 10px 12px 12px; }
.wm-line { margin: 0 0 8px; font-family: var(--hebrew); font-size: 1.15rem; line-height: 1.5; }
.wm-line mark { background: var(--chg); color: inherit; border-radius: 2px; padding: 0 2px; }
.wm-note { color: var(--muted); margin: 10px 0; min-width: 16rem; }

.pk { direction: ltr; }
.pk-vp { position: relative; overflow: hidden; background: color-mix(in srgb, var(--ink) 8%, var(--bg));
  border: 1px solid var(--line); border-radius: 6px; cursor: grab; touch-action: none; user-select: none; }
.pk-vp.drag { cursor: grabbing; }
.pk-layer { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.pk-layer img { display: block; width: 100%; height: 100%; pointer-events: none; }
.pk-vp.loading .pk-layer, .pk-vp.failed .pk-layer { visibility: hidden; }
.pk-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted); direction: rtl; font-size: .95rem; }
.pk-vp.loading .pk-msg::before { content: ""; width: 14px; height: 14px; margin-inline-end: 8px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent); animation: pk-spin .9s linear infinite; }
@keyframes pk-spin { to { transform: rotate(360deg); } }
.pk-hi { position: absolute; border: 2.5px solid var(--box); background: color-mix(in srgb, var(--box) 14%, transparent); }
.pk-b { position: absolute; border: 1px solid color-mix(in srgb, var(--box) 32%, transparent); }
.pk-tools { display: flex; align-items: center; gap: 6px; padding-top: 8px; flex-wrap: wrap; }
.pk-tools button { font: inherit; font-size: .85rem; min-width: 2.2em; padding: 2px 9px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); }
.pk-hint { margin-left: auto; font-size: .75rem; color: var(--muted); direction: rtl; }

@media (max-width: 760px) {
  .bc.lab .full { display: none; }
  .bc.lab .short { display: inline; }
  .bc.lab .cell { font-size: .75rem; padding-inline-end: 3px; }
  .cell.w { font-size: 1.05rem; }
  .pick select { max-width: 40vw; }
  .syn-links { margin-inline-start: 0; }
  .wm-body { padding: 8px; }
  .wm-hd { flex-wrap: wrap; }
  .pk-hint { display: none; }
}
