/* Xandine Social Wall — affichage public.
   Les couleurs, colonnes, espacements et formats arrivent en variables CSS depuis les réglages. */

.xsw {
	--xsw-cols: 4;
	--xsw-cols-t: 3;
	--xsw-cols-m: 2;
	--xsw-gap: 12px;
	--xsw-radius: 10px;
	--xsw-ratio: 1 / 1;
	--xsw-accent: #e2b76a;
	--xsw-bg: var(--xsw-c-bg, #0c1124);
	--xsw-surface: var(--xsw-c-surface, #131a32);
	--xsw-text: var(--xsw-c-text, #f3e9da);
	--xsw-dim: color-mix(in srgb, var(--xsw-text) 62%, transparent);
	--xsw-line: color-mix(in srgb, var(--xsw-text) 14%, transparent);
	--xsw-on-accent: #14110a;
	--xsw-icon-cut: var(--xsw-surface);
	box-sizing: border-box;
	background: var(--xsw-bg);
	color: var(--xsw-text);
	border-radius: calc(var(--xsw-radius) + 4px);
	padding: clamp(14px, 3vw, 28px);
	font-family: inherit;
	line-height: 1.45;
	container-type: inline-size;
}
.xsw *, .xsw *::before, .xsw *::after { box-sizing: border-box; }

/* Thème clair : on garde l'accent, on éclaircit le reste. */
.xsw--theme-light {
	--xsw-bg: #f4f2ee;
	--xsw-surface: #ffffff;
	--xsw-text: #16182a;
	--xsw-on-accent: #ffffff;
}
@media (prefers-color-scheme: light) {
	.xsw--theme-auto {
		--xsw-bg: #f4f2ee;
		--xsw-surface: #ffffff;
		--xsw-text: #16182a;
		--xsw-on-accent: #ffffff;
	}
}

.xsw .screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.xsw-ico { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; flex: none; }

.xsw__title { margin: 0 0 16px; font-size: clamp(1.4rem, 3.4vw, 2rem); line-height: 1.15; color: var(--xsw-text); }

/* En-tête des comptes */
.xsw__header { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }

.xsw__profile {
	position: relative; display: flex; align-items: center; gap: 10px; min-width: 0;
	flex: 1 1 220px; max-width: 100%;
	background: var(--xsw-surface); border: 1px solid var(--xsw-line); border-radius: var(--xsw-radius);
	padding: 10px 12px;
}
.xsw__avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; }
.xsw__badge {
	position: absolute; left: 42px; top: 36px; width: 20px; height: 20px; border-radius: 50%;
	display: grid; place-items: center; font-size: 12px;
	background: var(--xsw-surface); color: var(--xsw-text); border: 1px solid var(--xsw-line);
}
.xsw__who { display: grid; min-width: 0; flex: 1; }
.xsw__who strong { font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xsw__who span { font-size: .82rem; color: var(--xsw-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xsw__follow {
	flex: none; text-decoration: none; font-size: .85rem; font-weight: 600;
	padding: 7px 14px; border-radius: 999px; background: var(--xsw-accent); color: var(--xsw-on-accent);
	transition: filter .15s;
}
.xsw__follow:hover, .xsw__follow:focus-visible { filter: brightness(1.08); color: var(--xsw-on-accent); }

/* Filtres */
.xsw__filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.xsw__chip {
	display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
	font: inherit; font-size: .88rem; line-height: 1; padding: 8px 14px; border-radius: 999px;
	background: transparent; color: var(--xsw-text); border: 1px solid var(--xsw-line);
}
.xsw__chip:hover { border-color: var(--xsw-dim); }
.xsw__chip[aria-pressed="true"] { background: var(--xsw-accent); border-color: var(--xsw-accent); color: var(--xsw-on-accent); font-weight: 600; }

.xsw :focus-visible { outline: 2px solid var(--xsw-accent); outline-offset: 2px; }

/* Liste */
.xsw__viewport { position: relative; }
.xsw__items { list-style: none; margin: 0; padding: 0; }
.xsw__item { margin: 0; padding: 0; min-width: 0; }
.xsw__item[hidden] { display: none !important; }

/* Grille */
.xsw--grid .xsw__items {
	display: grid; gap: var(--xsw-gap);
	grid-template-columns: repeat(var(--xsw-cols), minmax(0, 1fr));
}
@container (max-width: 1024px) { .xsw--grid .xsw__items { grid-template-columns: repeat(var(--xsw-cols-t), minmax(0, 1fr)); } }
@container (max-width: 600px)  { .xsw--grid .xsw__items { grid-template-columns: repeat(var(--xsw-cols-m), minmax(0, 1fr)); } }

/* Mosaïque (formats d'origine, colonnes) */
.xsw--masonry .xsw__items { column-count: var(--xsw-cols); column-gap: var(--xsw-gap); }
.xsw--masonry .xsw__item { break-inside: avoid; margin-bottom: var(--xsw-gap); }
@container (max-width: 1024px) { .xsw--masonry .xsw__items { column-count: var(--xsw-cols-t); } }
@container (max-width: 600px)  { .xsw--masonry .xsw__items { column-count: var(--xsw-cols-m); } }

/* Carrousel */
.xsw--carousel .xsw__items {
	display: grid; grid-auto-flow: column; gap: var(--xsw-gap);
	grid-auto-columns: calc((100% - (var(--xsw-cols) - 1) * var(--xsw-gap)) / var(--xsw-cols));
	overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
	overscroll-behavior-x: contain; scrollbar-width: none; padding-bottom: 2px;
}
.xsw--carousel .xsw__items::-webkit-scrollbar { display: none; }
.xsw--carousel .xsw__item { scroll-snap-align: start; }
@container (max-width: 1024px) { .xsw--carousel .xsw__items { grid-auto-columns: calc((100% - (var(--xsw-cols-t) - 1) * var(--xsw-gap)) / var(--xsw-cols-t)); } }
@container (max-width: 600px)  { .xsw--carousel .xsw__items { grid-auto-columns: calc((100% - (var(--xsw-cols-m) - 1) * var(--xsw-gap)) / var(--xsw-cols-m) - 18px); } }
.xsw__nav {
	position: absolute; top: 50%; z-index: 2; transform: translateY(-50%);
	width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
	background: var(--xsw-surface); color: var(--xsw-text); border: 1px solid var(--xsw-line);
	box-shadow: 0 6px 18px rgba(0, 0, 0, .28); font-size: 18px;
}
.xsw__nav--prev { left: -10px; }
.xsw__nav--next { right: -10px; }
.xsw__nav[disabled] { opacity: 0; pointer-events: none; }
@media (hover: none) { .xsw__nav { display: none; } }

/* Liste (vignette + texte) */
.xsw--list .xsw__items { display: grid; gap: var(--xsw-gap); }
.xsw--list .xsw__item {
	display: grid; grid-template-columns: minmax(110px, 28%) minmax(0, 1fr); gap: 16px; align-items: start;
	background: var(--xsw-surface); border: 1px solid var(--xsw-line); border-radius: var(--xsw-radius); padding: 10px;
}
@container (max-width: 480px) { .xsw--list .xsw__item { grid-template-columns: 1fr; } }

/* Carte */
.xsw__card {
	position: relative; display: block; text-decoration: none; color: inherit;
	border-radius: var(--xsw-radius); overflow: hidden; background: var(--xsw-surface);
	isolation: isolate;
}
.xsw__media { position: relative; display: block; aspect-ratio: var(--xsw-ratio); overflow: hidden; }
.xsw--free-ratio .xsw__media { aspect-ratio: auto; }
.xsw__media img {
	display: block; width: 100%; height: 100%; object-fit: cover;
	transition: transform .5s cubic-bezier(.2, .7, .2, 1), opacity .3s;
}
.xsw--free-ratio .xsw__media img { height: auto; }
.xsw--hover-zoom .xsw__card:hover .xsw__media img,
.xsw--hover-zoom .xsw__card:focus-visible .xsw__media img { transform: scale(1.05); }
.xsw--hover-fade .xsw__card:hover .xsw__media img { opacity: .78; }

.xsw__text {
	display: flex; align-items: center; aspect-ratio: var(--xsw-ratio); padding: 18px;
	background: linear-gradient(150deg, color-mix(in srgb, var(--xsw-accent) 22%, var(--xsw-surface)), var(--xsw-surface));
	font-size: .98rem; line-height: 1.5;
}
.xsw--free-ratio .xsw__text { aspect-ratio: auto; min-height: 160px; }
.xsw__text span { display: -webkit-box; -webkit-line-clamp: 9; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }

.xsw__play, .xsw__album { position: absolute; z-index: 1; pointer-events: none; }
.xsw__play { inset: 0; display: grid; place-items: center; font-size: clamp(34px, 18%, 56px); }
.xsw__album { top: 10px; right: 10px; color: #fff; font-size: 18px; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .6)); }
.xsw__net {
	position: absolute; z-index: 2; left: 8px; top: 8px; width: 26px; height: 26px; border-radius: 50%;
	display: grid; place-items: center; font-size: 14px; color: #fff; --xsw-icon-cut: rgba(0,0,0,.55);
	background: rgba(0, 0, 0, .45); backdrop-filter: blur(4px);
}

.xsw__overlay {
	position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px;
	padding: 14px; color: #fff; opacity: 0; transition: opacity .25s;
	background: linear-gradient(to top, rgba(0, 0, 0, .82), rgba(0, 0, 0, .25) 60%, transparent);
}
.xsw__card:hover .xsw__overlay, .xsw__card:focus-visible .xsw__overlay { opacity: 1; }
@media (hover: none) { .xsw__overlay { display: none; } }
.xsw__overlay-text { font-size: .86rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }

.xsw__counts { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .8rem; font-variant-numeric: tabular-nums; }
.xsw__count { display: inline-flex; align-items: center; gap: 4px; }

.xsw__below { display: grid; gap: 4px; padding: 8px 2px 2px; font-size: .88rem; }
.xsw--list .xsw__below { padding: 2px 0; }
.xsw__date { color: var(--xsw-dim); font-size: .78rem; text-transform: none; }
.xsw__caption { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.xsw__below .xsw__counts { color: var(--xsw-dim); }

.xsw__empty { color: var(--xsw-dim); margin: 0; }

/* Voir plus */
.xsw__more-wrap { display: grid; justify-items: center; gap: 6px; margin-top: 18px; }
.xsw__more {
	font: inherit; font-weight: 600; cursor: pointer; padding: 11px 26px; border-radius: 999px;
	background: transparent; color: var(--xsw-text); border: 1px solid var(--xsw-accent);
}
.xsw__more:hover { background: var(--xsw-accent); color: var(--xsw-on-accent); }
.xsw__more[aria-busy="true"] { opacity: .6; cursor: progress; }
.xsw__status { margin: 0; font-size: .82rem; color: var(--xsw-dim); min-height: 1em; }

/* Visionneuse */
.xsw-lb {
	--xsw-text: #f3e9da; --xsw-dim: rgba(243, 233, 218, .65); --xsw-line: rgba(243, 233, 218, .16);
	position: fixed; inset: 0; z-index: 999999; margin: 0; padding: 0; border: 0; max-width: none; max-height: none;
	width: 100%; height: 100%; background: rgba(5, 7, 16, .9); color: var(--xsw-text);
	display: none; place-items: center; font-family: inherit;
}
.xsw-lb[open] { display: grid; }
.xsw-lb::backdrop { background: transparent; }
.xsw-lb__box {
	position: relative; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr);
	width: min(1080px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
	background: #10162b; border-radius: 14px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.xsw-lb__stage { position: relative; background: #000; display: grid; place-items: center; min-height: 320px; max-height: calc(100dvh - 48px); }
.xsw-lb__stage img { display: block; max-width: 100%; max-height: calc(100dvh - 48px); object-fit: contain; }
.xsw-lb__stage iframe { display: block; width: 100%; height: min(78dvh, 720px); border: 0; background: #000; }
.xsw-lb__side { display: grid; grid-template-rows: auto 1fr auto; min-width: 0; max-height: calc(100dvh - 48px); }
.xsw-lb__head { display: flex; align-items: center; gap: 10px; padding: 16px 52px 12px 18px; border-bottom: 1px solid var(--xsw-line); }
.xsw-lb__head img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.xsw-lb__head strong { display: block; font-size: .95rem; }
.xsw-lb__head span { font-size: .8rem; color: var(--xsw-dim); }
.xsw-lb__caption { margin: 0; padding: 14px 18px; overflow: auto; white-space: pre-line; overflow-wrap: anywhere; font-size: .92rem; line-height: 1.55; }
.xsw-lb__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px 16px; border-top: 1px solid var(--xsw-line); font-size: .85rem; color: var(--xsw-dim); }
.xsw-lb__open {
	display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 600;
	padding: 8px 14px; border-radius: 999px; background: var(--xsw-lb-accent, #e2b76a); color: #14110a;
}
.xsw-lb__btn {
	position: absolute; z-index: 3; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
	background: rgba(16, 22, 43, .85); color: #fff; border: 1px solid rgba(255, 255, 255, .18); cursor: pointer; font-size: 18px;
}
.xsw-lb__close { top: 10px; right: 10px; }
.xsw-lb__prev { left: 14px; top: 50%; transform: translateY(-50%); }
.xsw-lb__next { right: 14px; top: 50%; transform: translateY(-50%); }
.xsw-lb__btn:focus-visible, .xsw-lb__open:focus-visible, .xsw-lb__consent button:focus-visible { outline: 2px solid var(--xsw-lb-accent, #e2b76a); outline-offset: 2px; }
.xsw-lb__consent {
	position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px;
	padding: 24px; text-align: center; background: linear-gradient(to top, rgba(0, 0, 0, .85), rgba(0, 0, 0, .45));
}
.xsw-lb__consent p { margin: 0; max-width: 34ch; font-size: .86rem; color: #f3e9da; }
.xsw-lb__consent button {
	display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 600; cursor: pointer;
	padding: 11px 20px; border-radius: 999px; border: 0; background: var(--xsw-lb-accent, #e2b76a); color: #14110a;
}
@media (max-width: 760px) {
	.xsw-lb__box { grid-template-columns: 1fr; overflow: auto; }
	.xsw-lb__stage, .xsw-lb__stage img { max-height: 62dvh; }
	.xsw-lb__stage iframe { height: 62dvh; }
	.xsw-lb__side { max-height: none; }
	.xsw-lb__prev, .xsw-lb__next { top: auto; bottom: 12px; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.xsw *, .xsw-lb * { transition: none !important; scroll-behavior: auto !important; }
}

@container (max-width: 600px) {
	/* Sur téléphone : les comptes défilent sur une ligne au lieu de s'empiler. */
	.xsw__header { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: -4px; padding: 0 4px 2px; }
	.xsw__header::-webkit-scrollbar { display: none; }
	.xsw__profile { flex: 0 0 82%; scroll-snap-align: start; }
	.xsw__filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
	.xsw__filters::-webkit-scrollbar { display: none; }
	.xsw__chip { flex: none; }
}
