﻿/**
 * "Chi Sono" page — editorial hero, pinned horizontal path section,
 * manifesto, full-purple client-relationship band, closing CTA.
 * Scoped entirely under body.page-chi-sono so it never leaks onto
 * other pages.
 */

/* Same WordPress "constrained layout" gotcha as the hero slider: the
   Custom HTML block sits as a direct child of .wp-block-post-content,
   which auto-applies max-width + margin:auto to its children. Must be
   overridden on both the parent and .chi-sono itself. */
body.page-chi-sono main.wp-block-group,
body.page-chi-sono .wp-block-post-content {
	max-width: none;
	width: 100%;
	margin: 0;
	padding: 0;
}

body.page-chi-sono .chi-sono {
	background: var( --wp--preset--color--anthracite, #2b2e33 );
	color: var( --wp--preset--color--secondary, #ededed );
	overflow-x: clip;
	max-width: none !important;
	width: 100%;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

body.page-chi-sono .chi-sono section {
	position: relative;
	padding: clamp( 60px, 10vw, 140px ) clamp( 24px, 6vw, 96px );
}

/* ---------- 1. Hero ---------- */

/* Selector matches (and slightly beats) the specificity of
   `.chi-sono section` above — a plain `.cs-hero` class rule was
   silently losing to it, so padding-top edits here had no visible
   effect no matter the value. */
body.page-chi-sono .chi-sono section.cs-hero {
	display: grid;
	grid-template-columns: 1.1fr 0.9fr;
	align-items: center;
	gap: clamp( 32px, 6vw, 96px );
	padding-top: clamp( 120px, 14vw, 180px );
}

/* The tighter, top-aligned spacing is a desktop-only correction — the
   original center/large-padding values already read fine on
   tablet/mobile (where the layout stacks to a single column), so they
   stay untouched below 901px. */
@media ( min-width: 901px ) {
	body.page-chi-sono .chi-sono section.cs-hero {
		align-items: start;
		padding-top: clamp( 24px, 3vw, 40px );
	}
}

/* cs-eyebrow defined in global-theme.css */

.cs-hero__title {
	font-family: var( --wp--preset--font-family--manrope );
	font-weight: 800;
	font-size: clamp( 2.6rem, 5.2vw, 4.6rem );
	line-height: 1.05;
	margin: 0 0 1.75rem;
}

.cs-accent-primary {
	color: var( --wp--preset--color--primary, #8841e7 );
}

.cs-hero__p {
	font-family: var( --wp--preset--font-family--dm-sans );
	font-size: clamp( 1rem, 1.3vw, 1.15rem );
	line-height: 1.65;
	max-width: 42rem;
	opacity: 0.85;
	margin: 0 0 1.1rem;
}

.cs-hero__photo {
	position: relative;
	border-radius: 8px;
	overflow: hidden;
	aspect-ratio: 4 / 5;
}

.cs-hero__photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	filter: grayscale( 1 );
}

/* ---------- 2. Percorso (pinned horizontal) ---------- */

body.page-chi-sono .chi-sono section.cs-path {
	padding: 0;
	overflow: hidden;
}

.cs-path__pin {
	height: 100vh;
	overflow: hidden;
	display: flex;
	align-items: center;
}

.cs-path__track {
	display: flex;
	will-change: transform;
}

.cs-chapter {
	flex: 0 0 calc( 100vw - clamp( 48px, 5vw, 96px ) );
	min-height: calc( 100vh - clamp( 120px, 20vh, 280px ) );
	margin: clamp( 60px, 10vh, 140px ) clamp( 24px, 2.5vw, 48px );
	display: grid;
	grid-template-columns: clamp( 200px, 18vw, 260px ) 1fr clamp( 180px, 18vw, 260px );
	align-items: center;
	gap: 32px clamp( 24px, 3vw, 56px );
	padding: clamp( 40px, 5vh, 80px ) clamp( 80px, 12vw, 200px );
	box-sizing: border-box;
	background: var( --surface, #33373d );
	border-radius: clamp( 12px, 1.5vw, 20px );
	box-shadow: 0 8px 48px rgba( 0, 0, 0, 0.4 ), 0 0 0 1px var( --border );
}

.cs-chapter__number {
	font-family: var( --wp--preset--font-family--manrope );
	font-weight: 800;
	font-size: clamp( 5rem, 12vw, 11rem );
	line-height: 1;
	text-align: right;
}

.cs-chapter--01 .cs-chapter__number {
	color: var( --wp--preset--color--primary, #8841e7 );
}

.cs-chapter--02 .cs-chapter__number {
	color: var( --cs-cyan, #22e1ff );
}

.cs-chapter--03 .cs-chapter__number {
	color: var( --cs-orange, #ff7a1a );
}

.cs-chapter__body h2 {
	font-family: var( --wp--preset--font-family--manrope );
	font-weight: 700;
	font-size: clamp( 1.6rem, 2.6vw, 2.4rem );
	line-height: 1.15;
	margin: 0 0 1.25rem;
	max-width: 30ch;
}

.cs-chapter__body p {
	font-family: var( --wp--preset--font-family--dm-sans );
	font-size: clamp( 0.95rem, 1.15vw, 1.05rem );
	line-height: 1.65;
	opacity: 0.8;
	max-width: 46ch;
	margin: 0 0 1rem;
}

.cs-chapter__side {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	width: 100%;
	overflow: hidden;
}

.cs-tool-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 1.6rem;
}

.cs-tool-list li {
	display: flex;
	align-items: center;
	gap: 1rem;
	font-family: var( --wp--preset--font-family--dm-sans );
	font-size: 1.05rem;
	opacity: 0.85;
}

.cs-tool-list svg,
.cs-tool-list img {
	width: 52px;
	height: 52px;
	flex-shrink: 0;
	object-fit: contain;
}

.cs-wireframe,
.cs-ai-visual {
	width: clamp( 160px, 18vw, 240px );
	height: auto;
	opacity: 0.9;
}

.cs-wireframe {
	color: var( --cs-cyan, #22e1ff );
}

.cs-ai-visual {
	color: var( --cs-orange, #ff7a1a );
}

/* PNG icon images for chapter sides */
.cs-chapter__icon-img {
	height: clamp( 180px, 20vw, 240px );
	width: auto;
	max-width: none;
	object-fit: cover;
	display: block;
}

/* Slide 02 ha margine interno trasparente: aumento l'altezza per compensare */
.cs-chapter--02 .cs-chapter__icon-img {
	height: clamp( 240px, 28vw, 340px );
}

/* ---------- 3. Manifesto ---------- */

body.page-chi-sono .cs-manifesto {
	max-width: 60rem;
	margin: 0 auto;
	text-align: center;
	padding-top: clamp( 100px, 14vw, 180px );
	padding-bottom: clamp( 100px, 14vw, 180px );
}

.cs-manifesto__title {
	font-family: var( --wp--preset--font-family--manrope );
	font-weight: 800;
	font-size: clamp( 1.8rem, 4vw, 3.2rem );
	line-height: 1.25;
	margin: 0 0 2.5rem;
}

.cs-word {
	color: var( --text );
	opacity: 0.12;
}

.cs-word--accent {
	color: var( --accent-purple );
}

.cs-manifesto p {
	font-family: var( --wp--preset--font-family--dm-sans );
	font-size: clamp( 1rem, 1.2vw, 1.15rem );
	line-height: 1.7;
	opacity: 0.8;
	margin: 0 0 1rem;
}

/* ---------- 4. Rapporto col cliente (full purple) ---------- */

body.page-chi-sono .cs-relationship {
	background: var( --wp--preset--color--primary, #8841e7 );
	color: var( --wp--preset--color--secondary, #ededed );
	text-align: center;
}

.cs-relationship h2 {
	font-family: var( --wp--preset--font-family--manrope );
	font-weight: 800;
	font-size: clamp( 2.2rem, 4vw, 3.8rem );
	max-width: 24ch;
	margin: 0 auto clamp( 40px, 6vw, 72px );
	line-height: 1.1;
}

.cs-relationship__grid {
	display: grid;
	grid-template-columns: repeat( 3, 1fr );
	gap: clamp( 24px, 4vw, 48px );
	max-width: 56rem;
	margin: 0 auto;
}

.cs-rel-item svg,
.cs-rel-icon {
	width: 80px;
	height: 80px;
	margin-bottom: 1.25rem;
	object-fit: contain;
}

/* Bordi laterali sul box centrale "Confronto" */
.cs-relationship__grid .cs-rel-item:nth-child(2) {
	border-left: 1px solid rgba( 255, 255, 255, 0.3 );
	border-right: 1px solid rgba( 255, 255, 255, 0.3 );
	padding-left: clamp( 16px, 3vw, 40px );
	padding-right: clamp( 16px, 3vw, 40px );
}

/* Icons on purple background: force white so neon purple isn't lost */
.cs-relationship .cs-rel-icon {
	filter: brightness( 0 ) invert( 1 );
}

.cs-rel-item h3 {
	font-family: var( --wp--preset--font-family--manrope );
	font-weight: 700;
	font-size: 1.15rem;
	margin: 0 0 0.5rem;
}

.cs-rel-item p {
	font-family: var( --wp--preset--font-family--dm-sans );
	font-size: 0.9rem;
	opacity: 0.85;
	margin: 0;
}

/* ---------- 5. Chiusura ---------- */

body.page-chi-sono .cs-closing {
	display: grid;
	grid-template-columns: 1.1fr 0.9fr;
	gap: clamp( 32px, 6vw, 96px );
	align-items: center;
}

.cs-closing__title {
	font-family: var( --wp--preset--font-family--manrope );
	font-weight: 800;
	font-size: clamp( 2.2rem, 4.6vw, 3.8rem );
	line-height: 1.08;
	margin: 0;
}

.cs-closing__right p {
	font-family: var( --wp--preset--font-family--dm-sans );
	font-size: clamp( 0.95rem, 1.1vw, 1.05rem );
	line-height: 1.65;
	opacity: 0.85;
	margin: 0 0 1rem;
}

.cs-btn-outline {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	margin-top: 1rem;
	padding: 0.9rem 1.8rem;
	border: 1px solid var( --wp--preset--color--primary, #8841e7 );
	border-radius: 999px;
	color: var( --wp--preset--color--secondary, #ededed );
	font-family: var( --wp--preset--font-family--manrope );
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.cs-btn-outline:hover {
	background: var( --wp--preset--color--primary, #8841e7 );
	color: #17181a;
}

/* ---------- Reveal states (JS toggles these) ---------- */

.cs-reveal {
	opacity: 0;
	transform: translateY( 24px );
}

.cs-reveal.is-in {
	opacity: 1;
	transform: none;
	transition: opacity 0.9s ease, transform 0.9s ease;
}

.cs-hero__photo.cs-reveal {
	transform: none;
	clip-path: inset( 0 0 100% 0 );
}

.cs-hero__photo.cs-reveal.is-in {
	clip-path: inset( 0 0 0% 0 );
	transition: clip-path 1.1s cubic-bezier( 0.22, 1, 0.36, 1 );
}

/* ---------- Responsive ---------- */

@media ( max-width: 900px ) {
	body.page-chi-sono .chi-sono section.cs-hero {
		grid-template-columns: 1fr;
	}

	.cs-hero__photo {
		order: -1;
		aspect-ratio: 16 / 10;
	}

	.cs-chapter {
		grid-template-columns: 1fr;
		text-align: left;
		gap: 24px;
	}

	.cs-chapter__side {
		justify-content: flex-start;
	}

	.cs-relationship__grid {
		grid-template-columns: 1fr;
	}

	body.page-chi-sono .cs-closing {
		grid-template-columns: 1fr;
	}
}

/* Light mode: aggiungi bordo e ombra più marcata per far emergere la card */
[data-theme="light"] .cs-chapter {
	box-shadow: 0 4px 32px rgba( 0, 0, 0, 0.10 ), 0 0 0 1px rgba( 43, 46, 51, 0.12 );
}

/* Tablet: mantiene scroll orizzontale ma nasconde le immagini lato */
@media ( min-width: 768px ) and ( max-width: 900px ) {
	.cs-chapter {
		grid-template-columns: auto 1fr;
	}

	.cs-chapter__side {
		display: none;
	}
}

/* Mobile: layout verticale, nessuno scroll orizzontale */
@media ( max-width: 767px ) {
	body.page-chi-sono .chi-sono section.cs-path {
		overflow: visible;
		padding: clamp( 16px, 4vw, 32px );
	}

	.cs-path__pin {
		height: auto;
		overflow: visible;
		display: block;
	}

	.cs-path__track {
		display: block;
		transform: none !important;
	}

	.cs-chapter {
		flex: none;
		width: 100%;
		min-height: 0;
		margin: 0 0 clamp( 16px, 3vw, 24px );
		border-radius: 12px;
	}

	.cs-chapter:last-child {
		margin-bottom: 0;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.cs-reveal,
	.cs-reveal.is-in,
	.cs-hero__photo.cs-reveal,
	.cs-hero__photo.cs-reveal.is-in {
		transition: none !important;
		opacity: 1 !important;
		transform: none !important;
		clip-path: none !important;
	}
}
