/* ==========================================================================
   Accueil « carnet animé »
   Les états de départ des animations ne s'appliquent que sous html.cb-anim
   (ajoutée par home.js si le mouvement est autorisé) : sans JS, tout est visible.
   ========================================================================== */

.cb-home {
	--gutter: clamp(20px, 4vw, 64px);
	overflow-x: clip;
	color: var(--cb-ink);
	background: var(--cb-bg);
}

.cb-home a {
	color: inherit;
	text-decoration: none;
}

.cb-home h1,
.cb-home h2,
.cb-home h3 {
	margin: 0;
	font-family: var(--cb-font-sans);
	color: var(--cb-ink);
}

.cb-kicker {
	margin: 0 0 1.2rem;
	font-family: var(--cb-font-sans);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--cb-blue);
}

/* ---------- Hero ---------- */
/* Une seule colonne de texte, sans image : le titre prend la place */
.cb-hero {
	display: flex;
	align-items: center;
	min-height: calc(100svh - var(--cb-header-h, 76px));
	padding: clamp(28px, 5vw, 72px) var(--gutter) clamp(40px, 6vw, 96px);
}

/* Taille bornée par la largeur ET la hauteur : sur un écran large mais peu haut,
   le titre, l'intro et les boutons doivent tenir sans défiler */
.cb-hero__title {
	font-size: clamp(2.6rem, min(8.6vw, 12.5svh), 9.5rem);
	font-weight: 800;
	line-height: 0.98;
	letter-spacing: -0.045em;
}

/* Le masque de l'animation (overflow) doit laisser passer le trait sous « testé » :
   marge basse agrandie, compensée par une marge négative pour garder l'interligne */
.cb-line {
	display: block;
	overflow: hidden;
	padding-bottom: 0.18em;
	margin-bottom: -0.12em;
}

.cb-line > span {
	display: inline-block;
}

.cb-scribble {
	position: relative;
	font-style: normal;
	color: var(--cb-blue);
	white-space: nowrap;
}

.cb-scribble svg {
	position: absolute;
	left: -2%;
	bottom: -0.12em;
	width: 104%;
	height: 0.28em;
	overflow: visible;
}

.cb-scribble path {
	fill: none;
	stroke: var(--cb-blue);
	stroke-width: 5;
	stroke-linecap: round;
	stroke-dasharray: 260;
	stroke-dashoffset: 0;
}

.cb-hero__intro {
	max-width: 34rem;
	margin: clamp(20px, 2.4vw, 32px) 0 0;
	font-family: var(--cb-font-serif);
	font-size: clamp(1.1rem, 1.35vw, 1.3rem);
	line-height: 1.55;
	color: var(--cb-ink-soft);
}

.cb-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: clamp(24px, 3vw, 40px);
}

.cb-btn {
	display: inline-flex;
	align-items: center;
	padding: 14px 22px;
	border: 1.5px solid var(--cb-ink);
	border-radius: 100px;
	font-family: var(--cb-font-sans);
	font-size: 0.95rem;
	font-weight: 700;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.cb-home .cb-btn:hover {
	background: var(--cb-ink);
	color: #fff;
}

.cb-home .cb-btn--primary {
	background: var(--cb-ink);
	border-color: var(--cb-ink);
	color: var(--cb-paper);
}

.cb-home .cb-btn--primary:hover {
	background: var(--cb-blue);
	border-color: var(--cb-blue);
	color: #fff;
}


/* ---------- Bandeau défilant ---------- */
.cb-marquee {
	overflow: hidden;
	padding: clamp(14px, 2vw, 26px) 0;
	border-top: 1px solid var(--cb-ink);
	border-bottom: 1px solid var(--cb-ink);
	background: var(--cb-ink);
}

.cb-marquee__track {
	display: flex;
	width: max-content;
	animation: cb-marquee 38s linear infinite;
}

.cb-marquee span {
	padding-right: 0.6em;
	font-family: var(--cb-font-sans);
	font-size: clamp(2.2rem, 6vw, 5.5rem);
	font-weight: 800;
	line-height: 1;
	letter-spacing: -0.04em;
	white-space: nowrap;
	color: var(--cb-paper);
}

/* Bleu éclairci : le bleu de marque manque de contraste sur l'encre */
.cb-marquee i {
	font-style: normal;
	color: #8EA2F2;
}

@keyframes cb-marquee {
	to { transform: translateX(-50%); }
}

/* ---------- Titres de section ---------- */
.cb-section-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px 32px;
	padding: 0 var(--gutter);
	margin-bottom: clamp(20px, 3vw, 44px);
}

.cb-section-head h2 {
	font-size: clamp(2rem, 4vw, 3.6rem);
	font-weight: 800;
	letter-spacing: -0.04em;
}

.cb-section-head p {
	margin: 0;
	max-width: 26rem;
	font-family: var(--cb-font-serif);
	font-size: 1.1rem;
	color: var(--cb-ink-soft);
}

/* ---------- Index des univers ---------- */
.cb-index {
	position: relative;
	padding: clamp(64px, 9vw, 140px) 0 clamp(48px, 7vw, 110px);
}

.cb-index__list {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--cb-ink);
}

.cb-index__item {
	border-bottom: 1px solid var(--cb-ink);
}

.cb-index__item > a,
.cb-index__item > span {
	display: grid;
	grid-template-columns: 4rem minmax(0, 1fr) auto 3rem;
	align-items: center;
	gap: 16px;
	padding: clamp(14px, 2vw, 26px) var(--gutter);
	transition: background 0.35s, color 0.35s;
}

.cb-index__num {
	font-family: var(--cb-font-sans);
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--cb-blue);
}

.cb-index__name {
	font-family: var(--cb-font-sans);
	font-size: clamp(2.2rem, 6.5vw, 6.2rem);
	font-weight: 800;
	line-height: 1;
	letter-spacing: -0.05em;
	transition: transform 0.45s cubic-bezier(.2, .7, .2, 1);
}

.cb-index__meta {
	font-family: var(--cb-font-sans);
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--cb-ink-soft);
}

.cb-index__arrow {
	font-size: 2rem;
	justify-self: end;
	transition: transform 0.35s;
}

.cb-index__item > a:hover {
	background: var(--cb-ink);
	color: #fff;
}

.cb-index__item > a:hover .cb-index__name {
	color: #fff;
	transform: translateX(1.2rem);
}

.cb-index__item > a:hover .cb-index__meta {
	color: rgba(255, 255, 255, 0.7);
}

.cb-index__item > a:hover .cb-index__arrow {
	transform: translateX(-0.4rem) rotate(-45deg);
}

/* Rubriques à venir : gris clair plein (un contour fait apparaître les chevauchements de lettres) */
.cb-index__item.is-soon .cb-index__name {
	color: #CDD0DA;
}

/* Planche qui suit le curseur (souris uniquement) */
.cb-cursor-img {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 50;
	width: 300px;
	aspect-ratio: 5 / 3;
	border-radius: 12px;
	overflow: hidden;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.25s; /* position, échelle et rotation pilotées par GSAP */
	box-shadow: 0 20px 50px rgba(20, 23, 42, 0.25);
}

.cb-cursor-img.is-visible {
	opacity: 1;
}

.cb-cursor-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	background: #fff;
}

/* ---------- Derniers articles ---------- */
.cb-recents {
	padding: clamp(40px, 6vw, 90px) 0;
	background: var(--cb-tint);
	border-top: 1px solid var(--cb-line);
	border-bottom: 1px solid var(--cb-line);
}

.cb-recents__track {
	display: flex;
	gap: clamp(16px, 2vw, 28px);
	padding: 0 var(--gutter);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.cb-recents__track::-webkit-scrollbar {
	display: none;
}

/* Desktop animé : le rail est déplacé par GSAP, plus de défilement natif */
.cb-recents__track.is-pinned {
	overflow: visible;
	scroll-snap-type: none;
	will-change: transform;
}

.cb-card {
	flex: 0 0 clamp(270px, 34vw, 460px);
	scroll-snap-align: start;
}

.cb-card > a {
	display: block;
	height: 100%;
	border: 1px solid var(--cb-ink);
	border-radius: 18px;
	overflow: hidden;
	background: #fff;
	transition: transform 0.35s cubic-bezier(.2, .7, .2, 1), box-shadow 0.35s;
}

.cb-card > a:hover {
	transform: translateY(-6px) rotate(-0.6deg);
	box-shadow: 8px 8px 0 var(--cb-ink);
}

.cb-card__img {
	aspect-ratio: 5 / 3;
	overflow: hidden;
	border-bottom: 1px solid var(--cb-ink);
}

.cb-card__img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: left top;
	transition: transform 0.6s cubic-bezier(.2, .7, .2, 1);
}

.cb-card > a:hover .cb-card__img img {
	transform: scale(1.05);
}

.cb-card__body {
	padding: 20px 22px 24px;
}

.cb-card__cat {
	font-family: var(--cb-font-sans);
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--cb-blue);
}

.cb-home .cb-card__title {
	margin: 10px 0 16px;
	font-size: clamp(1.25rem, 1.7vw, 1.6rem);
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.025em;
}

.cb-card__more {
	font-family: var(--cb-font-sans);
	font-size: 0.85rem;
	font-weight: 700;
	border-bottom: 2px solid var(--cb-blue);
}

/* ---------- Qui écrit ici ---------- */
.cb-about {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
	gap: clamp(20px, 4vw, 64px);
	padding: clamp(64px, 9vw, 140px) var(--gutter);
}

.cb-home .cb-about__title {
	font-size: clamp(2rem, 4vw, 3.6rem);
	font-weight: 800;
	letter-spacing: -0.04em;
}

.cb-about__text {
	margin: 0;
	font-family: var(--cb-font-serif);
	font-size: clamp(1.35rem, 2.3vw, 2.15rem);
	line-height: 1.35;
	color: var(--cb-ink);
}

.cb-about__text strong {
	color: var(--cb-blue);
	font-weight: 600;
}

/* ---------- États de départ des animations (uniquement si home.js les gère) ---------- */
.cb-anim .cb-line > span {
	transform: translateY(105%);
}

.cb-anim .cb-scribble path {
	stroke-dashoffset: 260;
}

.cb-anim .cb-hero__intro,
.cb-anim .cb-hero__actions,
.cb-anim .cb-kicker {
	opacity: 0;
	transform: translateY(16px);
}

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
	.cb-index__item > a,
	.cb-index__item > span {
		grid-template-columns: 2.2rem minmax(0, 1fr) auto;
		gap: 10px;
	}

	.cb-index__arrow {
		display: none;
	}

	.cb-index__meta {
		font-size: 0.7rem;
	}

	.cb-about {
		grid-template-columns: 1fr;
	}

	.cb-cursor-img {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cb-marquee__track {
		animation: none;
	}

	.cb-home *,
	.cb-cursor-img {
		transition: none !important;
	}
}
