/**
 * Carte au Trésor — Design system
 * Direction : expédition / carte au trésor (Indiana Jones)
 * Typo : Cinzel Decorative + IM Fell English
 */

:root {
	--ct-parchment: #e8d4a8;
	--ct-parchment-deep: #c9b080;
	--ct-ink: #2a1a0e;
	--ct-ink-soft: #4a3520;
	--ct-lake: #3d2817;
	--ct-lake-light: #5c3d20;
	--ct-gold: #c4922a;
	--ct-gold-bright: #f4d67a;
	--ct-red: #7a1e12;
	--ct-white: #f8edd8;
	--ct-shadow: 0 12px 40px rgba(13, 8, 4, 0.35);
	--ct-shadow-deep: 0 20px 60px rgba(13, 8, 4, 0.5);
	--ct-radius: 2px;
	--ct-radius-lg: 4px;
	--ct-font-display: "Cinzel Decorative", Georgia, serif;
	--ct-font-body: "IM Fell English", Georgia, serif;
	--ct-font-sc: "IM Fell English SC", Georgia, serif;
	--ct-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
	scroll-behavior: smooth;
}

body.ct-theme {
	margin: 0;
	font-family: var(--ct-font-body);
	font-size: 1.05rem;
	line-height: 1.6;
	color: var(--ct-ink);
	background:
		radial-gradient(ellipse at 30% 20%, rgba(196, 146, 42, 0.12) 0%, transparent 50%),
		linear-gradient(180deg, #1a1008 0%, #2a1a0e 40%, #1a1008 100%);
	-webkit-font-smoothing: antialiased;
	min-height: 100vh;
	min-height: 100dvh;
}

body.ct-fullscreen {
	overflow: hidden;
	height: 100vh;
	height: 100dvh;
}

.ct-grain--heavy {
	opacity: 0.08;
}

/* Grain atmosphérique */
.ct-grain {
	pointer-events: none;
	position: fixed;
	inset: 0;
	z-index: 9999;
	opacity: 0.04;
	background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.ct-site {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	position: relative;
}

.ct-container {
	width: 100%;
	max-width: 720px;
	margin: 0 auto;
	padding: 0 1.5rem;
}

.ct-container--wide {
	max-width: 1180px;
}

/* ─── Header ─── */
.ct-header {
	background: linear-gradient(180deg, #1a1008, #2a1a0e);
	color: var(--ct-white);
	border-bottom: 2px solid var(--ct-gold);
	position: sticky;
	top: 0;
	z-index: 1000;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.ct-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 72px;
	gap: 1rem;
}

.ct-brand {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	text-decoration: none;
	color: inherit;
}

.ct-brand__compass {
	color: var(--ct-gold-bright);
	flex-shrink: 0;
}

.ct-brand__name {
	display: block;
	font-family: var(--ct-font-display);
	font-size: 1.35rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 1.2;
}

.ct-brand__tagline {
	display: block;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	opacity: 0.65;
	font-weight: 400;
}

.ct-nav__list {
	display: flex;
	gap: 0.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.ct-nav__link {
	display: block;
	padding: 0.5rem 1rem;
	color: rgba(255, 253, 249, 0.8);
	text-decoration: none;
	font-size: 0.9rem;
	font-weight: 500;
	letter-spacing: 0.03em;
	border-radius: var(--ct-radius);
	transition: color 0.2s var(--ct-ease), background 0.2s var(--ct-ease);
}

.ct-nav__link:hover,
.ct-nav__link.is-active {
	color: var(--ct-gold-bright);
	background: rgba(184, 137, 42, 0.15);
}

.ct-nav-toggle {
	display: none;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0.5rem;
}

.ct-nav-toggle span {
	display: block;
	width: 22px;
	height: 2px;
	background: var(--ct-white);
	margin: 5px 0;
	transition: transform 0.25s var(--ct-ease);
}

/* ─── Main ─── */
.ct-main {
	flex: 1;
	padding: 2rem 0 4rem;
}

/* ─── Footer ─── */
.ct-footer {
	background: var(--ct-ink);
	color: rgba(255, 253, 249, 0.7);
	padding: 1.75rem 0;
	margin-top: auto;
	font-size: 0.85rem;
	border-top: 1px solid rgba(184, 137, 42, 0.3);
}

.ct-footer__inner {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: flex-end;
	gap: 1rem;
}

.ct-footer__title {
	font-family: var(--ct-font-display);
	font-size: 1.1rem;
	margin: 0 0 0.25rem;
	color: var(--ct-white);
}

.ct-footer__copy,
.ct-footer__season {
	margin: 0;
}

/* ─── Buttons (thème) ─── */
.ct-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.7rem 1.4rem;
	font-family: var(--ct-font-body);
	font-size: 0.9rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
	border: 2px solid transparent;
	border-radius: var(--ct-radius);
	cursor: pointer;
	transition: transform 0.2s var(--ct-ease), box-shadow 0.2s var(--ct-ease), background 0.2s;
}

.ct-btn--lg {
	padding: 0.95rem 1.75rem;
	font-size: 0.85rem;
}

.ct-btn--primary {
	background: var(--ct-red);
	color: var(--ct-white);
	border-color: var(--ct-red);
	box-shadow: 0 4px 0 #8f1529;
}

.ct-btn--primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 0 #8f1529, var(--ct-shadow);
}

.ct-btn--ghost {
	background: transparent;
	color: var(--ct-ink);
	border-color: var(--ct-ink);
}

.ct-btn--ghost:hover {
	background: var(--ct-ink);
	color: var(--ct-white);
}

/* ─── Hero landing ─── */
.ct-hero {
	display: grid;
	grid-template-columns: 1fr 1.1fr;
	gap: 3rem;
	align-items: center;
	padding: 1rem 0 3rem;
}

.ct-hero__eyebrow {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.2em;
	color: var(--ct-red);
	margin: 0 0 0.75rem;
}

.ct-hero__title {
	font-family: var(--ct-font-display);
	font-size: clamp(2.5rem, 5vw, 3.75rem);
	font-weight: 700;
	line-height: 1.05;
	margin: 0 0 1.25rem;
	color: var(--ct-ink);
}

.ct-hero__lead {
	font-size: 1.1rem;
	color: var(--ct-ink-soft);
	margin: 0 0 2rem;
	max-width: 38ch;
	font-weight: 300;
}

.ct-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.85rem;
}

.ct-hero__frame {
	position: relative;
	border: 1px solid rgba(26, 35, 50, 0.15);
	padding: 0.75rem;
	background: var(--ct-white);
	box-shadow: var(--ct-shadow-deep);
	transform: rotate(1.5deg);
}

.ct-hero__map {
	width: 100%;
	display: block;
	border-radius: 2px;
}

.ct-hero__corner {
	position: absolute;
	width: 24px;
	height: 24px;
	border: 2px solid var(--ct-gold);
}

.ct-hero__corner--tl { top: -4px; left: -4px; border-right: none; border-bottom: none; }
.ct-hero__corner--br { bottom: -4px; right: -4px; border-left: none; border-top: none; }

/* ─── Steps ─── */
.ct-steps {
	padding-bottom: 2rem;
}

.ct-steps__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.25rem;
}

.ct-step-card {
	background: var(--ct-white);
	border: 1px solid rgba(26, 35, 50, 0.08);
	padding: 1.5rem 1.35rem;
	position: relative;
	overflow: hidden;
	transition: transform 0.3s var(--ct-ease), box-shadow 0.3s var(--ct-ease);
}

.ct-step-card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 4px;
	height: 100%;
	background: linear-gradient(180deg, var(--ct-gold), var(--ct-red));
}

.ct-step-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--ct-shadow);
}

.ct-step-card__num {
	font-family: var(--ct-font-display);
	font-size: 2rem;
	font-weight: 700;
	color: var(--ct-parchment-deep);
	line-height: 1;
	margin-bottom: 0.5rem;
}

.ct-step-card h2 {
	font-family: var(--ct-font-display);
	font-size: 1.25rem;
	margin: 0 0 0.5rem;
}

.ct-step-card p {
	margin: 0;
	font-size: 0.9rem;
	color: var(--ct-ink-soft);
}

/* ─── Reveal animations ─── */
.ct-reveal {
	opacity: 0;
	transform: translateY(24px);
	animation: ct-reveal 0.8s var(--ct-ease) forwards;
}

.ct-reveal--delay { animation-delay: 0.15s; }
.ct-reveal--delay-2 { animation-delay: 0.3s; }

@keyframes ct-reveal {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ─── Intégration plugin (.pgth-root) ─── */
.ct-main .pgth-root {
	--pgth-gold: var(--ct-gold);
	--pgth-gold-light: var(--ct-gold-bright);
	--pgth-navy: var(--ct-ink);
	--pgth-navy-deep: #0f1520;
	--pgth-radius: var(--ct-radius-lg);
	--pgth-shadow: var(--ct-shadow);
	font-family: var(--ct-font-body);
}

.ct-main .pgth-page-title,
.ct-main .pgth-map-title {
	font-family: var(--ct-font-display);
	font-weight: 600;
}

.ct-main .pgth-btn {
	font-family: var(--ct-font-body);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-size: 0.85rem;
	font-weight: 600;
	border-radius: var(--ct-radius);
	background: var(--ct-red);
	border: none;
	box-shadow: 0 3px 0 #8f1529;
}

.ct-main .pgth-btn:hover {
	transform: translateY(-1px);
}

.ct-main .pgth-btn--secondary {
	background: var(--ct-white);
	color: var(--ct-ink);
	border: 2px solid var(--ct-ink);
	box-shadow: none;
}

.ct-main .pgth-score {
	border: 1px solid rgba(184, 137, 42, 0.35);
}

.ct-main .pgth-month-pill--active {
	background: var(--ct-red);
	border-color: var(--ct-red);
}

.ct-main .pgth-poi {
	background: radial-gradient(circle at 30% 30%, var(--ct-gold-bright), var(--ct-gold));
	box-shadow: 0 0 0 3px var(--ct-white), 0 4px 16px rgba(26, 35, 50, 0.35);
}

.ct-main .pgth-modal__panel {
	border: 1px solid rgba(26, 35, 50, 0.1);
}

.ct-main .pgth-leaderboard-player {
	background: var(--ct-ink);
	border-bottom: 3px solid var(--ct-gold);
}

.ct-main .pgth-account {
	background: var(--ct-white);
	border: 1px solid rgba(26, 35, 50, 0.08);
	padding: 2rem;
	box-shadow: var(--ct-shadow);
}

.ct-main .pgth-form input,
.ct-main .pgth-form select,
.ct-main .pgth-question__input {
	border: 1px solid var(--ct-parchment-deep);
	border-radius: var(--ct-radius);
	font-family: var(--ct-font-body);
}

.ct-main .pgth-form input:focus,
.ct-main .pgth-question__input:focus {
	border-color: var(--ct-lake);
	outline: 2px solid rgba(47, 95, 122, 0.2);
}

html.admin-bar {
	margin-top: 0 !important;
}

html.admin-bar body.ct-theme {
	margin-top: 0 !important;
}

@media screen and (max-width: 782px) {
	html.admin-bar {
		margin-top: 0 !important;
	}
}
	clip: rect(1px, 1px, 1px, 1px);
	position: absolute !important;
	height: 1px;
	width: 1px;
	overflow: hidden;
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
	.ct-hero {
		grid-template-columns: 1fr;
	}

	.ct-hero__visual {
		order: -1;
	}

	.ct-steps__grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 768px) {
	.ct-nav-toggle { display: block; }

	.ct-nav {
		display: none;
		position: absolute;
		top: 72px;
		left: 0;
		right: 0;
		background: var(--ct-ink);
		padding: 1rem 1.5rem 1.5rem;
		border-bottom: 3px solid var(--ct-gold);
	}

	.ct-nav.is-open { display: block; }

	.ct-nav__list {
		flex-direction: column;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ct-reveal {
		opacity: 1;
		transform: none;
		animation: none;
	}
}

/* ─── Mode expédition (carte jeu) ─── */
.ct-main--expedition {
	padding: 0;
	margin: 0;
	flex: 1;
	height: 100vh;
	height: 100dvh;
	overflow: hidden;
}

body.ct-expedition .ct-site {
	min-height: 100dvh;
}

/* Pages compte / landing sur fond sombre */
body.ct-theme:not(.ct-expedition) .ct-main {
	padding: 2rem 0 3rem;
}

body.ct-theme:not(.ct-expedition) .ct-container {
	background: linear-gradient(180deg, rgba(248, 237, 216, 0.97), rgba(232, 212, 168, 0.95));
	border: 2px double var(--ct-lake-light);
	box-shadow: var(--ct-shadow-deep);
	padding: 2rem 1.5rem;
	margin-top: 1rem;
	margin-bottom: 2rem;
}

body.ct-theme:not(.ct-expedition) .ct-hero__title,
body.ct-theme:not(.ct-expedition) .ct-step-card h2 {
	font-family: var(--ct-font-display);
}

body.ct-theme:not(.ct-expedition) .ct-btn {
	font-family: var(--ct-font-sc);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
