/* read.css - JOB READ (25 Nov 2026): "Read it to me", "Make it easier to read", Speak.
   New file. Loaded on every page by build/read_hook.py. Colours only through the page's own tokens. */

/* ---- the Read it to me button (house shape: icon + words, 44px) ---- */
.mfp-read-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.mfp-read-wrap.mine { margin: 6px 0 0; }
.mfp-read, .mfp-speak {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; min-width: 44px; padding: 8px 16px; border-radius: 999px;
  border: 2px solid var(--line, var(--mfp-line, #d5ddf5)); background: var(--card, #fff);
  color: var(--ink, var(--mfp-ink, #16204a)); font: inherit; font-size: .95rem; font-weight: 700; line-height: 1.2;
  cursor: pointer; text-align: left;
}
.mfp-read svg, .mfp-speak svg { width: 20px; height: 20px; flex: none; }
.mfp-read[aria-pressed="true"], .mfp-speak.rec { border-color: var(--pop, #3355ff); background: var(--tint, #e3e9ff); }
.mfp-read[hidden], .mfp-read-wrap[hidden] { display: none; }
.mfp-read-st { font-size: .85rem; color: var(--soft, #4d5888); }
.mfp-read-wrap.in-head { margin: 0; }

/* ---- the menu entry and the floating buttons ---- */
.sm-g .mfp-menu-read {
  display: block; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 12px; background: none;
  color: var(--mfp-ink, var(--ink, #16204a)); font: inherit; text-align: left; cursor: pointer;
}
@media (hover: hover) { .sm-g .mfp-menu-read:hover { background: var(--mfp-tint, var(--tint, #e3e9ff)); } }
.mfp-read-float {
  position: fixed; z-index: 30; left: max(12px, env(safe-area-inset-left, 0px)); bottom: max(12px, env(safe-area-inset-bottom, 0px));
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}
.mfp-read-opt-float { left: auto; right: max(12px, env(safe-area-inset-right, 0px)); }

/* ---- the reading options side panel ---- */
.mfp-rp-shade { position: fixed; inset: 0; z-index: 38; background: var(--shade, rgba(16, 22, 60, .45)); }
.mfp-rp {
  position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; width: min(420px, 100%); overflow-y: auto;
  background: var(--card, #fff); color: var(--ink, #16204a); border-left: 2px solid var(--line, #d5ddf5);
  padding: 18px 16px 32px; display: flex; flex-direction: column; gap: 16px; font-family: var(--body, system-ui, sans-serif);
}
.mfp-rp[hidden], .mfp-rp-shade[hidden] { display: none; }
.mfp-rp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.mfp-rp h2 { font-family: var(--display, system-ui, sans-serif); font-size: 1.4rem; font-weight: 800; margin: 0; }
.mfp-rp h3 { font-family: var(--body, system-ui, sans-serif); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--soft, #4d5888); margin: 0 0 8px; }
.mfp-rp p { margin: 0; }
.mfp-rp .note { font-size: .92rem; color: var(--soft, #4d5888); }
.mfp-rp-x { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line, #d5ddf5); background: var(--card, #fff); color: var(--ink, #16204a); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.mfp-rp-grp { display: flex; flex-wrap: wrap; gap: 8px; }
.mfp-rp-btn {
  min-height: 44px; min-width: 44px; padding: 8px 14px; border-radius: 14px; border: 2px solid var(--line, #d5ddf5);
  background: var(--card, #fff); color: var(--ink, #16204a); font: inherit; font-weight: 700; cursor: pointer; text-align: left;
}
.mfp-rp-btn[aria-pressed="true"], .mfp-rp-btn[aria-checked="true"] { border-color: var(--pop, #3355ff); box-shadow: inset 0 0 0 2px var(--pop, #3355ff); }
.mfp-rp-sw { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink, #16204a); vertical-align: -3px; margin-right: 8px; }
.mfp-rp-btn.sw { display: inline-flex; align-items: center; }
.mfp-rp-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mfp-rp-row .mfp-rp-btn { min-width: 84px; text-align: center; }
.mfp-rp-line { font-size: .92rem; font-weight: 700; }

/* ---- the reading line ---- */
.mfp-ruler {
  position: fixed; z-index: 9; left: 0; right: 0; top: 0; height: 42px; pointer-events: none; display: none;
  background: rgba(255, 214, 0, .32); mix-blend-mode: multiply;
  border-top: 3px solid var(--pop, #3355ff); border-bottom: 3px solid var(--pop, #3355ff);
}
html[data-read-ruler="1"] .mfp-ruler { display: block; }

/* ---- the background tints: all pages, light, text 7:1 or more (read_contrast in READ_check.js) ---- */
html:root[data-read-bg] {
  --ink: #101433; --soft: #2c3262; --pop: #1b2da6; --pop-ink: #ffffff; --coral: #a31d12;
  --bg: var(--read-bg); --card: color-mix(in srgb, var(--read-bg) 50%, #ffffff);
  --tint: color-mix(in srgb, var(--read-bg) 90%, #000000); --line: color-mix(in srgb, var(--read-bg) 78%, #000000);
  --shade: rgba(16, 20, 51, .5); color-scheme: light;
}
html[data-read-bg="cream"] { --read-bg: #fdf6e3; }
html[data-read-bg="yellow"] { --read-bg: #fff9c4; }
html[data-read-bg="peach"] { --read-bg: #ffe8d6; }
html[data-read-bg="blue"] { --read-bg: #dff0ff; }
html[data-read-bg="green"] { --read-bg: #e1f5e1; }
html[data-read-bg="pink"] { --read-bg: #fde4ec; }
html[data-read-bg="grey"] { --read-bg: #e9ebee; }
html[data-read-bg] body { background: var(--bg); color: var(--ink); }

/* ---- text size ---- */
html[data-read-size="big"] { --read-scale: 1.15; }
html[data-read-size="bigger"] { --read-scale: 1.3; }
html[data-read-size] body { font-size: calc(17px * var(--read-scale)); }
html[data-read-size] body :is(p, li, label, td, th, input, textarea, select, button, a, summary, dd, dt) { font-size: max(1em, calc(15px * var(--read-scale))); }
html[data-read-size] { overflow-wrap: anywhere; }

/* ---- letter and line spacing ---- */
html[data-read-space="wide"] body { letter-spacing: .05em; word-spacing: .14em; line-height: 1.8; }
html[data-read-space="wide"] body :is(p, li, label, span, a, button, td, th, summary, h1, h2, h3, h4, input, textarea) { letter-spacing: .05em; word-spacing: .14em; }
html[data-read-space="wide"] body :is(p, li, label, td, th, textarea) { line-height: 1.8; }

/* ---- less movement ---- */
html[data-read-calm="1"] *, html[data-read-calm="1"] *::before, html[data-read-calm="1"] *::after {
  animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important;
}

/* ---- bigger tap areas (for sore or shaky hands) ---- */
html[data-read-tap="1"] body :is(button, [role="button"], [role="tab"], select, summary, .btn, .vibe) { min-height: 56px; min-width: 56px; }
html[data-read-tap="1"] body :is(input[type="checkbox"], input[type="radio"]) { width: 28px; height: 28px; }
html[data-read-tap="1"] body :is(label, .sm-g a) { min-height: 48px; }
html[data-read-tap="1"] body :is(button, a) { margin-block: 2px; }

/* ---- Interview practice has an older Speak from the mock-up (browser recognition / a developer line "Speak works in
   Chrome or the Claude desktop app"). It is hidden: the one Speak is build/speak.js, behind the switch. ---- */
.micNo, .micConsent, .micPause, .micInterim, button.mic { display: none !important; }

/* ---- Speak (only drawn when the speak switch is on) ---- */
.mfp-speak.rec { color: var(--ink, #16204a); }
.mfp-speak-st { font-size: .85rem; color: var(--soft, #4d5888); width: 100%; }

@media print { .mfp-read-wrap, .mfp-read-float, .mfp-rp, .mfp-rp-shade, .mfp-ruler { display: none !important; } }

/* note 44 (Inese, 25 Nov): only the icon; on a card it sits beside the title. Screen readers still hear the words. */
.mfp-read-i { width: 44px; padding: 0; }
.mfp-read-i > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:is(.card, .talk):has(> .mfp-read-wrap) { position: relative; }
:is(.card, .talk) > .mfp-read-wrap:not(:has([data-read-slow]:not([hidden]))) { position: absolute; top: 12px; right: 12px; margin: 0; z-index: 1; }
:is(.card, .talk) > .mfp-read-wrap:not(:has([data-read-slow]:not([hidden]))) + * { padding-right: 52px; }
.mfp-read-i { position: relative; }
