/* PTL Social Feed — grille, maçonnerie, carrousels, mur, spotlight + métadonnées.
   Personnalisable : --ptl-gap, --ptl-radius, --ptl-accent. */
.ptl-social { --gap: var(--ptl-gap, 12px); --radius: var(--ptl-radius, 12px); --accent: var(--ptl-accent, #e1306c); }
.ptl-social, .ptl-social * { box-sizing: border-box; }

/* ---------- En-tête profil ---------- */
.ptl-social__hd { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; }
.ptl-social__avatar { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: linear-gradient(45deg, #f09433, #dc2743 55%, #bc1888); padding: 2px; }
.ptl-social__avatar img, .ptl-social__avatar-ph { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #fff; display: grid; place-items: center; }
.ptl-social__avatar-ph svg { width: 26px; height: 26px; color: #bc1888; }
.ptl-social__id { display: flex; flex-direction: column; min-width: 0; }
.ptl-social__idrow { display: inline-flex; align-items: center; gap: 10px; }
.ptl-social__user { font-weight: 700; text-decoration: none; color: inherit; font-size: 1.05rem; }
.ptl-social__user:hover { text-decoration: underline; }
.ptl-social__nets { display: inline-flex; gap: 7px; }
.ptl-social__net-dot svg { width: 15px; height: 15px; display: block; }
.ptl-social__stats { font-size: .82rem; color: #777; margin-top: 3px; }
.ptl-social__stats strong { font-weight: 700; color: #333; }
.ptl-social__stats i { font-style: normal; margin: 0 6px; color: #bbb; }
.ptl-social__follow { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; font-size: .9rem; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.ptl-social__follow:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0, 0, 0, .2); color: #fff; }
.ptl-social__follow svg { width: 17px; height: 17px; }

/* ---------- Vignette commune ---------- */
.ptl-social__item { position: relative; display: block; overflow: hidden; border-radius: var(--radius); background: #eee; text-decoration: none; color: inherit; }
.ptl-social__media { position: relative; display: block; overflow: hidden; }
.ptl-social__item img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.ptl-social__item:hover img { transform: scale(1.06); }
.ptl-social__overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; text-align: center; color: #fff; background: linear-gradient(180deg, rgba(17, 17, 17, .38), rgba(17, 17, 17, .68)); opacity: 0; transition: opacity .3s ease; }
.ptl-social__item:hover .ptl-social__overlay, .ptl-social__item:focus-visible .ptl-social__overlay { opacity: 1; }
.ptl-social__overlay svg { width: 26px; height: 26px; }
.ptl-social__cap { font-size: .8rem; line-height: 1.45; max-height: 5.8em; overflow: hidden; }
/* Métadonnées à l'intérieur de l'overlay (mur/grille/carrousel) */
.ptl-social__overlay .ptl-social__meta { padding: 0; color: #fff; font-size: .85rem; font-weight: 600; justify-content: center; }
.ptl-social__overlay .ptl-social__meta svg { width: 15px; height: 15px; opacity: 1; }
.ptl-social__overlay .ptl-social__date { margin-left: 0; color: rgba(255, 255, 255, .72); font-weight: 400; }
/* Badge réseau */
.ptl-social__badge { position: absolute; top: 10px; right: 10px; z-index: 2; width: 28px; height: 28px; border-radius: 50%; background: var(--net, #333); color: #fff; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.ptl-social__badge svg { width: 15px; height: 15px; }
.ptl-social__play { position: absolute; left: 10px; top: 10px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; }
.ptl-social__play svg { width: 14px; height: 14px; }
/* Indicateur carrousel (plusieurs photos) */
.ptl-social__stack { position: absolute; left: 10px; top: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: .72rem; font-weight: 700; }
.ptl-social__stack svg { width: 13px; height: 13px; }
.ptl-social__stack i { font-style: normal; }
/* Métadonnées */
.ptl-social__meta { display: flex; align-items: center; gap: 12px; padding: 8px 4px 2px; font-size: .82rem; color: #555; }
.ptl-social__meta span { display: inline-flex; align-items: center; gap: 4px; }
.ptl-social__meta svg { width: 14px; height: 14px; opacity: .7; }
.ptl-social__date { margin-left: auto; color: #999; }

/* Post texte pur (LinkedIn/Facebook sans image) */
.ptl-social__item--text { background: #fff; border: 1px solid #e6e6ea; padding: 18px 18px 12px; display: flex; flex-direction: column; gap: 10px; min-height: 160px; }
.ptl-social__item--text .ptl-social__badge { position: static; box-shadow: none; }
.ptl-social__quote { margin: 0; font-size: .95rem; line-height: 1.55; color: #222; }
.ptl-social__item--text .ptl-social__meta { margin-top: auto; }

/* Carte riche (cards / spotlight-main) : image + corps texte dessous */
.ptl-social__item--rich { background: #fff; box-shadow: 0 6px 22px rgba(0, 0, 0, .08); }
.ptl-social__item--rich .ptl-social__body { display: block; padding: 12px 14px 14px; }
.ptl-social__text { display: block; font-size: .92rem; line-height: 1.5; color: #222; margin-bottom: 6px; }

/* ---------- Grille / mur ---------- */
.ptl-social--grid .ptl-social__grid, .ptl-social--wall .ptl-social__grid { display: grid; gap: var(--gap); grid-template-columns: repeat(var(--ptl-cols, 3), 1fr); }
.ptl-social--grid .ptl-social__item, .ptl-social--wall .ptl-social__item { aspect-ratio: 1; }
.ptl-social--grid .ptl-social__media, .ptl-social--wall .ptl-social__media { height: 100%; }
.ptl-social--wall .ptl-social__grid { grid-auto-flow: dense; }
.ptl-social--wall .ptl-social__cell--big { grid-column: span 2; grid-row: span 2; }
.ptl-social__cell.is-hidden { display: none; }
.ptl-social__morewrap { text-align: center; margin: 18px 0 0; }
.ptl-social__more { cursor: pointer; border: 1px solid currentColor; background: transparent; color: inherit; font: inherit; font-weight: 600; padding: 10px 22px; border-radius: 999px; transition: background .2s ease, color .2s ease; }
.ptl-social__more:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Maçonnerie ---------- */
.ptl-social--masonry .ptl-social__grid { display: block; columns: var(--ptl-cols, 3); column-gap: var(--gap); }
.ptl-social--masonry .ptl-social__cell { break-inside: avoid; margin: 0 0 var(--gap); }

/* ---------- Carrousels (carousel = images, cards = cartes) ---------- */
.ptl-social__viewport { position: relative; }
.ptl-social__track { display: flex; gap: var(--gap); margin: 0; padding: 4px; list-style: none; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.ptl-social__track::-webkit-scrollbar { display: none; }
.ptl-social__slide { scroll-snap-align: start; }
.ptl-social--carousel .ptl-social__slide { flex: 0 0 calc((100% - 2 * var(--gap)) / 3); }
.ptl-social--carousel .ptl-social__item { aspect-ratio: 1; }
.ptl-social--cards .ptl-social__slide { flex: 0 0 clamp(260px, 32%, 340px); }
.ptl-social--cards .ptl-social__media { aspect-ratio: 16/10; }
.ptl-social__arrow { position: absolute; top: 40%; transform: translateY(-50%); z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; background: #fff; color: #111; box-shadow: 0 4px 16px rgba(0, 0, 0, .18); display: grid; place-items: center; transition: transform .2s ease, opacity .2s ease; }
.ptl-social__arrow:hover { transform: translateY(-50%) scale(1.08); }
.ptl-social__arrow[disabled] { opacity: .35; cursor: default; }
.ptl-social__arrow--prev { left: -8px; }
.ptl-social__arrow--prev svg { transform: rotate(180deg); }
.ptl-social__arrow--next { right: -8px; }
.ptl-social__arrow svg { width: 20px; height: 20px; }

/* ---------- Spotlight (dernier post en grand + vignettes) ---------- */
.ptl-social__spot { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--gap); }
.ptl-social__spot-main .ptl-social__item { height: 100%; }
.ptl-social__spot-main .ptl-social__media { aspect-ratio: 4/3; height: auto; }
.ptl-social__spot-side { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.ptl-social__spot-side .ptl-social__item { aspect-ratio: 1; }
.ptl-social__spot-side .ptl-social__media { height: 100%; }

/* ---------- Lightbox ---------- */
.ptl-social-lb { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(10, 10, 12, .88); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.ptl-social-lb.is-open { opacity: 1; pointer-events: auto; }
.ptl-social-lb__box { display: flex; max-width: min(980px, 94vw); max-height: 88vh; background: #fff; border-radius: 14px; overflow: hidden; transform: scale(.96); transition: transform .25s ease; }
.ptl-social-lb.is-open .ptl-social-lb__box { transform: scale(1); }
.ptl-social-lb__img { position: relative; flex: 1 1 60%; min-width: 0; background: #000; display: grid; place-items: center; }
.ptl-social-lb__img img { max-width: 100%; max-height: 88vh; object-fit: contain; display: block; }
/* Diaporama carrousel dans la lightbox */
.ptl-social-lb__nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 38px; height: 38px; border: 0; border-radius: 50%; cursor: pointer; background: rgba(255, 255, 255, .92); color: #111; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); display: grid; place-items: center; transition: transform .15s ease; }
.ptl-social-lb__nav:hover { transform: translateY(-50%) scale(1.08); }
.ptl-social-lb__nav svg { width: 18px; height: 18px; }
.ptl-social-lb__nav--prev { left: 10px; }
.ptl-social-lb__nav--prev svg { transform: rotate(180deg); }
.ptl-social-lb__nav--next { right: 10px; }
.ptl-social-lb__count { position: absolute; top: 12px; left: 12px; z-index: 2; padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; font-size: .78rem; font-weight: 600; }
.ptl-social-lb__side { flex: 1 1 40%; max-width: 340px; padding: 22px; overflow: auto; display: flex; flex-direction: column; gap: 12px; font-size: .92rem; line-height: 1.55; }
.ptl-social-lb__net { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.ptl-social-lb__net svg { width: 18px; height: 18px; }
.ptl-social-lb__date { font-size: .78rem; opacity: .55; }
.ptl-social-lb__stats { display: inline-flex; gap: 16px; font-size: .88rem; font-weight: 600; color: #333; }
.ptl-social-lb__stats span { display: inline-flex; align-items: center; gap: 5px; }
.ptl-social-lb__stats svg { width: 15px; height: 15px; color: #e1306c; }
.ptl-social-lb__cta { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; text-decoration: none; font-size: .88rem; }
.ptl-social-lb__cta svg { width: 16px; height: 16px; }
.ptl-social-lb__close { position: absolute; top: 16px; right: 16px; width: 42px; height: 42px; border: 0; border-radius: 50%; cursor: pointer; background: rgba(255, 255, 255, .12); color: #fff; display: grid; place-items: center; }
.ptl-social-lb__close:hover { background: rgba(255, 255, 255, .24); }
.ptl-social-lb__close svg { width: 20px; height: 20px; }

/* ---------- Apparition en cascade (activée par JS : .ptl-social--js) ---------- */
.ptl-social--js .ptl-social__cell { opacity: 0; transform: translateY(16px) scale(.98); transition: opacity .5s ease, transform .5s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0s); }
.ptl-social--js .ptl-social__cell.is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
	.ptl-social--grid .ptl-social__grid, .ptl-social--wall .ptl-social__grid { grid-template-columns: repeat(min(var(--ptl-cols, 3), 3), 1fr); }
	.ptl-social--masonry .ptl-social__grid { columns: 2; }
	.ptl-social--carousel .ptl-social__slide { flex-basis: calc((100% - var(--gap)) / 2); }
	.ptl-social__spot { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
	.ptl-social--grid .ptl-social__grid, .ptl-social--wall .ptl-social__grid { grid-template-columns: repeat(2, 1fr); }
	.ptl-social--wall .ptl-social__cell--big { grid-column: span 2; grid-row: span 1; }
	.ptl-social--wall .ptl-social__cell--big .ptl-social__item { aspect-ratio: 16/9; }
	.ptl-social--carousel .ptl-social__slide { flex-basis: calc(100% - 40px); }
	.ptl-social--cards .ptl-social__slide { flex-basis: 80%; }
	.ptl-social__spot-side { grid-template-columns: 1fr 1fr; }
	.ptl-social-lb__box { flex-direction: column; }
	.ptl-social-lb__side { max-width: none; }
	.ptl-social__follow span { display: none; }
	.ptl-social__follow { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) {
	.ptl-social__item img, .ptl-social__follow, .ptl-social-lb, .ptl-social-lb__box, .ptl-social--js .ptl-social__cell { transition: none; }
	.ptl-social--js .ptl-social__cell { opacity: 1; transform: none; }
}
