/* IGoAbroad voice message: listen button, sticky mini-player, loading bar */

/* Listen button used inside pages */
.voice-cta {
  display: inline-flex; align-items: center; gap: 14px; margin: 0 0 22px; padding: 10px 18px 10px 10px;
  background: #fff; color: var(--navy); border: 1px solid var(--rule); border-left: 4px solid var(--gold);
  border-radius: var(--radius); cursor: pointer; text-align: left; font: inherit; max-width: 100%;
}
.voice-cta:hover { border-color: var(--navy); border-left-color: var(--gold); }
.voice-cta .vcta-ico { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: #fff; }
.voice-cta .vcta-ico .i-pause { display: none; }
.voice-cta.is-playing .vcta-ico .i-play { display: none; }
.voice-cta.is-playing .vcta-ico .i-pause { display: block; }
.voice-cta strong { display: block; font: 700 1rem var(--font-head); }
.voice-cta small { display: block; color: var(--muted); font-size: .85rem; }

/* Mini-player */
.igo-voice[hidden] { display: none; }
.igo-voice {
  position: fixed; z-index: 65; left: 0; right: 0; bottom: var(--igo-bar, 0px);
  color: #fff; font-family: var(--font-body);
}
.vc-bar {
  display: grid; grid-template-columns: 48px 1fr 36px; align-items: center; gap: 10px;
  background: var(--navy); border-top: 3px solid var(--gold); padding: 8px 10px;
  box-shadow: 0 -4px 18px rgba(8, 23, 72, .28);
}
body.no-bar .igo-voice { bottom: 0; }
.vc-play, .vc-x {
  border: 0; cursor: pointer; display: grid; place-items: center; color: #fff; font: inherit;
}
.vc-play { width: 48px; height: 48px; border-radius: 50%; background: var(--gold); color: var(--ink); }
.vc-play .i-pause { display: none; }
.is-playing .vc-play .i-play { display: none; }
.is-playing .vc-play .i-pause { display: block; }
.vc-x { width: 36px; height: 36px; background: none; font-size: 1.7rem; line-height: 1; border-radius: 50%; }
.vc-x:hover, .vc-caption:hover { background: rgba(255, 255, 255, .1); }
.vc-play:focus-visible, .vc-x:focus-visible, .vc-caption:focus-visible, .vc-seek:focus-visible, .vc-cue:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.vc-main { min-width: 0; }
.vc-caption {
  display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; color: #fff; cursor: pointer;
  text-align: left; font: 500 .95rem/1.35 var(--font-body); padding: 4px 6px; margin: 0 -6px; border-radius: var(--radius);
}
.vc-line { flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vc-chev { flex: none; opacity: .8; transition: transform .2s; }
.vc-caption:not(.has-cues) .vc-chev { display: none; }
.is-open .vc-chev { transform: rotate(180deg); }

.vc-eq { flex: none; display: none; align-items: flex-end; gap: 2px; width: 14px; height: 14px; }
.is-playing .vc-eq { display: flex; }
.vc-eq i { width: 3px; height: 40%; background: var(--gold); border-radius: 1px; animation: vc-eq 1s ease-in-out infinite; }
.vc-eq i:nth-child(2) { animation-delay: .2s; }
.vc-eq i:nth-child(3) { animation-delay: .4s; }
@keyframes vc-eq { 0%, 100% { height: 30%; } 50% { height: 100%; } }

.vc-row { display: flex; align-items: center; gap: 10px; }
.vc-time { flex: none; font-size: .75rem; opacity: .85; font-variant-numeric: tabular-nums; }
.vc-seek { --p: 0%; flex: 1; min-width: 0; height: 24px; margin: 0; background: none; -webkit-appearance: none; appearance: none; cursor: pointer; }
.vc-seek::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--gold) var(--p), rgba(255, 255, 255, .28) var(--p)); }
.vc-seek::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .28); }
.vc-seek::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--gold); }
.vc-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: #fff; border: 0; }
.vc-seek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }

/* Full transcript panel */
.vc-panel {
  background: #fff; color: var(--ink); border-top: 3px solid var(--gold); max-height: min(46vh, 340px); overflow-y: auto;
  overscroll-behavior: contain; padding: 12px 14px; box-shadow: 0 -4px 18px rgba(8, 23, 72, .2);
}
.vc-panel[hidden] { display: none; }
.vc-panel-head { margin: 0 0 8px; font: 700 .85rem var(--font-head); color: var(--navy); text-transform: uppercase; letter-spacing: .04em; }
.vc-list { list-style: none; margin: 0; padding: 0; }
.vc-cue { display: grid; grid-template-columns: 38px 1fr; gap: 8px; width: 100%; text-align: left; background: none; border: 0; border-left: 4px solid transparent; padding: 8px 8px; cursor: pointer; font: inherit; color: var(--ink); border-radius: var(--radius); }
.vc-cue:hover { background: var(--wash); }
.vc-cue.is-active { background: #FFF7DB; border-left-color: var(--gold); font-weight: 600; }
.vc-cue-t { color: var(--muted); font-size: .8rem; padding-top: 2px; font-variant-numeric: tabular-nums; }
.vc-cue-x { line-height: 1.5; }

/* Keep the page and floating buttons clear of the player */
body.has-voice { margin-bottom: calc(var(--igo-voice, 0px) + 12px); }
@media (max-width: 760px) {
  body.has-voice .igo-dock { bottom: calc(18px + var(--igo-bar, 0px) + var(--igo-voice, 0px)); }
}
@media (min-width: 761px) {
  .igo-voice { left: 18px; right: auto; bottom: 18px; width: min(460px, calc(100vw - 36px)); border-radius: 6px; overflow: hidden; box-shadow: 0 8px 28px rgba(8, 23, 72, .35); }
  body.no-bar .igo-voice { bottom: 18px; }
  .vc-bar { box-shadow: none; }
  .vc-panel { box-shadow: none; }
}

/* Thin loading bar while a page is being fetched */
html.igo-loading::before {
  content: ""; position: fixed; z-index: 200; top: 0; left: 0; height: 3px; width: 100%; background: var(--gold);
  transform-origin: left; animation: igo-load 1.2s ease-out forwards;
}
@keyframes igo-load { from { transform: scaleX(.05); } to { transform: scaleX(.85); } }

@media (prefers-reduced-motion: reduce) {
  .vc-eq i { animation: none !important; height: 70%; }
  html.igo-loading::before { animation: none !important; transform: scaleX(.6); }
}
