/* Page « Outils premium » — carrousel 3D, fond dégradé, panneau de texte
   Carrousel inspiré de « Infinite Gradient 3D Carousel » © Clément Grellier (licence MIT) */

:root {
	--pt-ink: #3b2a31;
	--pt-soft: #54434a;
	--pt-glass: rgba(255, 255, 255, .5);
	--pt-line: rgba(255, 255, 255, .85);
	--pt-wine: #990033;
	--pt-serif: "Lora", Georgia, serif;
}

.pt-page {
	background: #f4ede7;
	color: var(--pt-ink);
	font-family: "Open Sans", sans-serif;
	min-height: 100vh;
}
.pt-page .dcmfx-top { background: #cecbc3; }

/* Fond animé : un seul canvas fixe derrière toute la page */
.pt-bg {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
	pointer-events: none;
	background: #f4ede7;
}
.pt-stage, footer { position: relative; z-index: 1; }

.pt-stage {
	padding: 28px 16px 8px;
	overflow-x: clip; /* les cartes 3D lointaines ne créent pas de défilement horizontal */
	min-height: calc(100vh - 30px);
	min-height: calc(100svh - 30px);
	display: flex;
	flex-direction: column;
}

/* ------------ Titre + intro ------------ */
.pt-head { position: relative; z-index: 2; max-width: 52em; margin: 0 auto 8px; text-align: center; }
.pt-head h1 {
	font-family: var(--pt-serif);
	font-weight: 600;
	font-size: clamp(1.45rem, 1.1rem + 1.6vw, 2.5rem);
	line-height: 1.2;
	letter-spacing: .005em;
	text-wrap: balance;
	text-shadow: 0 1px 14px rgba(255, 255, 255, .7);
}
.pt-head p {
	margin-top: .8em;
	font-weight: 300;
	font-size: clamp(1rem, .95rem + .3vw, 1.2rem);
	line-height: 1.6;
	color: var(--pt-soft);
	text-wrap: balance;
	text-shadow: 0 1px 10px rgba(255, 255, 255, .65);
}

/* ------------ Grille carrousel / texte ------------ */
.pt-grid {
	flex: 1;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	align-items: center;
	gap: 8px;
	width: 100%;
	max-width: 1360px;
	margin: 0 auto;
}

.pt-carousel {
	position: relative;
	min-width: 0;
	outline: none;
	--ch: clamp(300px, 52vh, 560px); /* hauteur des cartes */
	height: calc(var(--ch) + 78px);
}
.pt-carousel:focus-visible { box-shadow: 0 0 0 2px var(--pt-line); border-radius: 12px; }

.pt-cards {
	position: absolute;
	inset: -80px 0 -10px 0;       /* marge verticale : les ombres portées ne sont pas coupées */
	perspective: 1500px;
	perspective-origin: 50% 50%;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
	touch-action: pan-y;
	cursor: grab;
	-webkit-user-select: none;
	user-select: none;
}
.pt-cards.is-drag { cursor: grabbing; }

.pt-card {
	position: absolute;
	left: 50%;
	top: 50%;
	height: var(--ch);
	aspect-ratio: var(--r, .8);
	margin: 0;
	transform: translate(-50%, -50%);
	will-change: transform, opacity;
	backface-visibility: hidden;
}
.pt-card picture { display: block; width: 100%; height: 100%; }
.pt-card img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: contain;          /* ratio natif, aucun rognage : les coins arrondis restent intacts */
	filter: drop-shadow(0 20px 24px rgba(70, 40, 50, .26)) drop-shadow(0 3px 6px rgba(70, 40, 50, .18));
	pointer-events: none;
}

/* Contrôles */
.pt-ctrl {
	position: absolute;
	left: 0; right: 0; bottom: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 18px;
}
.pt-arrow {
	width: 46px; height: 46px;
	border-radius: 50%;
	display: grid; place-items: center;
	color: var(--pt-wine);
	background: rgba(255, 255, 255, .6);
	border: 1px solid var(--pt-line);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	cursor: pointer;
	transition: background .25s, transform .25s, color .25s;
}
.pt-prev svg { transform: scaleX(-1); }
.pt-arrow:hover { background: var(--pt-wine); color: #fff; transform: scale(1.06); }
.pt-arrow:focus-visible, .pt-dots button:focus-visible, .pt-btn:focus-visible { outline: 2px solid var(--pt-wine); outline-offset: 3px; }

.pt-dots { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.pt-dots li { display: block; }
.pt-dots button {
	position: relative;
	display: block;
	width: 22px; height: 30px;   /* zone tactile confortable */
	background: none; border: 0; cursor: pointer; padding: 0;
}
.pt-dots button::before {
	content: "";
	position: absolute;
	left: 50%; top: 50%;
	width: 8px; height: 8px;
	margin: -4px 0 0 -4px;
	border-radius: 50%;
	background: rgba(153, 0, 51, .28);
	transition: transform .3s, background .3s, width .3s, margin .3s, border-radius .3s;
}
.pt-dots button:hover::before { background: rgba(153, 0, 51, .7); }
.pt-dots button[aria-current="true"]::before {
	background: var(--pt-wine);
	width: 22px; margin-left: -11px;
	border-radius: 4px;
}
.pt-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ------------ Panneau de texte ------------ */
.pt-panel {
	display: grid;               /* tous les articles dans la même cellule : hauteur stable (pas de CLS) */
	min-width: 0;
	padding: 4px 4px 24px;
}
.pt-slide {
	grid-area: 1 / 1;
	padding: clamp(20px, 2.4vw, 36px);
	border: 1px solid var(--pt-line);
	border-radius: 18px;
	background: var(--pt-glass);
	-webkit-backdrop-filter: blur(16px) saturate(1.3);
	backdrop-filter: blur(16px) saturate(1.3);
	box-shadow: 0 18px 50px rgba(90, 60, 70, .14);
	align-self: center;
}
.pt-num {
	font-family: var(--pt-serif);
	font-size: .95rem;
	letter-spacing: .25em;
	color: var(--pt-wine);
	margin-bottom: .7em;
}
.pt-slide h2 {
	font-family: var(--pt-serif);
	font-weight: 600;
	font-size: clamp(1.25rem, 1rem + .9vw, 1.85rem);
	line-height: 1.25;
	letter-spacing: .005em;
	margin-bottom: .7em;
	text-wrap: balance;
	color: #990033;
}
.pt-slide p { font-weight: 300; font-size: clamp(1rem, .96rem + .2vw, 1.12rem); line-height: 1.75; color: var(--pt-soft); }
.pt-slide p + p { margin-top: .8em; }
.pt-slide .pt-num { font-weight: 400; }
.pt-slide .pt-cta { margin-top: 1.6em; }
.pt-btn {
	display: inline-flex;
	align-items: center;
	gap: .8em;
	padding: .55em 1.4em .55em .8em;
	border-radius: 999px;
	background: #fff;
	color: var(--pt-wine) !important;
	font-weight: 400;
	letter-spacing: .04em;
	line-height: 1.3;
	text-decoration: none !important;
	background-image: none !important;
	border: 1px solid rgba(153, 0, 51, .22);
	box-shadow: 0 10px 26px rgba(90, 40, 60, .2);
	transition: transform .25s, box-shadow .25s, background-color .25s, color .25s;
}
.pt-btn img { flex: none; width: auto; height: 46px; max-width: none; }
.pt-btn:hover { background-color: var(--pt-wine); color: #fff !important; transform: translateY(-2px); box-shadow: 0 14px 34px rgba(90, 40, 60, .3); }
.pt-btn svg { flex: none; transition: transform .25s; }
.pt-btn:hover svg { transform: translateX(4px); }

/* ------------ Avec JavaScript : un seul texte visible à la fois ------------ */
.pt-js .pt-slide {
	opacity: 0;
	visibility: hidden;
	transform: translateY(14px);
	transition: opacity .5s ease, transform .6s cubic-bezier(.2, .7, .2, 1), visibility 0s linear .5s;
}
.pt-js .pt-slide.is-active {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition-delay: .12s, .12s, 0s;
}

/* ------------ Sans JavaScript : bande défilante + tous les textes ------------ */
html:not(.pt-js) .pt-carousel { height: auto; }
html:not(.pt-js) .pt-cards {
	position: static;
	display: flex;
	gap: 18px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding: 10px 6vw 20px;
	perspective: none;
	cursor: auto;
}
html:not(.pt-js) .pt-card { position: relative; left: auto; top: auto; transform: none; flex: none; scroll-snap-align: center; height: min(60vh, 460px); }
html:not(.pt-js) .pt-ctrl, html:not(.pt-js) .pt-live { display: none; }
html:not(.pt-js) .pt-panel { display: block; }
html:not(.pt-js) .pt-slide { margin-bottom: 18px; }

/* ------------ Grand écran : texte à côté de la carte centrale ------------ */
@media (min-width: 900px) {
	.pt-stage { padding-top: 34px; }
	.pt-grid {
		grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
		gap: clamp(8px, 2vw, 40px);
	}
	.pt-carousel { --ch: clamp(380px, calc(100vh - 360px), 640px); }
	.pt-panel { padding-right: clamp(0px, 1.5vw, 24px); }
	html:not(.pt-js) .pt-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 900px) and (max-height: 700px) {
	.pt-carousel { --ch: 340px; }
}

/* Petits écrans : texte sous la carte */
@media (max-width: 899px) {
	.pt-stage { padding-top: 16px; min-height: 0; }
	.pt-head { margin-bottom: 0; }
	.pt-head h1 { font-size: 1.35rem; }
	.pt-head p { margin-top: .5em; font-size: .92rem; line-height: 1.5; }
	.pt-carousel { --ch: clamp(210px, 33svh, 380px); height: calc(var(--ch) + 56px); }
	.pt-cards { inset: -24px 0 -6px 0; }       /* cartes plus proches du titre */
	.pt-ctrl { bottom: 0; gap: 12px; }
	.pt-arrow { width: 40px; height: 40px; }
	.pt-dots button { width: 18px; }
	.pt-panel { padding-bottom: 16px; }
	.pt-slide { padding: 18px; border-radius: 14px; }
	.pt-num { margin-bottom: .4em; }
	.pt-slide h2 { margin-bottom: .5em; }
}

@media (prefers-reduced-motion: reduce) {
	.pt-js .pt-slide, .pt-js .pt-slide.is-active { transition: opacity .2s linear, visibility 0s; transform: none; }
	.pt-btn, .pt-arrow, .pt-btn svg, .pt-dots button::before { transition: none; }
}
