/* ==========================================================================
   Quixotesco — CSS extras
   --------------------------------------------------------------------------
   Este arquivo cobre o que theme.json não consegue expressar:
   - drop-cap automático no primeiro parágrafo do conteúdo
   - swipe horizontal com scroll-snap (mobile)
   - dropdowns customizados do arquivo
   - meta-line com diamantes dourados
   - grafismos posicionados nas faixas (manifesto, reverberando, newsletter)
   - regras tipográficas finas que o block editor não expõe (kerning de versais,
     small-caps, pesos itálicos específicos por bloco etc.)

   Tudo aqui usa variáveis CSS expostas pelo theme.json
   (--wp--preset--color--*, --wp--preset--font-family--*, --wp--preset--spacing--*).
   ========================================================================== */


/* ==========================================================================
   Base / reset fino
   ========================================================================== */

html { scroll-behavior: smooth; }

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

::selection {
	background: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--black);
}

img { max-width: 100%; height: auto; display: block; }


/* ==========================================================================
   Meta-line: data · tag · tempo de leitura
   ========================================================================== */

.qx-meta-line {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.6875rem;
	letter-spacing: var(--wp--custom--letter-spacing--mono-tight);
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-mute);
	margin-block: var(--wp--preset--spacing--40);
}
.qx-meta-line .qx-meta-tag { color: var(--wp--preset--color--gold-deep); }
.qx-meta-line .qx-meta-sep {
	display: inline-block;
	width: 4px; height: 4px;
	background: var(--wp--preset--color--gold);
	transform: rotate(45deg);
}


/* ==========================================================================
   Kicker (linha em mono, dourada, acima do título)
   ========================================================================== */

.qx-kicker,
.wp-block-group.is-style-kicker {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.6875rem;
	letter-spacing: var(--wp--custom--letter-spacing--mono);
	text-transform: uppercase;
	color: var(--wp--preset--color--gold-deep);
	display: block;
}


/* ==========================================================================
   Drop-cap automático nos posts (primeiro parágrafo do post-content)
   ========================================================================== */

body.single .wp-block-post-content > p:first-of-type::first-letter {
	font-family: var(--wp--preset--font-family--display);
	font-size: 5em;
	line-height: 0.85;
	float: left;
	margin: 4px 14px 0 -2px;
	color: var(--wp--preset--color--ink);
	font-weight: 700;
}

/* Não aplicar drop-cap dentro de blockquote, pullquote, columns ou outras estruturas. */
body.single .wp-block-post-content blockquote p::first-letter,
body.single .wp-block-post-content .wp-block-pullquote p::first-letter,
body.single .wp-block-post-content .wp-block-columns p::first-letter,
body.single .wp-block-post-content .wp-block-quote p::first-letter {
	font-size: inherit;
	font-family: inherit;
	float: none;
	margin: 0;
	font-weight: inherit;
}

/* Em poemas, dropcap atrapalha — desativa. */
body.qx-cat-poema .wp-block-post-content > p:first-of-type::first-letter {
	all: unset;
}

@media (max-width: 640px) {
	body.single .wp-block-post-content > p:first-of-type::first-letter {
		font-size: 4em;
	}
}


/* ==========================================================================
   Tipografia editorial fina dentro do post-content
   ========================================================================== */

.wp-block-post-content h2 {
	margin-block: var(--wp--preset--spacing--70) var(--wp--preset--spacing--40);
	font-family: var(--wp--preset--font-family--sub);
	font-style: italic;
	font-weight: 500;
}
.wp-block-post-content h2::before {
	content: "✦";
	display: block;
	color: var(--wp--preset--color--gold);
	font-size: 0.875rem;
	margin-bottom: 0.5rem;
}
.wp-block-post-content h3 {
	margin-block: var(--wp--preset--spacing--60) var(--wp--preset--spacing--30);
}

.wp-block-post-content p {
	margin-block: 0 var(--wp--preset--spacing--40);
}

/* Citação inline — abre/fecha com aspas tipográficas douradas. */
.wp-block-post-content q {
	font-family: var(--wp--preset--font-family--quote);
	font-style: italic;
	color: var(--wp--preset--color--ink-soft);
}
.wp-block-post-content q::before { content: "“"; color: var(--wp--preset--color--gold); }
.wp-block-post-content q::after  { content: "”"; color: var(--wp--preset--color--gold); }


/* ==========================================================================
   Diamante (grafismo) genérico — usável dentro de Site Title, Headings, etc.
   ========================================================================== */

.qx-diamond {
	display: inline-block;
	width: 8px; height: 8px;
	background: var(--wp--preset--color--gold);
	transform: rotate(45deg);
	margin-inline-start: 0.4em;
	vertical-align: middle;
	position: relative;
	top: -0.15em;
}


/* ==========================================================================
   Filtros do arquivo (dropdowns)
   ========================================================================== */

.qx-archive-filters {
	display: flex;
	gap: var(--wp--preset--spacing--70);
	justify-content: center;
	flex-wrap: wrap;
	padding-block: var(--wp--preset--spacing--50);
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.qx-archive-filter {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 200px;
}
.qx-archive-filter .label {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.625rem;
	letter-spacing: var(--wp--custom--letter-spacing--mono);
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-mute);
}
.qx-archive-filter .select-wrap {
	position: relative;
	border-bottom: 1px solid var(--wp--preset--color--ink);
}
.qx-archive-filter select {
	appearance: none;
	-webkit-appearance: none;
	background: transparent;
	border: 0;
	outline: none;
	width: 100%;
	padding: 10px 24px 10px 0;
	font-family: var(--wp--preset--font-family--sub);
	font-style: italic;
	font-size: 1.1875rem;
	color: var(--wp--preset--color--ink);
	cursor: pointer;
}
.qx-archive-filter select:hover { color: var(--wp--preset--color--gold-deep); }
.qx-archive-filter .select-caret {
	position: absolute;
	right: 0; top: 50%;
	transform: translateY(-50%);
	font-size: 0.875rem;
	color: var(--wp--preset--color--gold-deep);
	pointer-events: none;
}


/* ==========================================================================
   Carrossel mobile (swipe horizontal)
   ========================================================================== */

.qx-swipe {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}
.qx-swipe::-webkit-scrollbar { display: none; }

.qx-slide {
	flex: 0 0 100%;
	scroll-snap-align: center;
}

.qx-dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	padding-block: var(--wp--preset--spacing--30);
	border-top: 1px solid var(--wp--preset--color--line);
}
.qx-dots .dot {
	width: 6px; height: 6px;
	background: var(--wp--preset--color--ink-faint);
	transform: rotate(45deg);
	transition: background .25s;
	cursor: pointer;
}
.qx-dots .dot.active { background: var(--wp--preset--color--gold); }


/* ==========================================================================
   Faixas escuras (Manifesto, Reverberando) — texto com cores corretas
   ========================================================================== */

.has-petrol-deep-background-color,
.has-black-background-color {
	color: var(--wp--preset--color--white);
}
.has-petrol-deep-background-color :is(h1, h2, h3, h4, h5, h6),
.has-black-background-color :is(h1, h2, h3, h4, h5, h6) {
	color: var(--wp--preset--color--white);
}
.has-petrol-deep-background-color a,
.has-black-background-color a {
	color: var(--wp--preset--color--gold);
}
.has-petrol-deep-background-color a:hover,
.has-black-background-color a:hover {
	color: var(--wp--preset--color--gold-pale);
}


/* ==========================================================================
   Cats teatral (faixa de categorias com numerais arábicos mono)
   ========================================================================== */

.qx-cats {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	border-top: 1px solid var(--wp--preset--color--line);
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.qx-cats-card {
	padding: var(--wp--preset--spacing--70) var(--wp--preset--spacing--50);
	text-align: center;
	border-right: 1px solid var(--wp--preset--color--line-soft);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--wp--preset--spacing--30);
	transition: background .3s;
	text-decoration: none;
	color: inherit;
}
.qx-cats-card:last-child { border-right: 0; }
.qx-cats-card .num {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 2.75rem;
	font-weight: 400;
	line-height: 1;
	color: transparent;
	-webkit-text-stroke: 1px var(--wp--preset--color--ink-faint);
	letter-spacing: 0.04em;
	transition: all .3s;
}
.qx-cats-card .name {
	font-family: var(--wp--preset--font-family--sub);
	font-style: italic;
	font-size: 1.5rem;
	color: var(--wp--preset--color--ink);
	transition: all .3s;
}
.qx-cats-card .rule {
	width: 0;
	height: 1px;
	background: var(--wp--preset--color--gold);
	transition: width .35s ease-out;
}
.qx-cats-card:hover { background: var(--wp--preset--color--white-deep); }
.qx-cats-card:hover .num {
	color: var(--wp--preset--color--gold);
	-webkit-text-stroke: 1px transparent;
	letter-spacing: 0.06em;
}
.qx-cats-card:hover .name {
	color: var(--wp--preset--color--gold-deep);
	transform: skewX(-4deg);
}
.qx-cats-card:hover .rule { width: 32px; }

@media (max-width: 960px) {
	.qx-cats {
		display: flex;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}
	.qx-cats::-webkit-scrollbar { display: none; }
	.qx-cats-card {
		flex: 0 0 50%;
		scroll-snap-align: start;
		border-top: 0; border-bottom: 0;
	}
}


/* ==========================================================================
   Container helpers (opcional para template-parts que precisem de larguras
   diferentes do contentSize/wideSize)
   ========================================================================== */

.qx-container-wide {
	max-width: var(--wp--custom--container--default);
	margin-inline: auto;
	padding-inline: var(--wp--preset--spacing--40);
}


/* ==========================================================================
   Footer — variantes mobile
   ========================================================================== */

@media (max-width: 960px) {
	.qx-footer-grid {
		grid-template-columns: 1fr 1fr !important;
	}
	.qx-footer-brand {
		grid-column: 1 / -1;
		text-align: center;
	}
	.qx-footer-siga {
		grid-column: 1 / -1;
	}
	.qx-footer-bottom {
		flex-direction: column !important;
		gap: 8px;
		text-align: center;
		align-items: center;
	}
}


/* ==========================================================================
   Acessibilidade
   ========================================================================== */

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px; width: 1px;
	margin: -1px; overflow: hidden;
	padding: 0; position: absolute;
	word-wrap: normal !important;
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
