/* Registro do Dia · Ferramentas da matéria 1.0.0 */

/* ---------- Tamanho do texto ---------- */
html[data-rdd-fonte="1"] { --rdd-leitura-escala: 0.9; }
html[data-rdd-fonte="2"] { --rdd-leitura-escala: 1; }
html[data-rdd-fonte="3"] { --rdd-leitura-escala: 1.12; }
html[data-rdd-fonte="4"] { --rdd-leitura-escala: 1.25; }
html[data-rdd-fonte="5"] { --rdd-leitura-escala: 1.4; }

html[data-rdd-fonte] .entry--single .entry-content {
	font-size: calc(var(--rdd-fs-18, 1.125rem) * var(--rdd-leitura-escala, 1));
}
html[data-rdd-fonte] .entry--single .entry-subtitle {
	font-size: calc(clamp(var(--rdd-fs-18, 1.125rem), 2.2vw, var(--rdd-fs-24, 1.5rem)) * var(--rdd-leitura-escala, 1));
}
html[data-rdd-fonte] .entry--single .entry-content h2 { font-size: calc(clamp(1.5rem, 2.6vw, 2rem) * var(--rdd-leitura-escala, 1)); }
html[data-rdd-fonte] .entry--single .entry-content h3 { font-size: calc(var(--rdd-fs-24, 1.5rem) * var(--rdd-leitura-escala, 1)); }
html[data-rdd-fonte] .entry--single .entry-content h4 { font-size: calc(var(--rdd-fs-20, 1.25rem) * var(--rdd-leitura-escala, 1)); }
html[data-rdd-fonte] .entry--single .entry-content blockquote { font-size: calc(var(--rdd-fs-24, 1.5rem) * var(--rdd-leitura-escala, 1)); }

/* ---------- Barra do cabeçalho ---------- */
.rdd-leitura {
	--rl-ink: var(--ink, #1a1a1a);
	--rl-mute: var(--gray-news, #6b665e);
	--rl-rule: var(--rule, rgba(26, 26, 26, 0.18));
	--rl-rule-strong: var(--rule-strong, rgba(26, 26, 26, 0.42));
	--rl-red: var(--rdd-accent, #a01818);
	--rl-chip: var(--paper-deep, #ede6d6);
	font-family: var(--f-meta, 'IBM Plex Sans Condensed', 'Helvetica Neue', Arial, sans-serif);
	font-size: 0.8125rem;
	line-height: 1.2;
	color: var(--rl-ink);
}

.rdd-leitura--topo {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.625rem 1rem;
	margin: 1.25rem 0 0;
	padding: 0.625rem 0;
	border-top: 1px solid var(--rl-rule-strong);
	border-bottom: 1px solid var(--rl-rule);
}

.rdd-leitura button,
.rdd-leitura a.rdd-share {
	font: inherit;
	color: inherit;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.rdd-leitura button:focus-visible,
.rdd-leitura a:focus-visible,
.rdd-leitura-barra button:focus-visible,
.rdd-leitura-barra a:focus-visible {
	outline: 2px solid var(--rl-red, #a01818);
	outline-offset: 2px;
}

/* Ouvir: só aparece se o navegador sabe ler em voz alta */
.rdd-leitura__ouvir { display: none; align-items: center; gap: 0.375rem; }
.rdd-leitura-tts .rdd-leitura__ouvir { display: inline-flex; }

.rdd-leitura__play {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	min-height: 2.5rem;
	padding: 0.375rem 0.875rem 0.375rem 0.5rem;
	border: 1px solid var(--rl-ink);
	border-radius: 999px;
	background: transparent;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	font-weight: 600;
	transition: background 160ms ease, color 160ms ease;
}
.rdd-leitura__play svg { width: 1.5rem; height: 1.5rem; padding: 0.3rem; border-radius: 50%; background: var(--rl-red); color: #fff; flex: none; }
.rdd-leitura__play:hover { background: var(--rl-ink); color: var(--paper, #f4f0e8); }
.rdd-leitura__dur { font-weight: 400; color: var(--rl-mute); letter-spacing: 0.06em; }
.rdd-leitura__play:hover .rdd-leitura__dur { color: inherit; opacity: 0.75; }

.rdd-leitura__ico-pausa { display: none; }
[data-rdd-estado="tocando"] .rdd-leitura__ico-play { display: none; }
[data-rdd-estado="tocando"] .rdd-leitura__ico-pausa { display: block; }

.rdd-leitura__mini {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding: 0 0.5rem;
	border: 1px solid var(--rl-rule-strong);
	border-radius: 999px;
	background: transparent;
	font-weight: 600;
	letter-spacing: 0.04em;
}
.rdd-leitura__mini svg { width: 0.875rem; height: 0.875rem; }
.rdd-leitura__mini[hidden] { display: none; }
.rdd-leitura__estado { color: var(--rl-mute); font-size: 0.75rem; letter-spacing: 0.04em; }

/* Tamanho do texto: só com JavaScript */
.rdd-leitura__fonte { display: none; align-items: center; border: 1px solid var(--rl-rule-strong); border-radius: 999px; overflow: hidden; }
.rdd-leitura-js .rdd-leitura__fonte { display: inline-flex; }
.rdd-leitura__fonte button {
	display: inline-flex;
	align-items: baseline;
	justify-content: center;
	gap: 0.05rem;
	min-width: 2.75rem;
	height: 2.5rem;
	padding: 0 0.625rem;
	border: 0;
	background: transparent;
	font-weight: 600;
	line-height: 2.5rem;
}
.rdd-leitura__fonte button + button { border-left: 1px solid var(--rl-rule); }
.rdd-leitura__fonte button:hover { background: var(--rl-chip); }
.rdd-leitura__fonte button:disabled { opacity: 0.35; cursor: default; background: transparent; }
.rdd-a { font-family: var(--f-headline, 'Playfair Display', Georgia, serif); font-weight: 700; }
.rdd-a--p { font-size: 0.95rem; }
.rdd-a--g { font-size: 1.25rem; }

/* Compartilhar */
.rdd-leitura__share { display: inline-flex; align-items: center; gap: 0.375rem; margin-left: auto; }
.rdd-share {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.375rem;
	min-width: 2.5rem;
	height: 2.5rem;
	padding: 0 0.625rem;
	border: 1px solid var(--rl-rule-strong, rgba(26, 26, 26, 0.42));
	border-radius: 999px;
	background: transparent;
	text-decoration: none;
	transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.rdd-share svg { width: 1.125rem; height: 1.125rem; flex: none; }
.rdd-leitura--topo .rdd-share span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rdd-leitura--topo .rdd-share { padding: 0; }
.rdd-leitura a.rdd-share,
.rdd-leitura a.rdd-share:hover { text-decoration: none; }
.rdd-share--whatsapp:hover { background: #25d366; border-color: #25d366; color: #fff; }
.rdd-share--facebook:hover { background: #1877f2; border-color: #1877f2; color: #fff; }
.rdd-share--instagram:hover { background: #d62976; border-color: #d62976; color: #fff; }
.rdd-share--link:hover { background: var(--rl-ink); border-color: var(--rl-ink); color: var(--paper, #f4f0e8); }

/* ---------- Bloco do fim ---------- */
.rdd-leitura--fim {
	margin: 2.5rem 0 0;
	padding: 1.25rem 0 0;
	border-top: 3px double var(--rl-rule-strong);
	text-align: center;
}
.rdd-leitura__chamada {
	margin: 0 0 0.875rem;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--rl-mute);
}
.rdd-leitura__share--grande { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin: 0; }
.rdd-leitura__share--grande .rdd-share { height: 2.875rem; padding: 0 1.125rem; font-weight: 600; letter-spacing: 0.04em; }
.rdd-leitura__share--grande .rdd-share--whatsapp { background: #1fa855; border-color: #1fa855; color: #fff; padding: 0 1.5rem; font-size: 0.9375rem; }
.rdd-leitura__share--grande .rdd-share--whatsapp:hover { background: #178a45; border-color: #178a45; }
.rdd-leitura__share--grande .rdd-share--whatsapp svg { width: 1.375rem; height: 1.375rem; }

/* Trecho sendo lido */
.entry--single .rdd-lendo {
	background: linear-gradient(transparent 0, rgba(160, 24, 24, 0.09) 0);
	box-shadow: -0.5rem 0 0 rgba(160, 24, 24, 0.09), 0.5rem 0 0 rgba(160, 24, 24, 0.09);
	border-radius: 2px;
	transition: background 200ms ease;
}
[data-theme="dark"] .entry--single .rdd-lendo {
	background: rgba(232, 223, 208, 0.1);
	box-shadow: -0.5rem 0 0 rgba(232, 223, 208, 0.1), 0.5rem 0 0 rgba(232, 223, 208, 0.1);
}

/* ---------- Barra fixa do celular ---------- */
.rdd-leitura-barra { display: none; }
@media (max-width: 767px) {
	.rdd-leitura-barra:not([hidden]) {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 9990;
		display: flex;
		gap: 0.375rem;
		padding: 0.5rem 0.625rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
		background: var(--paper, #f4f0e8);
		border-top: 1px solid var(--rule-strong, rgba(26, 26, 26, 0.42));
		box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.12);
		font-family: var(--f-meta, 'IBM Plex Sans Condensed', Arial, sans-serif);
		font-size: 0.75rem;
		color: var(--ink, #1a1a1a);
		animation: rdd-leitura-sobe 180ms ease-out;
	}
	.rdd-leitura-barra .rdd-share {
		flex: 1 1 0;
		height: 2.75rem;
		padding: 0 0.25rem;
		gap: 0.3rem;
		font: inherit;
		font-weight: 600;
		color: inherit;
		text-decoration: none;
		cursor: pointer;
	}
	.rdd-leitura-barra .rdd-share--whatsapp { flex-grow: 1.6; background: #1fa855; border-color: #1fa855; color: #fff; }
	.rdd-leitura-barra .rdd-share--ouvir { display: none; }
	.rdd-leitura-tts .rdd-leitura-barra .rdd-share--ouvir { display: inline-flex; border-color: var(--rdd-accent, #a01818); color: var(--rdd-accent, #a01818); }
	.rdd-leitura-barra .rdd-share--ouvir svg { width: 1rem; height: 1rem; }
	body.rdd-leitura-barra-on { padding-bottom: calc(3.75rem + env(safe-area-inset-bottom, 0px)); }

	.rdd-leitura--topo { gap: 0.5rem 0.625rem; }
	.rdd-leitura__share { margin-left: 0; }
	.rdd-leitura__estado { display: none; }
}
@media (max-width: 380px) {
	.rdd-leitura-barra .rdd-share span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.rdd-leitura-barra .rdd-share--whatsapp span { position: static; width: auto; height: auto; clip: auto; }
}
@keyframes rdd-leitura-sobe { from { transform: translateY(100%); } to { transform: none; } }

/* ---------- Player flutuante (leitura ativa e barra do topo fora da tela) ---------- */
.rdd-leitura-player {
	position: fixed;
	left: 50%;
	bottom: 1.25rem;
	z-index: 9991;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.375rem 0.5rem 0.375rem 0.375rem;
	transform: translateX(-50%);
	border-radius: 999px;
	background: var(--ink-black, #080808);
	color: var(--paper, #f4f0e8);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
	font-family: var(--f-meta, 'IBM Plex Sans Condensed', Arial, sans-serif);
	font-size: 0.8125rem;
	line-height: 1;
	animation: rdd-leitura-surge 180ms ease-out;
}
.rdd-leitura-player[hidden] { display: none; }
.rdd-leitura-player button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	height: 2.5rem;
	min-width: 2.5rem;
	padding: 0 0.75rem;
	border: 1px solid rgba(244, 240, 232, 0.35);
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-weight: 600;
	letter-spacing: 0.06em;
	cursor: pointer;
}
.rdd-leitura-player button:hover { background: rgba(244, 240, 232, 0.12); }
.rdd-leitura-player button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.rdd-leitura-player .rdd-leitura-player__play { background: var(--rdd-accent, #a01818); border-color: var(--rdd-accent, #a01818); color: #fff; text-transform: uppercase; padding: 0 1rem 0 0.75rem; }
.rdd-leitura-player .rdd-leitura-player__play:hover { background: var(--red-deep, #7a1212); }
.rdd-leitura-player svg { width: 1rem; height: 1rem; }
.rdd-leitura-player__estado { min-width: 6.5rem; color: rgba(244, 240, 232, 0.72); letter-spacing: 0.04em; white-space: nowrap; }
[data-theme="dark"] .rdd-leitura-player { background: #f4ecdc; color: #1c1914; }
[data-theme="dark"] .rdd-leitura-player button { border-color: rgba(28, 25, 20, 0.3); }
[data-theme="dark"] .rdd-leitura-player__estado { color: rgba(28, 25, 20, 0.7); }
@keyframes rdd-leitura-surge { from { opacity: 0; transform: translate(-50%, 0.75rem); } to { opacity: 1; transform: translateX(-50%); } }
@media (max-width: 767px) {
	.rdd-leitura-player {
		left: 0;
		right: 0;
		bottom: 0;
		transform: none;
		justify-content: space-between;
		border-radius: 0;
		padding: 0.5rem 0.625rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
		animation: rdd-leitura-sobe 180ms ease-out;
	}
	.rdd-leitura-player__estado { flex: 1; min-width: 0; text-align: center; }
}
body.rdd-leitura-player-on .rdd-leitura-aviso { bottom: 5rem; }

/* ---------- Aviso (link copiado etc.) ---------- */
.rdd-leitura-aviso {
	position: fixed;
	left: 50%;
	bottom: 1.25rem;
	z-index: 9995;
	max-width: min(92vw, 26rem);
	transform: translateX(-50%);
	padding: 0.75rem 1rem;
	border-radius: 8px;
	background: var(--ink-black, #080808);
	color: var(--paper, #f4f0e8);
	font-family: var(--f-meta, 'IBM Plex Sans Condensed', Arial, sans-serif);
	font-size: 0.875rem;
	line-height: 1.35;
	text-align: center;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.rdd-leitura-aviso[hidden] { display: none; }
body.rdd-leitura-barra-on .rdd-leitura-aviso { bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px)); }

@media (prefers-reduced-motion: reduce) {
	.rdd-leitura-barra:not([hidden]), .rdd-leitura-player { animation: none; }
}

@media print {
	.rdd-leitura, .rdd-leitura-barra, .rdd-leitura-player, .rdd-leitura-aviso { display: none !important; }
}
