/* SR Acessibilidade - Paleta Super Green */
:root {
  --sr-verde-escuro: #1B4332;
  --sr-verde-medio: #2D6A4F;
  --sr-verde-claro: #52B788;
  --sr-branco: #ffffff;
  --sr-cinza: #f5f5f5;
  --sr-sombra: rgba(0,0,0,0.18);
  --sr-raio: 12px;
  --sr-transicao: 0.25s ease;
}

/* ── BLINDAGEM TOTAL DO PLUGIN CONTRA TEMAS ── */
body.sr-alto-contraste #sr-btn-acessibilidade,
body.sr-fundo-amarelo #sr-btn-acessibilidade,
body.sr-fundo-creme #sr-btn-acessibilidade,
body.sr-modo-escuro #sr-btn-acessibilidade,
body.sr-inverter #sr-btn-acessibilidade {
  background: #1B4332 !important;
  color: #ffffff !important;
  filter: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  display: flex !important;
}
body.sr-alto-contraste #sr-btn-acessibilidade svg,
body.sr-fundo-amarelo #sr-btn-acessibilidade svg,
body.sr-fundo-creme #sr-btn-acessibilidade svg,
body.sr-modo-escuro #sr-btn-acessibilidade svg,
body.sr-inverter #sr-btn-acessibilidade svg {
  fill: #ffffff !important;
  filter: none !important;
}
body.sr-alto-contraste #sr-painel,
body.sr-fundo-amarelo #sr-painel,
body.sr-fundo-creme #sr-painel,
body.sr-modo-escuro #sr-painel,
body.sr-inverter #sr-painel {
  filter: none !important;
  background: #ffffff !important;
  color: #222222 !important;
}
body.sr-alto-contraste #sr-painel *,
body.sr-fundo-amarelo #sr-painel *,
body.sr-fundo-creme #sr-painel *,
body.sr-modo-escuro #sr-painel *,
body.sr-inverter #sr-painel * {
  filter: none !important;
}

/* ── Botão flutuante ── */
#sr-btn-acessibilidade {
  position: fixed !important;
  top: 18px;
  right: 18px;
  z-index: 99999;
  background: var(--sr-verde-escuro);
  color: var(--sr-branco);
  border: none;
  border-radius: 50px;
  padding: 10px 18px;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px var(--sr-sombra);
  transition: background var(--sr-transicao), transform var(--sr-transicao);
  outline: none;
}
#sr-btn-acessibilidade:hover,
#sr-btn-acessibilidade:focus {
  background: var(--sr-verde-medio);
  transform: scale(1.04);
}
#sr-btn-acessibilidade svg {
  width: 20px;
  height: 20px;
  fill: var(--sr-branco);
  flex-shrink: 0;
}

/* ── Painel ── */
#sr-painel {
  position: fixed;
  top: 62px;
  right: 18px;
  z-index: 99998;
  background: var(--sr-branco);
  border-radius: var(--sr-raio);
  box-shadow: 0 8px 32px var(--sr-sombra);
  width: 320px;
  max-height: 88vh;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  font-family: inherit;
  border-top: 4px solid var(--sr-verde-claro);
}
#sr-painel.sr-aberto {
  display: flex;
}

/* Cabeçalho do painel */
#sr-painel-header {
  background: var(--sr-verde-escuro);
  color: var(--sr-branco);
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: calc(var(--sr-raio) - 4px) calc(var(--sr-raio) - 4px) 0 0;
}
#sr-painel-header span { opacity: 0.7; font-size: 12px; font-weight: 400; }

/* Corpo do painel */
#sr-painel-corpo {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Seções */
.sr-secao {
  border-bottom: 1px solid #e8e8e8;
  padding-bottom: 16px;
}
.sr-secao:last-child { border-bottom: none; padding-bottom: 0; }
.sr-secao-titulo {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sr-verde-medio);
  margin-bottom: 10px;
}

/* Grade de botões */
.sr-grade {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.sr-grade.sr-grade-3 { grid-template-columns: 1fr 1fr 1fr; }

/* Botões do painel — alta especificidade para sobrescrever tema */
#sr-acessibilidade-root .sr-btn,
#sr-painel .sr-btn {
  background: #f0f0f0 !important;
  border: 2px solid #cccccc !important;
  border-radius: 8px !important;
  padding: 9px 8px !important;
  font-size: 12px !important;
  font-family: inherit !important;
  cursor: pointer !important;
  text-align: center !important;
  transition: all var(--sr-transicao) !important;
  color: #222222 !important;
  line-height: 1.3 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  text-decoration: none !important;
  display: block !important;
  width: 100% !important;
}
#sr-acessibilidade-root .sr-btn:hover,
#sr-painel .sr-btn:hover {
  border-color: var(--sr-verde-claro) !important;
  background: #d8f0e5 !important;
  color: #1B4332 !important;
}
#sr-acessibilidade-root .sr-btn.sr-ativo,
#sr-painel .sr-btn.sr-ativo {
  background: var(--sr-verde-claro) !important;
  color: #ffffff !important;
  border-color: var(--sr-verde-medio) !important;
  font-weight: 700 !important;
}
#sr-acessibilidade-root .sr-btn span,
#sr-painel .sr-btn span {
  display: block !important;
  font-size: 18px !important;
  margin-bottom: 2px !important;
  color: inherit !important;
}

/* Controle de tamanho de fonte */
#sr-painel .sr-fonte-controle {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: #f0f0f0 !important;
  border-radius: 8px !important;
  padding: 6px 10px !important;
}
#sr-painel .sr-fonte-controle button {
  background: #1B4332 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 6px !important;
  width: 32px !important;
  height: 32px !important;
  font-size: 18px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background var(--sr-transicao) !important;
  box-shadow: none !important;
  text-shadow: none !important;
  line-height: 1 !important;
}
#sr-painel .sr-fonte-controle button:hover {
  background: #2D6A4F !important;
}
.sr-fonte-valor {
  font-size: 13px;
  font-weight: 600;
  color: var(--sr-verde-escuro);
  min-width: 60px;
  text-align: center;
}

/* Slider espaçamento */
.sr-slider-wrap { display: flex; flex-direction: column; gap: 6px; }
.sr-slider-wrap label { font-size: 12px; color: #555; display: flex; justify-content: space-between; }
.sr-slider-wrap label span { font-weight: 600; color: var(--sr-verde-escuro); }
input[type=range].sr-slider {
  width: 100%;
  accent-color: var(--sr-verde-claro);
  cursor: pointer;
}

/* TTS */
.sr-tts-wrap { display: flex; flex-direction: column; gap: 8px; }
.sr-tts-controles { display: flex; gap: 8px; }
#sr-painel .sr-tts-controles button {
  flex: 1 !important;
  background: #1B4332 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 9px 6px !important;
  font-size: 12px !important;
  font-family: inherit !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  transition: background var(--sr-transicao) !important;
  box-shadow: none !important;
  text-shadow: none !important;
  text-decoration: none !important;
}
#sr-painel .sr-tts-controles button:hover {
  background: #2D6A4F !important;
}
#sr-painel .sr-tts-controles button:disabled {
  opacity: 0.4 !important;
  cursor: not-allowed !important;
}
.sr-tts-status {
  font-size: 11px;
  color: #777;
  text-align: center;
  min-height: 16px;
}
.sr-tts-velocidade { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #555; }
.sr-tts-velocidade select {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  accent-color: var(--sr-verde-claro);
}

/* Régua de leitura */
#sr-regua {
  position: fixed;
  left: 0;
  width: 100%;
  height: 36px;
  background: rgba(82, 183, 136, 0.18);
  border-top: 2px solid var(--sr-verde-claro);
  border-bottom: 2px solid var(--sr-verde-claro);
  pointer-events: none;
  z-index: 99990;
  display: none;
  transition: top 0.05s linear;
}

/* Máscara de leitura */
#sr-mascara-top, #sr-mascara-bot {
  position: fixed;
  left: 0;
  width: 100%;
  background: rgba(0,0,0,0.55);
  pointer-events: none;
  z-index: 99989;
  display: none;
}
#sr-mascara-top { top: 0; }
#sr-mascara-bot { bottom: 0; }

/* Rodapé do painel */
#sr-painel-footer {
  padding: 12px 16px;
  border-top: 1px solid #e8e8e8;
}
#sr-painel #sr-btn-reset {
  width: 100% !important;
  background: #ffffff !important;
  border: 2px solid #1B4332 !important;
  border-radius: 8px !important;
  color: #1B4332 !important;
  font-size: 13px !important;
  font-family: inherit !important;
  font-weight: 700 !important;
  padding: 9px !important;
  cursor: pointer !important;
  transition: all var(--sr-transicao) !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
#sr-painel #sr-btn-reset:hover {
  background: #1B4332 !important;
  color: #ffffff !important;
}

/* ── ALTO CONTRASTE ── */
body.sr-alto-contraste {
  background-color: #000000 !important;
  color: #ffffff !important;
}
body.sr-alto-contraste div:not(#sr-acessibilidade-root):not(#sr-acessibilidade-root div),
body.sr-alto-contraste section,
body.sr-alto-contraste article,
body.sr-alto-contraste main,
body.sr-alto-contraste header,
body.sr-alto-contraste footer,
body.sr-alto-contraste aside,
body.sr-alto-contraste nav,
body.sr-alto-contraste .site-content,
body.sr-alto-contraste .entry-content,
body.sr-alto-contraste .post-content,
body.sr-alto-contraste .site-header,
body.sr-alto-contraste .site-footer,
body.sr-alto-contraste .widget,
body.sr-alto-contraste .container {
  background-color: #000000 !important;
  color: #ffffff !important;
  border-color: #ffffff !important;
}
body.sr-alto-contraste p,
body.sr-alto-contraste span:not(#sr-acessibilidade-root span),
body.sr-alto-contraste li,
body.sr-alto-contraste td,
body.sr-alto-contraste h1,
body.sr-alto-contraste h2,
body.sr-alto-contraste h3,
body.sr-alto-contraste h4,
body.sr-alto-contraste h5,
body.sr-alto-contraste h6 {
  color: #ffffff !important;
  background-color: transparent !important;
  text-shadow: none !important;
}
body.sr-alto-contraste a,
body.sr-alto-contraste a:visited {
  color: #ffff00 !important;
  text-decoration: underline !important;
}
body.sr-alto-contraste img { filter: brightness(0.9) contrast(1.2); }

/* ── FUNDO CREME ── */
body.sr-fundo-creme,
body.sr-fundo-creme div,
body.sr-fundo-creme section,
body.sr-fundo-creme article,
body.sr-fundo-creme main,
body.sr-fundo-creme header,
body.sr-fundo-creme footer,
body.sr-fundo-creme aside,
body.sr-fundo-creme nav,
body.sr-fundo-creme .site-content,
body.sr-fundo-creme .entry-content,
body.sr-fundo-creme .post-content,
body.sr-fundo-creme .site-header,
body.sr-fundo-creme .site-footer,
body.sr-fundo-creme .widget,
body.sr-fundo-creme .container {
  background-color: #fdf6ec !important;
  color: #2c1a0e !important;
}
body.sr-fundo-creme p,
body.sr-fundo-creme span,
body.sr-fundo-creme li,
body.sr-fundo-creme td,
body.sr-fundo-creme h1,
body.sr-fundo-creme h2,
body.sr-fundo-creme h3,
body.sr-fundo-creme h4,
body.sr-fundo-creme h5,
body.sr-fundo-creme h6 {
  color: #2c1a0e !important;
  background-color: transparent !important;
}

/* ── MODO ESCURO ── */
body.sr-modo-escuro,
body.sr-modo-escuro div,
body.sr-modo-escuro section,
body.sr-modo-escuro article,
body.sr-modo-escuro main,
body.sr-modo-escuro header,
body.sr-modo-escuro footer,
body.sr-modo-escuro aside,
body.sr-modo-escuro nav,
body.sr-modo-escuro .site-content,
body.sr-modo-escuro .entry-content,
body.sr-modo-escuro .post-content,
body.sr-modo-escuro .site-header,
body.sr-modo-escuro .site-footer,
body.sr-modo-escuro .widget,
body.sr-modo-escuro .container {
  background-color: #1a1a2e !important;
  color: #e0e0e0 !important;
}
body.sr-modo-escuro p,
body.sr-modo-escuro span,
body.sr-modo-escuro li,
body.sr-modo-escuro td,
body.sr-modo-escuro h1,
body.sr-modo-escuro h2,
body.sr-modo-escuro h3,
body.sr-modo-escuro h4,
body.sr-modo-escuro h5,
body.sr-modo-escuro h6 {
  color: #e0e0e0 !important;
  background-color: transparent !important;
}
body.sr-modo-escuro a { color: #52B788 !important; }

/* ── INVERTER CORES ── */
body.sr-inverter { filter: invert(1) hue-rotate(180deg) !important; }
body.sr-inverter img,
body.sr-inverter video { filter: invert(1) hue-rotate(180deg) !important; }

/* Proteger painel do plugin em todos os temas */
body.sr-alto-contraste #sr-painel-header,
body.sr-fundo-amarelo #sr-painel-header,
body.sr-fundo-creme #sr-painel-header,
body.sr-modo-escuro #sr-painel-header,
body.sr-inverter #sr-painel-header {
  background: #1B4332 !important;
  color: #ffffff !important;
}
body.sr-alto-contraste #sr-painel-corpo,
body.sr-fundo-amarelo #sr-painel-corpo,
body.sr-fundo-creme #sr-painel-corpo,
body.sr-modo-escuro #sr-painel-corpo,
body.sr-inverter #sr-painel-corpo {
  background: #ffffff !important;
}

/* Destaque TTS */
.sr-destaque-tts {
  background: rgba(82, 183, 136, 0.35) !important;
  border-radius: 3px;
  transition: background 0.2s;
}

/* Cursor ampliado */
body.sr-cursor-grande { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M8 2l16 12-7 1 4 9-3 1-4-9-6 5z' fill='%231B4332' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E") 4 2, auto !important; }

/* Fonte dislexia */
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@400;700&display=swap');
body.sr-fonte-dislexia,
body.sr-fonte-dislexia p,
body.sr-fonte-dislexia h1,
body.sr-fonte-dislexia h2,
body.sr-fonte-dislexia h3,
body.sr-fonte-dislexia li,
body.sr-fonte-dislexia span {
  font-family: 'Lexend', sans-serif !important;
  letter-spacing: 0.05em !important;
}

/* Animações reduzidas */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
body.sr-sem-animacao *, body.sr-sem-animacao *::before, body.sr-sem-animacao *::after {
  animation: none !important;
  transition: none !important;
}
