/*
Theme Name: Chiara Bigatti
Theme URI: https://chiarabigatti.com/
Author: Chiara Bigatti
Description: Tema su misura per chiarabigatti.com: art licensing e immagini decorative della collezione Visual Labyrinths. Carta e inchiostro come in una galleria, perché il colore lo porta l'opera.
Version: 1.1.1
Requires at least: 6.6
Tested up to: 7.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: chiarabigatti
*/

/* Tokens ------------------------------------------------------------------------------- */

:root {
	--cb-ink: var(--wp--preset--color--inchiostro);
	--cb-paper: var(--wp--preset--color--carta);
	--cb-sand: var(--wp--preset--color--sabbia);
	--cb-line: var(--wp--preset--color--filo);
	--cb-muted: var(--wp--preset--color--grafite);
	--cb-wine: var(--wp--preset--color--vinaccia);
	--cb-gap: clamp(0.5rem, 1.1vw, 0.875rem);
	--cb-header-h: 4.75rem;
	--cb-ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

/* Base --------------------------------------------------------------------------------- */

html {
	scroll-padding-top: calc(var(--cb-header-h) + 1.5rem);
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	font-kerning: normal;
}

/* Paper grain under everything that has no background of its own. */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .09 0 0 0 0 .08 0 0 0 0 .07 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection {
	background: var(--cb-wine);
	color: var(--cb-paper);
}

:where(h1, h2, h3, h4) {
	text-wrap: balance;
}

:where(p, li) {
	text-wrap: pretty;
}

:where(h1, h2, h3, h4) em {
	font-weight: 400;
}

strong {
	font-weight: 600;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--cb-wine);
	outline-offset: 3px;
	border-radius: 2px;
}

:where(.has-inchiostro-background-color, .has-vinaccia-background-color) :focus-visible {
	outline-color: var(--cb-paper);
}

.wp-site-blocks {
	overflow-x: clip;
}

/* Read by screen readers, not shown. */
.cb-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Header ------------------------------------------------------------------------------- */

.cb-header-wrap {
	position: sticky;
	top: 0;
	z-index: 100;
	background: color-mix(in srgb, var(--cb-paper) 84%, transparent);
	-webkit-backdrop-filter: saturate(1.4) blur(16px);
	backdrop-filter: saturate(1.4) blur(16px);
	border-bottom: 1px solid var(--cb-line);
}

.admin-bar .cb-header-wrap {
	top: var(--wp-admin--admin-bar--height, 32px);
}

/* A backdrop-filter makes the header the containing block of the menu overlay, which is fixed
   to the screen: left on, it squeezes the open menu into the header's 76 pixels. */
.cb-header-wrap:has(.is-menu-open) {
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
}

@supports (animation-timeline: scroll()) {
	.cb-header-wrap {
		border-bottom-color: transparent;
		animation: cb-header-line linear both;
		animation-timeline: scroll(root);
		animation-range: 0 160px;
	}

	@keyframes cb-header-line {
		to {
			border-bottom-color: var(--cb-line);
			background: color-mix(in srgb, var(--cb-paper) 90%, transparent);
		}
	}
}

.cb-header__bar {
	min-height: var(--cb-header-h);
	gap: 2rem;
}

.cb-brand {
	display: inline-flex;
	align-items: center;
	gap: 0.85rem;
	color: inherit;
	text-decoration: none;
}

.cb-brand img {
	display: block;
	width: 46px;
	height: 46px;
}

.cb-brand__name {
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.4rem;
	font-weight: 450;
	letter-spacing: -0.01em;
	line-height: 1;
	white-space: nowrap;
}

.cb-brand:hover .cb-brand__name {
	color: var(--cb-wine);
}

.cb-nav .wp-block-navigation-item__content {
	padding-block: 0.35rem;
	text-decoration: none;
	background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
	transition: background-size 0.4s var(--cb-ease), color 0.2s;
}

.cb-nav .wp-block-navigation-item__content:hover,
.cb-nav .current-menu-item > .wp-block-navigation-item__content {
	background-size: 100% 1px;
	color: inherit;
}

.cb-nav .cb-nav__cta > .wp-block-navigation-item__content {
	padding: 0.62rem 1.2rem;
	border-radius: 999px;
	background: var(--cb-ink);
	color: var(--cb-paper);
	transition: background-color 0.25s;
}

.cb-nav .cb-nav__cta > .wp-block-navigation-item__content:hover,
.cb-nav .cb-nav__cta.current-menu-item > .wp-block-navigation-item__content {
	background: var(--cb-wine);
	color: var(--cb-paper);
}

/* Core swaps the bar for the overlay menu only below 600px, but brand, five items and the language
   ring need about 1060px: in between, the items broke onto two or three lines and at 600px ran out
   of the bar. */
@media (min-width: 600px) and (max-width: 1099px) {
	.cb-nav .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}

	.cb-nav .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}
}

/* The overlay's colours are the navigation block's own settings (inchiostro on carta). */
.cb-nav .wp-block-navigation__responsive-container.is-menu-open {
	--navigation-layout-justification-setting: flex-start;
	padding: clamp(1.25rem, 4vw, 3.5rem);
}

.cb-nav .is-menu-open .wp-block-navigation__responsive-container-content {
	padding-top: 4.5rem;
}

/* The bar aligns right; the open menu reads from the left, like every title on the site. The list
   repeats the bar's items-justified-right class, so it needs the override as well as the overlay. */
.cb-nav .is-menu-open .wp-block-navigation__container {
	--navigation-layout-justification-setting: flex-start;
	gap: 1.1rem;
}

.cb-nav .is-menu-open .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(1.75rem, 7vw, 2.5rem);
	font-weight: 450;
	line-height: 1.15;
}

.cb-nav .is-menu-open .cb-nav__cta > .wp-block-navigation-item__content {
	margin-top: 0.75rem;
	padding: 0.7rem 1.4rem;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 1.0625rem;
	font-weight: 600;
}

.cb-header__end {
	gap: clamp(1rem, 1.6vw, 1.6rem);
}

/* In the bar, never a label on two lines (the open menu may wrap them). */
.cb-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation-item__label {
	white-space: nowrap;
}

/* IT / EN: a small ring after the menu, and on phones beside the menu button. */
.cb-lang {
	display: grid;
	flex: none;
	place-items: center;
	box-sizing: border-box;
	width: 2.5rem;
	height: 2.5rem;
	border: 1px solid var(--cb-line);
	border-radius: 50%;
	color: inherit;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	line-height: 1;
	text-decoration: none;
	transition: border-color 0.2s, color 0.2s;
}

.cb-lang:hover {
	border-color: var(--cb-ink);
	color: var(--cb-wine);
}

/* On the narrowest phones (320px) brand, menu button and ring need a little less room. */
@media (max-width: 379px) {
	.cb-header__bar {
		gap: 1rem;
	}

	.cb-brand {
		gap: 0.6rem;
	}

	.cb-brand img {
		width: 40px;
		height: 40px;
	}

	.cb-brand__name {
		font-size: 1.25rem;
	}

	.cb-header__end {
		gap: 0.75rem;
	}

	.cb-lang {
		width: 2.25rem;
		height: 2.25rem;
	}
}

/* Shared type styles ------------------------------------------------------------------- */

.is-style-cb-kicker {
	display: flex;
	align-items: center;
	gap: 0.9em;
	margin-block: 0;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.2em;
	line-height: 1.4;
	text-transform: uppercase;
	color: var(--cb-muted);
}

.is-style-cb-kicker::before {
	content: "";
	flex: none;
	width: 2.5rem;
	height: 1px;
	background: currentColor;
}

.has-text-align-center.is-style-cb-kicker {
	justify-content: center;
}

.is-style-cb-lead {
	max-width: 62ch;
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.55;
}

.is-style-cb-note {
	font-size: 0.8125rem;
	letter-spacing: 0.02em;
	color: var(--cb-muted);
}

:where(.has-inchiostro-background-color, .has-vinaccia-background-color) :is(.is-style-cb-kicker, .is-style-cb-note) {
	color: color-mix(in srgb, currentColor 0%, var(--cb-paper) 72%);
}

.cb-display {
	font-size: clamp(2.6rem, 1.1rem + 4.4vw, 5.4rem);
	font-weight: 430;
	line-height: 1.02;
	letter-spacing: -0.022em;
}

.cb-display em {
	font-style: italic;
}

.cb-title-italic {
	font-style: italic;
	font-weight: 400;
}

/* Buttons on dark bands invert. */
:where(.has-inchiostro-background-color, .has-vinaccia-background-color) .wp-block-button:not(.is-style-outline) > .wp-element-button {
	border-color: var(--cb-paper);
	background: var(--cb-paper);
	color: var(--cb-ink);
}

:where(.has-inchiostro-background-color, .has-vinaccia-background-color) .wp-block-button:not(.is-style-outline) > .wp-element-button:hover {
	background: transparent;
	color: var(--cb-paper);
}

.wp-block-button.is-style-outline > .wp-element-button:hover {
	border-color: currentColor;
	background: var(--cb-ink);
	color: var(--cb-paper);
}

:where(.has-inchiostro-background-color, .has-vinaccia-background-color) .wp-block-button.is-style-outline > .wp-element-button:hover {
	background: var(--cb-paper);
	color: var(--cb-ink);
}

.wp-element-button {
	transition: background-color 0.25s, color 0.25s, border-color 0.25s, transform 0.25s var(--cb-ease);
}

.wp-element-button::after {
	content: "\2192";
	display: inline-block;
	margin-left: 0.6em;
	transition: transform 0.3s var(--cb-ease);
}

.wp-element-button:hover::after {
	transform: translateX(0.22em);
}

/* Sections ----------------------------------------------------------------------------- */

.cb-section {
	padding-block: var(--wp--preset--spacing--80);
}

.cb-section--flush {
	padding-top: 0;
}

/* Bands meet edge to edge: a block gap between two dark ones shows as a strip of paper. */
.wp-block-post-content > .alignfull + .alignfull,
.wp-site-blocks > footer {
	margin-block-start: 0;
}

.cb-section-title {
	margin-bottom: var(--wp--preset--spacing--60);
}

.cb-after-gallery {
	margin-top: var(--wp--preset--spacing--60);
}

.cb-after-list {
	margin-top: var(--wp--preset--spacing--50);
}

.cb-split-media {
	gap: var(--wp--preset--spacing--70);
}

.cb-intro {
	padding-block: var(--wp--preset--spacing--70) var(--wp--preset--spacing--60);
}

.cb-intro .cb-display {
	margin-block: 1.5rem 1.75rem;
}

.cb-section-head {
	gap: var(--wp--preset--spacing--50);
	margin-bottom: var(--wp--preset--spacing--60);
}

.cb-section-head > .wp-block-column:last-child {
	align-self: flex-end;
}

.cb-section-head .is-style-cb-lead {
	margin: 0;
}

/* Hero --------------------------------------------------------------------------------- */

.cb-hero {
	position: relative;
	padding-block: var(--wp--preset--spacing--60) var(--wp--preset--spacing--80);
}

.cb-hero__grid {
	gap: clamp(2.5rem, 6vw, 6.5rem);
}

/* The hero title shares its row with the disc, so it runs one size below the other display titles. */
.cb-hero .cb-display {
	margin-block: 1.6rem 1.8rem;
	font-size: clamp(2.6rem, 1.2rem + 3.5vw, 4.6rem);
}

.cb-hero .is-style-cb-lead {
	margin-bottom: 2.25rem;
}

.cb-hero .is-style-cb-note {
	margin-top: 2rem;
}

/* The collection is concentric: the hero image turns, very slowly, inside rings of line. */
.is-style-cb-disc {
	position: relative;
	isolation: isolate;
	width: min(100%, 34rem);
	margin-inline: auto;
	aspect-ratio: 1;
}

.is-style-cb-disc::before {
	content: "";
	position: absolute;
	inset: -24%;
	z-index: -1;
	border-radius: 50%;
	background: repeating-radial-gradient(circle at 50% 50%, transparent 0 calc(1.35rem - 1px), color-mix(in srgb, var(--cb-ink) 16%, transparent) calc(1.35rem - 1px) 1.35rem);
	-webkit-mask: radial-gradient(closest-side, transparent 33%, #000 36%, #000 62%, transparent 100%);
	mask: radial-gradient(closest-side, transparent 33%, #000 36%, #000 62%, transparent 100%);
}

.is-style-cb-disc img {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
	box-shadow: 0 0 0 1px color-mix(in srgb, var(--cb-ink) 22%, transparent), 0 40px 90px -40px rgb(23 20 18 / 0.55);
}

/* One turn a minute. At four minutes a turn the eightfold mandala looked as if it stood still. */
@media (prefers-reduced-motion: no-preference) {
	.is-style-cb-disc img {
		animation: cb-spin 60s linear infinite;
	}
}

/* Stacked under the text (phones, tablets), the rings reached up behind the buttons: they extend a
   quarter of the disc beyond it, so the disc steps down by a fifth of its width on top of the gap. */
@media (max-width: 781px) {
	.cb-hero .is-style-cb-disc {
		margin-top: calc(min(100%, 34rem) * 0.2);
	}

	/* Below it the rings would reach into the clients strip, which has no background to hide them. */
	.cb-hero {
		padding-bottom: calc(min(100%, 34rem) * 0.24 + 1.5rem);
	}
}

@keyframes cb-spin {
	to {
		rotate: 360deg;
	}
}

/* Clients and projects, set as names between two hairlines, under the hero. */
.cb-proof {
	padding-block: clamp(1.5rem, 3vw, 2.25rem);
	border-block: 1px solid var(--cb-line);
}

.cb-proof .cb-proof__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.9rem clamp(1.5rem, 4vw, 3.5rem);
}

.cb-proof .cb-proof__inner > * {
	margin: 0;
}

.cb-proof .cb-proof__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem clamp(1.25rem, 3vw, 2.75rem);
	padding: 0;
	list-style: none;
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(1.2rem, 0.95rem + 1vw, 1.65rem);
	font-weight: 450;
	line-height: 1.25;
	letter-spacing: -0.01em;
}

.cb-proof .cb-proof__list > li {
	margin: 0;
}

/* Galleries ---------------------------------------------------------------------------- */

.wp-block-gallery.has-nested-images.is-style-cb-squares {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--cb-gap);
}

/* Two works: each the size of a bento's large tile. */
.wp-block-gallery.has-nested-images.is-style-cb-squares.columns-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wp-block-gallery.has-nested-images.is-style-cb-squares figure.wp-block-image:not(#individual-image) {
	width: auto;
	margin: 0;
	overflow: hidden;
	background: var(--cb-sand);
}

.wp-block-gallery.has-nested-images.is-style-cb-squares figure.wp-block-image img {
	width: 100%;
	height: 100%;
	aspect-ratio: 1;
	object-fit: cover;
}

.wp-block-gallery.has-nested-images.is-style-cb-masonry {
	display: block;
	columns: 3 16rem;
	column-gap: var(--cb-gap);
}

.wp-block-gallery.has-nested-images.is-style-cb-masonry figure.wp-block-image:not(#individual-image) {
	display: block;
	width: 100%;
	margin: 0 0 var(--cb-gap);
	break-inside: avoid;
	overflow: hidden;
	background: var(--cb-sand);
}

.wp-block-gallery.has-nested-images.is-style-cb-masonry figure.wp-block-image img {
	width: 100%;
	height: auto;
}

/* Bento: four columns, the 1st and 8th works shown twice the size. Ten squares fill it exactly. */
.wp-block-gallery.has-nested-images.is-style-cb-squares.cb-bento {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.wp-block-gallery.has-nested-images.cb-bento figure.wp-block-image:is(:nth-child(1), :nth-child(8)) {
	grid-column: span 2;
	grid-row: span 2;
}

@media (max-width: 781px) {
	.wp-block-gallery.has-nested-images.is-style-cb-squares,
	.wp-block-gallery.has-nested-images.is-style-cb-squares.cb-bento {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Three works keep their row on a tablet; on a phone the odd one out takes the full width. */
@media (min-width: 600px) and (max-width: 781px) {
	.wp-block-gallery.has-nested-images.is-style-cb-squares.columns-3:not(.cb-bento) {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 599px) {
	.wp-block-gallery.has-nested-images.is-style-cb-squares:not(.cb-bento) figure.wp-block-image:last-child:nth-child(odd):not(#individual-image) {
		grid-column: span 2;
	}
}

/* Rows of different proportions at one height: each picture takes a share of twelve columns close to
   its width-to-height ratio (cb-span-N, set by tools/build_content.py), and the few pixels left over
   are cropped off the shorter one. */
.wp-block-gallery.has-nested-images.is-style-cb-rows {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: var(--cb-gap);
}

.wp-block-gallery.has-nested-images.is-style-cb-rows figure.wp-block-image:not(#individual-image) {
	grid-column: span 6;
	width: auto;
	margin: 0;
}

.wp-block-gallery.has-nested-images.is-style-cb-rows figure.cb-span-4:not(#individual-image) {
	grid-column: span 4;
}

.wp-block-gallery.has-nested-images.is-style-cb-rows figure.cb-span-5:not(#individual-image) {
	grid-column: span 5;
}

.wp-block-gallery.has-nested-images.is-style-cb-rows figure.cb-span-7:not(#individual-image) {
	grid-column: span 7;
}

.wp-block-gallery.has-nested-images.is-style-cb-rows figure.cb-span-8:not(#individual-image) {
	grid-column: span 8;
}

.wp-block-gallery.has-nested-images.is-style-cb-rows figure.cb-span-12:not(#individual-image) {
	grid-column: span 12;
}

.wp-block-gallery.has-nested-images.is-style-cb-rows figure.wp-block-image:not(#individual-image) img {
	flex: 1 0 auto;
	width: 100%;
	height: auto;
	object-fit: cover;
	background: var(--cb-sand);
}

/* Titles under the works, like the labels in a gallery, instead of core's caption over the picture. */
.wp-block-gallery.has-nested-images.cb-captioned figure.wp-block-image:not(#individual-image) {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	overflow: visible;
	background: none;
}

.wp-block-gallery.has-nested-images.cb-captioned figure.wp-block-image:has(figcaption)::before {
	content: none;
}

.wp-block-gallery.has-nested-images.cb-captioned figure.wp-block-image figcaption,
.wp-block-image.cb-framed figcaption {
	position: static;
	flex: none;
	max-height: none;
	margin: 0;
	padding: 0.7rem 0 0;
	overflow: visible;
	background: none;
	color: var(--cb-muted);
	font-family: var(--wp--preset--font-family--display);
	font-size: 1rem;
	font-style: italic;
	line-height: 1.35;
	text-align: left;
	text-shadow: none;
	will-change: auto;
	scrollbar-gutter: auto;
}

.wp-block-gallery.has-nested-images.cb-captioned figure.wp-block-image figcaption em,
.wp-block-image.cb-framed figcaption em {
	font-style: normal;
}

.wp-block-gallery.has-nested-images.is-style-cb-squares.cb-captioned figure.wp-block-image:not(#individual-image) img {
	flex: none;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
	background: var(--cb-sand);
}

/* The large tile of a captioned bento fills its two rows, minus its own caption. */
.wp-block-gallery.has-nested-images.is-style-cb-squares.cb-bento.cb-captioned figure.wp-block-image:not(#individual-image):is(:nth-child(1), :nth-child(8)) img {
	flex: 1 1 0;
	min-height: 0;
	aspect-ratio: auto;
}

/* On two columns a tile spanning two rows would have no smaller tiles beside it to size those rows,
   so there the large one is a full-width square. */
@media (max-width: 781px) {
	.wp-block-gallery.has-nested-images.cb-bento.cb-captioned figure.wp-block-image:is(:nth-child(1), :nth-child(8)) {
		grid-row: auto;
	}

	.wp-block-gallery.has-nested-images.is-style-cb-squares.cb-bento.cb-captioned figure.wp-block-image:not(#individual-image):is(:nth-child(1), :nth-child(8)) img {
		flex: none;
		aspect-ratio: 1;
	}
}

.cb-framed img {
	display: block;
	width: 100%;
	height: auto;
}

/* Series (Visual Labyrinths) and projects (Applicazioni) --------------------------------- */

.cb-series,
.cb-project {
	padding-bottom: var(--wp--preset--spacing--70);
}

.cb-series__head,
.cb-project__grid {
	padding-top: 1.5rem;
	border-top: 1px solid var(--cb-ink);
}

.cb-series__head {
	margin-bottom: var(--wp--preset--spacing--50);
}

.cb-series__head h2,
.cb-project h2 {
	margin: 1.1rem 0 0;
	font-size: var(--wp--preset--font-size--x-large);
}

.cb-series__head > .wp-block-column:last-child p {
	max-width: 44ch;
	margin: 0;
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.5;
}

.cb-project__grid {
	gap: var(--wp--preset--spacing--60);
}

.cb-project__grid > .wp-block-column:first-child > p:not(.is-style-cb-kicker) {
	max-width: 38ch;
	margin-top: 0.9rem;
	color: var(--cb-muted);
}

/* Numbered editorial list (Cosa offro) -------------------------------------------------- */

.cb-split {
	gap: var(--wp--preset--spacing--60);
}

@media (min-width: 782px) {
	.cb-split > .wp-block-column:first-child {
		position: sticky;
		top: calc(var(--cb-header-h) + 2.5rem);
		align-self: flex-start;
	}
}

.cb-numbered {
	counter-reset: cb-item;
	border-bottom: 1px solid var(--cb-line);
}

.cb-numbered > .cb-item {
	counter-increment: cb-item;
	display: grid;
	grid-template-columns: clamp(3rem, 6vw, 5.5rem) minmax(0, 1fr);
	column-gap: 1.25rem;
	align-items: baseline;
	margin: 0;
	padding-block: clamp(1.5rem, 3vw, 2.25rem);
	border-top: 1px solid var(--cb-line);
}

.cb-numbered > .cb-item::before {
	content: counter(cb-item, decimal-leading-zero);
	content: counter(cb-item, decimal-leading-zero) / "";
	grid-row: span 2;
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(1.5rem, 2.6vw, 2.25rem);
	font-style: italic;
	line-height: 1;
	color: var(--cb-wine);
}

.cb-numbered > .cb-item > * {
	grid-column: 2;
	margin: 0;
}

.cb-numbered > .cb-item > * + * {
	margin-top: 0.6rem;
}

/* Sector definitions -------------------------------------------------------------------- */

.cb-defs > .cb-def {
	margin: 0;
	padding-block: 1.35rem;
	border-top: 1px solid var(--cb-line);
}

.cb-defs > .cb-def:last-child {
	border-bottom: 1px solid var(--cb-line);
}

.cb-def > * {
	margin: 0;
}

.cb-def > * + * {
	margin-top: 0.4rem;
}

.cb-def p {
	color: var(--cb-muted);
}

.cb-cols-3 {
	gap: var(--wp--preset--spacing--50);
}

.cb-cols-3 > .wp-block-column {
	padding-top: 1.5rem;
	border-top: 1px solid var(--cb-ink);
}

/* Lists --------------------------------------------------------------------------------- */

.wp-block-list.is-style-cb-rules {
	padding: 0;
	list-style: none;
}

.wp-block-list.is-style-cb-rules > li {
	margin: 0;
	padding-block: 0.8rem;
	border-bottom: 1px solid var(--cb-line);
}

.wp-block-list.is-style-cb-rules > li:first-child {
	border-top: 1px solid var(--cb-line);
}

/* Steps (Come funziona) ----------------------------------------------------------------- */

.cb-steps {
	position: relative;
	gap: var(--wp--preset--spacing--50);
}

.cb-steps > .wp-block-column {
	position: relative;
	padding-top: 3.75rem;
}

/* A dot inside two rings, joined by a line: the labyrinth, reduced to a path. */
.cb-steps > .wp-block-column::before {
	content: "";
	position: absolute;
	top: 0.75rem;
	left: 0.75rem;
	width: 0.7rem;
	height: 0.7rem;
	border-radius: 50%;
	background: var(--cb-wine);
	box-shadow: 0 0 0 0.45rem var(--cb-paper), 0 0 0 calc(0.45rem + 1px) var(--cb-wine), 0 0 0 0.9rem var(--cb-paper), 0 0 0 calc(0.9rem + 1px) color-mix(in srgb, var(--cb-wine) 45%, transparent);
}

.cb-steps > .wp-block-column:not(:last-child)::after {
	content: "";
	position: absolute;
	top: calc(1.1rem - 0.5px);
	left: 2.75rem;
	right: calc(-1 * var(--wp--preset--spacing--50) + 0.75rem);
	height: 1px;
	background: var(--cb-line);
}

.cb-steps h3 {
	margin: 0 0 0.6rem;
	font-size: var(--wp--preset--font-size--large);
}

.cb-steps p {
	margin: 0;
	color: var(--cb-muted);
}

@media (max-width: 781px) {
	.cb-steps > .wp-block-column {
		padding-top: 0;
		padding-left: 3.5rem;
	}

	.cb-steps > .wp-block-column:not(:last-child)::after {
		top: 2rem;
		bottom: calc(-1 * var(--wp--preset--spacing--50));
		left: calc(1.1rem - 0.5px);
		right: auto;
		width: 1px;
		height: auto;
	}
}

/* Questions (Licensing) ------------------------------------------------------------------ */

.cb-faq > .wp-block-column > .wp-block-details {
	margin: 0;
	border-top: 1px solid var(--cb-line);
}

.cb-faq > .wp-block-column > .wp-block-details:last-child {
	border-bottom: 1px solid var(--cb-line);
}

.cb-faq summary {
	position: relative;
	display: block;
	padding: 1.3rem 3.25rem 1.3rem 0;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 450;
	line-height: 1.3;
	list-style: none;
	cursor: pointer;
	transition: color 0.2s;
}

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

.cb-faq summary:hover {
	color: var(--cb-wine);
}

/* A plus in a ring that loses its upright stroke when the answer is open. */
.cb-faq summary::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 0.25rem;
	width: 1.9rem;
	height: 1.9rem;
	translate: 0 -50%;
	border: 1px solid var(--cb-line);
	border-radius: 50%;
	background:
		linear-gradient(currentColor, currentColor) center / 0.7rem 1px no-repeat,
		linear-gradient(currentColor, currentColor) center / 1px 0.7rem no-repeat;
	transition: background-size 0.25s var(--cb-ease), border-color 0.2s;
}

.cb-faq details[open] > summary::after {
	border-color: currentColor;
	background-size: 0.7rem 1px, 1px 0;
}

.cb-faq .wp-block-details > :not(summary) {
	max-width: 62ch;
	margin: 0 0 1.5rem;
	color: var(--cb-muted);
}

/* Call to action band ------------------------------------------------------------------ */

.cb-cta {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	padding-block: var(--wp--preset--spacing--80);
}

.cb-cta::after {
	content: "";
	position: absolute;
	z-index: -1;
	top: 50%;
	right: -18vw;
	width: min(78vw, 64rem);
	aspect-ratio: 1;
	translate: 0 -50%;
	border-radius: 50%;
	background: repeating-radial-gradient(circle, transparent 0 calc(1.6rem - 1px), rgb(245 241 234 / 0.14) calc(1.6rem - 1px) 1.6rem);
	-webkit-mask: radial-gradient(closest-side, #000 55%, transparent 100%);
	mask: radial-gradient(closest-side, #000 55%, transparent 100%);
}

.cb-cta-text {
	max-width: 34ch;
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.55;
}

.cb-cta-text strong {
	display: block;
	margin-bottom: 0.9rem;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 430;
	line-height: 1.05;
	letter-spacing: -0.02em;
	text-wrap: balance;
}

.cb-cta-text br {
	display: none;
}

.cb-cta .wp-block-buttons {
	margin-top: 2.25rem;
}

.cb-cta .is-style-cb-note {
	margin-top: 1.5rem;
}

/* About ---------------------------------------------------------------------------------- */

.cb-bio {
	gap: var(--wp--preset--spacing--70);
}

.cb-bio h2 {
	margin-bottom: 1.25rem;
	font-size: var(--wp--preset--font-size--x-large);
}

.cb-bio p {
	max-width: 66ch;
}

.cb-bio .wp-block-separator {
	margin-block: var(--wp--preset--spacing--60);
}

.cb-aside h2 {
	margin-bottom: 1rem;
	font-size: var(--wp--preset--font-size--large);
}

.cb-aside .wp-block-image {
	margin-bottom: var(--wp--preset--spacing--50);
}

/* Contact form (Contact Form 7) ---------------------------------------------------------- */

.cb-form-card {
	padding: clamp(1.5rem, 4vw, 3rem);
	border: 1px solid var(--cb-line);
	border-radius: 1.25rem;
	background: var(--wp--preset--color--bianco);
	box-shadow: 0 30px 80px -50px rgb(23 20 18 / 0.35);
}

.wpcf7 .cb-cf7 {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.4rem 1.25rem;
}

.wpcf7 .cb-cf7 > p {
	margin: 0;
}

.wpcf7 .cb-cf7 > p:nth-child(n + 5) {
	grid-column: 1 / -1;
}

.wpcf7 .cb-cf7 label {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--cb-muted);
}

.wpcf7 .cb-cf7 label br {
	display: none;
}

.wpcf7 .cb-cf7 :is(input[type="text"], input[type="email"], select, textarea) {
	box-sizing: border-box;
	width: 100%;
	padding: 0.9rem 1rem;
	border: 1px solid var(--cb-line);
	border-radius: 0.75rem;
	background: var(--cb-paper);
	color: var(--cb-ink);
	font: inherit;
	font-size: 1rem;
	font-weight: 400;
	letter-spacing: normal;
	text-transform: none;
	transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.wpcf7 .cb-cf7 :is(input, select, textarea):hover {
	border-color: color-mix(in srgb, var(--cb-ink) 35%, var(--cb-line));
}

.wpcf7 .cb-cf7 :is(input, select, textarea):focus {
	outline: none;
	border-color: var(--cb-ink);
	background: var(--wp--preset--color--bianco);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--cb-wine) 22%, transparent);
}

.wpcf7 .cb-cf7 select {
	-webkit-appearance: none;
	appearance: none;
	padding-right: 2.75rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23171412' stroke-width='1.5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 1rem center;
}

.wpcf7 .cb-cf7 textarea {
	min-height: 10rem;
	resize: vertical;
}

.wpcf7 .cb-cf7 ::placeholder {
	color: color-mix(in srgb, var(--cb-muted) 75%, transparent);
}

.wpcf7 .cb-cf7 input[type="submit"] {
	-webkit-appearance: none;
	appearance: none;
	padding: 1rem 1.9rem;
	border: 1px solid var(--cb-ink);
	border-radius: 999px;
	background: var(--cb-ink);
	color: var(--cb-paper);
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	/* As the theme's other buttons; inheriting the body's 1.65 made it taller than them. */
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.25s, border-color 0.25s;
}

.wpcf7 .cb-cf7 input[type="submit"]:hover {
	border-color: var(--cb-wine);
	background: var(--cb-wine);
}

.wpcf7 .cb-cf7 input[type="submit"]:disabled {
	opacity: 0.6;
	cursor: progress;
}

.wpcf7 .wpcf7-not-valid-tip {
	margin-top: 0.4rem;
	font-size: 0.8125rem;
	font-weight: 500;
	letter-spacing: normal;
	text-transform: none;
	color: #9b1c1c;
}

.wpcf7 .cb-cf7 .wpcf7-not-valid {
	border-color: #9b1c1c;
}

.wpcf7 form .wpcf7-response-output {
	margin: 1.5rem 0 0;
	padding: 1rem 1.25rem;
	border-radius: 0.75rem;
	font-size: 0.9375rem;
}

/* minmax(0, ...) rather than 1fr: the fields' size="40" would otherwise hold the column at ~290px
   and push the form out of its card on a 320px phone. */
@media (max-width: 599px) {
	.wpcf7 .cb-cf7 {
		grid-template-columns: minmax(0, 1fr);
	}

	/* "Invia richiesta di collaborazione" is wider than the card on a phone: full width, and wrap. */
	.wpcf7 .cb-cf7 input[type="submit"] {
		width: 100%;
		padding-inline: 1.25rem;
		white-space: normal;
	}
}

/* The form, and beside it (below it on phones) what to write and when to expect an answer. */
.cb-contact {
	gap: var(--wp--preset--spacing--60);
}

.cb-contact__info .cb-def ul {
	margin: 0;
	padding-left: 1.1em;
	color: var(--cb-muted);
}

.cb-contact__info .cb-def li + li {
	margin-top: 0.2rem;
}

/* Footer ---------------------------------------------------------------------------------- */

.cb-footer {
	padding-block: var(--wp--preset--spacing--70) var(--wp--preset--spacing--50);
}

/* After a dark call to action the two read as one block: a hairline on the seam parts them. */
.wp-site-blocks:has(.wp-block-post-content > .has-inchiostro-background-color:last-child) .cb-footer {
	padding-top: 0;
}

.wp-site-blocks:has(.wp-block-post-content > .has-inchiostro-background-color:last-child) .cb-footer > .alignwide:first-child {
	padding-top: var(--wp--preset--spacing--70);
	border-top: 1px solid rgb(245 241 234 / 0.16);
}

.cb-footer a {
	color: inherit;
	text-decoration: none;
}

.cb-footer a:hover {
	color: var(--cb-paper);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.cb-footer__brand {
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(2.25rem, 5vw, 4rem);
	font-weight: 430;
	line-height: 1;
	letter-spacing: -0.02em;
}

.cb-footer .wp-block-navigation {
	font-size: 0.9375rem;
	color: color-mix(in srgb, var(--cb-paper) 78%, transparent);
}

.cb-footer__base {
	margin-top: var(--wp--preset--spacing--60);
	padding-top: 1.5rem;
	border-top: 1px solid rgb(245 241 234 / 0.16);
	font-size: 0.8125rem;
	color: color-mix(in srgb, var(--cb-paper) 62%, transparent);
}

.cb-footer__base p {
	margin: 0;
}

.cb-footer__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.75rem;
}

/* Posts and fallback templates ------------------------------------------------------------- */

.cb-archive .wp-block-post {
	padding-block: 2rem;
	border-top: 1px solid var(--cb-line);
}

.cb-404 {
	padding-block: var(--wp--preset--spacing--80);
}

/* Motion ---------------------------------------------------------------------------------- */

/* No cross-document view transition on purpose: it held every new page back ~330 ms before
   showing it, then spent 250 ms more fading in. Pages swap in one frame instead.
   Images never move with the scroll: no reveal, no pinning, no hover zoom. Only text rises in. */
@media (prefers-reduced-motion: no-preference) {
	@supports (animation-timeline: view()) {
		:is(.cb-reveal, .cb-numbered > .cb-item, .cb-defs > .cb-def, .cb-steps > .wp-block-column) {
			animation: cb-rise linear both;
			animation-timeline: view();
			animation-range: entry 0% entry 55%;
		}

		@keyframes cb-rise {
			from {
				opacity: 0;
				translate: 0 2rem;
			}
		}
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
	}
}
