/*
Theme Name: Nekohito Roteiro
Theme URI: https://nekohito.org/
Author: Nekohito
Description: A storyboard pad for Nekohito: white pages, thick black ink frames with rounded corners, lime marker fills and speech bubbles.
Version: 1.0.2
Requires at least: 6.6
Requires PHP: 8.2
License: GNU General Public License v2 or later
Text Domain: nekohito-roteiro
*/

/* Fonts ship inside the theme (SIL Open Font License, see assets/fonts). */
@font-face {
	font-family: "Shantell Sans";
	src: url("assets/fonts/shantell-sans.woff2") format("woff2");
	font-weight: 400 800;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Lexend";
	src: url("assets/fonts/lexend.woff2") format("woff2");
	font-weight: 300 700;
	font-style: normal;
	font-display: swap;
}

:root {
	--tinta: #000000;
	--papel: #ffffff;
	--marcador: #8cc63f;
	--cinza: #cfc8c0;
	--tinta-suave: #4d4843;
	--quadro-claro: #f1f8e6;
	--traco: 3.5px;
	--traco-fino: 2.5px;
	--canto: 18px;
	--sarjeta: 16px;
	--mao: "Shantell Sans", "Comic Neue", "Segoe Print", sans-serif;
	--texto: "Lexend", "Segoe UI", system-ui, sans-serif;
	--medida: 35rem;
	--largo: 54rem;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--papel);
	color: var(--tinta);
	font-family: var(--texto);
	font-size: 1.125rem;
	line-height: 1.65;
	font-weight: 400;
	overflow-wrap: break-word;
}

img,
svg {
	max-width: 100%;
	height: auto;
}

h1,
h2,
h3,
h4 {
	font-family: var(--mao);
	font-weight: 700;
	font-variation-settings: "INFM" 60;
	line-height: 1.15;
	margin: 0 0 0.5em;
	text-wrap: balance;
}

h1 {
	font-size: clamp(2.1rem, 1.4rem + 3vw, 3.4rem);
	font-weight: 800;
}

h2 {
	font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.15rem);
}

h3 {
	font-size: 1.4rem;
}

p {
	margin: 0 0 1.1em;
}

a {
	color: var(--tinta);
	text-decoration-line: underline;
	text-decoration-color: var(--marcador);
	text-decoration-thickness: 0.32em;
	text-underline-offset: -0.12em;
	text-decoration-skip-ink: none;
}

a:hover {
	background: var(--marcador);
	text-decoration-color: var(--tinta);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.15em;
}

:focus-visible {
	outline: 3px solid var(--tinta);
	outline-offset: 3px;
	box-shadow: 0 0 0 7px var(--marcador);
	border-radius: 6px;
}

.pular {
	position: absolute;
	left: 1rem;
	top: -4rem;
	z-index: 30;
	padding: 0.5rem 1rem;
	background: var(--marcador);
	border: var(--traco-fino) solid var(--tinta);
	border-radius: 999px;
	font-family: var(--mao);
	font-weight: 700;
}

.pular:focus {
	top: 1rem;
}

.prancha {
	width: min(100% - 2rem, 74rem);
	margin-inline: auto;
}

/* ── Header: a comic frame with the menu as speech bubbles ── */

.cabecalho {
	margin-top: 1.1rem;
	border: var(--traco) solid var(--tinta);
	border-radius: 22px 20px 24px 19px;
	padding: 0.75rem 1.1rem 0.95rem;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.8rem 1.5rem;
	background: var(--papel);
}

.marca {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	text-decoration: none;
	color: var(--tinta);
}

.marca:hover {
	background: none;
}

.marca img {
	width: 3rem;
	height: 3rem;
	display: block;
}

.marca span {
	font-family: var(--mao);
	font-weight: 800;
	font-variation-settings: "INFM" 70;
	font-size: 1.9rem;
	line-height: 1;
	letter-spacing: -0.01em;
	padding-bottom: 0.2rem;
}

.baloes ul,
ul.baloes {
	list-style: none;
	margin: 0;
	padding: 0 0 0.6rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.9rem 0.8rem;
}

.baloes a {
	--fundo: var(--papel);
	position: relative;
	display: inline-block;
	padding: 0.3rem 0.95rem 0.35rem;
	border: var(--traco-fino) solid var(--tinta);
	border-radius: 16px;
	background: var(--fundo);
	font-family: var(--mao);
	font-weight: 700;
	font-size: 1rem;
	line-height: 1.3;
	text-decoration: none;
}

.baloes a::before,
.baloes a::after {
	content: "";
	position: absolute;
	clip-path: polygon(0 0, 100% 0, 0 100%);
}

.baloes a::before {
	left: 13px;
	bottom: -11px;
	width: 15px;
	height: 13px;
	background: var(--tinta);
}

.baloes a::after {
	left: 15.5px;
	bottom: -6.5px;
	width: 9px;
	height: 8.5px;
	background: var(--fundo);
}

.baloes a:hover {
	--fundo: var(--quadro-claro);
	text-decoration: none;
}

.baloes .current-menu-item > a,
.baloes .current-menu-ancestor > a,
.baloes .current-post-ancestor > a,
.baloes .current-category-ancestor > a,
.baloes .current-menu-parent > a {
	--fundo: var(--marcador);
}

/* ── Frames, captions and the storyboard notes under each panel ── */

.quadro {
	border: var(--traco) solid var(--tinta);
	border-radius: var(--canto);
	background: var(--papel);
	overflow: hidden;
}

.quadro img {
	display: block;
	width: 100%;
	height: auto;
}

.notas {
	display: flex;
	gap: 0.6rem;
	align-items: flex-start;
	margin-top: 0.55rem;
	padding: 0.1rem 0.2rem 0.35rem;
	font-size: 0.95rem;
	line-height: 1.6;
	color: var(--tinta);
	background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(1.52rem - 1.5px), var(--cinza) calc(1.52rem - 1.5px), var(--cinza) 1.52rem);
	background-position: 0 0.1rem;
}

.numero {
	flex: none;
	display: inline-grid;
	place-items: center;
	min-width: 1.9rem;
	height: 1.9rem;
	padding: 0 0.35rem;
	border: var(--traco-fino) solid var(--tinta);
	border-radius: 9px;
	background: var(--marcador);
	font-family: var(--mao);
	font-weight: 800;
	font-size: 1rem;
	line-height: 1;
}

/* ── Home ── */

.abertura {
	padding: clamp(2.2rem, 5vw, 4rem) 0 1.6rem;
	display: grid;
	gap: 0.6rem;
}

.abertura h1 {
	font-size: clamp(2.5rem, 1.5rem + 4.6vw, 5rem);
	line-height: 1.02;
	max-width: 14ch;
	margin: 0;
	font-variation-settings: "INFM" 80;
}

.abertura p {
	max-width: 36rem;
	font-size: 1.2rem;
	margin: 0.6rem 0 0;
}

.tira {
	list-style: none;
	margin: 1.6rem 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--sarjeta);
}

.tira li {
	margin: 0;
}

.tira .quadro {
	aspect-ratio: 4 / 3;
	background: var(--papel);
}

.tira .quadro img {
	height: 100%;
	object-fit: contain;
}

@media (prefers-reduced-motion: no-preference) {
	.tira li {
		animation: entra-quadro 420ms cubic-bezier(0.2, 0.8, 0.3, 1) both;
	}
	.tira li:nth-child(2) {
		animation-delay: 260ms;
	}
	.tira li:nth-child(3) {
		animation-delay: 520ms;
	}
}

@keyframes entra-quadro {
	from {
		opacity: 0;
		transform: translateY(10px) rotate(-0.6deg);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.secao-titulo {
	margin: clamp(3rem, 6vw, 4.5rem) 0 1.2rem;
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}

.secao-titulo h2 {
	margin: 0;
}

.paginas {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: var(--sarjeta);
	align-items: stretch;
}

.painel {
	grid-column: span 2;
	margin: 0;
	display: flex;
	flex-direction: column;
}

.painel .quadro {
	flex: 1 1 auto;
}

.painel--destaque {
	grid-column: span 4;
	grid-row: span 2;
}

.painel .quadro {
	display: block;
	text-decoration: none;
	color: var(--tinta);
}

.painel .quadro:hover {
	background: var(--quadro-claro);
}

.painel--destaque .quadro img {
	aspect-ratio: 16 / 10;
	object-fit: cover;
	border-bottom: var(--traco) solid var(--tinta);
}

.painel .conteudo {
	padding: 1rem 1.2rem 1.25rem;
}

.painel h3 {
	font-size: 1.35rem;
	margin: 0 0 0.35rem;
}

.painel--destaque h3 {
	font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem);
}

.painel p {
	margin: 0;
	font-size: 1rem;
}

.painel--cinza .quadro {
	background: var(--quadro-claro);
}

.painel--cinza .quadro:hover {
	background: var(--papel);
}

.painel .icone {
	display: block;
	width: 4.5rem;
	margin: 1.1rem 1.2rem 0;
}

.texto-casa {
	margin-top: clamp(3rem, 6vw, 4.5rem);
}

/* ── Reading column ── */

.corpo {
	max-width: var(--largo);
	margin-inline: auto;
	display: grid;
	grid-template-columns:
		[largo-start] minmax(0, 1fr)
		[texto-start] minmax(0, var(--medida))
		[texto-end] minmax(0, 1fr)
		[largo-end];
}

.corpo > * {
	grid-column: texto;
	min-width: 0;
}

.corpo > h2 {
	margin-top: 2.2em;
	padding-top: 0.2em;
}

.corpo > h3 {
	margin-top: 1.6em;
}

.corpo ul {
	padding-left: 1.3rem;
	margin: 0 0 1.2em;
}

.corpo ul li {
	margin-bottom: 0.4em;
	padding-left: 0.2rem;
}

.corpo ul li::marker {
	content: "■ ";
	color: var(--marcador);
	font-size: 0.9em;
}

.corpo strong {
	font-weight: 600;
}

/* Steps: numbered storyboard panels in a row that wraps (articles); on other pages
   the same panels stack in the reading column */
.pagina .corpo > ol {
	grid-column: texto;
	grid-template-columns: minmax(0, 1fr);
}

.corpo > ol {
	grid-column: largo;
	list-style: none;
	counter-reset: cena;
	margin: 1.4rem 0 2rem;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
	gap: var(--sarjeta);
}

.corpo > ol > li {
	counter-increment: cena;
	position: relative;
	margin: 0;
	padding: 2.9rem 1rem 1rem;
	border: var(--traco) solid var(--tinta);
	border-radius: var(--canto);
	background: var(--papel);
	font-size: 1rem;
	line-height: 1.55;
}

.corpo > ol > li::before {
	content: counter(cena);
	position: absolute;
	top: -1px;
	left: -1px;
	display: grid;
	place-items: center;
	width: 2.4rem;
	height: 2.4rem;
	background: var(--marcador);
	border-right: var(--traco) solid var(--tinta);
	border-bottom: var(--traco) solid var(--tinta);
	border-radius: 14px 0 14px 0;
	font-family: var(--mao);
	font-weight: 800;
	font-size: 1.15rem;
}

.corpo > ol > li:nth-child(even) {
	background: var(--quadro-claro);
}

.corpo > ol > li > strong:first-child {
	display: block;
	font-family: var(--mao);
	font-weight: 700;
	font-size: 1.15rem;
	line-height: 1.25;
	margin-bottom: 0.3rem;
}

/* Figures: a panel in black ink, the caption on the storyboard's ruled lines */
.corpo figure {
	grid-column: largo;
	margin: 2rem 0 2.2rem;
}

.corpo figure > img,
.corpo figure > svg {
	display: block;
	width: 100%;
	border: var(--traco) solid var(--tinta);
	border-radius: var(--canto);
	background: var(--papel);
}

.corpo figcaption {
	margin-top: 0.6rem;
	padding: 0 0.2rem 0.3rem;
	font-size: 0.95rem;
	line-height: 1.6;
	color: var(--tinta-suave);
	background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(1.52rem - 1.5px), var(--cinza) calc(1.52rem - 1.5px), var(--cinza) 1.52rem);
}

.corpo figcaption strong {
	color: var(--tinta);
}

/* Tables: a framed panel with a lime marker header */
.rolagem {
	grid-column: largo;
	margin: 1.8rem 0 2.2rem;
	overflow-x: auto;
	container-type: inline-size;
	border: var(--traco) solid var(--tinta);
	border-radius: var(--canto);
	background: var(--papel);
}

.corpo table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.98rem;
	line-height: 1.5;
	min-width: 32rem;
}

/* On a phone the table scrolls under its caption, which stays in view and wraps */
.corpo caption {
	caption-side: top;
	position: sticky;
	left: 0;
	box-sizing: border-box;
	max-width: 100cqi;
	text-align: left;
	padding: 0.8rem 1rem 0.7rem;
	font-family: var(--mao);
	font-weight: 700;
	font-size: 1.1rem;
	border-bottom: var(--traco) solid var(--tinta);
	background: var(--quadro-claro);
}

.corpo th,
.corpo td {
	text-align: left;
	vertical-align: top;
	padding: 0.65rem 1rem;
	border-bottom: 1.5px solid var(--cinza);
}

.corpo thead th {
	background: var(--marcador);
	font-family: var(--mao);
	font-weight: 700;
	border-bottom: var(--traco-fino) solid var(--tinta);
}

.corpo tbody th {
	font-weight: 600;
}

.corpo tbody tr:last-child > * {
	border-bottom: 0;
}

/* Asides: speech bubbles */
.corpo aside {
	position: relative;
	margin: 1.6rem 0 2.6rem;
	padding: 1.1rem 1.3rem 0.4rem;
	border: var(--traco) solid var(--tinta);
	border-radius: 26px;
	background: var(--quadro-claro);
}

.corpo aside::before,
.corpo aside::after {
	content: "";
	position: absolute;
	clip-path: polygon(0 0, 100% 0, 0 100%);
}

.corpo aside::before {
	left: 2.2rem;
	bottom: -22px;
	width: 30px;
	height: 25px;
	background: var(--tinta);
}

.corpo aside::after {
	left: calc(2.2rem + 3.6px);
	bottom: -14px;
	width: 19px;
	height: 17.5px;
	background: var(--quadro-claro);
}

.corpo aside > p:first-child strong:first-child {
	font-family: var(--mao);
	font-weight: 700;
	font-size: 1.12em;
}

/* Takeaways and cited statements: thought bubbles */
.corpo blockquote {
	position: relative;
	margin: 1.8rem 0 3rem;
	padding: 1.3rem 1.6rem 0.5rem;
	border: var(--traco) solid var(--tinta);
	border-radius: 48px;
	background: var(--papel);
	font-family: var(--mao);
	font-weight: 600;
	font-size: 1.2rem;
	line-height: 1.45;
}

.corpo blockquote::before,
.corpo blockquote::after {
	content: "";
	position: absolute;
	border: var(--traco) solid var(--tinta);
	border-radius: 50%;
	background: var(--marcador);
}

.corpo blockquote::before {
	right: 3.2rem;
	bottom: -1.35rem;
	width: 1.15rem;
	height: 1.15rem;
}

.corpo blockquote::after {
	right: 2.2rem;
	bottom: -2.25rem;
	width: 0.7rem;
	height: 0.7rem;
}

.corpo blockquote cite,
.corpo blockquote footer {
	display: block;
	font-family: var(--texto);
	font-weight: 400;
	font-style: normal;
	font-size: 0.9rem;
	color: var(--tinta-suave);
	margin: -0.4rem 0 0.8rem;
}

/* Questions and answers: a short dialogue of bubbles */
.corpo details {
	margin: 0 0 0.9rem;
}

.corpo summary {
	position: relative;
	cursor: pointer;
	list-style: none;
	padding: 0.6rem 1rem 0.6rem 3rem;
	border: var(--traco-fino) solid var(--tinta);
	border-radius: 20px;
	background: var(--papel);
	font-family: var(--mao);
	font-weight: 700;
	font-size: 1.08rem;
	line-height: 1.35;
}

.corpo summary::-webkit-details-marker {
	display: none;
}

.corpo summary::before {
	content: "+";
	position: absolute;
	left: 0.7rem;
	top: 50%;
	translate: 0 -50%;
	display: grid;
	place-items: center;
	width: 1.6rem;
	height: 1.6rem;
	border: var(--traco-fino) solid var(--tinta);
	border-radius: 50%;
	background: var(--marcador);
	font-size: 1.1rem;
	line-height: 1;
}

.corpo details[open] > summary {
	background: var(--quadro-claro);
}

.corpo details[open] > summary::before {
	content: "–";
}

.corpo details > :not(summary) {
	margin: 0.7rem 0 0.4rem 2.2rem;
}

.corpo details > p,
.corpo details > div {
	padding: 0.8rem 1.1rem;
	border: var(--traco-fino) solid var(--tinta);
	border-radius: 20px 20px 20px 6px;
	background: var(--papel);
	font-size: 1rem;
}

/* Terms */
.corpo dl {
	margin: 1.2rem 0 1.8rem;
	padding: 0;
}

.corpo dt {
	font-family: var(--mao);
	font-weight: 700;
	font-size: 1.1rem;
	margin-top: 0.9rem;
}

.corpo dt::after {
	content: "";
	display: block;
	width: 3.2rem;
	height: 0.32rem;
	margin-top: 0.15rem;
	background: var(--marcador);
	border-radius: 4px;
}

.corpo dd {
	margin: 0.35rem 0 0;
	padding-left: 0.9rem;
	border-left: var(--traco-fino) solid var(--cinza);
}

.corpo hr {
	border: 0;
	height: var(--traco);
	background: var(--tinta);
	border-radius: 4px;
	margin: 2.5rem 0;
}

/* ── Ad slots: plain, labelled frames set apart from the panels ── */

.quadrinho {
	margin: 2.4rem 0;
	padding: 0.55rem 0.8rem 0.8rem;
	border: 2px solid var(--cinza);
	border-radius: 10px;
	background: var(--papel);
	text-align: center;
}

.corpo > .quadrinho {
	grid-column: texto;
}

/* The slot a page adds after its last panel keeps to the page's width */
body > .quadrinho {
	box-sizing: border-box;
	width: min(100% - 2rem, 74rem);
	margin: 0 auto 2.4rem;
}

.balao {
	display: block;
	margin: 0 0 0.45rem;
	text-align: left;
	font-family: var(--texto);
	font-size: 0.8rem;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: 0.01em;
	color: var(--tinta-suave);
}

.quadrinho iframe {
	display: block;
	margin: 0 auto;
	border: 0;
	max-width: 100%;
}

/* ── Article ── */

.cena-abertura {
	margin-top: clamp(1.4rem, 3vw, 2.2rem);
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
	gap: 0;
	border: var(--traco) solid var(--tinta);
	border-radius: 26px 22px 28px 22px;
	overflow: hidden;
	background: var(--quadro-claro);
}

.cena-abertura .texto {
	padding: clamp(1.4rem, 3vw, 2.4rem);
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
}

.cena-abertura h1 {
	margin: 0;
	font-size: clamp(2rem, 1.3rem + 2.6vw, 3.2rem);
	line-height: 1.08;
}

.cena-abertura .resumo {
	margin: 0;
	font-size: 1.15rem;
	max-width: 32rem;
}

.cena-abertura .desenho {
	border-left: var(--traco) solid var(--tinta);
	background: var(--papel);
	display: grid;
	place-items: center;
}

.cena-abertura .desenho img {
	display: block;
	width: 100%;
	height: auto;
}

.nicho {
	align-self: flex-start;
	position: relative;
	display: inline-block;
	padding: 0.2rem 0.85rem 0.25rem;
	border: var(--traco-fino) solid var(--tinta);
	border-radius: 14px;
	background: var(--marcador);
	font-family: var(--mao);
	font-weight: 700;
	font-size: 0.95rem;
	text-decoration: none;
	margin-bottom: 0.4rem;
}

.nicho::before,
.nicho::after {
	content: "";
	position: absolute;
	clip-path: polygon(0 0, 100% 0, 0 100%);
}

.nicho::before {
	left: 12px;
	bottom: -11px;
	width: 14px;
	height: 13px;
	background: var(--tinta);
}

.nicho::after {
	left: 14.5px;
	bottom: -6.5px;
	width: 8px;
	height: 8.5px;
	background: var(--marcador);
}

.nicho:hover {
	background: var(--papel);
	text-decoration: none;
}

.nicho:hover::after {
	background: var(--papel);
}

.assinatura {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-top: auto;
	padding-top: 0.6rem;
	font-size: 0.95rem;
	line-height: 1.45;
}

.assinatura img {
	width: 2.9rem;
	height: 2.9rem;
	flex: none;
}

.assinatura b {
	font-family: var(--mao);
	font-weight: 700;
	font-size: 1.05rem;
}

.assinatura span {
	display: block;
}

.datas {
	color: var(--tinta-suave);
}

.artigo .corpo {
	margin-top: clamp(2rem, 4vw, 3rem);
}

.fecho {
	max-width: var(--largo);
	margin: 3.5rem auto 0;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 1.1rem;
	align-items: start;
	padding: 1.2rem 1.4rem;
	border: var(--traco) solid var(--tinta);
	border-radius: var(--canto);
	background: var(--papel);
}

.fecho img {
	width: 4rem;
	height: 4rem;
}

.fecho h2 {
	font-size: 1.3rem;
	margin: 0 0 0.25rem;
}

.fecho p {
	margin: 0;
	font-size: 1rem;
}

.fecho .papel {
	color: var(--tinta-suave);
	margin-bottom: 0.4rem;
}

.mais {
	max-width: var(--largo);
	margin: 3.5rem auto 0;
}

.mais h2 {
	font-size: 1.6rem;
}

.mais ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
	gap: var(--sarjeta);
}

.mais li {
	margin: 0;
}

.mais a {
	display: block;
	height: 100%;
	padding: 1rem 1.2rem;
	border: var(--traco) solid var(--tinta);
	border-radius: var(--canto);
	text-decoration: none;
	background: var(--papel);
}

.mais a:hover {
	background: var(--quadro-claro);
}

.mais a b {
	display: block;
	font-family: var(--mao);
	font-weight: 700;
	font-size: 1.2rem;
	line-height: 1.25;
	margin-bottom: 0.3rem;
}

.mais a span {
	display: block;
	font-size: 0.95rem;
	color: var(--tinta-suave);
}

/* ── Pages, archive, search, 404 ── */

.cena-pagina {
	margin-top: clamp(1.4rem, 3vw, 2.2rem);
	padding: clamp(1.4rem, 3vw, 2.2rem);
	border: var(--traco) solid var(--tinta);
	border-radius: 24px 20px 26px 20px;
	background: var(--quadro-claro);
}

.cena-pagina h1 {
	margin: 0;
	max-width: 22ch;
}

.cena-pagina p {
	margin: 0.8rem 0 0;
	max-width: 40rem;
	font-size: 1.12rem;
}

.cena-pagina .datas {
	font-size: 0.95rem;
}

.pagina .corpo {
	margin-top: clamp(2rem, 4vw, 3rem);
}

.folha {
	list-style: none;
	margin: 2rem 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: calc(var(--sarjeta) + 0.6rem) var(--sarjeta);
}

.folha li {
	margin: 0;
}

.folha .quadro {
	display: block;
	text-decoration: none;
}

.folha .quadro:hover {
	background: none;
	outline: 0;
}

.folha .quadro:hover img {
	opacity: 0.92;
}

.folha img {
	aspect-ratio: 16 / 10;
	object-fit: cover;
}

.folha h2 {
	font-size: 1.45rem;
	margin: 0.2rem 0 0.25rem;
}

.folha h2 a {
	text-decoration-thickness: 0.28em;
}

.folha p {
	margin: 0;
	font-size: 1rem;
}

.folha .datas {
	font-size: 0.9rem;
	margin-top: 0.3rem;
}

.folha .notas {
	display: block;
	background: none;
	padding: 0.3rem 0.2rem 0;
}

.vazio {
	margin-top: 2rem;
	padding: 1.4rem;
	border: var(--traco) dashed var(--tinta);
	border-radius: var(--canto);
	max-width: 40rem;
}

.busca {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-top: 1.1rem;
	max-width: 36rem;
}

.busca label {
	flex-basis: 100%;
	font-family: var(--mao);
	font-weight: 700;
}

.busca input {
	flex: 1 1 14rem;
	min-width: 0;
	font: inherit;
	font-size: 1rem;
	padding: 0.55rem 1rem;
	border: var(--traco-fino) solid var(--tinta);
	border-radius: 999px;
	background: var(--papel);
	color: var(--tinta);
}

.busca button,
.botao {
	font-family: var(--mao);
	font-weight: 700;
	font-size: 1rem;
	padding: 0.55rem 1.3rem;
	border: var(--traco-fino) solid var(--tinta);
	border-radius: 999px;
	background: var(--marcador);
	color: var(--tinta);
	cursor: pointer;
	text-decoration: none;
	display: inline-block;
}

.busca button:hover,
.botao:hover {
	background: var(--papel);
}

.paginacao {
	margin-top: 2.4rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
}

.paginacao .page-numbers {
	display: inline-block;
	padding: 0.25rem 0.85rem;
	border: var(--traco-fino) solid var(--tinta);
	border-radius: 14px;
	font-family: var(--mao);
	font-weight: 700;
	text-decoration: none;
}

.paginacao .current {
	background: var(--marcador);
}

.cena-pagina--vazia {
	display: grid;
	grid-template-columns: minmax(0, 16rem) minmax(0, 1fr);
	gap: 1.2rem 2.2rem;
	align-items: center;
}

.quadro-vazio img {
	display: block;
	width: 100%;
}

/* ── Footer: the last panel ── */

.rodape {
	margin: clamp(4rem, 8vw, 6rem) 0 1.4rem;
	padding: 1.4rem 1.4rem 1.2rem;
	border: var(--traco) solid var(--tinta);
	border-radius: 20px 24px 19px 22px;
	background: var(--quadro-claro);
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 1rem 2rem;
	align-items: start;
}

.rodape .marca img {
	width: 2.6rem;
	height: 2.6rem;
}

.rodape .marca span {
	font-size: 1.5rem;
}

.rodape p {
	margin: 0.6rem 0 0;
	font-size: 0.95rem;
	max-width: 30rem;
}

.rodape nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.35rem;
	font-size: 0.95rem;
}

.rodape .fim {
	grid-column: 1 / -1;
	margin: 0;
	padding-top: 0.8rem;
	border-top: var(--traco-fino) solid var(--tinta);
	font-size: 0.88rem;
	color: var(--tinta-suave);
	max-width: none;
}

/* ── Measurement banner and choice ── */

/* While the banner shows, the page gets room to scroll its last lines above it */
body:has(.legenda) {
	padding-bottom: 12rem;
}

.legenda {
	position: fixed;
	z-index: 40;
	left: 0.75rem;
	right: 0.75rem;
	bottom: 0.75rem;
	max-width: 44rem;
	margin-inline: auto;
	padding: 1rem 1.2rem 1.05rem;
	border: var(--traco) solid var(--tinta);
	border-radius: 22px;
	background: var(--papel);
	font-size: 0.95rem;
	line-height: 1.55;
}

.legenda p {
	margin: 0 0 0.75rem;
}

.legenda button,
.claquete button {
	font-family: var(--mao);
	font-weight: 700;
	font-size: 1rem;
	min-width: 7.5rem;
	padding: 0.45rem 1.2rem;
	border: var(--traco-fino) solid var(--tinta);
	border-radius: 999px;
	background: var(--papel);
	color: var(--tinta);
	cursor: pointer;
	margin: 0 0.4rem 0.2rem 0;
}

.legenda button:hover,
.claquete button:hover {
	background: var(--marcador);
}

.claquete {
	margin: 1.6rem 0 2rem;
	padding: 1.1rem 1.3rem 1rem;
	border: var(--traco) solid var(--tinta);
	border-radius: var(--canto);
	background: var(--quadro-claro);
}

fieldset.claquete {
	min-inline-size: 0;
}

.claquete legend {
	font-family: var(--mao);
	font-weight: 700;
	font-size: 1.2rem;
	padding: 0 0.4rem;
	background: var(--papel);
	border: var(--traco-fino) solid var(--tinta);
	border-radius: 14px;
}

.claquete p {
	margin: 0 0 0.6rem;
}

.didascalia {
	font-style: italic;
	color: var(--tinta-suave);
	min-height: 1em;
}

.didascalia:empty {
	display: none;
}

/* ── Narrow screens ── */

@media (max-width: 60rem) {
	.paginas {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.painel,
	.painel--destaque {
		grid-column: span 1;
		grid-row: auto;
	}
	.painel--destaque {
		grid-column: 1 / -1;
	}
	.cena-abertura {
		grid-template-columns: minmax(0, 1fr);
	}
	.cena-abertura .desenho {
		border-left: 0;
		border-top: var(--traco) solid var(--tinta);
		order: 2;
	}
}

@media (max-width: 40rem) {
	body {
		font-size: 1.0625rem;
	}
	.prancha,
	body > .quadrinho {
		width: min(100% - 1.5rem, 74rem);
	}
	.cabecalho {
		padding: 0.7rem 0.8rem 0.8rem;
	}
	.marca img {
		width: 2.5rem;
		height: 2.5rem;
	}
	.marca span {
		font-size: 1.6rem;
	}
	.baloes a {
		font-size: 0.95rem;
		padding: 0.25rem 0.75rem 0.3rem;
	}
	.tira {
		grid-template-columns: minmax(0, 1fr);
		max-width: 24rem;
	}
	.paginas,
	.folha {
		grid-template-columns: minmax(0, 1fr);
	}
	.corpo > ol {
		grid-template-columns: minmax(0, 1fr);
	}
	.corpo details > :not(summary) {
		margin-left: 0.8rem;
	}
	.rodape,
	.cena-pagina--vazia {
		grid-template-columns: minmax(0, 1fr);
	}
	.quadro-vazio {
		max-width: 12rem;
	}
	.fecho {
		grid-template-columns: minmax(0, 1fr);
	}
	.legenda {
		left: 0.5rem;
		right: 0.5rem;
		bottom: 0.5rem;
		padding: 0.85rem 0.95rem;
	}
	.legenda button {
		min-width: 0;
	}
	body:has(.legenda) {
		padding-bottom: 17rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
		scroll-behavior: auto !important;
	}
}

code {
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	font-size: 0.86em;
	background: var(--quadro-claro);
	border: 1.5px solid var(--cinza);
	border-radius: 6px;
	padding: 0.05em 0.3em;
	overflow-wrap: anywhere;
}
