/* ==========================================================================
   MARCDGRAPH Media — front-end
   Couleurs et polices injectées via variables CSS (css_vars()).
   ========================================================================== */

.mdm-root {
	font-family: var(--mdm-b-font), system-ui, -apple-system, "Segoe UI", sans-serif;
	color: var(--mdm-text);
	line-height: 1.5;
}
.mdm-root *, .mdm-root *::before, .mdm-root *::after { box-sizing: border-box; }
.mdm-wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---------- Hero ---------- */
.mdm-hero {
	position: relative;
	background-color: var(--mdm-dark);
	background-size: cover;
	background-position: center;
	text-align: center;
	color: #fff;
	padding: 84px 20px;
}
.mdm-hero__overlay {
	position: absolute; inset: 0;
	background: linear-gradient(rgba(12,28,46,.74), rgba(12,28,46,.86));
}
.mdm-hero__inner { position: relative; max-width: 760px; margin: 0 auto; }
.mdm-hero__title {
	font-family: var(--mdm-h-font), sans-serif;
	font-size: clamp(2.6rem, 7vw, 4.4rem);
	letter-spacing: .08em;
	font-weight: 700;
	margin: 0;
}
.mdm-hero__mark {
	position: relative;
	display: inline-flex;
	width: 34px; height: 34px;
	color: var(--mdm-accent);
	margin: 18px 0 16px;
}
.mdm-hero__mark svg { width: 100%; height: 100%; }
.mdm-hero__mark::before, .mdm-hero__mark::after {
	content: ""; position: absolute; top: 50%;
	width: 64px; height: 1px; background: var(--mdm-accent); opacity: .55;
}
.mdm-hero__mark::before { right: 100%; margin-right: 14px; }
.mdm-hero__mark::after { left: 100%; margin-left: 14px; }
.mdm-hero__tagline { color: var(--mdm-accent); font-size: 1.35rem; font-weight: 600; margin: 0 0 14px; }
.mdm-hero__subtitle { color: rgba(255,255,255,.85); line-height: 1.6; margin: 0; }

/* ---------- Sections ---------- */
.mdm-section { background: var(--mdm-bg); padding: 64px 0; }
.mdm-section + .mdm-section { padding-top: 8px; }
.mdm-section__head {
	display: flex; align-items: center; justify-content: space-between;
	gap: 18px; flex-wrap: wrap; margin-bottom: 32px;
}
.mdm-section__title {
	font-family: var(--mdm-h-font), sans-serif;
	font-size: 1.7rem; font-weight: 700; letter-spacing: .03em;
	color: var(--mdm-text); margin: 0;
	position: relative; padding-bottom: 12px;
}
.mdm-section__title::after {
	content: ""; position: absolute; left: 0; bottom: 0;
	width: 54px; height: 3px; background: var(--mdm-accent);
}

/* ---------- Boutons ---------- */
.mdm-root a { text-decoration: none; }
.mdm-btn,
.mdm-btn:hover,
.mdm-btn:focus,
.mdm-filter,
.mdm-cta__social a {
	text-decoration: none !important;
	box-shadow: none;
}
.mdm-btn {
	display: inline-flex; align-items: center; gap: 8px;
	font-family: inherit; font-weight: 600; font-size: .92rem;
	padding: 11px 22px; border-radius: 8px; cursor: pointer;
	text-decoration: none; border: none; line-height: 1;
	transition: transform .15s, background .2s, color .2s, border-color .2s, filter .2s;
}
.mdm-btn .mdm-ico { width: 17px; height: 17px; display: inline-flex; }
.mdm-btn .mdm-ico svg { width: 100%; height: 100%; }
.mdm-btn--solid { background: var(--mdm-accent); color: #fff; }
.mdm-btn--solid:hover { filter: brightness(.94); transform: translateY(-1px); }
.mdm-btn--ghost { background: #fff; color: var(--mdm-text); border: 1px solid rgba(0,0,0,.12); }
.mdm-btn--ghost .mdm-ico { color: var(--mdm-accent); }
.mdm-btn--ghost:hover { border-color: var(--mdm-accent); }

/* ---------- Vidéos ---------- */
.mdm-videos__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.mdm-video { cursor: pointer; }
.mdm-video__thumb {
	position: relative; border-radius: 10px; overflow: hidden;
	aspect-ratio: 16 / 9; background: #000;
}
.mdm-video__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.mdm-video__noimg { width: 100%; height: 100%; background: linear-gradient(135deg, #1b2c44, #0e1d30); }
.mdm-video:hover .mdm-video__thumb img { transform: scale(1.05); }
.mdm-video__thumb::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.28));
}
.mdm-video__badge {
	position: absolute; top: 10px; left: 10px; z-index: 2;
	background: var(--mdm-accent); color: var(--mdm-badge-text);
	font-size: 11px; font-weight: 700; letter-spacing: .06em;
	padding: 5px 11px; border-radius: 6px;
}
.mdm-video__play {
	position: absolute; inset: 0; margin: auto; z-index: 2;
	width: 54px; height: 54px; display: flex; align-items: center; justify-content: center;
	color: #fff; transition: transform .2s;
}
.mdm-video__play svg { width: 54px; height: 54px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.45)); }
.mdm-video:hover .mdm-video__play { transform: scale(1.08); }
.mdm-video__dur {
	position: absolute; bottom: 8px; right: 8px; z-index: 2;
	background: rgba(0,0,0,.78); color: #fff; font-size: 12px;
	padding: 3px 8px; border-radius: 4px;
}
.mdm-video__title {
	font-family: var(--mdm-h-font), sans-serif;
	font-size: 1rem; font-weight: 700; color: var(--mdm-text);
	margin: 12px 0 6px;
}
.mdm-video__date { display: flex; align-items: center; gap: 6px; color: var(--mdm-accent); font-size: .85rem; margin: 0; }
.mdm-video__date .mdm-ico { width: 15px; height: 15px; display: inline-flex; color: var(--mdm-accent); }
.mdm-video__date .mdm-ico svg { width: 100%; height: 100%; }

/* ---------- Slider vidéos (page Média) ---------- */
.mdm-videos__carousel { position: relative; margin: 0 56px; }
.mdm-videos__viewport { overflow: hidden; }
.mdm-videos__track {
	display: flex; gap: 22px;
	transition: transform .45s cubic-bezier(.4,0,.2,1);
	will-change: transform;
}
.mdm-videos__track .mdm-video { flex: 0 0 auto; }

.mdm-videos .mdm-nav {
	position: absolute; top: 50%; transform: translateY(-50%);
	width: 46px !important; height: 46px !important;
	min-width: 46px !important; max-width: 46px !important;
	padding: 0 !important; margin: 0 !important; border: none !important;
	border-radius: 50% !important; background: #fff !important;
	color: var(--mdm-dark) !important;
	display: flex !important; align-items: center; justify-content: center;
	line-height: 1 !important; cursor: pointer;
	box-shadow: 0 6px 20px rgba(0,0,0,.16); z-index: 6;
	appearance: none; -webkit-appearance: none; font-size: 0;
	transition: box-shadow .15s, opacity .2s;
}
.mdm-videos .mdm-nav svg { width: 22px !important; height: 22px !important; display: block; }
.mdm-videos .mdm-nav:hover { box-shadow: 0 8px 26px rgba(0,0,0,.24); }
.mdm-videos .mdm-nav--prev { left: -56px; }
.mdm-videos .mdm-nav--next { right: -56px; }
.mdm-videos .mdm-nav[disabled] { opacity: .35; cursor: default; }

.mdm-videos__dots { display: flex; justify-content: center; gap: 9px; margin-top: 26px; }
.mdm-vdot {
	width: 9px; height: 9px; border-radius: 50%; border: 0;
	background: rgba(0,0,0,.18); cursor: pointer; padding: 0;
	transition: background .2s, transform .2s;
}
.mdm-vdot.is-active { background: var(--mdm-accent); transform: scale(1.15); }

/* ---------- Galerie ---------- */
.mdm-gallery__filters { display: flex; flex-wrap: wrap; gap: 6px; }
.mdm-filter {
	font-family: inherit; font-weight: 600; font-size: .9rem;
	padding: 7px 18px; border-radius: 999px; border: none;
	background: transparent; color: var(--mdm-muted); cursor: pointer;
	transition: background .2s, color .2s;
}
.mdm-filter:hover { color: var(--mdm-text); }
.mdm-filter.is-active { background: var(--mdm-accent); color: #fff; }

.mdm-gallery__grid { column-count: 4; column-gap: 12px; margin-top: 6px; transition: opacity .2s; }
.mdm-gallery__grid.is-loading { opacity: .45; }
.mdm-photo { break-inside: avoid; margin: 0 0 12px !important; padding: 0; }
.mdm-photo__btn {
	display: block; width: 100%; padding: 0; border: none; background: none;
	cursor: pointer; border-radius: 10px; overflow: hidden; line-height: 0;
}
.mdm-photo__btn img {
	width: 100%; height: auto; display: block; border-radius: 10px;
	transition: transform .4s, filter .3s;
}
.mdm-photo__btn:hover img { transform: scale(1.03); filter: brightness(.9); }

/* --- Élément vidéo dans la galerie --- */
.mdm-photo--video .mdm-photo__btn { position: relative; }
.mdm-photo__play {
	position: absolute; inset: 0; margin: auto;
	width: 54px; height: 54px; color: #fff;
	display: flex; align-items: center; justify-content: center;
	pointer-events: none; transition: transform .2s;
}
.mdm-photo__play svg { width: 54px; height: 54px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
.mdm-photo--video .mdm-photo__btn::after {
	content: ""; position: absolute; inset: 0; border-radius: 10px;
	background: rgba(0,0,0,.18); pointer-events: none;
}
.mdm-photo--video .mdm-photo__btn:hover .mdm-photo__play { transform: scale(1.08); }
.mdm-photo__vph {
	display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 10px;
	background: linear-gradient(135deg, #1b2c44, #0e1d30);
}
/* La vidéo elle-même sert d'aperçu (première image) */
.mdm-photo__vid {
	display: block; width: 100%; height: auto;
	border-radius: 10px; background: #0e1d30;
	aspect-ratio: 16 / 9; /* valeur d'attente, remplacée par le ratio réel */
	object-fit: cover;
	transition: transform .4s, filter .3s;
	pointer-events: none;
}
.mdm-photo__btn:hover .mdm-photo__vid { transform: scale(1.03); filter: brightness(.9); }

.mdm-gallery__pagination { margin-top: 18px; }
.mdm-gallery__pages { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.mdm-page {
	min-width: 38px; height: 38px; padding: 0 10px;
	border-radius: 8px; border: 1px solid rgba(0,0,0,.12);
	background: #fff; color: var(--mdm-text); font-family: inherit; font-weight: 600;
	cursor: pointer; transition: background .2s, color .2s, border-color .2s;
}
.mdm-page:hover { border-color: var(--mdm-accent); }
.mdm-page.is-active { background: var(--mdm-accent); border-color: var(--mdm-accent); color: #fff; }

.mdm-empty, .mdm-gallery__empty { text-align: center; color: var(--mdm-muted); padding: 30px 0; }

/* ---------- CTA « Stay Connected » ---------- */
.mdm-cta { background: var(--mdm-dark); color: #fff; padding: 50px 0; }
.mdm-cta__inner { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.mdm-cta__mark {
	width: 64px; height: 64px; border-radius: 50%;
	border: 2px solid var(--mdm-accent); color: var(--mdm-accent);
	display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.mdm-cta__mark svg { width: 30px; height: 30px; }
.mdm-cta__kicker { color: var(--mdm-accent); font-size: 12px; font-weight: 700; letter-spacing: .15em; }
.mdm-cta__title { font-family: var(--mdm-h-font), sans-serif; font-size: 1.7rem; font-weight: 700; margin: 6px 0 8px; }
.mdm-cta__text { color: rgba(255,255,255,.78); max-width: 560px; line-height: 1.6; margin: 0 0 16px; }
.mdm-cta__actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mdm-cta__actions .mdm-btn--solid { background: #CD201F; }
.mdm-cta__actions .mdm-btn--solid:hover { background: #b81d1c; }
.mdm-cta__social { display: flex; gap: 10px; }
.mdm-cta__social a {
	width: 40px; height: 40px; border-radius: 50%;
	background: rgba(255,255,255,.08); color: #fff;
	display: flex; align-items: center; justify-content: center;
	text-decoration: none; font-size: 16px; transition: background .2s;
}
.mdm-cta__social a:hover { background: var(--mdm-accent); }

/* ---------- Lightbox ---------- */
.mdm-lb {
	position: fixed; inset: 0; z-index: 99999;
	background: rgba(0,0,0,.9);
	display: flex; align-items: center; justify-content: center; padding: 24px;
}
.mdm-lb[hidden] { display: none; }
.mdm-lb__close {
	position: absolute; top: 20px; right: 24px;
	width: 46px; height: 46px; border-radius: 50%;
	border: none; background: rgba(255,255,255,.14); color: #fff;
	font-size: 30px; line-height: 1; cursor: pointer; transition: background .2s;
}
.mdm-lb__close:hover { background: rgba(255,255,255,.26); }
.mdm-lb__video { width: min(92vw, 960px); }
.mdm-lb__frame { position: relative; padding-top: 56.25%; }
.mdm-lb__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 10px; border: 0; }
.mdm-lb__stage { display: flex; align-items: center; justify-content: center; width: 100%; }
.mdm-lb__img { max-width: 92vw; max-height: 86vh; border-radius: 10px; display: block; }
.mdm-lb__player { max-width: 92vw; max-height: 86vh; border-radius: 10px; display: block; background: #000; }
.mdm-lb__stage .mdm-lb__frame { width: min(92vw, 960px); position: relative; padding-top: 0; }
.mdm-lb__stage .mdm-lb__frame::before { content: ""; display: block; padding-top: 56.25%; }
.mdm-lb__stage .mdm-lb__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 10px; }
.mdm-lb__nav {
	position: absolute; top: 50%; transform: translateY(-50%);
	width: 50px; height: 50px; border-radius: 50%;
	border: none; background: rgba(255,255,255,.14); color: #fff;
	display: flex; align-items: center; justify-content: center;
	cursor: pointer; z-index: 2; transition: background .2s;
}
.mdm-lb__nav svg { width: 26px; height: 26px; }
.mdm-lb__nav:hover { background: rgba(255,255,255,.28); }
.mdm-lb__nav--prev { left: 22px; }
.mdm-lb__nav--next { right: 22px; }
@media (max-width: 600px) {
	.mdm-lb__nav { width: 42px; height: 42px; }
	.mdm-lb__nav--prev { left: 8px; }
	.mdm-lb__nav--next { right: 8px; }
}

/* ---------- Accessibilité ---------- */
.mdm-video:focus-visible, .mdm-filter:focus-visible, .mdm-page:focus-visible,
.mdm-photo__btn:focus-visible, .mdm-btn:focus-visible, .mdm-lb__close:focus-visible {
	outline: 3px solid var(--mdm-accent); outline-offset: 2px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.mdm-videos__grid { grid-template-columns: repeat(3, 1fr); }
	.mdm-gallery__grid { column-count: 3; }
	.mdm-videos__carousel { margin: 0 48px; }
	.mdm-videos .mdm-nav--prev { left: -48px; }
	.mdm-videos .mdm-nav--next { right: -48px; }
}
@media (max-width: 768px) {
	.mdm-section { padding: 48px 0; }
	.mdm-videos__grid { grid-template-columns: repeat(2, 1fr); }
	.mdm-gallery__grid { column-count: 2; }
	.mdm-section__head { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 600px) {
	.mdm-videos__carousel { margin: 0 6px; }
	.mdm-videos .mdm-nav { width: 40px !important; height: 40px !important; min-width: 40px !important; max-width: 40px !important; background: rgba(255,255,255,.92) !important; }
	.mdm-videos .mdm-nav--prev { left: 2px; }
	.mdm-videos .mdm-nav--next { right: 2px; }
}
@media (max-width: 480px) {
	.mdm-cta__inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
	.mdm-video__thumb img, .mdm-photo__btn img, .mdm-btn, .mdm-video__play, .mdm-videos__track { transition: none; }
}
