/* /servizi + /servizi/<servizio>/ (inc/servizi.php, content from staging/tools/servizi-*.php).
   Huge service headings, a two-line excerpt, one full-colour proof per row (client work: never screened).
   No content is hidden before JS runs; assets/js/pages/servizi.js only adds motion. */

/* ---------- 0. Shell ---------- */
/* Additional CSS (Customizer) makes the old page a two-column grid: undo it here. */
body.cj-servizi #main .entry-content {
	display: block;
	max-width: none;
	margin: 0;
}
.cj-servizi .entry-content > * { max-width: none; }
.cj-servizi .cj-anchor { position: absolute; scroll-margin-top: calc(var(--header-height, 90px) + 1rem); }
.cj-servizi :is(.cj-svc, .cj-svc-intro, [id]) { scroll-margin-top: calc(var(--header-height, 90px) + 1rem); }

/* Cross-document morph: the proof lifts out of its row and becomes the service page hero. */
@media (prefers-reduced-motion: no-preference) {
	@view-transition { navigation: auto; }
}
::view-transition-group(*) { animation-duration: 0.45s; animation-timing-function: cubic-bezier(0.2, 0.7, 0.1, 1); }

/* SplitText line masks (servizi.js): room for descenders, without moving the layout. */
.cj-line-mask { padding-bottom: 0.2em; margin-bottom: -0.2em; }

/* ---------- 1. Lede ---------- */
.cj-svc-intro { position: relative; } /* padding: base.css page box (--cj-atl-gap / --cj-atl-bottom) */
.cj-servizi .entry-content .cj-svc-lede {
	max-width: var(--cj-lede-measure);
	margin: 0;
	font-size: var(--cj-lede-size);
	font-weight: 500;
	line-height: var(--cj-lede-leading);
	letter-spacing: var(--cj-lede-tracking);
}

/* ---------- 2. Service index ---------- */
.cj-svc-list { counter-reset: svc; }
.cj-svc {
	counter-increment: svc;
	position: relative;
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	grid-template-areas:
		"num   num   num   num   num   num   num   proof proof proof proof proof"
		"title title title title title title title proof proof proof proof proof"
		"text  text  text  text  text  text  .     proof proof proof proof proof"
		"more  more  more  more  more  more  .     proof proof proof proof proof";
	grid-template-rows: auto auto auto 1fr;
	column-gap: clamp(1rem, 2.5vw, 2.5rem);
	align-items: start;
	padding: clamp(3rem, 9vh, 6.5rem) 0;
	border-top: 1px solid rgba(255, 255, 255, 0.55);
}
.cj-svc:nth-child(even) {
	grid-template-areas:
		"proof proof proof proof proof .     num   num   num   num   num   num"
		"proof proof proof proof proof title title title title title title title"
		"proof proof proof proof proof .     text  text  text  text  text  text"
		"proof proof proof proof proof .     more  more  more  more  more  more";
}
.cj-svc::before {
	content: counter(svc, decimal-leading-zero) / "";
	grid-area: num;
	display: block;
	margin-bottom: 0.15em;
	font-size: clamp(2.5rem, 1.5rem + 3.5vw, 5.5rem);
	font-weight: 600;
	line-height: 1;
	color: transparent;
	-webkit-text-stroke: 1.5px var(--cj-white);
}
.cj-servizi .entry-content .cj-svc__title {
	grid-area: title;
	margin: 0 0 0.35em;
	font-size: clamp(2.6rem, 0.9rem + 6.2vw, 8.25rem);
	font-weight: 700;
	line-height: 0.92;
	letter-spacing: -0.035em;
	text-transform: none;
	overflow-wrap: break-word;
	hyphens: manual;
}
.cj-servizi .entry-content .cj-svc__text {
	grid-area: text;
	max-width: 34ch;
	margin: 0 0 1.25rem;
	font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem); /* large-type rule: ≥ 20px, 500 */
	font-weight: 500;
	line-height: 1.4;
}
.cj-servizi .entry-content .cj-svc__more { grid-area: more; margin: 0; font-size: 1.125rem; font-weight: 700; }
.cj-svc__more a {
	color: inherit;
	text-decoration: none;
	border-bottom: 2px solid currentColor;
	padding-bottom: 0.1em;
}
.cj-svc__more a::after { content: "→"; display: inline-block; margin-left: 0.3em; transition: transform 0.25s ease; } /* a leading space in an inline-block collapses: margin, not " →" (2026-11-12) */
.cj-svc__more a:is(:hover, :focus-visible)::after { transform: translateX(0.3em); }

/* Proof: full-colour client work. Lifts on hover/focus; links to the project. */
.cj-svc__proof,
.cj-svc__art {
	grid-area: proof;
	align-self: center;
	margin: 0 !important;
}
.cj-svc__proof a { display: block; }
.cj-svc__proof img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 4px;
	box-shadow: 0 0 0 rgba(80, 0, 35, 0);
	transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.1, 1), box-shadow 0.4s ease;
}
.cj-svc__proof a:is(:hover, :focus-visible) img {
	transform: translateY(-8px) scale(1.015);
	box-shadow: 0 24px 48px -18px rgba(80, 0, 35, 0.55);
}
.cj-servizi .cj-svc__proof figcaption {
	margin-top: 0.75rem;
	font-size: 0.8rem;
	font-weight: 700; /* small-print rule */
	line-height: 1.4;
	letter-spacing: 0.02em;
	color: var(--cj-white);
	text-align: left;
}
/* Rows with no proof that can be shown (PR, Inbound): the stipple art slot stays empty until the art exists. */
.cj-svc.cj-svc--noproof { grid-template-areas: /* beats :nth-child(even) */
		"num   num   num   num   num   num   num   num   num   .     .     ."
		"title title title title title title title title title title .     ."
		"text  text  text  text  text  text  text  .     .     .     .     ."
		"more  more  more  more  more  more  more  .     .     .     .     ."; }

/* View-transition names: one per service, shared by the row proof and the service page hero. */
#campagne .cj-svc__proof img,            .cj-vt-campagne img            { view-transition-name: cj-vt-campagne; } /* not #pubblicita: ad blockers hide it (EasyList Italy ###pubblicita) */
#eventi .cj-svc__proof img,              .cj-vt-eventi img              { view-transition-name: cj-vt-eventi; }
#fiere .cj-svc__proof img,               .cj-vt-fiere img               { view-transition-name: cj-vt-fiere; }
#brand-narrative-design .cj-svc__proof img, .cj-vt-brand-narrative-design img { view-transition-name: cj-vt-brand-narrative-design; }
#web .cj-svc__proof img,                 .cj-vt-web img                 { view-transition-name: cj-vt-web; }
#brand-image .cj-svc__proof img,         .cj-vt-brand-image img         { view-transition-name: cj-vt-brand-image; }
#packaging .cj-svc__proof img,           .cj-vt-packaging img           { view-transition-name: cj-vt-packaging; }
#retail-hospitality .cj-svc__proof img,  .cj-vt-retail-hospitality img  { view-transition-name: cj-vt-retail-hospitality; }

/* ---------- 3. Metodo (black panel) ---------- */
.cj-servizi .entry-content .cj-metodo {
	position: relative;
	margin-block: clamp(3rem, 8vh, 6rem) 0;
	padding: clamp(3rem, 10vh, 7rem) clamp(16px, 6vw, 96px);
	background: var(--cj-black);
	color: var(--cj-white);
}
.cj-metodo h2 { margin: 0 0 2.5rem; font-size: clamp(2rem, 1rem + 4vw, 5rem); font-weight: 700; line-height: 1; color: var(--cj-white); }
.cj-servizi .entry-content .cj-metodo ol {
	position: relative;
	display: grid;
	gap: clamp(1.5rem, 4vh, 2.75rem);
	margin: 0;
	padding: 0 0 0 2.25rem;
	list-style: none;
	counter-reset: step;
}
.cj-metodo ol::before,
.cj-metodo ol::after { /* the rail, and its progress (scaleY driven by --p from servizi.js) */
	content: "";
	position: absolute;
	left: 0.45rem;
	top: 0.5rem;
	bottom: 0.5rem;
	width: 2px;
	background: rgba(255, 255, 255, 0.25);
}
.cj-metodo ol::after { background: var(--cj-pink); transform-origin: top; transform: scaleY(var(--p, 1)); }
.cj-servizi .entry-content .cj-metodo li {
	position: relative;
	counter-increment: step;
	max-width: 46ch;
	margin: 0;
	font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
	font-weight: 400;
	line-height: 1.5;
	transition: opacity 0.3s ease;
}
.cj-metodo li::before {
	content: "";
	position: absolute;
	left: calc(-2.25rem + 0.45rem - 5px);
	top: 0.55em;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--cj-black);
	border: 2px solid var(--cj-pink);
	z-index: 1;
}
.cj-metodo li strong { font-weight: 700; color: var(--cj-white); }
.cj-js .cj-metodo li:not(.is-on) { opacity: 0.45; }
.cj-metodo li.is-on::before { background: var(--cj-pink); }

/* ---------- 4. Clients marquee (Blocksy content block 25044, the home logos) ---------- */
.cj-svc-clients { padding: clamp(3rem, 8vh, 5rem) 0; overflow: hidden; }
.cj-svc-clients h2 { margin: 0 0 2rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.cj-marquee-on .cj-svc-clients :is(.wp-block-columns, .wp-block-column) { display: block; margin: 0; }
.cj-marquee-on .cj-svc-clients .wp-block-gallery {
	display: flex !important;
	flex-wrap: nowrap !important;
	gap: clamp(2rem, 5vw, 4.5rem) !important;
	width: max-content;
	margin: 0;
	will-change: transform;
}
.cj-marquee-on .cj-svc-clients .wp-block-gallery > figure.wp-block-image {
	flex: 0 0 auto !important;
	width: clamp(110px, 12vw, 170px) !important;
	margin: 0 !important;
}

/* ---------- 5. CTA band (white paper, pink type) ---------- */
.cj-servizi .entry-content .cj-svc-cta {
	padding: clamp(3.5rem, 12vh, 8rem) clamp(16px, 6vw, 96px);
	background: var(--cj-white);
	color: var(--cj-pink);
}
.cj-svc-cta h2 { margin: 0 0 clamp(2rem, 4vh, 3rem); max-width: 16ch; font-size: clamp(2.25rem, 1rem + 5vw, 6rem); font-weight: 700; line-height: 1; letter-spacing: -0.03em; color: var(--cj-pink); }
/* The CTA band is white paper: the slab button (base.css §6) flips to pink. */
.cj-svc-cta { --cj-btn-bg: var(--cj-pink); --cj-btn-fg: var(--cj-white); --cj-btn-wipe: var(--cj-pink-40); --cj-btn-wipe-fg: var(--cj-white); }

/* ---------- 6. Service pages ---------- */
.cj-servizi .entry-content .cj-svc-body { margin-block: 0 clamp(3rem, 8vh, 6rem); }
.cj-servizi .entry-content .cj-svc-body__text {
	max-width: 46ch;
	margin: 0 0 0 auto; /* sits to the right, under the hero: a column of reading after the picture */
	font-size: clamp(1.25rem, 1.1rem + 0.55vw, 1.625rem);
	font-weight: 500;
	line-height: 1.45;
}
.cj-servizi .entry-content .cj-svc-body__text + .cj-svc-body__text { /* r4 (2026-11-16): the lede, then reading text in the same column */
	margin-top: 1.25em;
	font-size: clamp(1.05rem, 1rem + 0.25vw, 1.2rem);
	font-weight: 400;
	line-height: 1.6;
}
/* One reading column for the lede and the paragraphs after it (r4): a ch measure would shrink with the smaller type. */
.cj-servizi .entry-content .cj-svc-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 40rem); }
.cj-servizi .entry-content .cj-svc-body > .cj-svc-body__text { grid-column: 2; max-width: none; margin-left: 0; margin-right: 0; }
@media (max-width: 899.98px) {
	.cj-servizi .entry-content .cj-svc-body { grid-template-columns: minmax(0, 1fr); }
	.cj-servizi .entry-content .cj-svc-body > .cj-svc-body__text { grid-column: 1; }
}
.cj-servizi .entry-content .cj-svc-standfirst {
	max-width: var(--cj-standfirst-measure); /* the project standfirst (tokens.css) */
	margin-block: var(--cj-atl-gap) clamp(2rem, 6vh, 4rem);
	font-size: var(--cj-standfirst-size);
	font-weight: 500;
	line-height: var(--cj-standfirst-leading);
	letter-spacing: var(--cj-standfirst-tracking);
}
.cj-svc-hero { margin-block: 0 clamp(3rem, 8vh, 6rem) !important; } /* inline margins stay auto (constrained layout) */
.cj-svc-hero img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; }
.cj-svc-hero figcaption { margin-top: 0.75rem; font-size: 0.8rem; font-weight: 700; color: var(--cj-white); text-align: left; }
.cj-servizi .entry-content :is(.cj-svc-work, .cj-svc-what, .cj-svc-news) > h2 {
	margin: 0 0 1.5rem;
	font-size: clamp(2rem, 1rem + 3.5vw, 4.5rem);
	font-weight: 700;
	line-height: 1;
}
.cj-svc-work__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(1rem, 2.5vw, 2rem);
	margin-bottom: clamp(3rem, 8vh, 6rem);
}
.cj-svc-work__grid figure { margin: 0 !important; }
/* The link is inline-block by default (core image block): it shrinks to the image's intrinsic width, so an SVG
   without a width attribute rendered narrower and shorter than its column (2026-11-19). Block = full column. */
.cj-svc-work__grid figure > a { display: block; }
.cj-svc-work__grid img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.1, 1); }
.cj-svc-work__grid a:is(:hover, :focus-visible) img { transform: translateY(-6px); }
.cj-svc-work__grid:has(+ .cj-svc-work__all) { margin-bottom: 1.75rem; }
.cj-servizi .entry-content .cj-svc-work__all { margin: 0 0 clamp(3rem, 8vh, 6rem); } /* link to the portfolio archive (inc/portfolio.php) */
/* Layout hero tiles (rules/06 §4): the SVG layout on its brand ground, never cropped (as img.cj-pf-layout on /portfolio). */
.cj-svc-work__grid img.cj-pf-layout { box-sizing: border-box; padding: clamp(0.75rem, 6%, 1.75rem); background: var(--cj-pf-ground, var(--cj-surface)); object-fit: contain; }
.cj-svc-work__grid figcaption { margin-top: 0.6rem; font-size: 0.8rem; font-weight: 700; color: var(--cj-white); text-align: left; }
/* «Su Squeeze» (2026-11-16): news about the service's work, as on the portfolio pages (portfolio.css .cj-pf-news). */
.cj-servizi .entry-content .cj-svc-news ul { margin: 0 0 clamp(3rem, 8vh, 6rem); padding: 0; list-style: none; }
.cj-servizi .entry-content .cj-svc-news li { padding-top: 0.9rem; border-top: 1px solid rgba(255, 255, 255, 0.55); }
.cj-servizi .entry-content .cj-svc-news li + li { margin-top: 0.9rem; }
.cj-servizi .entry-content .cj-svc-news a { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem; color: var(--cj-white); text-decoration: none; }
.cj-svc-news time { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.cj-svc-news__title { font-size: clamp(1.3rem, 1rem + 1vw, 2rem); font-weight: 700; line-height: 1.1; border-bottom: 2px solid transparent; }
.cj-svc-news a:is(:hover, :focus-visible) .cj-svc-news__title { border-bottom-color: currentColor; }
.cj-svc-what__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.25rem clamp(2rem, 4vw, 4rem); margin-bottom: clamp(3rem, 8vh, 6rem); }
.cj-servizi .entry-content .cj-svc-what__item { padding-top: 1.1rem; border-top: 1px solid rgba(255, 255, 255, 0.55); }
.cj-servizi .entry-content .cj-svc-what__item h3 { margin: 0 0 0.6rem; font-size: clamp(1.3rem, 1rem + 1vw, 1.75rem); font-weight: 700; line-height: 1.15; }
.cj-servizi .entry-content .cj-svc-what__text { max-width: 56ch; margin: 0; line-height: 1.55; }
@media (max-width: 899.98px) { .cj-svc-what__grid { grid-template-columns: minmax(0, 1fr); } }
.cj-servizi .entry-content .cj-svc-what ul { margin: 0 0 clamp(3rem, 8vh, 6rem); padding: 0; list-style: none; display: grid; gap: 1.1rem; }
.cj-servizi .entry-content .cj-svc-what li { max-width: 52ch; padding-top: 1.1rem; border-top: 1px solid rgba(255, 255, 255, 0.55); }

/* ---------- 7. Tablet and phone ---------- */
@media (max-width: 899.98px) {
	.cj-svc,
	.cj-svc:nth-child(even),
	.cj-svc--noproof {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas: "num" "title" "text" "proof" "more";
		grid-template-rows: none;
	}
	.cj-svc__proof { margin: 0.5rem 0 1.5rem !important; }
	.cj-svc-work__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 559.98px) {
	.cj-svc-work__grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
	.cj-svc__proof img,
	.cj-svc-work__grid img,
	.cj-svc__more a::after { transition: none; }
	.cj-js .cj-metodo li:not(.is-on) { opacity: 1; }
}
