/* ============================================================
   Reading mode — distraction-free full-width overlay for long-form pages.

   assets/js/reading-mode.js adds an eye toggle to pages estimated at 2+
   minutes and clones the rendered article into the overlay styled here.
   Table full-screen (table-expand.css) stays a regular-mode affordance only:
   the reading pane is already wider than the normal content column, so its
   "Expand" chip is hidden once inside .wu-reading-overlay.
   ============================================================ */

.wu-reading-toggle {
  position: fixed;
  top: calc(var(--md-header-height, 2.4rem) + 12px);
  right: 16px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: 999px;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color--light);
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 120ms ease, color 120ms ease, border-color 120ms ease;
}

.wu-reading-toggle:hover,
.wu-reading-toggle:focus-visible {
  opacity: 1;
  color: var(--md-accent-fg-color);
  border-color: var(--md-accent-fg-color);
}

/* ---------- Overlay ---------- */

.wu-reading-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: var(--md-default-bg-color);
}

.wu-reading-overlay[hidden] { display: none; }

.wu-reading-overlay__rail {
  flex-shrink: 0;
  height: 3px;
  background: var(--md-default-fg-color--lightest);
}

.wu-reading-overlay__progress-track { height: 100%; }

.wu-reading-overlay__progress {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--md-accent-fg-color);
}

.wu-reading-overlay__head {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  flex-shrink: 0;
  padding: 0.9rem 1.4rem;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

.wu-reading-overlay__eyebrow {
  margin: 0;
  font-family: var(--font-mono), var(--md-code-font), monospace;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--md-default-fg-color--light);
}

.wu-reading-overlay__meta {
  margin: 0.15rem 0 0;
  font-family: var(--font-mono), var(--md-code-font), monospace;
  font-size: 0.7rem;
  color: var(--md-default-fg-color--light);
}

.wu-reading-overlay__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.wu-reading-overlay__btn {
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: 0.5rem;
  background: transparent;
  color: var(--md-default-fg-color--light);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.wu-reading-overlay__btn:hover,
.wu-reading-overlay__btn:focus-visible {
  color: var(--md-accent-fg-color);
  border-color: var(--md-accent-fg-color);
}

.wu-reading-overlay__body {
  flex: 1;
  overflow: auto;
  padding: 2.5rem 1.5rem 5rem;
}

/* Wider than the normal Material content column — the point of the mode. */
.wu-reading-overlay__body .md-content__inner {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0;
}

.wu-reading-overlay__body .md-content__inner::before { display: none; }

/* Table full screen is a regular-mode affordance; the reading pane already
   gives tables the extra width it exists to provide. */
.wu-reading-overlay__body .wu-table-expand { display: none !important; }

html.wu-reading-open,
body.wu-reading-open { overflow: hidden; height: 100%; }

@media print {
  .wu-reading-toggle,
  .wu-reading-overlay { display: none !important; }
}
