/**
 * Renovexo — header, « planche des univers » mega menu and mobile drawer.
 * The logo sits on a white plaque hanging over the bottom edge of the header bar, into the hero. Header is not sticky (house rule).
 * Desktop navigation from 1024 px; below, the « Menu » button opens a full-screen blueprint drawer.
 */

.rv-site-header { position: relative; z-index: 50; margin: 0; }
.rv-header {
	position: relative;
	background: var(--rv-white);
	border-bottom: var(--rv-border);
}
.rv-header__bar {
	display: flex;
	align-items: center;
	gap: 16px;
	max-width: calc(var(--rv-wide) + 2 * var(--rv-gutter));
	min-height: 68px;
	margin-inline: auto;
	padding-inline: var(--rv-gutter);
	box-sizing: border-box;
}

/* Logo plaque: the stacked logo on a white card hanging half below the header bar, over the hero */
.rv-header__badge {
	position: relative;
	z-index: 3;
	flex: none;
	align-self: flex-start;
	display: block;
	width: 104px;
	margin: 8px 0 -44px;
	padding: 10px 10px 8px;
	border: var(--rv-border);
	border-radius: 18px;
	background: var(--rv-white);
	box-shadow: 0 5px 0 var(--rv-ink);
	box-sizing: border-box;
}
.rv-header__badge img { display: block; width: 100%; height: auto; }
.rv-header__badge:focus-visible { border-radius: 18px; }

/* Desktop navigation */
.rv-nav { display: none; margin-left: auto; }
.rv-nav__list { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.rv-nav__link {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	min-height: 44px;
	padding: 0 14px;
	border: 0;
	border-radius: 8px;
	background: none;
	color: var(--rv-ink);
	font-family: var(--rv-font-body);
	font-size: 1rem;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	background-image: linear-gradient(var(--rv-yellow), var(--rv-yellow));
	background-repeat: no-repeat;
	background-position: 14px calc(100% - 9px);
	background-size: 0 6px;
	transition: background-size .2s ease;
}
.rv-nav__link:hover,
.rv-has-dropdown.is-open > .rv-nav__link { background-size: calc(100% - 28px) 6px; color: var(--rv-ink); }
.rv-nav__chevron { transition: transform .2s ease; }
.rv-has-dropdown.is-open .rv-nav__chevron { transform: rotate(180deg); }

.rv-header__actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.rv-header__cta { min-height: 44px; padding: .55rem 1rem; font-size: .82rem; }

/* Search button */
.rv-search-toggle {
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	border: var(--rv-border);
	border-radius: 50%;
	background: var(--rv-white);
	color: var(--rv-ink);
	cursor: pointer;
	transition: background-color .15s ease;
}
.rv-search-toggle:hover { background: var(--rv-yellow); }

/* Menu button (mobile, tablet) */
.rv-mobile-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 12px;
	border: var(--rv-border);
	border-radius: var(--rv-radius-sm);
	background: var(--rv-yellow);
	color: var(--rv-ink);
	font-family: var(--rv-font-head);
	font-size: .82rem;
	font-weight: 600;
	cursor: pointer;
}
.rv-mobile-toggle__bars { display: grid; gap: 4px; width: 18px; }
.rv-mobile-toggle__bars span { display: block; height: 2.5px; border-radius: 2px; background: var(--rv-ink); }
.rv-mobile-toggle__bars span:nth-child(2) { width: 70%; }

@media (max-width: 479px) {
	.rv-header__cta { display: none; }
}

/* ---- Planche des univers (desktop mega menu) ---------------------------------------------------------------- */

.rv-planche {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	z-index: 2;
	visibility: hidden;
	opacity: 0;
	transform: translateY(-8px);
	background: linear-gradient(180deg, var(--rv-night) 0%, #1B238A 100%);
	border-bottom: var(--rv-border);
	border-radius: 0 0 22px 22px;
	color: var(--rv-white);
	transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}
.rv-has-dropdown.is-open .rv-planche {
	visibility: visible;
	opacity: 1;
	transform: none;
	transition: opacity .18s ease, transform .18s ease;
}
.rv-planche__inner {
	display: grid;
	grid-template-columns: minmax(220px, 1fr) 3fr;
	gap: 40px;
	max-width: calc(var(--rv-wide) + 2 * var(--rv-gutter));
	margin-inline: auto;
	padding: 104px var(--rv-gutter) 44px;
	box-sizing: border-box;
}
.rv-planche__title { margin: 0 0 10px; font-family: var(--rv-font-head); font-size: 1.3rem; font-weight: 700; line-height: 1.2; }
.rv-planche__text { margin: 0 0 20px; color: var(--rv-calque); font-size: .98rem; line-height: 1.6; }
.rv-planche__more { color: var(--rv-yellow); font-weight: 700; text-underline-offset: 4px; }
.rv-planche__more:hover { color: var(--rv-white); }
.rv-planche__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 18px; margin: 0; padding: 0; list-style: none; }
.rv-planche__item {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 52px;
	padding: 6px 10px 6px 6px;
	border: 2px solid transparent;
	border-radius: 12px;
	color: var(--rv-white);
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none;
}
.rv-planche__item:hover { border-color: var(--rv-yellow); background: rgba(255, 255, 255, .06); color: var(--rv-white); }
.rv-planche__icon {
	display: grid;
	place-items: center;
	flex: none;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--rv-white);
	color: var(--rv-blue);
	box-shadow: 0 0 0 2px var(--rv-ink);
}
.rv-planche__item:hover .rv-planche__icon { background: var(--rv-yellow); color: var(--rv-ink); }

@media (min-width: 1024px) {
	.rv-nav { display: block; }
	.rv-header__actions { margin-left: 8px; }
	.rv-mobile-toggle { display: none; }
	.rv-header__bar { min-height: 76px; }
	.rv-header__badge { width: 156px; margin: 10px 0 -84px; padding: 16px 16px 12px; border-radius: 24px; }
	.rv-header__cta { padding: .6rem 1.15rem; font-size: .85rem; }
	/* Hover opens the sheet too (keyboard and touch use the button). */
	.rv-has-dropdown:hover .rv-planche {
		visibility: visible;
		opacity: 1;
		transform: none;
		transition: opacity .18s ease .08s, transform .18s ease .08s;
	}
	.rv-has-dropdown:hover > .rv-nav__link { background-size: calc(100% - 28px) 6px; }
}
@media (min-width: 1024px) and (max-width: 1199px) {
	.rv-planche__inner { grid-template-columns: 1fr; gap: 24px; padding-left: var(--rv-gutter); }
}

/* ---- Mobile drawer ---------------------------------------------------------------------------------------- */

.rv-drawer {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	flex-direction: column;
	visibility: hidden;
	opacity: 0;
	transform: translateY(-12px);
	background: linear-gradient(180deg, #232FA8 0%, var(--rv-blue) 60%, #3D4FD6 100%);
	color: var(--rv-white);
	transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
}
.rv-drawer.is-active { visibility: visible; opacity: 1; transform: none; transition: opacity .22s ease, transform .22s ease; }
.admin-bar .rv-drawer { top: 46px; }
@media (min-width: 783px) { .admin-bar .rv-drawer { top: 32px; } }

.rv-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px var(--rv-gutter);
	border-bottom: 2px solid rgba(255, 255, 255, .25);
}
.rv-mobile-close {
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	border: var(--rv-border);
	border-radius: 50%;
	background: var(--rv-yellow);
	color: var(--rv-ink);
	cursor: pointer;
}
.rv-drawer__body { flex: 1; overflow-y: auto; padding: 20px var(--rv-gutter) 28px; }
.rv-drawer__main { margin: 0 0 28px; padding: 0; list-style: none; }
.rv-drawer__main a {
	display: block;
	padding: 10px 0;
	color: var(--rv-white);
	font-family: var(--rv-font-head);
	font-size: clamp(1.45rem, 6vw, 1.9rem);
	font-weight: 700;
	letter-spacing: -.02em;
	text-decoration: none;
}
.rv-drawer__main a:hover { color: var(--rv-yellow); }
.rv-drawer__label { margin: 0 0 12px; color: var(--rv-yellow); font-weight: 700; }
.rv-drawer__cats { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 420px) { .rv-drawer__cats { grid-template-columns: 1fr 1fr; } }
.rv-drawer__cats a {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 50px;
	padding: 6px 10px 6px 6px;
	border: 2px solid rgba(255, 255, 255, .35);
	border-radius: 12px;
	color: var(--rv-white);
	font-weight: 700;
	line-height: 1.25;
	text-decoration: none;
	box-sizing: border-box;
}
.rv-drawer__cats a:hover { border-color: var(--rv-yellow); }
.rv-drawer__icon {
	display: grid;
	place-items: center;
	flex: none;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--rv-white);
	color: var(--rv-blue);
}
.rv-drawer__foot { padding: 4px var(--rv-gutter) 20px; background: var(--rv-night); }

/* ---- Search modal ----------------------------------------------------------------------------------------- */

.rv-search {
	width: min(760px, calc(100% - 2 * var(--rv-gutter)));
	max-width: none;
	max-height: calc(100% - 64px);
	margin: clamp(24px, 10vh, 120px) auto auto;
	padding: 0;
	border: var(--rv-border);
	border-radius: 24px;
	background: linear-gradient(180deg, #FFFFFF 0%, #F6F6F2 100%);
	box-shadow: 0 8px 0 var(--rv-ink);
	color: var(--rv-ink);
}
.rv-search::backdrop { background: rgba(21, 28, 102, .62); backdrop-filter: blur(3px); }
.rv-search[open] { animation: rv-search-in .2s ease; }
@keyframes rv-search-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.rv-search__panel { padding: clamp(20px, 4vw, 34px); }
.rv-search__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.rv-search__title { margin: 0; font-family: var(--rv-font-head); font-size: clamp(1.25rem, 1.05rem + .8vw, 1.6rem); font-weight: 800; letter-spacing: -.02em; }
.rv-search__close {
	display: grid;
	place-items: center;
	flex: none;
	width: 44px;
	height: 44px;
	border: var(--rv-border);
	border-radius: 50%;
	background: var(--rv-yellow);
	color: var(--rv-ink);
	cursor: pointer;
}
.rv-search__form {
	position: relative;
	display: grid;
	gap: 10px;
	margin-bottom: 26px;
}
@media (min-width: 600px) { .rv-search__form { grid-template-columns: 1fr auto; } }
.rv-search__icon { position: absolute; left: 16px; top: 15px; color: var(--rv-blue); pointer-events: none; }
.rv-search__field {
	width: 100%;
	min-height: 56px;
	padding: 0 16px 0 50px;
	border: var(--rv-border);
	border-radius: 14px;
	background: var(--rv-white);
	color: var(--rv-ink);
	font: 700 1.05rem var(--rv-font-body);
	box-sizing: border-box;
}
.rv-search__field:focus { outline: none; border-color: var(--rv-blue); box-shadow: 0 0 0 4px var(--rv-calque); }
.rv-search__go { min-height: 56px; }
.rv-search__label { margin: 0 0 10px; color: var(--rv-muted); font-size: .9rem; font-weight: 700; }
.rv-search__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }
.rv-search__chips:last-child { margin-bottom: 0; }
.rv-search__chips a {
	display: inline-flex;
	align-items: center;
	min-height: 38px;
	padding: 0 14px;
	border: 2px solid var(--rv-ink);
	border-radius: 999px;
	background: var(--rv-white);
	color: var(--rv-ink);
	font-size: .9rem;
	font-weight: 700;
	text-decoration: none;
}
.rv-search__chips a:hover { background: var(--rv-yellow); }
.rv-search__chips--calc a { background: var(--rv-calque); }
