/* Structural layout: container, header, footer, section rhythm */

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

.section { padding-block: var(--section-padding-y); }
.section--surface { background: var(--surface); }
.section--dark { background: linear-gradient(160deg, var(--dark-blue) 0%, var(--dark-blue-alt) 100%); color: #fff; }
.section--dark h2, .section--dark h3 { color: #fff; }
.section--dark p { color: rgba(255,255,255,0.72); }

.section-header {
	max-width: 720px;
	margin: 0 auto 56px;
	text-align: center;
}
.section-header .eyebrow { justify-content: center; }

.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--primary-blue);
	background: var(--light-blue);
	padding: 6px 14px;
	border-radius: var(--radius-pill);
	margin-bottom: 16px;
}
.section--dark .eyebrow { background: rgba(255,255,255,0.1); color: #93c5fd; }

/* Header */
.site-header {
	position: sticky;
	top: 0;
	z-index: 500;
	background: rgba(9,9,9,0.92);
	backdrop-filter: saturate(180%) blur(12px);
	border-bottom: 1px solid var(--border);
	height: var(--header-height);
}
.site-header .container {
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	/* The full 7-item nav + both header buttons genuinely needs a little
	   more room than the content grid's 1240px — a header-only widening,
	   not a change to --container-width (which still aligns every
	   section below it). Fixes a pre-existing wrap bug (confirmed on
	   production too) where "Comment ça marche" broke onto 3 lines. */
	max-width: 1320px;
}
.site-branding { display: flex; align-items: center; }
.site-branding a { display: flex; align-items: center; gap: 10px; color: var(--text); }
/* height (not max-height) is required here: our logo SVGs have no width/height
   attributes on the root <svg> (by design, for crisp responsive scaling), and as
   a flex item, "max-height + width:auto" with no other definite axis collapses
   the image to 0×0 in some browsers. An explicit height keeps one axis definite
   so the browser can derive width from the SVG's aspect ratio reliably. */
.site-branding img { height: 32px; width: auto; max-width: none; }
.site-branding .site-title { font-family: var(--font-heading); font-weight: 800; font-size: 1.25rem; color: var(--text); }

.primary-nav ul { list-style: none; display: flex; align-items: center; gap: 22px; margin: 0; padding: 0; }
.primary-nav a { color: var(--text); font-weight: 600; font-size: 0.95rem; white-space: nowrap; }
.primary-nav a:hover { color: var(--primary-blue); }

.header-actions { display: flex; align-items: center; gap: 12px; }

.lang-switcher-select {
	background: transparent;
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: var(--radius-pill);
	padding: 7px 12px;
	font-size: 0.82rem;
	font-weight: 600;
	cursor: pointer;
}
.lang-switcher-select:hover { border-color: var(--primary-blue); }
body.home .site-header:not(.is-scrolled) .lang-switcher-select { color: #fff; border-color: rgba(255,255,255,0.35); }
@media (max-width: 880px) { .lang-switcher { order: 3; } }

/* Homepage only: header floats transparently over the hero (so the photo
   runs edge-to-edge from y=0) instead of sitting in a separate solid bar
   above it — the hero itself gains matching top padding below so its own
   content never sits under the overlaid logo/nav row (see .hero in
   components.css). Solidifies on scroll via .is-scrolled, toggled by
   assets/js/main.js's initTransparentHeader() (home only, no-op
   everywhere else) — same visual language as the sticky header it
   replaces once scrolled, so nothing about non-home pages changes. */
body.home .site-header {
	position: absolute;
	top: 0; left: 0; right: 0;
	background: transparent;
	backdrop-filter: none;
	border-bottom: none;
	transition: background var(--transition-base), backdrop-filter var(--transition-base), border-color var(--transition-base);
}
body.home .site-header::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(5,10,28,0.55) 0%, rgba(5,10,28,0) 100%);
	z-index: -1;
	opacity: 1;
	transition: opacity var(--transition-base);
}
body.home .site-header:not(.is-scrolled) .site-branding .site-title,
/* :not(.is-open) — the mobile dropdown panel (.primary-nav.is-open, see
   responsive.css) always has a solid white background regardless of
   scroll state; without this exclusion, opening it at the top of the
   homepage forced these links white-on-white (invisible) — found during
   the devices-section regression pass, pre-existing and unrelated to
   that work, fixed here since it's a real break in "menu mobile". */
body.home .site-header:not(.is-scrolled) .primary-nav:not(.is-open) a,
body.home .site-header:not(.is-scrolled) .nav-toggle { color: #fff; }
body.home .site-header:not(.is-scrolled) .nav-toggle { border-color: rgba(255,255,255,0.35); }
/* Two logos on the homepage: white + blue over the dark hero photo, the
   navy one once the header turns white on scroll. */
.site-branding .default-logo--hero { display: none; }
body.home .site-header:not(.is-scrolled) .site-branding .default-logo--hero { display: block; }
body.home .site-header:not(.is-scrolled) .site-branding .default-logo:not(.default-logo--hero) { display: none; }
body.home .site-header:not(.is-scrolled) .primary-nav a:hover { color: var(--primary-blue-light); }
body.home .site-header:not(.is-scrolled) .header-actions .btn-secondary {
	background: rgba(255,255,255,0.1);
	border-color: rgba(255,255,255,0.28);
	color: #fff;
}
body.home .site-header:not(.is-scrolled) .header-actions .btn-secondary:hover { background: rgba(255,255,255,0.18); color: #fff; }

body.home .site-header.is-scrolled {
	position: fixed;
	background: rgba(9,9,9,0.92);
	backdrop-filter: saturate(180%) blur(12px);
	border-bottom: 1px solid var(--border);
}
body.home .site-header.is-scrolled::before { opacity: 0; }
.nav-toggle {
	display: none;
	background: none;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 8px;
	color: var(--text);
}
.nav-toggle .icon-close { display: none; }
.nav-toggle.is-open .icon-menu { display: none; }
.nav-toggle.is-open .icon-close { display: inline-flex; }

/* Footer */
.site-footer {
	background: linear-gradient(160deg, var(--dark-blue) 0%, var(--dark-blue-alt) 100%);
	color: rgba(255,255,255,0.72);
	padding-top: 72px;
}
/* Explicit fixed track count (brand + 4 link columns — see footer.php),
   not repeat(auto-fit, ...): mixing an auto-fit repetition with a
   flexible (fr) track in the same list is an ambiguous sizing case —
   the repeat count depends on how much space is left after the fr
   track, but the fr track's size depends on the repeat count. Confirmed
   live on production: it was resolving to a single collapsed column
   (computed grid-template-columns of one full-width track) instead of
   5, even though the CSS itself was valid and correctly served — not a
   caching issue, a genuine engine-dependent degenerate case. A fixed
   column count has no such ambiguity. */
.footer-grid {
	display: grid;
	grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr;
	gap: 40px;
	padding-bottom: 48px;
	border-bottom: 1px solid rgba(255,255,255,0.12);
}
.footer-brand .site-title { color: #fff; font-family: var(--font-heading); font-weight: 800; font-size: 1.25rem; }
.footer-brand > a { display: inline-flex; margin-bottom: 22px; }
.footer-brand img { height: 34px; width: auto; max-width: none; } /* see .site-branding img comment above */
.footer-brand p { color: rgba(255,255,255,0.6); max-width: 320px; }
.footer-col h4 { color: #fff; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 18px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.footer-col a { color: rgba(255,255,255,0.72); }
.footer-col a:hover { color: #fff; }
.footer-contact li { display: flex; align-items: flex-start; gap: 10px; color: rgba(255,255,255,0.72); }
.footer-contact .icon { flex-shrink: 0; margin-top: 3px; color: var(--primary-blue-light); }

.social-links { display: flex; gap: 10px; margin-top: 8px; }
.social-links a {
	display: flex; align-items: center; justify-content: center;
	width: 38px; height: 38px;
	border-radius: 50%;
	background: rgba(255,255,255,0.08);
	color: #fff;
}
.social-links a:hover { background: var(--primary-blue); }

.footer-bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	padding: 24px 0;
	font-size: 0.85rem;
	color: rgba(255,255,255,0.5);
}
.footer-bottom ul { list-style: none; display: flex; gap: 20px; padding: 0; margin: 0; }
.footer-bottom a { color: rgba(255,255,255,0.6); }
.footer-bottom a:hover { color: #fff; }

/* Utility grids */
.grid { display: grid; gap: 28px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.page-hero {
	padding: 56px 0 40px;
	background: linear-gradient(160deg, var(--dark-blue) 0%, var(--dark-blue-alt) 100%);
	color: #fff;
	text-align: center;
}
.page-hero h1 { color: #fff; margin-bottom: 8px; }
.page-hero p { color: rgba(255,255,255,0.72); max-width: 640px; margin-inline: auto; }
/* Rank Math's own breadcrumb output (#rank-math-breadcrumb) — restyled to
   fit the hero's dark background instead of its default dark-on-transparent
   look. No custom breadcrumb markup/schema here, so there's nothing to
   conflict with Rank Math's own BreadcrumbList structured data. */
.page-hero #rank-math-breadcrumb { margin-bottom: 14px; font-size: 0.85rem; color: rgba(255,255,255,0.6); }
.page-hero #rank-math-breadcrumb a { color: rgba(255,255,255,0.85); }
.page-hero #rank-math-breadcrumb a:hover { color: #fff; }
.page-hero--contact {
	padding: 96px 0 88px;
	text-align: left;
	background:
		linear-gradient(90deg, rgba(7,13,34,0.96) 0%, rgba(7,13,34,0.75) 40%, rgba(7,13,34,0) 65%),
		url("../images/matv-contact-banner.webp") right center / cover no-repeat,
		var(--dark-blue);
}
.page-hero--contact p { margin-inline: 0; }
@media (max-width: 760px) {
	.page-hero--contact { padding: 64px 0 56px; background-position: 0 0, 78% center, 0 0; }
}

.entry-content { max-width: 820px; margin: 0 auto; }
/* Long-form legal/document pages (CGU, Politique de confidentialité…) don't
   want section-hero-sized headings stacked a dozen times down the page —
   override the global clamp() with a document-appropriate scale. */
.entry-content h2 { font-size: 1.375rem; margin: 40px 0 12px; }
.entry-content h3 { font-size: 1.1rem; margin: 24px 0 8px; }
.entry-content p, .entry-content li { line-height: 1.7; }
.entry-content ul, .entry-content ol { color: var(--text); }
.entry-content hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }
.entry-content em { color: var(--muted-text); }
