/* ==========================================================================
   RAMA SERVICES — HEADER  (v1.0.0)
   Toutes les classes sont préfixées .rama-hd pour ne jamais entrer en
   conflit avec le thème WordPress.
   ========================================================================== */

.rama-hd-wrap {
	--rama-hd-green: #2f4a35;
	--rama-hd-green-dark: #24392a;
	--rama-hd-cream: #e7dcbb;
	--rama-hd-white: #ffffff;
	--rama-hd-radius: 4px;
	--rama-hd-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--rama-hd-h: 88px;          /* hauteur du header en haut de page */
	--rama-hd-h-stuck: 68px;    /* hauteur du header une fois collé */
	--rama-hd-break: 1024px;    /* seuil d'apparition du menu burger */
	/* Doit correspondre à --rama-hero-inset du plugin « Landing » (26px) :
	   sans ça, le logo déborde au-dessus du hero arrondi, sur le fond blanc. */
	--rama-hd-offset: 26px;
}

.rama-hd-wrap *,
.rama-hd-wrap *::before,
.rama-hd-wrap *::after {
	box-sizing: border-box;
}

/* ---------- Lien d'évitement (accessibilité) ---------- */
.rama-hd__skip {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100000;
	padding: 12px 20px;
	background: var(--rama-hd-green);
	color: #fff;
	font-family: var(--rama-hd-sans);
	font-size: 0.9rem;
	text-decoration: none;
	border-radius: 0 0 var(--rama-hd-radius) 0;
}

.rama-hd__skip:focus {
	left: 0;
}

/* ==========================================================================
   BARRE
   ========================================================================== */
.rama-hd {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 9999;
	height: calc(var(--rama-hd-h) + var(--rama-hd-offset));
	padding-top: var(--rama-hd-offset);
	display: flex;
	align-items: center;
	background: transparent;
	font-family: var(--rama-hd-sans);
	transition: background-color .3s ease, height .3s ease, padding-top .3s ease, box-shadow .3s ease;
}

/* [header_rama sticky="no"] */
.rama-hd-wrap--nosticky .rama-hd {
	position: absolute;
}

/* La barre d'administration WordPress est fixée en haut : on décale le
   header d'autant, sinon il passe dessous et se retrouve sur du blanc. */
body.admin-bar .rama-hd {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar .rama-hd {
		top: 46px;
	}
}

/* État « collé » : fond vert opaque. */
.rama-hd.is-stuck,
.rama-hd-wrap--opaque .rama-hd {
	height: var(--rama-hd-h-stuck);
	padding-top: 0;
	background: var(--rama-hd-green);
	box-shadow: 0 6px 26px rgba(27, 42, 32, .22);
}

/* Cale : réserve la hauteur du header sur les pages où il est opaque
   (mentions légales, politique de confidentialité…), pour qu'il ne recouvre
   pas le titre de la page. */
.rama-hd__cale {
	height: 68px;
}

@media (max-width: 1024px) {
	.rama-hd__cale {
		height: 64px;
	}
}

@media (max-width: 480px) {
	.rama-hd__cale {
		height: 60px;
	}
}

body.admin-bar .rama-hd__cale {
	height: 68px;
}

.rama-hd__inner {
	width: 100%;
	max-width: 1360px;
	margin: 0 auto;
	padding: 0 32px;
	display: flex;
	align-items: center;
	gap: 24px;
}

/* ---------- Logo ---------- */
.rama-hd__logo {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	margin-right: auto;
	text-decoration: none;
	line-height: 0;
}

/* Les !important sont volontaires : beaucoup de thèmes et Elementor
   imposent « img { height: auto } » avec une spécificité supérieure, ce qui
   faisait s'afficher le logo à sa taille d'origine (énorme). */
.rama-hd .rama-hd__logo .rama-hd__logo-img {
	height: var(--rama-hd-logo-h, 56px) !important;
	width: auto !important;
	max-width: 240px !important;
	max-height: var(--rama-hd-logo-h, 56px) !important;
	object-fit: contain;
	display: block;
	transition: height .3s ease, max-height .3s ease, filter .3s ease;
}

.rama-hd.is-stuck .rama-hd__logo .rama-hd__logo-img {
	height: calc(var(--rama-hd-logo-h, 56px) * .82) !important;
	max-height: calc(var(--rama-hd-logo-h, 56px) * .82) !important;
}

/* ---------- Nom de l'entreprise à côté du logo ---------- */
.rama-hd__logo-nom {
	display: inline-block;
	max-width: 0;
	margin-left: 0;
	overflow: hidden;
	white-space: nowrap;
	opacity: 0;
	font-family: "Playfair Display", "Libre Baskerville", Georgia, "Times New Roman", serif;
	font-size: 1.38rem;
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: .01em;
	color: var(--rama-hd-white);
	transition: opacity .3s ease, max-width .35s ease, margin-left .35s ease;
}

/* Apparaît quand la barre passe en vert. */
.rama-hd.is-stuck .rama-hd__logo-nom,
.rama-hd-wrap--opaque .rama-hd__logo-nom,
.rama-hd__logo--nom-toujours .rama-hd__logo-nom {
	max-width: 240px;
	margin-left: 14px;
	opacity: 1;
}

/* Logo blanchi en permanence (option RAMA_HEADER_LOGO_INVERT). */
.rama-hd__logo--invert .rama-hd__logo-img {
	filter: brightness(0) invert(1);
}

/* Logo blanchi UNIQUEMENT quand la barre est verte : au défilement, et sur
   les pages internes où le header est opaque. Par-dessus la photo du hero,
   il garde ses couleurs d'origine. La transition est déjà déclarée sur
   .rama-hd__logo-img, le passage se fait donc en fondu. */
.rama-hd.is-stuck .rama-hd__logo--invert-vert .rama-hd__logo-img,
.rama-hd-wrap--opaque .rama-hd__logo--invert-vert .rama-hd__logo-img {
	filter: brightness(0) invert(1);
}

/* Pastille claire derrière le logo (option RAMA_HEADER_LOGO_PASTILLE). */
.rama-hd__logo--pastille .rama-hd__logo-img {
	background: var(--rama-hd-white);
	border-radius: 12px;
	padding: 6px;
	box-sizing: content-box;
}

.rama-hd__logo-texte {
	font-family: Georgia, "Times New Roman", serif;
	font-size: 1.4rem;
	font-weight: 600;
	color: var(--rama-hd-white);
	line-height: 1.2;
	letter-spacing: .01em;
}

/* ---------- Navigation (desktop) ---------- */
.rama-hd__nav {
	display: flex;
	align-items: center;
	gap: 28px;
}

.rama-hd__liste {
	display: flex;
	align-items: center;
	gap: 30px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.rama-hd__lien {
	position: relative;
	display: inline-block;
	padding: 6px 0;
	color: var(--rama-hd-white);
	font-size: 0.9rem;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	transition: color .2s ease;
}

/* Soulignement animé « maison » — le thème ne peut pas le remplacer. */
.rama-hd__lien::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	height: 2px;
	background: var(--rama-hd-cream);
	transform: scaleX(0);
	transform-origin: right;
	transition: transform .28s ease;
}

.rama-hd__lien:hover::after,
.rama-hd__lien:focus-visible::after {
	transform: scaleX(1);
	transform-origin: left;
}

.rama-hd__lien:hover,
.rama-hd__lien:focus-visible {
	color: var(--rama-hd-cream);
}

/* Le téléphone n'apparaît que dans le menu mobile. */
.rama-hd__tel {
	display: none;
}

/* ---------- Bouton d'action ---------- */
.rama-hd__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	min-height: 46px;
	padding: 12px 26px;
	background: var(--rama-hd-cream);
	color: var(--rama-hd-green) !important;
	font-size: 0.87rem;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	text-decoration: none;
	border-radius: var(--rama-hd-radius);
	white-space: nowrap;
	transition: background-color .22s ease, transform .22s ease, color .22s ease;
}

.rama-hd__cta:hover {
	background: var(--rama-hd-white);
	transform: translateY(-2px);
}

.rama-hd__cta--mobile {
	display: none;
}

/* ---------- Burger ---------- */
.rama-hd__burger {
	display: none;
	/* Au-dessus du panneau mobile, pour rester cliquable et permettre la
	   fermeture (la croix reste visible par-dessus le menu ouvert). */
	position: relative;
	z-index: 10001;
	flex: 0 0 auto;
	width: 46px;
	height: 46px;
	padding: 11px;
	background: transparent;
	border: 0;
	cursor: pointer;
	flex-direction: column;
	justify-content: space-between;
}

.rama-hd__burger-bar {
	display: block;
	width: 100%;
	height: 2px;
	background: var(--rama-hd-white);
	border-radius: 2px;
	transition: transform .3s ease, opacity .2s ease;
}

.rama-hd__burger[aria-expanded="true"] .rama-hd__burger-bar:nth-child(1) {
	transform: translateY(10px) rotate(45deg);
}

.rama-hd__burger[aria-expanded="true"] .rama-hd__burger-bar:nth-child(2) {
	opacity: 0;
}

.rama-hd__burger[aria-expanded="true"] .rama-hd__burger-bar:nth-child(3) {
	transform: translateY(-10px) rotate(-45deg);
}

/* ---------- Voile sombre derrière le menu mobile ---------- */
.rama-hd__voile {
	position: fixed;
	inset: 0;
	z-index: 9998;
	background: rgba(20, 32, 24, .55);
	opacity: 0;
	transition: opacity .3s ease;
	backdrop-filter: blur(2px);
}

.rama-hd__voile.is-open {
	opacity: 1;
}

/* Blocage du défilement quand le menu mobile est ouvert. */
body.rama-hd-menu-open {
	overflow: hidden;
}

/* ==========================================================================
   TABLETTE ET MOBILE  (<= 1024px)
   ========================================================================== */
@media (max-width: 1024px) {

	.rama-hd-wrap {
		--rama-hd-h: 74px;
		--rama-hd-h-stuck: 64px;
		--rama-hd-offset: 12px;
	}

	.rama-hd__logo-img {
		height: var(--rama-hd-logo-h-mob, 44px);
	}

	.rama-hd.is-stuck .rama-hd__logo-img {
		height: calc(var(--rama-hd-logo-h-mob, 44px) * .9);
	}

	.rama-hd__inner {
		padding: 0 20px;
		gap: 12px;
	}

	.rama-hd__burger {
		display: flex;
	}

	.rama-hd__cta--desktop {
		display: none;
	}

	.rama-hd__cta--mobile {
		display: inline-flex;
		width: 100%;
		margin-top: 8px;
	}

	/* Le menu devient un panneau qui glisse depuis la droite. */
	.rama-hd__nav {
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		width: min(360px, 86vw);
		z-index: 10000;
		display: flex;
		flex-direction: column;
		align-items: stretch;
		justify-content: flex-start;
		gap: 0;
		padding: calc(var(--rama-hd-h) + 18px) 26px 34px;
		background: var(--rama-hd-green);
		box-shadow: -18px 0 44px rgba(20, 32, 24, .3);
		overflow-y: auto;
		overscroll-behavior: contain;
		transform: translateX(102%);
		visibility: hidden;
		transition: transform .34s cubic-bezier(.4, 0, .2, 1), visibility .34s;
	}

	.rama-hd__nav.is-open {
		transform: translateX(0);
		visibility: visible;
	}

	.rama-hd__liste {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		width: 100%;
	}

	.rama-hd__liste li + li {
		border-top: 1px solid rgba(255, 255, 255, .13);
	}

	.rama-hd__lien {
		display: block;
		padding: 17px 2px;
		font-size: 1rem;
		letter-spacing: .05em;
	}

	.rama-hd__lien::after {
		display: none;
	}

	.rama-hd__tel {
		display: inline-flex;
		align-items: center;
		gap: 10px;
		min-height: 46px;
		margin-top: 22px;
		padding: 10px 2px;
		color: var(--rama-hd-cream);
		font-size: 1rem;
		font-weight: 700;
		text-decoration: none;
	}

	.rama-hd__tel svg {
		flex: 0 0 auto;
	}
}

/* ---------- Petits écrans ---------- */
@media (max-width: 480px) {
	.rama-hd-wrap {
		--rama-hd-h: 66px;
		--rama-hd-h-stuck: 60px;
	}

	.rama-hd__inner {
		padding: 0 16px;
	}

	.rama-hd .rama-hd__logo .rama-hd__logo-img {
		max-width: 150px !important;
	}

	.rama-hd__logo-nom {
		font-size: 1.02rem;
	}

	.rama-hd.is-stuck .rama-hd__logo-nom {
		max-width: 150px;
		margin-left: 10px;
	}

	.rama-hd__nav {
		width: min(330px, 90vw);
		padding: calc(var(--rama-hd-h) + 14px) 20px 28px;
	}
}

/* ---------- Accessibilité : focus visible ---------- */
.rama-hd a:focus-visible,
.rama-hd button:focus-visible {
	outline: 3px solid var(--rama-hd-cream);
	outline-offset: 3px;
	border-radius: 2px;
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
	.rama-hd,
	.rama-hd *,
	.rama-hd__voile {
		transition-duration: .01ms !important;
	}
}

/* ---------- Impression ---------- */
@media print {
	.rama-hd,
	.rama-hd__voile {
		display: none !important;
	}
}
