/* ==========================================================================
   assets/css/circuit-fiche-pdf.css — Fiche Technique A4 Imprimable / PDF
   Reproduction 1:1 de la Fiche Technique PDF Terres d'Aventure (5 pages A4)
   Adaptée pour Sahara Bouarif Voyages (Douz, Tunisie).
   ========================================================================== */

:root {
	--ft-taupe: #8f836e;
	--ft-taupe-light: #a69c89;
	--ft-orange: #ea4b1a;
	--ft-gray-dot: #c9c5bd;
	--ft-ink: #1f1f1f;
	--ft-text: #2b2926;
	--ft-muted: #55524d;
	--ft-rule: #44403a;
	--ft-rule-light: #c8c2b7;
	--ft-desk: #e5e2dc;

	--ft-font-body: 'PT Sans Narrow', 'Barlow Condensed', 'Arial Narrow', 'Lato', sans-serif;
	--ft-font-heading: 'Montserrat', 'PT Sans Narrow', sans-serif;
	--ft-font-serif: 'Merriweather', Georgia, serif;
	--ft-font-italic: 'Cormorant Garamond', Georgia, serif;
}

*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	font-size: 16px;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

body.ft-pdf-body {
	background-color: var(--ft-desk);
	color: var(--ft-text);
	font-family: var(--ft-font-body);
	font-size: 10pt;
	line-height: 1.38;
	min-height: 100vh;
	padding: 76px 16px 48px;
	print-color-adjust: exact;
	-webkit-print-color-adjust: exact;
}

/* ==========================================================================
   BARRE D'ACTION FLOTTANTE (ÉCRAN UNIQUEMENT — MASQUÉE À L'IMPRESSION / PDF)
   ========================================================================== */
.ft-screen-bar {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100;
	height: 58px;
	background: #231e18;
	color: #f6efe2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0 clamp(1rem, 3vw, 2rem);
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.24);
	font-family: 'Montserrat', 'Lato', sans-serif;
}

.ft-screen-bar__left {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	min-width: 0;
}

.ft-screen-bar__back {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.42rem 0.9rem;
	border-radius: 999px;
	border: 1px solid rgba(246, 239, 226, 0.28);
	color: #f6efe2;
	text-decoration: none;
	font-size: 0.8rem;
	font-weight: 600;
	white-space: nowrap;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.ft-screen-bar__back:hover {
	background-color: rgba(255, 255, 255, 0.1);
	border-color: rgba(246, 239, 226, 0.55);
}

.ft-screen-bar__meta {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	min-width: 0;
	font-size: 0.82rem;
	color: rgba(246, 239, 226, 0.82);
}

.ft-screen-bar__code {
	display: inline-block;
	padding: 0.18rem 0.55rem;
	border-radius: 4px;
	background: rgba(234, 75, 26, 0.2);
	border: 1px solid rgba(234, 75, 26, 0.55);
	color: #ffb8a1;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	flex-shrink: 0;
}

.ft-screen-bar__title {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 600;
	color: #ffffff;
}

.ft-screen-bar__actions {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	flex-shrink: 0;
}

.ft-screen-bar__hint {
	font-size: 0.74rem;
	color: rgba(246, 239, 226, 0.62);
	display: none;
}

@media (min-width: 900px) {
	.ft-screen-bar__hint {
		display: inline;
	}
}

.ft-btn-print {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.5rem 1.2rem;
	border: 0;
	border-radius: 999px;
	background-color: var(--ft-orange);
	color: #ffffff;
	font-family: 'Montserrat', 'Lato', sans-serif;
	font-size: 0.82rem;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(234, 75, 26, 0.35);
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.ft-btn-print:hover {
	background-color: #d43e10;
	transform: translateY(-1px);
}

/* ==========================================================================
   FEUILLES A4 (210mm × 297mm) — EXACT FORMAT FICHE TECHNIQUE TERDAV
   ========================================================================== */
.ft-sheets {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 24px;
}

.ft-sheet {
	width: 210mm;
	min-height: 297mm;
	background: #ffffff;
	padding: 13mm 15mm 12mm;
	display: flex;
	flex-direction: column;
	position: relative;
	box-shadow: 0 10px 34px rgba(0, 0, 0, 0.16), 0 1px 4px rgba(0, 0, 0, 0.08);
	color: var(--ft-text);
}

.ft-sheet__body {
	flex: 1 1 auto;
}

/* Mobile preview scaling */
@media screen and (max-width: 840px) {
	body.ft-pdf-body {
		padding: 70px 8px 32px;
	}
	.ft-sheet {
		width: 100%;
		min-height: auto;
		padding: 20px 18px 18px;
	}
	.ft-screen-bar__meta {
		display: none;
	}
}

/* ==========================================================================
   PAGE 1 — EN-TÊTE MARQUE + TITRE + BARRE MÉTA + HERO + CARTE + INFOS
   ========================================================================== */
.ft-p1-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 13mm;
}

.ft-brand {
	display: flex;
	align-items: center;
	gap: 14px;
}

.ft-brand__mark {
	display: flex;
	flex-direction: column;
	align-items: center;
	line-height: 1;
	color: var(--ft-taupe);
}

.ft-brand__name {
	font-family: var(--ft-font-heading);
	font-weight: 800;
	font-size: 16.5pt;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ft-taupe);
}

.ft-brand__sub {
	font-family: var(--ft-font-serif);
	font-weight: 400;
	font-size: 7.2pt;
	letter-spacing: 0.28em;
	text-transform: uppercase;
	color: var(--ft-taupe);
	margin-top: 3px;
}

.ft-brand__sep {
	width: 1px;
	height: 28px;
	background-color: var(--ft-rule-light);
	flex-shrink: 0;
}

.ft-brand__type {
	font-family: var(--ft-font-italic);
	font-style: italic;
	font-weight: 500;
	font-size: 15.5pt;
	color: var(--ft-taupe);
	line-height: 1.1;
}

.ft-site-url {
	font-family: var(--ft-font-body);
	font-size: 9.5pt;
	font-weight: 700;
	color: var(--ft-ink);
	text-decoration: none;
	letter-spacing: 0.01em;
}

/* Titre principal + destination */
.ft-title-block {
	margin-bottom: 3.5mm;
}

.ft-h1 {
	font-family: var(--ft-font-serif);
	font-size: 20.5pt;
	font-weight: 700;
	line-height: 1.18;
	color: var(--ft-ink);
	margin: 0 0 2mm;
	letter-spacing: -0.01em;
}

.ft-destination {
	font-family: var(--ft-font-body);
	font-size: 11.5pt;
	font-weight: 400;
	color: var(--ft-text);
}

/* Barre horizontale méta (Jours / Niveau / Altitude / code | groupe) */
.ft-meta-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
	border-top: 0.8pt solid var(--ft-rule);
	border-bottom: 0.8pt solid var(--ft-rule);
	padding: 2.2mm 0;
	margin-bottom: 4.5mm;
	font-size: 9.5pt;
	color: var(--ft-muted);
}

.ft-meta-bar__left {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 5px;
}

.ft-meta-bar__right {
	font-size: 9.5pt;
	color: var(--ft-muted);
}

.ft-dots {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	vertical-align: middle;
	margin: 0 2px;
}

.ft-dot {
	width: 9.5px;
	height: 9.5px;
	border-radius: 50%;
	background-color: var(--ft-gray-dot);
	display: inline-block;
}

.ft-dot.is-on {
	background-color: var(--ft-orange);
}

.ft-tris {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	vertical-align: middle;
	margin: 0 2px;
}

.ft-tri {
	width: 10px;
	height: 9px;
	display: inline-block;
	fill: var(--ft-gray-dot);
}

.ft-tri.is-on {
	fill: var(--ft-orange);
}

/* Grille haute Page 1 : Photo (63%) + vous apprécierez (37%) */
.ft-p1-topgrid {
	display: grid;
	grid-template-columns: 62.5% 1fr;
	gap: 5.5mm;
	align-items: start;
	margin-bottom: 5.5mm;
}

.ft-hero-photo {
	width: 100%;
	height: 76mm;
	overflow: hidden;
	background: #ebe6dd;
}

.ft-hero-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ft-appreciate__title {
	font-family: var(--ft-font-heading);
	font-size: 12pt;
	font-weight: 700;
	color: var(--ft-taupe);
	margin: 0 0 2.5mm;
	text-transform: lowercase;
}

.ft-appreciate__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 2mm;
}

.ft-appreciate__list li {
	position: relative;
	padding-left: 9px;
	font-size: 9.3pt;
	line-height: 1.35;
	color: var(--ft-text);
}

.ft-appreciate__list li::before {
	content: "•";
	position: absolute;
	left: 0;
	top: 0;
	color: var(--ft-ink);
	font-weight: 700;
}

/* Grille basse Page 1 : Carte (37%) + Texte introductif (63%) */
.ft-p1-midgrid {
	display: grid;
	grid-template-columns: 37% 1fr;
	gap: 5.5mm;
	align-items: start;
	margin-bottom: 6mm;
}

.ft-map-box {
	width: 100%;
	aspect-ratio: 1 / 1.02;
	border: 0.6pt solid #c9c3b8;
	background: #dfdad0;
	overflow: hidden;
}

.ft-map-box svg {
	width: 100%;
	height: 100%;
	display: block;
}

.ft-intro-copy p {
	font-size: 9.4pt;
	line-height: 1.4;
	color: var(--ft-text);
	margin: 0 0 3.2mm;
	text-align: left;
}

.ft-intro-copy p:last-child {
	margin-bottom: 0;
}

/* Bandeau Infos techniques (4 colonnes séparées par filets verticaux) */
.ft-infos-tech {
	margin-top: 2mm;
}

.ft-infos-tech__title {
	font-family: var(--ft-font-serif);
	font-size: 12pt;
	font-weight: 700;
	color: var(--ft-ink);
	margin: 0 0 3mm;
}

.ft-infos-tech__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 0;
}

.ft-infos-tech__col {
	padding: 0 8px 2px 0;
}

.ft-infos-tech__col + .ft-infos-tech__col {
	border-left: 0.8pt solid var(--ft-rule);
	padding-left: 9px;
}

.ft-infos-tech__label {
	display: block;
	font-family: var(--ft-font-heading);
	font-size: 8.6pt;
	font-weight: 700;
	color: var(--ft-taupe);
	margin-bottom: 1.2mm;
}

.ft-infos-tech__val {
	display: block;
	font-size: 9pt;
	color: var(--ft-text);
	line-height: 1.3;
}

@media screen and (max-width: 720px) {
	.ft-p1-topgrid,
	.ft-p1-midgrid {
		grid-template-columns: 1fr;
	}
	.ft-hero-photo {
		height: 220px;
	}
	.ft-infos-tech__grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px 0;
	}
	.ft-infos-tech__col:nth-child(3) {
		border-left: 0;
		padding-left: 0;
	}
}

/* ==========================================================================
   PAGES 2 À 5 — TITRES DE SECTIONS, JOUR PAR JOUR & RUBRIQUES INDENTÉES
   ========================================================================== */
.ft-section-title {
	font-family: var(--ft-font-heading);
	font-size: 16.5pt;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--ft-taupe);
	margin: 0 0 4.5mm;
	line-height: 1.15;
}

.ft-section-title--center {
	text-align: center;
	margin-bottom: 5.5mm;
}

.ft-section-title--spaced {
	margin-top: 6mm;
}

/* Étapes Jour par Jour (Page 2) */
.ft-day {
	margin-bottom: 4.5mm;
	break-inside: avoid;
	page-break-inside: avoid;
}

.ft-day__head {
	font-family: var(--ft-font-heading);
	font-size: 9.8pt;
	font-weight: 700;
	line-height: 1.3;
	margin: 0 0 1.4mm;
}

.ft-day__num {
	color: var(--ft-taupe);
	text-transform: uppercase;
}

.ft-day__place {
	color: var(--ft-ink);
}

.ft-day__body {
	padding-left: 4.8mm;
	font-size: 9pt;
	line-height: 1.36;
	color: var(--ft-text);
}

.ft-day__desc {
	margin: 0 0 1.2mm;
}

.ft-day__meta {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 8.8pt;
	line-height: 1.35;
	color: var(--ft-text);
}

/* Sous-rubriques éditoriales indentées (Pages 2, 3, 4, 5) */
.ft-subblock {
	margin-bottom: 3.6mm;
	break-inside: avoid;
	page-break-inside: avoid;
}

.ft-subblock__title {
	font-family: var(--ft-font-heading);
	font-size: 9.8pt;
	font-weight: 700;
	color: var(--ft-taupe);
	margin: 0 0 1.1mm;
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

.ft-subblock__body {
	padding-left: 4.8mm;
	font-size: 9pt;
	line-height: 1.38;
	color: var(--ft-text);
}

.ft-subblock__body p {
	margin: 0 0 2.2mm;
}

.ft-subblock__body p:last-child {
	margin-bottom: 0;
}

.ft-subblock__subhead {
	display: block;
	font-weight: 700;
	color: var(--ft-ink);
	margin-top: 2mm;
	margin-bottom: 0.4mm;
}

.ft-subblock__subhead:first-child {
	margin-top: 0;
}

.ft-u-link {
	text-decoration: underline;
	color: var(--ft-ink);
}

/* 5 Chaussures / empreintes inline (Page 2 — Niveau de difficulté physique) */
.ft-footprints {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	margin-left: 4px;
}

.ft-footprint {
	width: 14px;
	height: 16px;
	fill: var(--ft-gray-dot);
	display: inline-block;
}

.ft-footprint.is-on {
	fill: var(--ft-orange);
}

/* Listes compactes (Budget, Équipement, Carte d'identité) */
.ft-plain-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ft-plain-list li {
	font-size: 9pt;
	line-height: 1.38;
	color: var(--ft-text);
	margin-bottom: 0.6mm;
}

.ft-dash-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ft-dash-list li {
	font-size: 9pt;
	line-height: 1.38;
	color: var(--ft-text);
	margin-bottom: 0.6mm;
}

.ft-equip-group-label {
	font-size: 9pt;
	color: var(--ft-text);
	margin: 2.8mm 0 0.8mm;
	display: block;
}

.ft-equip-group-label:first-child {
	margin-top: 0;
}

/* ==========================================================================
   PIED DE PAGE STANDARD (PAGES 1 À 4) + PIED LÉGAL COMPLET (PAGE 5)
   ========================================================================== */
.ft-page-footer {
	margin-top: auto;
	padding-top: 4mm;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	font-size: 8.6pt;
	color: var(--ft-muted);
}

.ft-page-footer__left {
	display: inline-flex;
	align-items: center;
	gap: 14px;
}

.ft-emblem {
	width: 18px;
	height: 18px;
	fill: var(--ft-taupe);
	flex-shrink: 0;
}

.ft-page-footer__page {
	font-size: 8.6pt;
	color: var(--ft-muted);
	white-space: nowrap;
}

/* Page 5 : Accroche d'inscription + bloc légal complet en bas */
.ft-p5-cta {
	text-align: center;
	margin-top: 16mm;
	margin-bottom: auto;
	padding: 6mm 0;
	font-family: var(--ft-font-body);
	font-size: 10.2pt;
	letter-spacing: 0.02em;
	color: var(--ft-text);
}

.ft-p5-cta a {
	color: var(--ft-taupe-light);
	text-decoration: none;
	font-weight: 700;
}

.ft-p5-legal {
	margin-top: auto;
	border-top: 0.9pt solid var(--ft-rule);
	padding-top: 2.5mm;
	text-align: center;
}

.ft-p5-legal__contact {
	font-family: var(--ft-font-heading);
	font-size: 8pt;
	font-weight: 700;
	color: var(--ft-taupe);
	margin: 0 0 1.8mm;
	line-height: 1.35;
}

.ft-p5-legal__fine {
	font-size: 6.9pt;
	line-height: 1.38;
	color: var(--ft-muted);
	margin: 0;
}

/* ==========================================================================
   RÈGLES D'IMPRESSION A4 PARFAITES (@media print)
   ========================================================================== */
@page {
	size: A4 portrait;
	margin: 0;
}

@media print {
	html,
	body.ft-pdf-body {
		background: #ffffff !important;
		padding: 0 !important;
		margin: 0 !important;
		width: 210mm;
		print-color-adjust: exact !important;
		-webkit-print-color-adjust: exact !important;
	}

	.ft-screen-bar {
		display: none !important;
	}

	.ft-sheets {
		display: block;
		gap: 0;
	}

	.ft-sheet {
		width: 210mm;
		height: 297mm;
		min-height: 297mm;
		max-height: 297mm;
		margin: 0;
		padding: 13mm 15mm 11mm;
		box-shadow: none !important;
		overflow: hidden;
		break-after: page;
		page-break-after: always;
	}

	.ft-sheet:last-child {
		break-after: auto;
		page-break-after: auto;
	}

	/* Si un itinéraire très long dépasse légèrement, laisser respirer sans couper */
	.ft-sheet--flow {
		height: auto;
		max-height: none;
		overflow: visible;
	}
}
