/* CJ base layer: typography, contrast rules, brand fixes. Loads after Blocksy and the Customizer CSS. */

/* ---------- 1. Jost everywhere (named exceptions are SVG/images: logo, SQUEEZE, client logos) ---------- */
html body,
[data-prefix] .entry-header .page-title,
.wp-block-pullquote {
	--theme-font-family: var(--cj-font);
	font-family: var(--cj-font);
}
body {
	font-weight: 400;
	-webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6,
.page-title,
.wp-block-heading {
	font-family: var(--cj-font);
	text-transform: none;
	letter-spacing: -0.01em;
}
/* Page headings (H1): 600, uppercase (Stefano 2026-11-09). The home .cj-h1 keeps its own 700. */
[data-prefix] .entry-header .page-title,
.entry-content h1:not(.cj-h1) {
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0;
}

/* ---------- 2. Contrast rules on pink (white on #ff0077 = 3.8:1: AA for large text only) ---------- */
/* Large-type rule: running copy on pink ≥ 20px, weight 500. */
/* Not: card meta (portfolio/news tags), cards, navigation, term lists. */
.entry-content :is(p, li):not([class*="-font-size"], .entry-meta li, .entry-card :is(p, li), nav li, .wp-block-post-terms *) {
	font-size: clamp(1.125rem, 1.02rem + 0.45vw, 1.375rem);
	font-weight: 500;
	line-height: 1.5;
}
/* Small-print rule: below 18.66px means bold. */
.ct-footer,
.ct-footer p,
.ct-footer a,
figcaption,
.entry-meta,
small {
	font-weight: 700;
}

/* Footer legal line (customizer copyright_text, staging/tools/footer-legal.php): two groups that wrap as units.
   One line: "Copyright © 2009-2026 Communication Juice Srl – Dati Aziendali - IVA …". Wrapped: the dash
   that would start line 2 sits in the negative margin and is clipped. */
.ct-footer-copyright:has(.cj-legal) { overflow: hidden; }
.cj-legal { margin-inline-start: -1.1em !important; }
.cj-legal__part { display: inline-block; }
/* Phones: the bottom footer row stacks (it kept 2 columns of ~147px: copyright | socials). */
@media (max-width: 689.98px) {
	[data-footer] .ct-footer [data-row="bottom"] > .ct-container { grid-template-columns: 1fr; row-gap: 1.25rem; } /* beats Blocksy's mobile 1fr 1fr */
}
.cj-legal__part::before {
	content: "–";
	display: inline-block;
	width: 1.1em;
	text-align: center;
}

/* Card tags (portfolio / news archive): small print, 0.65rem (was 0.5rem = 8px). */
.entry-card .entry-meta,
.entry-card .entry-meta :is(li, a, span) {
	font-size: 0.65rem;
	letter-spacing: 0.04em;
}

/* Paper exception: long-form reading (news articles) sits on a white sheet. */
body.single-post .entry-content {
	background: var(--cj-white);
	color: var(--cj-anthracite);
	padding: clamp(1.25rem, 4vw, 3.5rem);
	border-radius: 4px;
	--theme-text-color: var(--cj-anthracite);
	--theme-heading-color: var(--cj-anthracite);
	--theme-link-initial-color: var(--cj-pink-20);
	--theme-link-hover-color: var(--cj-pink-40);
}
body.single-post .entry-content :is(p, li) {
	font-size: 1.125rem;
	font-weight: 400;
	line-height: 1.65;
	color: var(--cj-anthracite);
}
body.single-post .entry-content :is(h1, h2, h3, h4) { color: var(--cj-anthracite); }
body.single-post .entry-content a { color: var(--cj-pink-20); }

/* ---------- 3. Kill the old #ff0073 ---------- */
/* Logo SVG contrast circle (footer widget / header text) */
#bg_contrast,
[id="bg_contrast"] * {
	fill: var(--cj-pink);
}
/* Complianz cookie banner (until its plugin settings are fixed in the DB) */
.cmplz-cookiebanner {
	--cmplz_banner_background_color: var(--cj-pink);
	--cmplz_banner_border_color: var(--cj-pink);
	--cmplz_button_accept_background_color: var(--cj-white);
	--cmplz_button_accept_border_color: var(--cj-white);
	--cmplz_button_accept_text_color: var(--cj-pink);
	--cmplz_button_deny_background_color: var(--cj-pink-20);
	--cmplz_button_deny_border_color: var(--cj-white);
	--cmplz_button_deny_text_color: var(--cj-white);
	--cmplz_button_settings_background_color: var(--cj-pink-20);
	--cmplz_button_settings_border_color: var(--cj-white);
	--cmplz_button_settings_text_color: var(--cj-white);
	font-family: var(--cj-font);
}

/* ---------- 4. Home H1: Lettere solide (hidden words in COMUNICHIAMO) ---------- */
/* The H1 block's container fills the first screen (minus the header) and centres the word. */
.cj-home :is(.gspb_container, .cj-hero-h1):has(> .cj-h1) {
	min-height: calc(100svh - var(--header-height, 120px));
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
}
.cj-h1 {
	position: relative;
	margin: 0 auto;
	font-family: var(--cj-font);
	font-weight: 700; /* Stefano 2026-11-09: 900 too heavy for COMUNICHIAMO */
	font-size: clamp(2.2rem, 9.2vw, 10.5rem); /* fits COMUNICHIAMO with margins */
	line-height: 0.9;
	letter-spacing: -0.03em;
	text-transform: uppercase;
	color: var(--cj-white);
	text-align: center;
	white-space: nowrap;
}
.cj-h1__l {
	display: inline-block;
	will-change: transform;
}
.cj-h1__reading {
	margin: 0.9em auto 0;
	min-height: 1.4em;
	font-family: var(--cj-font);
	font-weight: 500;
	font-size: clamp(1rem, 0.9rem + 0.6vw, 1.5rem);
	letter-spacing: 0.24em;
	text-transform: lowercase;
	text-align: center;
	color: var(--cj-white);
}
.cj-h1__reading b { font-weight: 800; }

/* ATL editor's note: bottom of the first frame, 1px white rule, small print (bold, per the small-print rule).
   A real H2 in the HTML, styled as a paragraph; assets/js/home.js holds it in place and fades it on scroll. */
.cj-home .cj-hero-h1 { position: relative; }
.cj-home .cj-atl-note {
	position: absolute;
	left: 0;
	right: 0;
	bottom: clamp(16px, 4svh, 40px);
	margin: 0 !important;
	padding-top: 0.75rem;
	border-top: 1px solid var(--cj-white);
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 2rem;
}
/* Weight 500: Stefano 2026-11-09, waiver of the small-print bold rule for this note. */
.cj-home .cj-atl-note__text {
	margin: 0;
	max-width: 46ch;
	font-family: var(--cj-font);
	font-size: clamp(0.875rem, 0.83rem + 0.2vw, 1rem);
	font-weight: 500;
	line-height: 1.45;
	letter-spacing: 0;
	text-transform: none;
	color: var(--cj-white);
}
.cj-home .cj-atl-note__text a {
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

/* "Ultimi lavori": one title at a time, stacked in one grid cell (inc/home-atl.php + home.js). Desktop only. */
.cj-home .cj-atl-work {
	flex: 0 1 auto;
	min-width: 0;
	text-align: right;
}
.cj-home .cj-atl-note .cj-atl-work__label {
	margin: 0 0 0.2rem;
	font-size: 0.65rem;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	opacity: 0.8;
}
.cj-home .cj-atl-note .cj-atl-work__list {
	display: grid;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow: hidden;
}
.cj-home .cj-atl-note .cj-atl-work__item {
	grid-area: 1 / 1;
	margin: 0;
	font-size: clamp(0.875rem, 0.83rem + 0.2vw, 1rem);
	font-weight: 500;
	line-height: 1.45;
	white-space: nowrap;
}
.cj-home .cj-atl-work__item:not(:first-child) { visibility: hidden; } /* until home.js takes over */
.cj-home .cj-atl-work__item a { color: inherit; text-decoration: none; }
.cj-home .cj-atl-work__item a:is(:hover, :focus-visible) { text-decoration: underline; text-underline-offset: 0.2em; }
@media (max-width: 799px) {
	.cj-home .cj-atl-work { display: none; }
}

/* AMO heart stream (hover/tap on A-M-O) */
.cj-h1__l--amo { cursor: default; }
.cj-hearts {
	position: absolute;
	inset: 0;
	pointer-events: none;
	overflow: visible;
}
.cj-heart,
.cj-heart path {
	fill: none !important;
}
.cj-heart {
	position: absolute;
	width: 0.2em;
	height: 0.2em;
	fill: none;
	stroke: var(--cj-white);
	stroke-width: 1.6;
	stroke-linejoin: round;
}

/* ---------- 5a. Home sections: native core/group (were Greenshift containers, Stefano 2026-11-09) ---------- */
/* Same layout Greenshift generated: flex column, centred; statement text max 888px (600px under 1000px).
   Statements and clients: min-height 100vh, as Greenshift had. */
.cj-home .home-hero,
.cj-home .home-hero__inner {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	box-sizing: border-box;
}
.cj-home .home-hero.hh-portfolio { display: block; }
.cj-home .home-hero:not(.hh-portfolio) { min-height: 100vh; } /* mobile: Additional CSS sets 70vh !important */
.cj-home .home-hero__inner { max-width: 888px; }
@media (max-width: 999.98px) {
	.cj-home .home-hero__inner { max-width: 600px; }
}

/* ---------- 5. Home statement stage (assets/js/home.js) ---------- */
.has-cj-stage .cj-stage {
	position: relative;
	height: 100svh;
	overflow: hidden;
}
.has-cj-stage .cj-stage > .home-hero {
	position: absolute !important; /* Greenshift sets position on the container id */
	inset: 0 !important;
	width: auto !important;
	max-width: none !important;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 !important;
	padding: var(--header-height, 70px) clamp(16px, 5vw, 80px) 0 !important;
}
.has-cj-stage .cj-stage > .home-hero > * {
	width: min(100%, 1100px);
	margin: 0 auto !important;
}
.has-cj-stage .cj-stage h2 { perspective: 600px; }
.cj-w { display: inline-block; will-change: transform, opacity; }
.battito-pulse { font-style: normal; font-weight: 800; transform-origin: center; }
/* Blob: off-palette #A8004F in the page markup → brand shade-20 */
#liquid-blob path { fill: var(--cj-pink-20); }

/* ---------- 6. Buttons: square-cut slab, no idle pulse (Stefano 2026-11-09) ---------- */
/* Additional CSS (Customizer) pulses every content button and submit forever (scale + ring, 1.5s loop).
   Motion now answers intent only: on hover/focus the fill wipes in from the left and the arrow moves.
   Colours via --cj-btn-*: white slab on pink by default; sections on white set their own (servizi.css). */
html body .entry-content a.wp-block-button__link,
html body .entry-content .wp-element-button,
html body.front-page #main a.wp-block-button__link,
html body .pulsa,
html body input[type="submit"] {
	animation: none !important;
	box-shadow: none !important;
	transform: none;
}
html body .entry-content a.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 0.75em;
	padding: 0.95em 1.35em;
	border: 0;
	border-radius: 4px;
	background: linear-gradient(var(--cj-btn-wipe, var(--cj-pink-20)), var(--cj-btn-wipe, var(--cj-pink-20))) no-repeat left / 0% 100%,
		var(--cj-btn-bg, var(--cj-white));
	color: var(--cj-btn-fg, var(--cj-pink));
	font-family: var(--cj-font);
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.2;
	text-transform: uppercase;
	text-decoration: none;
	transition: background-size 0.4s cubic-bezier(0.2, 0.7, 0.1, 1), color 0.25s ease;
}
html body .entry-content a.wp-block-button__link::after {
	content: "→";
	display: inline-block;
	transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.1, 1);
}
html body .entry-content a.wp-block-button__link:is(:hover, :focus-visible) {
	background-size: 100% 100%, auto;
	color: var(--cj-btn-wipe-fg, var(--cj-white));
}
html body .entry-content a.wp-block-button__link:is(:hover, :focus-visible)::after { transform: translateX(0.35em); }
html body .entry-content a.wp-block-button__link:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
html body input[type="submit"] { border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
	html body .entry-content a.wp-block-button__link,
	html body .entry-content a.wp-block-button__link::after { transition: none; }
}
