/**
 * Blocos Gutenberg - Escudo Help (Etapa 07B)
 *
 * FONTE ÚNICA de estilo do conteúdo de artigo, para o FRONT-END e para o EDITOR.
 *
 * Escopo: :is(.article-content, .editor-styles-wrapper)
 *   .article-content          → <div> do conteúdo no artigo publicado
 *   .editor-styles-wrapper    → canvas do editor de blocos
 * Por isso este arquivo é carregado SEM transformação de escopo do editor
 * (inc/blocks.php: enqueue_block_assets, e não add_editor_style) — o mesmo CSS
 * vale nos dois contextos. Nada aqui vaza para Home, header, footer ou
 * páginas de categoria/tópico (só atua dentro do escopo).
 *
 * Usa só tokens (tokens.css) e CSS aninhado nativo (Chrome 120+, Firefox 117+,
 * Safari 17.2+). Escala e uso: docs/gutenberg-design-system.md.
 *
 * Organização:
 *   1. Base e ritmo vertical     2. Títulos          3. Texto inline
 *   4. Listas                    5. Citações, separador
 *   6. Código                    7. Tabela
 *   8. Mídia (imagem, galeria, vídeo, embed, mídia+texto, arquivo)
 *   9. Layout (grupo, colunas, botões, detalhes)
 *  10. Avisos (Nota, Dica, Atenção, Importante)
 *  11. Passo a passo e introdução   12. Alinhamentos e responsivo
 */

/* ---------- 1. Base e ritmo vertical ---------- */

:is(.article-content, .editor-styles-wrapper) {
	color: var(--escudo-text-soft);
	font-size: var(--escudo-prose-size);
	line-height: var(--escudo-prose-leading);
	overflow-wrap: break-word;

	/* Reset de margens: o espaço entre blocos vem só da regra de fluxo abaixo.
	   :where() mantém a especificidade em zero, para não anular o fluxo. */
	& :where(p, h2, h3, h4, h5, h6, ul, ol, blockquote, pre, figure, table, details, hr) {
		margin-block: 0;
	}
}

/* Fluxo: todo bloco irmão posterior ganha a mesma distância (especificidade
   baixa de propósito: títulos e componentes abaixo a sobrescrevem). Vale para a
   raiz do artigo e para contêineres (grupo, coluna, mídia+texto, detalhes);
   no editor, para as listas de blocos (.block-editor-block-list__layout). */
.article-content > * + *,
:is(.article-content, .editor-styles-wrapper) :where(.wp-block-group, .wp-block-column, .wp-block-media-text__content, .wp-block-details, .block-editor-block-list__layout) > * + * {
	margin-top: var(--escudo-prose-gap);
}

.article-content > :first-child {
	margin-top: 0;
}

/* Componentes "grandes" respiram mais (o maior margin entre vizinhos prevalece). */
:is(.article-content, .editor-styles-wrapper) {
	& :is(.wp-block-image, .wp-block-gallery, .wp-block-video, .wp-block-embed, .wp-block-media-text, .wp-block-table, .wp-block-code, .wp-block-preformatted, .wp-block-verse, .wp-block-pullquote, .wp-block-details, .wp-block-file, .wp-block-columns, .wp-block-buttons, .wp-block-group[class*="is-style-escudo-"]) {
		margin-block: var(--escudo-prose-gap-lg);
	}

	/* A 1ª imagem de uma galeria não é bloco "grande" por si. */
	& .wp-block-gallery .wp-block-image {
		margin-block: 0;
	}
}

/* ---------- 2. Títulos ---------- */

:is(.article-content, .editor-styles-wrapper) {
	& :is(h2, h3, h4, h5, h6) {
		color: var(--escudo-text);
		letter-spacing: var(--escudo-tracking-tight);
		scroll-margin-top: var(--article-top, 6.5rem);
		text-wrap: balance;
	}

	/* H1 é do título do artigo; se um H1 aparecer no conteúdo, ele se comporta como H2. */
	& :is(h1, h2) {
		margin-top: var(--escudo-prose-h2-gap);
		font-size: clamp(1.5rem, 1.3rem + 0.9vw, 1.875rem);
		font-weight: var(--escudo-weight-medium);
		line-height: 1.2;
	}

	& h3 {
		margin-top: var(--escudo-prose-h3-gap);
		font-size: clamp(1.1875rem, 1.1rem + 0.45vw, 1.375rem);
		font-weight: var(--escudo-weight-medium);
		line-height: 1.3;
	}

	& h4 {
		margin-top: var(--escudo-prose-h4-gap);
		font-size: 1.0625rem;
		font-weight: var(--escudo-weight-semibold);
		line-height: 1.4;
	}

	& h5 {
		margin-top: var(--escudo-prose-h5-gap);
		color: var(--escudo-text-soft);
		font-size: 0.9375rem;
		font-weight: var(--escudo-weight-semibold);
		line-height: 1.4;
	}

	& h6 {
		margin-top: var(--escudo-prose-h5-gap);
		color: var(--escudo-text-muted);
		font-size: 0.8125rem;
		font-weight: var(--escudo-weight-semibold);
		letter-spacing: 0.08em;
		line-height: 1.4;
		text-transform: uppercase;
	}

	/* O primeiro bloco depois do título fica colado a ele. */
	& :is(h1, h2, h3, h4, h5, h6) + * {
		margin-top: var(--escudo-space-3);
	}
}

/* Título em abertura de contêiner não carrega a margem de seção. */
:is(.article-content, .editor-styles-wrapper) :is(.wp-block-group, .wp-block-column, .wp-block-media-text__content, .block-editor-block-list__layout) > :first-child {
	margin-top: 0;
}

/* ---------- 3. Texto inline ---------- */

:is(.article-content, .editor-styles-wrapper) {
	& strong,
	& b {
		color: var(--escudo-text);
		font-weight: var(--escudo-weight-semibold);
	}

	& a {
		color: var(--escudo-link);
		text-decoration: underline;
		text-decoration-color: rgb(var(--escudo-primary-rgb) / 0.45);
		text-decoration-thickness: 1px;
		text-underline-offset: 3px;
		transition: color var(--escudo-transition-fast), text-decoration-color var(--escudo-transition-fast);
	}

	& a:hover {
		color: var(--escudo-color-primary-hover);
		text-decoration-color: currentcolor;
	}

	& mark {
		padding: 0.05em 0.3em;
		border-radius: 0.25rem;
		background: rgb(var(--escudo-primary-rgb) / 0.28);
		color: var(--escudo-text);
	}

	& :is(code, kbd, samp) {
		padding: 0.125em 0.4em;
		border: 1px solid var(--escudo-border);
		border-radius: 0.375rem;
		background: var(--escudo-surface);
		color: var(--escudo-text);
		font-family: var(--escudo-font-mono);
		font-size: 0.875em;
		overflow-wrap: anywhere;
	}

	& kbd {
		border-bottom-width: 2px;
		border-color: var(--escudo-border-strong);
	}

	& :is(sub, sup) {
		font-size: 0.75em;
		line-height: 0;
	}

	& :is(del, s) {
		color: var(--escudo-text-muted);
	}
}

/* ---------- 4. Listas ---------- */

:is(.article-content, .editor-styles-wrapper) {
	/* Recuo de 1,5rem por nível: a profundidade da lista aparece no recuo. */
	& :is(ul, ol) {
		padding-left: var(--escudo-prose-indent);
	}

	& ul {
		list-style-type: disc;
	}

	& ul ul {
		list-style-type: circle;
	}

	& ul ul ul {
		list-style-type: square;
	}

	& ol {
		list-style-type: decimal;
	}

	& ol ol {
		list-style-type: lower-alpha;
	}

	& ol ol ol {
		list-style-type: lower-roman;
	}

	& li {
		padding-left: var(--escudo-space-1);
	}

	& li + li {
		margin-top: var(--escudo-space-2);
	}

	/* Lista aninhada: respiro menor, recuo próprio. */
	& li > :is(ul, ol) {
		margin-top: var(--escudo-space-2);
	}

	& li::marker {
		color: var(--escudo-text-subtle);
	}

	& ol li::marker {
		font-variant-numeric: tabular-nums;
	}
}

/* ---------- 5. Citações e separador ---------- */

:is(.article-content, .editor-styles-wrapper) {
	& :is(blockquote, .wp-block-quote) {
		margin-inline: 0;
		padding: var(--escudo-space-1) 0 var(--escudo-space-1) var(--escudo-space-5);
		border: 0;
		border-left: 2px solid var(--escudo-border-strong);
		color: var(--escudo-text);
	}

	& :is(blockquote, .wp-block-quote) :is(p) {
		margin: 0;
	}

	& :is(blockquote, .wp-block-quote) p + p {
		margin-top: var(--escudo-space-3);
	}

	& :is(blockquote, .wp-block-quote) :is(cite, .wp-block-quote__citation) {
		display: block;
		margin-top: var(--escudo-space-3);
		color: var(--escudo-text-muted);
		font-size: var(--escudo-text-sm);
		font-style: normal;
	}

	/* Citação em destaque: centrada, leve, só filetes finos (sem moldura grossa). */
	& .wp-block-pullquote {
		padding: var(--escudo-space-6) var(--escudo-space-4);
		border: 0;
		border-block: 1px solid var(--escudo-border-strong);
		color: var(--escudo-text);
		text-align: center;
	}

	& .wp-block-pullquote blockquote {
		margin: 0;
		padding: 0;
		border: 0;
	}

	& .wp-block-pullquote p {
		font-size: clamp(1.25rem, 1.1rem + 0.8vw, 1.625rem);
		font-weight: var(--escudo-weight-light);
		line-height: 1.4;
		letter-spacing: var(--escudo-tracking-tight);
	}

	& .wp-block-pullquote :is(cite, .wp-block-pullquote__citation) {
		display: block;
		margin-top: var(--escudo-space-4);
		color: var(--escudo-text-muted);
		font-size: var(--escudo-text-sm);
		font-style: normal;
		text-transform: none;
	}

	& :is(hr, .wp-block-separator) {
		margin-block: var(--escudo-space-7);
		border: 0;
		border-top: 1px solid var(--escudo-border);
		background: none;
		color: var(--escudo-border);
		opacity: 1;
	}

	/* Estilo "Pontos": três pontos centrados no lugar da linha. */
	& .wp-block-separator.is-style-dots {
		height: auto;
		border: 0;
		line-height: 1;
		text-align: center;
	}

	& .wp-block-separator.is-style-dots::before {
		content: "···";
		color: var(--escudo-text-subtle);
		font-size: 1.5rem;
		letter-spacing: 1em;
		padding-left: 1em;
	}
}

/* ---------- 6. Código ---------- */

:is(.article-content, .editor-styles-wrapper) {
	/* Superfície própria, mono, indentação preservada, linhas LONGAS NÃO QUEBRAM:
	   rolagem horizontal dentro do bloco (nunca na página). */
	& :is(pre:not(.wp-block-verse), .wp-block-code, .wp-block-preformatted) {
		max-width: 100%;
		margin-inline: 0;
		padding: var(--escudo-space-4) var(--escudo-prose-pad);
		overflow-x: auto;
		border: 1px solid var(--escudo-border);
		border-radius: var(--escudo-radius-md);
		background: var(--escudo-surface-sunken);
		box-shadow: var(--escudo-highlight);
		color: var(--escudo-text);
		font-family: var(--escudo-font-mono);
		font-size: 0.875rem;
		line-height: 1.65;
		overflow-wrap: normal;
		word-break: normal;
		white-space: pre;
		tab-size: 2;
		-moz-tab-size: 2;
		scrollbar-width: thin;
		scrollbar-color: var(--escudo-border-strong) transparent;
	}

	& pre:not(.wp-block-verse) code {
		display: block;
		padding: 0;
		border: 0;
		background: none;
		color: inherit;
		font-size: inherit;
		line-height: inherit;
		white-space: inherit;
		overflow-wrap: normal;
		word-break: normal;
	}

	/* Poesia/verso: texto corrido, com quebras preservadas. */
	& .wp-block-verse {
		padding: var(--escudo-space-1) 0 var(--escudo-space-1) var(--escudo-space-5);
		border: 0;
		border-left: 2px solid var(--escudo-border-strong);
		background: none;
		color: var(--escudo-text);
		font-family: inherit;
		font-size: inherit;
		white-space: pre-wrap;
	}
}

/* ---------- 7. Tabela ---------- */

:is(.article-content, .editor-styles-wrapper) {
	/* A rolagem horizontal fica no bloco; a tabela mantém uma largura mínima legível. */
	& .wp-block-table {
		max-width: 100%;
		overflow-x: auto;
		scrollbar-width: thin;
		scrollbar-color: var(--escudo-border-strong) transparent;
	}

	& .wp-block-table table {
		width: max-content;
		min-width: 100%;
		border-collapse: collapse;
		table-layout: auto;
		font-size: 0.9375rem;
		line-height: 1.5;
	}

	& .wp-block-table :is(th, td) {
		padding: var(--escudo-space-3) var(--escudo-space-4);
		border: 0;
		border-bottom: 1px solid var(--escudo-border);
		text-align: left;
		vertical-align: top;
	}

	& .wp-block-table thead {
		border-bottom: 0;
	}

	/* Célula não passa de 24rem (texto longo quebra); colunas curtas não encolhem demais. */
	& .wp-block-table :is(th, td) {
		min-width: 5rem;
		max-width: 24rem;
	}

	& .wp-block-table thead th {
		border-bottom-color: var(--escudo-border-strong);
		background: var(--escudo-surface);
		color: var(--escudo-text);
		font-weight: var(--escudo-weight-semibold);
		white-space: nowrap;
	}

	& .wp-block-table tbody th {
		color: var(--escudo-text);
		font-weight: var(--escudo-weight-medium);
	}

	& .wp-block-table tfoot {
		border-top: 0;
	}

	& .wp-block-table tfoot td {
		color: var(--escudo-text-muted);
	}

	/* Estilo "Listras" (core). */
	& .wp-block-table.is-style-stripes {
		border: 0;
	}

	& .wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
		background: var(--escudo-glass-bg);
	}

	& .wp-block-table figcaption {
		position: sticky;
		left: 0;
	}
}

/* ---------- 8. Mídia ---------- */

:is(.article-content, .editor-styles-wrapper) {
	& figure {
		margin-inline: 0;
	}

	& :is(img, video, iframe, svg, canvas) {
		max-width: 100%;
	}

	& :is(img, video) {
		height: auto;
	}

	& figcaption,
	& .wp-element-caption {
		margin-top: var(--escudo-space-2);
		color: var(--escudo-text-subtle);
		font-size: var(--escudo-text-sm);
		line-height: 1.5;
		text-align: left;
	}

	/* Imagem: borda fina e radius como os cards. */
	& .wp-block-image img {
		display: block;
		border: 1px solid var(--escudo-border);
		border-radius: var(--escudo-radius-md);
	}

	& .wp-block-image.is-style-rounded img {
		border-radius: 9999px;
	}

	/* Galeria: grade de imagens, cada uma com o mesmo acabamento. */
	& .wp-block-gallery {
		gap: var(--escudo-space-4);
	}

	& .wp-block-gallery.has-nested-images figure.wp-block-image img {
		border-radius: var(--escudo-radius-md);
	}

	& .wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
		color: var(--escudo-text);
		font-size: var(--escudo-text-xs);
	}

	/* Vídeo e embed: moldura de superfície, proporção preservada. */
	& .wp-block-video video {
		display: block;
		width: 100%;
		border: 1px solid var(--escudo-border);
		border-radius: var(--escudo-radius-md);
		background: #000;
	}

	& .wp-block-embed .wp-block-embed__wrapper {
		overflow: hidden;
		border: 1px solid var(--escudo-border);
		border-radius: var(--escudo-radius-md);
		background: var(--escudo-surface-sunken);
	}

	& .wp-block-embed iframe {
		display: block;
		width: 100%;
		border: 0;
	}

	/* Responsivo do core (wp-embed-aspect-*): o wrapper mantém a proporção. */
	& .wp-has-aspect-ratio .wp-block-embed__wrapper {
		position: relative;
	}

	& .wp-has-aspect-ratio .wp-block-embed__wrapper iframe {
		position: absolute;
		inset: 0;
		height: 100%;
	}

	/* Mídia e texto: cartão com imagem de um lado e texto do outro. */
	& .wp-block-media-text {
		overflow: hidden;
		border: 1px solid var(--escudo-border);
		border-radius: var(--escudo-radius-md);
		background: var(--escudo-surface);
		box-shadow: var(--escudo-highlight);
	}

	& .wp-block-media-text__content {
		padding: var(--escudo-prose-pad) var(--escudo-space-5);
	}

	& .wp-block-media-text__media img,
	& .wp-block-media-text__media video {
		border: 0;
		border-radius: 0;
	}

	/* Arquivo para download: linha com nome + botão. */
	& .wp-block-file {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
		gap: var(--escudo-space-3) var(--escudo-space-4);
		padding: var(--escudo-space-4) var(--escudo-prose-pad);
		border: 1px solid var(--escudo-border);
		border-radius: var(--escudo-radius-md);
		background: var(--escudo-surface);
		box-shadow: var(--escudo-highlight);
		font-size: 0.9375rem;
	}

	& .wp-block-file > a:not(.wp-block-file__button) {
		min-width: 0;
		color: var(--escudo-text);
		font-weight: var(--escudo-weight-medium);
		overflow-wrap: anywhere;
		text-decoration-color: var(--escudo-border-strong);
	}

	& .wp-block-file .wp-block-file__button {
		display: inline-flex;
		align-items: center;
		min-height: 2.75rem;
		margin: 0;
		padding: 0 var(--escudo-space-5);
		border: 1px solid var(--escudo-glass-border);
		border-radius: var(--escudo-radius-pill);
		background: var(--escudo-glass-bg);
		color: var(--escudo-text);
		font-size: var(--escudo-text-sm);
		font-weight: var(--escudo-weight-medium);
		text-decoration: none;
		transition: background-color var(--escudo-transition-fast), border-color var(--escudo-transition-fast);
	}

	& .wp-block-file .wp-block-file__button:hover {
		border-color: var(--escudo-border-strong);
		background: var(--escudo-glass-bg-hover);
		color: var(--escudo-text);
	}

	& .wp-block-audio audio {
		display: block;
		width: 100%;
	}
}

/* ---------- 9. Layout ---------- */

:is(.article-content, .editor-styles-wrapper) {
	/* Colunas: alinhadas pelo topo, espaço consistente; empilham abaixo de 782px (core). */
	& .wp-block-columns {
		align-items: flex-start;
		gap: var(--escudo-space-5) var(--escudo-space-6);
	}

	& .wp-block-column {
		min-width: 0;
	}

	/* Botões: pílula (mesmo padrão dos botões da Home), sem sublinhado. */
	& .wp-block-buttons {
		display: flex;
		flex-wrap: wrap;
		gap: var(--escudo-space-3);
	}

	& .wp-block-button__link,
	& .wp-block-button .wp-block-button__link {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-height: 2.75rem;
		padding: 0 var(--escudo-space-5);
		border: 1px solid transparent;
		border-radius: var(--escudo-radius-pill);
		background: var(--escudo-color-primary);
		color: var(--escudo-text-inverse);
		font-size: 0.9375rem;
		font-weight: var(--escudo-weight-semibold);
		line-height: 1.2;
		text-align: center;
		text-decoration: none;
		transition: filter var(--escudo-transition-base), box-shadow var(--escudo-transition-base), background-color var(--escudo-transition-fast), border-color var(--escudo-transition-fast);
	}

	& .wp-block-button__link:hover {
		color: var(--escudo-text-inverse);
		filter: brightness(1.08);
		box-shadow: var(--escudo-shadow-cta);
	}

	& .wp-block-button.is-style-outline .wp-block-button__link {
		border-color: var(--escudo-border-strong);
		background: transparent;
		color: var(--escudo-text);
	}

	& .wp-block-button.is-style-outline .wp-block-button__link:hover {
		background: var(--escudo-glass-bg-hover);
		box-shadow: none;
		filter: none;
	}

	/* Detalhes expansíveis: cartão com cabeçalho clicável e seta. */
	& .wp-block-details {
		padding: 0;
		overflow: hidden;
		border: 1px solid var(--escudo-border);
		border-radius: var(--escudo-radius-md);
		background: var(--escudo-surface);
		box-shadow: var(--escudo-highlight);
	}

	& .wp-block-details > summary {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: var(--escudo-space-4);
		min-height: 3rem;
		padding: var(--escudo-space-3) var(--escudo-prose-pad);
		color: var(--escudo-text);
		font-weight: var(--escudo-weight-medium);
		list-style: none;
		cursor: pointer;
		transition: background-color var(--escudo-transition-fast);
	}

	& .wp-block-details > summary::-webkit-details-marker {
		display: none;
	}

	& .wp-block-details > summary::after {
		content: "";
		flex-shrink: 0;
		width: 1.125rem;
		height: 1.125rem;
		background-color: var(--escudo-text-subtle);
		-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
		mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
		transition: transform var(--escudo-transition-base);
	}

	& .wp-block-details > summary:hover {
		background: var(--escudo-glass-bg);
	}

	& .wp-block-details[open] > summary::after {
		transform: rotate(180deg);
	}

	& .wp-block-details[open] > summary {
		border-bottom: 1px solid var(--escudo-border);
	}

	& .wp-block-details > :not(summary) {
		margin-inline: var(--escudo-prose-pad);
	}

	& .wp-block-details > :nth-child(2) {
		margin-top: var(--escudo-space-4);
	}

	& .wp-block-details > :last-child:not(summary) {
		margin-bottom: var(--escudo-prose-pad);
	}

	& .wp-block-spacer {
		margin-block: 0;
	}
}

/* ---------- 10. Avisos: Nota, Dica, Atenção, Importante ----------
 * Estilos de bloco do Grupo (register_block_style em inc/blocks.php):
 *   is-style-escudo-nota | -dica | -atencao | -importante
 * O RÓTULO é texto de verdade: o 1º parágrafo com a classe .escudo-callout__label
 * (inserido pelos padrões de bloco). Se o autor aplicar só o estilo a um Grupo
 * sem rótulo, o CSS gera o rótulo (ícone + palavra) — o significado nunca fica
 * só na cor. O ícone é decorativo. */

:is(.article-content, .editor-styles-wrapper) {
	& .wp-block-group.is-style-escudo-nota {
		--callout-rgb: var(--escudo-tone-note-rgb);
		--callout-tone: var(--escudo-tone-note);
		--callout-label: "Nota";
		--callout-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a7b3c7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 8h.01'/%3E%3C/svg%3E");
	}

	& .wp-block-group.is-style-escudo-dica {
		--callout-rgb: var(--escudo-tone-tip-rgb);
		--callout-tone: var(--escudo-tone-tip);
		--callout-label: "Dica";
		--callout-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235ec9a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 21h4M12 3a6 6 0 0 0-3.9 10.6c.6.6.9 1.4.9 2.4h6c0-1 .3-1.8.9-2.4A6 6 0 0 0 12 3z'/%3E%3C/svg%3E");
	}

	& .wp-block-group.is-style-escudo-atencao {
		--callout-rgb: var(--escudo-tone-warning-rgb);
		--callout-tone: var(--escudo-tone-warning);
		--callout-label: "Atenção";
		--callout-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f0b64a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 2.5 20h19L12 3zM12 10v4M12 17h.01'/%3E%3C/svg%3E");
	}

	& .wp-block-group.is-style-escudo-importante {
		--callout-rgb: var(--escudo-tone-important-rgb);
		--callout-tone: var(--escudo-tone-important);
		--callout-label: "Importante";
		--callout-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff5c9d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 21V4M5 4h11l-2 4 2 4H5'/%3E%3C/svg%3E");
	}

	& .wp-block-group[class*="is-style-escudo-"] {
		padding: var(--escudo-space-4) var(--escudo-prose-pad) var(--escudo-prose-pad);
		border: 1px solid rgb(var(--callout-rgb) / 0.3);
		border-radius: var(--escudo-radius-md);
		background: rgb(var(--callout-rgb) / 0.06);
		box-shadow: inset 3px 0 0 var(--callout-tone);
	}

	/* Rótulo real (parágrafo do padrão) e rótulo gerado: mesma aparência. */
	& .wp-block-group[class*="is-style-escudo-"] > .escudo-callout__label,
	& .wp-block-group[class*="is-style-escudo-"]:not(:has(> .escudo-callout__label))::before {
		display: flex;
		align-items: center;
		gap: var(--escudo-space-2);
		margin: 0 0 var(--escudo-space-2);
		color: var(--callout-tone);
		font-size: 0.8125rem;
		font-weight: var(--escudo-weight-semibold);
		letter-spacing: 0.08em;
		line-height: 1.4;
		text-transform: uppercase;
	}

	& .wp-block-group[class*="is-style-escudo-"] > .escudo-callout__label::before,
	& .wp-block-group[class*="is-style-escudo-"]:not(:has(> .escudo-callout__label))::before {
		flex-shrink: 0;
		width: 1.125rem;
		height: 1.125rem;
		background: var(--callout-icon) center / contain no-repeat;
		content: "";
	}

	/* Rótulo gerado: ícone (via ::before) + palavra. O texto vem de --callout-label. */
	& .wp-block-group[class*="is-style-escudo-"]:not(:has(> .escudo-callout__label))::before {
		content: var(--callout-label);
		width: auto;
		height: auto;
		padding-left: 1.625rem;
		background: var(--callout-icon) left center / 1.125rem no-repeat;
	}

	/* Conteúdo do aviso: texto na cor de leitura; recuos de lista menores. */
	& .wp-block-group[class*="is-style-escudo-"] > :not(.escudo-callout__label) {
		color: var(--escudo-text-soft);
	}

	& .wp-block-group[class*="is-style-escudo-"] > * + * {
		margin-top: var(--escudo-space-3);
	}

	& .wp-block-group[class*="is-style-escudo-"] > :last-child {
		margin-bottom: 0;
	}
}

/* ---------- 11. Passo a passo e introdução ---------- */

:is(.article-content, .editor-styles-wrapper) {
	/* Lista numerada vira procedimento: número em círculo + linha-guia. */
	& :is(ol.is-style-escudo-passos, .wp-block-list.is-style-escudo-passos) {
		padding-left: 0;
		list-style: none;
		counter-reset: escudo-passo;
	}

	& .is-style-escudo-passos > li {
		position: relative;
		min-height: 2rem;
		margin-top: 0;
		padding: 0.25rem 0 var(--escudo-space-6) 3rem;
		counter-increment: escudo-passo;
	}

	& .is-style-escudo-passos > li::before {
		content: counter(escudo-passo);
		position: absolute;
		top: 0;
		left: 0;
		display: grid;
		place-items: center;
		width: 2rem;
		height: 2rem;
		border: 1px solid var(--escudo-border-strong);
		border-radius: 50%;
		background: var(--escudo-surface);
		color: var(--escudo-text);
		font-size: 0.875rem;
		font-weight: var(--escudo-weight-semibold);
		font-variant-numeric: tabular-nums;
		line-height: 1;
	}

	& .is-style-escudo-passos > li:not(:last-child)::after {
		content: "";
		position: absolute;
		top: 2.25rem;
		bottom: 0.25rem;
		left: 1rem;
		width: 1px;
		background: var(--escudo-border);
	}

	& .is-style-escudo-passos > li:last-child {
		padding-bottom: 0;
	}

	& .is-style-escudo-passos > li > :is(ul, ol) {
		margin-top: var(--escudo-space-3);
	}

	/* Introdução: parágrafo maior, para abrir o artigo. */
	& p.is-style-escudo-introducao {
		color: var(--escudo-text);
		font-size: 1.375rem;
		font-weight: var(--escudo-weight-light);
		line-height: 1.55;
		letter-spacing: -0.01em;
	}
}

/* ---------- 12. Alinhamentos e responsivo ---------- */

:is(.article-content, .editor-styles-wrapper) {
	/* Largo/cheio ficam contidos na coluna de leitura (sem estourar o layout). */
	& :is(.alignwide, .alignfull) {
		width: 100%;
		max-width: 100%;
		margin-inline: 0;
	}

	& .aligncenter {
		margin-inline: auto;
	}
}

.article-content {
	display: flow-root; /* contém imagens com float */
}

@media (min-width: 640px) {
	:is(.article-content, .editor-styles-wrapper) {
		& .alignleft {
			float: left;
			max-width: 45%;
			margin: var(--escudo-space-1) var(--escudo-space-5) var(--escudo-space-3) 0;
		}

		& .alignright {
			float: right;
			max-width: 45%;
			margin: var(--escudo-space-1) 0 var(--escudo-space-3) var(--escudo-space-5);
		}
	}
}

@media (max-width: 639.98px) {
	:is(.article-content, .editor-styles-wrapper) {
		font-size: 1.0625rem;

		& :is(.alignleft, .alignright) {
			float: none;
			margin-inline: 0;
		}

		& .wp-block-file {
			align-items: flex-start;
		}

		& .wp-block-pullquote {
			padding-inline: 0;
		}
	}
}

@media (prefers-reduced-motion: reduce) {
	:is(.article-content, .editor-styles-wrapper) .wp-block-details > summary::after {
		transition: none;
	}
}
