/*
 * Header (top bar, logo, search, navigation, drop-downs, mega-menu, phone menu) and footer.
 * Matches design/maquette-menu-*, maquette-megamenu-*, maquette-accueil-* of the prototype.
 */

/* ---------- top bar ---------- */
.feu-topbar { background: #3a0d11; color: #f3e6d2; font-size: var(--wp--preset--font-size--sm); }
.feu-topbar__nav ul { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .25rem 1.5rem; margin: 0; padding: .5rem 0; list-style: none; }
.feu-topbar li { white-space: nowrap; }
.feu-topbar a { position: relative; color: inherit; text-decoration: none; }
.feu-topbar a::after { content: ""; position: absolute; left: -6px; right: -6px; top: 50%; height: 44px; transform: translateY(-50%); }   /* a 44px target, same look */
.feu-topbar a:hover { color: #fff; text-decoration: underline; }
.feu-topbar__donate { display: inline-block; padding: .2rem .9rem; border-radius: 999px; background: var(--wp--preset--color--gold); color: #2a1213 !important; font-weight: 600; }
.feu-topbar__donate:hover { background: #d9b565; text-decoration: none !important; }

/* ---------- header ---------- */
.feu-header { position: relative; z-index: 50; background: var(--wp--preset--color--surface); border-bottom: 1px solid var(--feu-border-strong); }
.feu-header__inner { display: flex; align-items: center; gap: 1.5rem; padding-block: 1.1rem .6rem; }
.feu-logo { display: inline-flex; align-items: center; gap: 1rem; margin-right: auto; text-decoration: none; color: var(--wp--preset--color--brand); }
.feu-logo img { width: 64px; height: 64px; flex: none; }
.feu-logo span { font-family: var(--wp--preset--font-family--heading); font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem); font-weight: 500; line-height: 1; }
.feu-header__search { width: min(300px, 32vw); }

.feu-search { position: relative; }
.feu-search input {
	width: 100%; padding: .7rem 1rem .7rem 2.4rem; border: 1px solid var(--feu-border-strong); border-radius: 999px;
	background: var(--wp--preset--color--fill); color: var(--wp--preset--color--text); font: inherit; font-size: 1rem;   /* 16px at least: iOS zooms into smaller fields */
	transition: border-color .2s var(--feu-ease), box-shadow .2s var(--feu-ease), background-color .2s var(--feu-ease);
}
.feu-search input::placeholder { color: var(--wp--preset--color--text-secondary); }
.feu-search input:focus { outline: none; border-color: var(--wp--preset--color--gold); background: var(--wp--preset--color--surface); box-shadow: 0 0 0 3px rgb(201 162 74 / .25); }
.feu-search__icon { position: absolute; left: .9rem; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--wp--preset--color--muted); pointer-events: none; }

/* ---------- main navigation ---------- */
.feu-nav__list { display: flex; flex-wrap: wrap; gap: 0 2rem; margin: 0; padding: 0; list-style: none; }
.feu-nav__item { position: relative; display: flex; align-items: center; }
.feu-nav__item > a, .feu-nav__all {
	display: inline-flex; align-items: center; gap: .4rem; padding: .7rem 0 .85rem;
	color: var(--wp--preset--color--text); font-size: 1rem; text-decoration: none; background: none; border: 0; cursor: pointer;
	box-shadow: inset 0 -2px 0 transparent; transition: color .2s var(--feu-ease), box-shadow .2s var(--feu-ease);
}
.feu-nav__item > a:hover, .feu-nav__all:hover { color: var(--wp--preset--color--brand); }
.feu-nav__item > a[aria-current], .feu-nav__item:has(.feu-drop.is-open) > a, .feu-nav__all[aria-expanded="true"] { color: var(--wp--preset--color--brand); box-shadow: inset 0 -2px 0 var(--wp--preset--color--brand); }
.feu-nav__all { color: var(--wp--preset--color--brand); font-weight: 600; }
.feu-nav__caret { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-left: .15rem; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--wp--preset--color--text); cursor: pointer; }
.feu-nav__caret svg, .feu-nav__all svg { width: 12px; height: 12px; transition: transform .25s var(--feu-ease); }
.feu-nav__caret[aria-expanded="true"] svg, .feu-nav__all[aria-expanded="true"] svg { transform: rotate(180deg); }

.feu-drop {
	position: absolute; top: 100%; left: -1rem; z-index: 60; min-width: 320px; padding: .5rem;
	background: var(--wp--preset--color--surface); border: 1px solid var(--feu-border-strong); border-radius: var(--feu-radius-lg);
	box-shadow: 0 18px 40px var(--feu-shadow-strong);
	opacity: 0; visibility: hidden; transform: translateY(-6px);
	transition: opacity .15s ease, transform .2s var(--feu-ease), visibility 0s linear .2s;
}
.feu-drop.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity .2s ease, transform .25s var(--feu-ease), visibility 0s; }
.feu-drop ul { margin: 0; padding: 0; list-style: none; }
.feu-drop li a, .feu-mega__list a {
	display: flex; justify-content: space-between; gap: 1rem; padding: .45rem .5rem; border-radius: var(--feu-radius-sm);
	color: var(--wp--preset--color--text); font-size: var(--wp--preset--font-size--sm); text-decoration: none;
	transition: background-color .15s ease, color .15s ease;
}
.feu-drop li a:hover, .feu-drop li a[aria-current], .feu-mega__list a:hover, .feu-mega__list a[aria-current] { background: var(--wp--preset--color--fill); color: var(--wp--preset--color--brand); }
.feu-drop .feu-arrow-link { display: block; margin-top: .4rem; padding: .6rem .5rem .3rem; border-top: 1px solid var(--wp--preset--color--border); }

/* ---------- mega-menu ---------- */
.feu-mega { position: absolute; left: 0; right: 0; top: 100%; z-index: 55; background: var(--wp--preset--color--surface); border-bottom: 1px solid var(--feu-border-strong); box-shadow: 0 30px 60px var(--feu-shadow-strong); }
.feu-mega:not([hidden]) { animation: feu-unfold .3s var(--feu-ease) both; }
@keyframes feu-unfold { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.feu-mega__inner { padding-block: 2rem 1rem; }
.feu-mega__search, .feu-mega__eyebrow { display: none; }
.feu-mega__body { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 2.5rem; }
.feu-mega__columns { columns: 4 200px; column-gap: 2rem; }
.feu-mega__section, .feu-mega__others { break-inside: avoid; margin-bottom: 1.6rem; }
.feu-mega__head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--feu-border-strong); margin-bottom: .6rem; }
.feu-mega__title { display: block; padding-bottom: .4rem; font-family: var(--wp--preset--font-family--heading); font-size: 1.35rem; font-weight: 600; line-height: 1.15; color: var(--wp--preset--color--brand); text-decoration: none; }
.feu-mega__title:hover { color: var(--wp--preset--color--burgundy-deep); }
.feu-mega__expand { display: none; }
.feu-mega__list { margin: 0; padding: 0; list-style: none; }
.feu-mega__all, .feu-mega__videos { display: none; }
.feu-mega__others { display: grid; gap: .9rem; margin: 0; padding: 0; list-style: none; }
.feu-mega__others .feu-mega__title { padding-bottom: 0; }
.feu-mega__latest { display: grid; gap: .6rem; align-content: start; }
.feu-mega__latest-link { display: grid; gap: .6rem; color: var(--wp--preset--color--text); text-decoration: none; }
.feu-mega__latest-link img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--feu-radius-lg); }
.feu-mega__latest-title { font-family: var(--wp--preset--font-family--heading); font-size: 1.3rem; font-weight: 600; line-height: 1.15; }
.feu-mega__latest-link:hover .feu-mega__latest-title { color: var(--wp--preset--color--brand); }
.feu-mega__latest-meta { margin: 0; color: var(--wp--preset--color--muted); font-size: var(--wp--preset--font-size--sm); }
.feu-mega__latest :is(.feu-btn, .feu-arrow-link) { justify-self: start; }
.feu-mega__foot { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.8rem; padding-top: 1rem; border-top: 1px solid var(--wp--preset--color--border); font-size: var(--wp--preset--font-size--sm); color: var(--wp--preset--color--muted); }
.feu-mega__foot p { margin: 0; }
.feu-mega__foot a { color: var(--wp--preset--color--text-secondary); }

/* the phone search button (opens the menu on its search field; the search page without JavaScript), hidden on large screens */
.feu-search-link { display: none; place-items: center; flex: none; width: 42px; height: 42px; border: 1px solid var(--feu-border-strong); border-radius: 50%; background: var(--wp--preset--color--fill); color: var(--wp--preset--color--text); }
.feu-search-link svg { width: 18px; height: 18px; }

/* the phone "Menu" button (hidden on large screens) */
.feu-menu-toggle { display: none; align-items: center; gap: .55rem; padding: .6rem 1.1rem; border: 1px solid var(--feu-border-strong); border-radius: 999px; background: var(--wp--preset--color--fill); color: var(--wp--preset--color--text); font-weight: 600; cursor: pointer; }
.feu-menu-toggle[aria-expanded="true"] { background: var(--wp--preset--color--brand); border-color: var(--wp--preset--color--brand); color: var(--feu-on-brand); }
.feu-menu-toggle__icon { position: relative; width: 16px; height: 12px; }
.feu-menu-toggle__icon i { position: absolute; left: 0; width: 100%; height: 2px; border-radius: 2px; background: currentColor; transition: transform .3s var(--feu-ease), top .3s var(--feu-ease), opacity .2s ease; }
.feu-menu-toggle__icon i:nth-child(1) { top: 0; }
.feu-menu-toggle__icon i:nth-child(2) { top: 5px; }
.feu-menu-toggle__icon i:nth-child(3) { top: 10px; }
.feu-menu-toggle[aria-expanded="true"] .feu-menu-toggle__icon i:nth-child(1) { top: 5px; transform: rotate(45deg); }
.feu-menu-toggle[aria-expanded="true"] .feu-menu-toggle__icon i:nth-child(2) { opacity: 0; }
.feu-menu-toggle[aria-expanded="true"] .feu-menu-toggle__icon i:nth-child(3) { top: 5px; transform: rotate(-45deg); }
.feu-menu-toggle__close, .feu-menu-toggle[aria-expanded="true"] .feu-menu-toggle__open { display: none; }
.feu-menu-toggle[aria-expanded="true"] .feu-menu-toggle__close { display: inline; }

@media (max-width: 1100px) {
	.feu-mega__columns { columns: 3 200px; }
	.feu-nav__list { gap: 0 1.25rem; }   /* the four sections and "Toutes les rubriques" on one line down to 1024px */
}

/* ---------- phones and tablets: the mega-menu becomes the menu ---------- */
@media (max-width: 900px) {
	.feu-header__inner { padding-block: .9rem; }
	.feu-header__search, .feu-nav { display: none; }
	.feu-menu-toggle { display: inline-flex; }
	.feu-search-link { display: inline-grid; }
	.feu-header__inner { gap: .5rem; }
	.feu-logo img { width: 52px; height: 52px; }
	.feu-mega { position: static; box-shadow: none; border-bottom: 0; border-top: 1px solid var(--feu-border-strong); }
	.feu-mega__inner { padding-block: 1.2rem 1.5rem; }
	.feu-mega__search { display: block; margin-bottom: 1.2rem; }
	.feu-mega__eyebrow { display: block; margin-bottom: .4rem; }
	.feu-mega__body, .feu-mega__columns { display: block; columns: auto; }
	.feu-mega__section, .feu-mega__others { margin-bottom: 0; }
	.feu-mega__section { border-bottom: 1px solid var(--wp--preset--color--border); }
	.feu-mega__head { border: 0; margin: 0; }
	.feu-mega__title { padding: .85rem 0; font-size: 1.45rem; color: var(--wp--preset--color--text); }
	.feu-mega__title[aria-current] { color: var(--wp--preset--color--brand); }
	.feu-mega__expand { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-right: -10px; border: 0; background: none; color: var(--wp--preset--color--gold-text); cursor: pointer; position: relative; }
	.feu-mega__expand::before, .feu-mega__expand::after { content: ""; position: absolute; width: 14px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .25s var(--feu-ease); }
	.feu-mega__expand::after { transform: rotate(90deg); }
	.feu-mega__expand[aria-expanded="true"]::after { transform: rotate(0deg); }
	.feu-mega__panel { display: none; margin-bottom: 1rem; padding: .5rem; background: var(--wp--preset--color--bg); border-radius: var(--feu-radius-lg); }
	.feu-mega__panel.is-open { display: block; animation: feu-unfold .25s var(--feu-ease) both; }
	.feu-mega__list a { padding: .65rem .6rem; font-size: 1rem; }
	.feu-mega__all { display: block; margin-top: .3rem; padding: .7rem .6rem .4rem; border-top: 1px solid var(--feu-border-strong); }
	.feu-mega__others { display: block; }
	.feu-mega__others li { border-bottom: 1px solid var(--wp--preset--color--border); }
	.feu-mega__others .feu-mega__title { display: flex; justify-content: space-between; align-items: center; padding: .85rem 0; }
	.feu-mega__videos { display: flex; justify-content: space-between; align-items: center; padding: .85rem 0; border-bottom: 1px solid var(--wp--preset--color--border); }
	.feu-mega__videos::after, .feu-mega__others .feu-mega__title::after { content: "→"; font-family: var(--wp--preset--font-family--body); font-size: 1rem; color: var(--wp--preset--color--gold-text); }
	.feu-mega__latest, .feu-mega__foot p { display: none; }
	.feu-mega__foot { margin-top: 1rem; border: 0; padding-top: 0; }
	.feu-topbar__nav ul { justify-content: center; }
	body.feu-menu-open { overflow: hidden; }
	body.feu-menu-open .feu-mega { position: fixed; inset: var(--feu-header-bottom, 0) 0 0 0; overflow-y: auto; overscroll-behavior: contain; }
}
@media (max-width: 480px) {
	.feu-topbar__nav ul { gap: .25rem .8rem; font-size: .78rem; }
	.feu-topbar__donate { padding: .15rem .7rem; }
	.feu-logo { gap: .5rem; }
	.feu-logo img { width: 40px; height: 40px; }
	.feu-logo span { font-size: 1.2rem; white-space: nowrap; }
	.feu-search-link { width: 40px; height: 40px; }
	.feu-menu-toggle { padding: .55rem .8rem; gap: .45rem; }
}
/* small phones: the word "Menu" / "Fermer" stays, the three lines go */
@media (max-width: 370px) {
	.feu-menu-toggle__icon { display: none; }
}
@media (max-width: 340px) {
	.feu-header__inner { gap: .4rem; }
	.feu-logo span { font-size: 1.05rem; }
	.feu-search-link { width: 38px; height: 38px; }
	.feu-menu-toggle { padding: .5rem .7rem; }
}

/* ---------- footer ---------- */
.feu-footer { background: var(--wp--preset--color--footer); color: #cdbca7; font-size: var(--wp--preset--font-size--sm); }
.feu-footer a { color: #f1e6d6; text-decoration: none; }
.feu-footer a:hover { color: var(--wp--preset--color--gold); text-decoration: underline; }
.feu-footer__grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, .8fr) minmax(0, 1fr); gap: 2rem 3rem; padding-block: 3.5rem 2.5rem; }
.feu-footer__name { margin: 0 0 1rem; font-family: var(--wp--preset--font-family--heading); font-size: 2rem; font-weight: 500; color: #e6c77a; line-height: 1.1; }
.feu-footer__about { margin: 0; max-width: 46ch; line-height: 1.7; }
.feu-footer .feu-eyebrow { margin-bottom: 1rem; color: #c9a24a; font-size: .75rem; }
.feu-footer ul { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; color: #f1e6d6; }
.feu-footer__bottom { border-top: 1px solid rgb(255 255 255 / .08); }
.feu-footer__bottom-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem 1.5rem; padding-block: 1rem; font-size: var(--wp--preset--font-size--xs); color: #9c8b78; }
.feu-footer__bottom p { margin: 0; }
.feu-forget { margin-left: auto; padding: .35rem .8rem; border: 1px solid rgb(255 255 255 / .15); border-radius: 999px; background: none; color: #cdbca7; font-size: var(--wp--preset--font-size--xs); cursor: pointer; }
.feu-forget:hover { color: #fff; }
.feu-forget[hidden] { display: none; }
.feu-theme-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgb(255 255 255 / .06); }
.feu-theme-switch button { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 999px; background: none; color: #cdbca7; cursor: pointer; transition: background-color .2s ease, color .2s ease; }
.feu-theme-switch button svg { width: 16px; height: 16px; }
.feu-theme-switch button:hover { color: #fff; }
.feu-theme-switch button[aria-pressed="true"] { background: #e6c77a; color: #2a1213; }
@media (max-width: 760px) {
	.feu-footer__grid { grid-template-columns: 1fr; padding-block: 2.5rem 2rem; }
}
