/**********************************************************
** ReadSpeaker "Ouvir" button (single.php, single-equipa.php)
** Figma: readspeaker / closed. Enqueued on single posts only.
**
** Restyles ReadSpeaker's own markup (.rsbtn > a.rsbtn_play with
** .rsbtn_left = label and .rsbtn_right.rsplay = icon). Its injected
** stylesheet draws the button with sprite backgrounds, so the sprite
** properties are overridden with !important. webReader.js is loaded
** with notools=1 (functions.php): only the player controls remain.
/**********************************************************/

body .rsbtn {
  display: inline-flex;
  margin: 0;
  height: 38px !important;
}

/* Pill: 1px border, 8px 12px 8px 8px padding, 4px gap */
body .rsbtn a.rsbtn_play {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: auto;
  height: auto;
  padding: 8px 12px 8px 8px;
  border: 1px solid #E0E8EB;
  border-radius: 500px;
  background: transparent;
  text-decoration: none;
  color: var(--gray);
  transition: border-color 0.2s ease, color 0.2s ease;
}

body .rsbtn a.rsbtn_play:hover,
body .rsbtn a.rsbtn_play:focus-visible {
  border-color: var(--gray);
  color: var(--white);
  text-decoration: none;
}

/* Label ("Ouvir"), after the icon */
body .rsbtn a.rsbtn_play span.rsbtn_left {
  order: 2;
  float: none !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
}

body .rsbtn a.rsbtn_play .rsbtn_text,
body .rsbtn a.rsbtn_play .rsbtn_text span {
  display: inline;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  text-indent: 0 !important;
  text-transform: uppercase;
  color: var(--gray) !important;
}

.rs_addtools .rsbtn_play .rsbtn_right::before, 
.rsbtn .rsbtn_play .rsbtn_right::before {
    content: none !important;
}

/* Icon from Figma, drawn as a mask so it follows the text colour (day/night) */
body .rsbtn a.rsbtn_play span.rsbtn_right {
  order: 1;
  display: block;
  flex: 0 0 20px;
  float: none !important;
  width: 20px !important;
  height: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: currentColor !important;
  -webkit-mask: url('../img/icon-readspeaker.svg') center / contain no-repeat;
  mask: url('../img/icon-readspeaker.svg') center / contain no-repeat;
}

/* Dark mode (Figma): white icon + label (var(--gray) is white here), border #3A3C45 */
.theme--night .rsbtn a.rsbtn_play {
  border-color: #3A3C45;
}

/* Touch devices with the OS in dark mode get the dark variables on .theme--day
   (same media query as the dark overrides in style.css) */
@media (prefers-color-scheme: dark) and (hover: none) {
  .theme--day .rsbtn a.rsbtn_play {
    border-color: #3A3C45;
  }
}

/* Team profile: the button sits under the name / role */
.equipa-profile__header .rsbtn {
  margin-top: 12px;
}

.rs_addtools .rsbtn_play .rsbtn_left .rsbtn_text::before,
.rsbtn .rsbtn_play .rsbtn_left .rsbtn_text::before,
.rs_addtools .rsbtn_play .rsbtn_left .rsbtn_text::after, 
.rsbtn .rsbtn_play .rsbtn_left .rsbtn_text::after {
  content: none !important;
}

body .rsbtn a.rsbtn_play span.rsbtn_right{
  background: var(--gray) !important;
}