/* Landing voice dock. Same controls as the site player, colored per page.
   Highlight tokens feed /voice-highlight.css. */

html[data-landing-voice='zombie'] {
  --voice-highlight-bg: #7ec8a0;
  --voice-highlight-fg: #1a2035;
  --voice-highlight-ring: #7ec8a0;
  --voice-highlight-ring-width: 2px;
  --voice-highlight-button-glow: 0 0 0 4px #7ec8a0;
}

html[data-landing-voice='mindycards'] {
  --voice-highlight-bg: color-mix(in srgb, var(--accent) 32%, var(--surface));
  --voice-highlight-fg: var(--ink);
  --voice-highlight-ring: var(--accent);
  --voice-highlight-ring-width: 2px;
  --voice-highlight-button-glow: 0 0 0 4px var(--accent);
}

html[data-landing-voice='zombie'] img.voice-reading-active {
  outline: 4px solid #7ec8a0;
  outline-offset: 4px;
}

html[data-landing-voice='mindycards'] img.voice-reading-active,
html[data-landing-voice='mindycards'] [role='img'].voice-reading-active {
  outline: 4px solid var(--accent);
  outline-offset: 4px;
}

html[data-landing-voice][data-voice-reading] [data-voice-highlight='button'].voice-reading-active,
html[data-landing-voice][data-voice-reading] a.store-btn.voice-reading-active,
html[data-landing-voice][data-voice-reading] a.store-link.voice-reading-active {
  outline: 3px solid var(--voice-highlight-ring, var(--accent));
  outline-offset: 3px;
  box-shadow: inset 0 0 0 3px var(--voice-highlight-ring, var(--accent)), var(--voice-highlight-button-glow) !important;
}

html[data-landing-voice][data-voice-reading] [data-voice-highlight='block'].voice-reading-active {
  background-color: var(--voice-highlight-bg) !important;
  color: var(--voice-highlight-fg, var(--ink)) !important;
  box-shadow: 0 0 0 3px var(--voice-highlight-ring);
  border-radius: 0.5rem;
}

html[data-landing-voice][data-voice-reading] [data-voice-highlight='field'].voice-reading-active {
  outline: 3px solid var(--voice-highlight-ring);
  outline-offset: 3px;
}

html[data-voice-reading] .voice-word-marker,
html[data-voice-reading] .voice-reading-active-word {
  background-color: var(--voice-highlight-bg);
  color: var(--voice-highlight-fg);
  box-shadow: 0 0 0 var(--voice-highlight-ring-width, 2px) var(--voice-highlight-ring);
  border-radius: 0.2rem;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

html[data-landing-voice][data-voice-reading] :is([data-voice-key], .voice-reading-active-word, .voice-word-marker) {
  scroll-margin-bottom: calc(var(--voice-reader-bar-height, 8.5rem) + 1.25rem);
}

html[data-landing-voice='zombie'] body:has(.voice-reader-bar) .fab-container {
  bottom: calc(60px + var(--voice-reader-bar-height, 8.5rem));
}

html[data-landing-voice='zombie'] body:has(.voice-reader-bar) .settings-panel {
  bottom: calc(80px + var(--voice-reader-bar-height, 8.5rem));
}

html[data-landing-voice='mindycards'] body:has(.voice-reader-bar:not([hidden])) {
  padding-bottom: calc(var(--voice-reader-bar-height, 8.5rem) + 12px);
}

.voice-reader-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  box-sizing: border-box;
  padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  font-size: 16px;
}

.voice-reader-bar * { box-sizing: border-box; }

.voice-reader-inner {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.voice-reader-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  min-width: 0;
}

.voice-reader-status,
.voice-reader-section,
.voice-reader-voice-label,
.voice-reader-speed-label {
  margin: 0;
  line-height: 1.35;
}

.voice-reader-status { font-size: 0.875em; }
.voice-reader-section,
.voice-reader-voice-label,
.voice-reader-speed-label { font-size: 0.75em; }

.voice-reader-section {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.voice-reader-progress {
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
}

.voice-reader-progress > div {
  height: 100%;
  width: 0;
  border-radius: inherit;
}

.voice-reader-transport,
.voice-reader-extra {
  display: flex;
  align-items: center;
  gap: 8px;
}

.voice-reader-transport {
  gap: 14px;
}

@media (max-width: 760px) {
  .voice-reader-transport {
    gap: 22px;
  }

  .voice-segment {
    gap: 8px;
  }
}

.voice-reader-extra {
  justify-content: space-between;
  padding-top: 10px;
}

.voice-reader-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  font-size: 0.875em;
  cursor: pointer;
  padding: 0 16px;
}

.voice-reader-btn:disabled { opacity: 0.35; cursor: default; }

.voice-reader-btn-icon {
  width: 40px;
  min-width: 40px;
  padding: 0;
}

.voice-reader-btn svg { width: 1.15em; height: 1.15em; display: block; }

.voice-segment {
  display: inline-flex;
  gap: 4px;
}

.voice-segment button {
  font: inherit;
  font-size: 0.75em;
  font-weight: 700;
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
}

html[data-landing-voice='zombie'] .voice-reader-bar {
  background: #2d3d2d;
  border-top: 3px solid #5a7a5a;
  box-shadow: 0 -4px 0 #000;
  color: #fff;
  font-family: 'Atkinson Hyperlegible', 'Lexend Deca', sans-serif;
}

html[data-landing-voice='zombie'] .voice-reader-status,
html[data-landing-voice='zombie'] .voice-reader-section,
html[data-landing-voice='zombie'] .voice-reader-voice-label,
html[data-landing-voice='zombie'] .voice-reader-speed-label { color: #d7e8dc; }

html[data-landing-voice='zombie'] .voice-reader-progress { background: #1a2035; }
html[data-landing-voice='zombie'] .voice-reader-progress > div { background: #7ec8a0; }

html[data-landing-voice='zombie'] .voice-reader-btn-icon,
html[data-landing-voice='zombie'] .voice-reader-btn-outline,
html[data-landing-voice='zombie'] .voice-segment button {
  background: #1a2035;
  border: 3px solid #5a7a5a;
  color: #7ec8a0;
  box-shadow: 3px 3px 0 #000;
}

html[data-landing-voice='zombie'] .voice-reader-btn-primary,
html[data-landing-voice='zombie'] .voice-segment button[aria-pressed='true'] {
  background: #7ec8a0;
  border: 3px solid #2d5a3d;
  color: #1a3d2d;
  box-shadow: 3px 3px 0 #000;
}

html[data-landing-voice='mindycards'] .voice-reader-bar {
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-family: var(--font-body);
}

html[data-landing-voice='mindycards'] .voice-reader-status,
html[data-landing-voice='mindycards'] .voice-reader-speed-label { color: var(--ink); }

html[data-landing-voice='mindycards'] .voice-reader-section,
html[data-landing-voice='mindycards'] .voice-reader-voice-label { color: var(--mute); }

html[data-landing-voice='mindycards'] .voice-reader-progress { background: var(--accent-soft); }
html[data-landing-voice='mindycards'] .voice-reader-progress > div { background: var(--accent); }

html[data-landing-voice='mindycards'] .voice-reader-extra { border-top: 1px solid var(--border); }

html[data-landing-voice='mindycards'] .voice-reader-btn-icon,
html[data-landing-voice='mindycards'] .voice-reader-btn-outline,
html[data-landing-voice='mindycards'] .voice-segment button {
  background: var(--surface);
  border: 1px solid var(--border-firm);
  color: var(--ink);
}

html[data-landing-voice='mindycards'] .voice-reader-btn-primary,
html[data-landing-voice='mindycards'] .voice-segment button[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

html[data-landing-voice='zombie'] .voice-reader-extra {
  border-top: 3px solid #5a7a5a;
}
