/*
Theme Name: Mad'Ex
Description: Thème sur mesure pour Mad'Ex – Madagascar Excursion. Grandes photos, cartes arrondies, bleu nuit.
Version: 1.0.0
Requires PHP: 7.4
Text Domain: madex
*/

:root {
	--navy: #0b2545;
	--navy-deep: #071a33;
	--green: #1f7a4d;
	--green-light: #2fa36b;
	--sand: #f4efe6;
	--grey-bg: #f5f6f8;
	--text: #5f6b85;
	--heading: #0b2545;
	--line: #e3e6ec;
	--white: #fff;
	--radius-lg: 28px;
	--radius: 16px;
	--radius-sm: 10px;
	--container: 1240px;
	--gutter: 24px;
	--shadow: 0 18px 40px -18px rgba(11, 37, 69, .25);
	--font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

	/* Harmonise le contenu Elementor existant avec le thème */
	--e-global-color-primary: var(--navy);
	--e-global-color-secondary: var(--green);
	--e-global-color-text: var(--text);
	--e-global-color-accent: var(--green);
	--e-global-typography-primary-font-family: "Manrope";
	--e-global-typography-secondary-font-family: "Manrope";
	--e-global-typography-text-font-family: "Manrope";
	--e-global-typography-accent-font-family: "Manrope";
}

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

html { scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: var(--font);
	font-size: 17px;
	font-weight: 500;
	line-height: 1.7;
	color: var(--text);
	background: var(--white);
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--green); text-decoration: none; transition: color .2s; }
a:hover { color: var(--navy); }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font);
	color: var(--heading);
	font-weight: 700;
	line-height: 1.2;
	margin: 0 0 .6em;
	letter-spacing: -.01em;
}
h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }

.container {
	width: 100%;
	max-width: var(--container);
	margin: 0 auto;
	padding: 0 var(--gutter);
}

.section { padding: clamp(64px, 9vw, 120px) 0; }
.section--grey { background: var(--grey-bg); }
.section--navy { background: var(--navy); color: rgba(255, 255, 255, .75); }
.section--navy h2, .section--navy h3 { color: var(--white); }

.eyebrow {
	display: inline-block;
	font-size: .8rem;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--green);
	margin-bottom: 14px;
}

.section-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 48px;
	flex-wrap: wrap;
}
.section-head h2 { margin: 0; }
.section-head p { max-width: 520px; margin: 0; }

/* Boutons */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 14px 26px;
	border-radius: 999px;
	font-weight: 700;
	font-size: .95rem;
	line-height: 1;
	border: 2px solid transparent;
	cursor: pointer;
	transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--green); color: var(--white); }
.btn--primary:hover { background: var(--green-light); color: var(--white); }
.btn--light { background: var(--white); color: var(--navy); }
.btn--light:hover { background: var(--sand); color: var(--navy); }
.btn--outline { border-color: var(--line); color: var(--navy); }
.btn--outline:hover { border-color: var(--navy); color: var(--navy); }
.btn svg { width: 16px; height: 16px; }

/* En-tête */
.site-header {
	position: fixed;
	inset: 0 0 auto 0;
	z-index: 50;
	padding: 22px 0;
	transition: background .3s, padding .3s, box-shadow .3s;
}
/* En-tête transparent devenu blanc après défilement */
.site-header.is-scrolled { background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); box-shadow: 0 1px 0 var(--line); padding: 10px 0; }
.site-header.is-scrolled .site-logo img { height: 58px; box-shadow: none; }
.site-header.is-scrolled .main-nav a { color: var(--navy); }
.site-header.is-scrolled .main-nav a:hover,
.site-header.is-scrolled .main-nav .current-menu-item > a,
.site-header.is-scrolled .main-nav .current-page-ancestor > a { background: var(--grey-bg); color: var(--navy); }
.site-header.is-scrolled .menu-toggle { background: var(--grey-bg); }
.site-header .site-logo img { transition: height .3s; }
.site-header--solid {
	position: sticky;
	top: 0;
	background: var(--white);
	box-shadow: 0 1px 0 var(--line);
	padding: 14px 0;
}
.site-header .container { display: flex; align-items: center; gap: 32px; }
.site-logo img { height: 64px; width: auto; border-radius: 6px; }
.site-header:not(.site-header--solid) .site-logo img { height: 76px; box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .4); }

.main-nav { margin-left: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.main-nav li { position: relative; }
.main-nav a {
	display: block;
	padding: 10px 16px;
	border-radius: 999px;
	font-weight: 600;
	font-size: .95rem;
	color: var(--white);
}
.site-header--solid .main-nav a { color: var(--navy); }
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current-page-ancestor > a { background: rgba(255, 255, 255, .14); color: var(--white); }
.site-header--solid .main-nav a:hover,
.site-header--solid .main-nav .current-menu-item > a,
.site-header--solid .main-nav .current-page-ancestor > a { background: var(--grey-bg); color: var(--navy); }

.main-nav .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 230px;
	padding: 10px;
	background: var(--white);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	flex-direction: column;
	gap: 2px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity .2s, transform .2s, visibility .2s;
}
.main-nav li:hover > .sub-menu, .main-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.main-nav .sub-menu a { color: var(--navy); border-radius: var(--radius-sm); }
.main-nav .sub-menu a:hover { background: var(--grey-bg); color: var(--navy); }

.menu-toggle {
	display: none;
	margin-left: auto;
	background: var(--white);
	border: 0;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	cursor: pointer;
	color: var(--navy);
}
.menu-toggle svg { width: 22px; height: 22px; }
.site-header--solid .menu-toggle { background: var(--grey-bg); }

/* Héros */
.hero {
	padding: 12px 12px 0;
}
.hero__frame {
	position: relative;
	min-height: min(92vh, 860px);
	border-radius: var(--radius-lg);
	overflow: hidden;
	display: flex;
	align-items: flex-end;
	background: var(--navy) center / cover no-repeat;
}
.hero__bg {
	position: absolute;
	inset: -10% 0 0;
	background: var(--navy) center / cover no-repeat;
	will-change: transform;
}
.hero__frame::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(180deg, rgba(7, 26, 51, .55) 0%, rgba(7, 26, 51, .15) 40%, rgba(7, 26, 51, .75) 100%);
}
.hero__content {
	position: relative;
	z-index: 2;
	padding-top: 180px;
	padding-bottom: clamp(48px, 8vw, 110px);
	color: rgba(255, 255, 255, .85);
}
.hero__content h1 { color: var(--white); max-width: 820px; }
.hero__content p { max-width: 560px; font-size: 1.1rem; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }

.page-hero .hero__frame { min-height: 460px; }
.page-hero .hero__content { padding-top: 160px; padding-bottom: 64px; }
.breadcrumb { font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: rgba(255, 255, 255, .7); margin-bottom: 14px; }
.breadcrumb a { color: rgba(255, 255, 255, .9); }

/* Chiffres */
.stats {
	display: grid;
	grid-template-columns: 1.3fr repeat(3, 1fr);
	gap: 32px;
	align-items: center;
}
.stats__intro h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.stat { border-left: 1px solid var(--line); padding-left: 28px; }
.stat strong { display: block; font-size: clamp(2.4rem, 4vw, 3.4rem); color: var(--navy); line-height: 1; margin-bottom: 8px; }
.stat span { font-weight: 600; }

/* Cartes excursions */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.card {
	display: flex;
	flex-direction: column;
	color: var(--text);
	border-radius: var(--radius);
	transition: transform .25s;
}
.card:hover { transform: translateY(-6px); color: var(--text); }
.card__media {
	position: relative;
	aspect-ratio: 4 / 3;
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--grey-bg);
}
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.card:hover .card__media img { transform: scale(1.05); }
.card__tag {
	position: absolute;
	top: 16px;
	left: 16px;
	background: var(--white);
	color: var(--navy);
	padding: 6px 14px;
	border-radius: 999px;
	font-size: .78rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}
.card__body { padding: 22px 4px 0; }
.card__body h3 { margin-bottom: 8px; }
.card__body p { font-size: .95rem; margin-bottom: 14px; }
.card__more { font-weight: 700; color: var(--green); display: inline-flex; align-items: center; gap: 8px; }
.card__more svg { width: 16px; height: 16px; transition: transform .2s; }
.card:hover .card__more svg { transform: translateX(4px); }

/* Services */
.services { display: grid; grid-template-columns: 1fr 1.2fr; gap: 64px; align-items: center; }
.services__media { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4 / 5; }
.services__media img { width: 100%; height: 100%; object-fit: cover; }
.service-list { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 16px; }
.service-list li {
	display: grid;
	grid-template-columns: 56px 1fr;
	gap: 18px;
	background: var(--white);
	border-radius: var(--radius);
	padding: 22px 24px;
}
.service-list .num {
	font-size: 1.4rem;
	font-weight: 800;
	color: var(--green);
	line-height: 1.2;
}
.service-list h3 { margin-bottom: 4px; }
.service-list p { margin: 0; font-size: .95rem; }

/* Destinations (bandeau) */
.dest-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; grid-auto-rows: 260px; gap: 20px; }
.dest {
	position: relative;
	border-radius: var(--radius);
	overflow: hidden;
	color: var(--white);
	display: flex;
	align-items: flex-end;
	padding: 22px;
	background: var(--navy) center / cover no-repeat;
}
.dest::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(7, 26, 51, .8)); transition: opacity .3s; }
.dest:first-child { grid-row: span 2; }
.dest > * { position: relative; }
.dest strong { display: block; font-size: 1.35rem; }
.dest span { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; opacity: .8; }
.dest:hover { color: var(--white); }
.dest:hover::before { opacity: .7; }

/* Liste d'excursions (pages région) */
.excursion-list { display: grid; gap: 28px; }
.excursion {
	display: grid;
	grid-template-columns: 1fr 1.1fr;
	background: var(--white);
	border-radius: var(--radius-lg);
	overflow: hidden;
}
.excursion:nth-child(even) .excursion__media { order: 2; }
.excursion__media { min-height: 360px; background: var(--grey-bg); }
.excursion__media img { width: 100%; height: 100%; object-fit: cover; }
.excursion__body { padding: clamp(28px, 4vw, 52px); align-self: center; }
.excursion__body .num { display: block; font-weight: 800; color: var(--green); font-size: 1.1rem; margin-bottom: 10px; }
.excursion__body h3 { font-size: clamp(1.4rem, 2.2vw, 1.8rem); }
.excursion__body .btn { margin-top: 8px; }

/* Galerie */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.gallery__item { border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; background: var(--grey-bg); }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.gallery__item:hover img { transform: scale(1.05); }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.contact-cards { list-style: none; margin: 28px 0; padding: 0; display: grid; gap: 14px; }
.contact-cards li { display: flex; gap: 16px; align-items: center; background: var(--grey-bg); border-radius: var(--radius); padding: 18px 20px; }
.contact-cards strong { display: block; color: var(--heading); }
.contact-cards a { font-weight: 700; }
.contact-cards__icon { flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--white); color: var(--green); display: grid; place-items: center; }
.contact-cards__icon svg { width: 22px; height: 22px; }
.socials { display: flex; flex-wrap: wrap; gap: 10px; }
.contact-form { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(24px, 4vw, 44px); box-shadow: var(--shadow); }
.contact-form input[type="text"], .contact-form input[type="email"], .contact-form input[type="tel"], .contact-form textarea, .contact-form select {
	width: 100% !important;
	max-width: 100% !important;
	border: 1px solid var(--line) !important;
	border-radius: var(--radius-sm) !important;
	padding: 12px 14px !important;
	font: inherit !important;
	color: var(--heading) !important;
	background: var(--white) !important;
}
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--green) !important; border-color: transparent !important; }
.contact-form label { color: var(--heading) !important; font-weight: 600 !important; }
.contact-form button[type="submit"] {
	background: var(--green) !important;
	color: var(--white) !important;
	border: 0 !important;
	border-radius: 999px !important;
	padding: 14px 28px !important;
	font: 700 .95rem var(--font) !important;
	cursor: pointer;
}

/* Appel à l'action */
.cta {
	position: relative;
	border-radius: var(--radius-lg);
	overflow: hidden;
	padding: clamp(48px, 7vw, 96px) clamp(24px, 6vw, 80px);
	background: var(--navy) center / cover no-repeat;
	text-align: center;
	color: rgba(255, 255, 255, .8);
}
.cta::before { content: ""; position: absolute; inset: 0; background: rgba(7, 26, 51, .72); }
.cta > * { position: relative; }
.cta h2 { color: var(--white); max-width: 720px; margin: 0 auto 16px; }
.cta p { max-width: 560px; margin: 0 auto 28px; }

/* Contenu de page (Elementor ou éditeur) */
.page-content { padding: clamp(48px, 7vw, 96px) 0; }
.page-content .elementor-heading-title { font-family: var(--font) !important; }
.page-content .elementor-widget-text-editor { font-family: var(--font); color: var(--text); }
.page-content .elementor-button { border-radius: 999px !important; font-family: var(--font) !important; font-weight: 700 !important; }
.page-content .elementor-widget-image img { border-radius: var(--radius); }
.entry-content > *:not(.elementor) { max-width: 820px; margin-left: auto; margin-right: auto; }

/* Pied de page */
.site-footer { background: var(--navy-deep); color: rgba(255, 255, 255, .65); padding: 80px 0 32px; margin-top: 0; }
.site-footer a { color: rgba(255, 255, 255, .85); }
.site-footer a:hover { color: var(--white); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; }
.footer-grid h4 { color: var(--white); font-size: 1rem; margin-bottom: 18px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-logo img { height: 80px; width: auto; border-radius: 6px; margin-bottom: 18px; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 56px; padding-top: 24px; font-size: .88rem; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Animations GSAP
   Les éléments animés sont cachés tant que le JavaScript n'a pas pris la main (classe « js » posée dans le <head>).
   « anim-off » (CDN bloqué, erreur…) les réaffiche. */
.js .reveal,
.js .hero__content > * { opacity: 0; }
.anim-off .reveal,
.anim-off .hero__content > * { opacity: 1 !important; visibility: visible !important; transform: none !important; }
.split-line { padding-bottom: .08em; margin-bottom: -.08em; } /* évite de couper les jambages (g, p) */
.card__media img { will-change: transform; }

/* Responsive */
@media (max-width: 1024px) {
	.stats { grid-template-columns: repeat(3, 1fr); }
	.stats__intro { grid-column: 1 / -1; }
	.stat:first-of-type { border-left: 0; padding-left: 0; }
	.cards { grid-template-columns: repeat(2, 1fr); }
	.services { grid-template-columns: 1fr; }
	.services__media { aspect-ratio: 16 / 9; }
	.footer-grid { grid-template-columns: 1fr 1fr; }
	.contact { grid-template-columns: 1fr; }
	.gallery { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
	.excursion { grid-template-columns: 1fr; }
	.excursion:nth-child(even) .excursion__media { order: 0; }
	.excursion__media { min-height: 0; aspect-ratio: 16 / 10; }
}

@media (max-width: 860px) {
	.menu-toggle { display: inline-grid; place-items: center; }
	.main-nav {
		position: absolute;
		top: calc(100% + 8px);
		left: var(--gutter);
		right: var(--gutter);
		background: var(--white);
		border-radius: var(--radius);
		box-shadow: var(--shadow);
		padding: 12px;
		display: none;
	}
	.main-nav.is-open { display: block; }
	.main-nav ul { flex-direction: column; }
	.main-nav a,
	.site-header .main-nav .current-menu-item > a,
	.site-header .main-nav .current-page-ancestor > a { color: var(--navy); }
	.main-nav a:hover,
	.site-header .main-nav .current-menu-item > a,
	.site-header .main-nav .current-page-ancestor > a { background: var(--grey-bg); }
	.main-nav .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; padding: 0 0 0 14px; min-width: 0; }
	.site-header .btn { display: none; }
	.dest-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: 220px; }
	.dest:first-child { grid-column: 1 / -1; grid-row: auto; }
}

@media (max-width: 600px) {
	:root { --gutter: 16px; }
	.hero { padding: 8px 8px 0; }
	.hero__frame { border-radius: 20px; }
	.cards { grid-template-columns: 1fr; }
	.stats { grid-template-columns: 1fr; gap: 20px; }
	.stat { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 16px; }
	.dest-grid { grid-template-columns: 1fr; }
	.footer-grid { grid-template-columns: 1fr; }
	.service-list li { grid-template-columns: 1fr; gap: 6px; }
}
