

/* ===== Social Media Galerie ===== */

.social-media-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
}

.social-media-card {
  min-width: 0;
}

/* ===== Image cliquable ===== */

.social-media-preview {
  position: relative;
  display: block;
  width: 100%;
  height: 260px;
  max-height: 300px;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: #222;
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.social-media-preview > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform .25s ease;
}

.social-media-preview:hover > img {
  transform: scale(1.035);
}

/* Voile en bas pour la lisibilité du texte */
.social-media-preview::after {
  content: "";
  position: absolute;
  inset: 45% 0 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(0, 0, 0, .8)
  );
}

/* ===== Bouton lecture YouTube ===== */

.social-media-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 38px;
  padding-left: 3px;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  font-size: 19px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  border: 2px solid white;
}

.social-media-preview:hover .social-media-play {
    background: rgba(255,255,255,0.8);
    color: #232323a3;
}

/* ===== Caption facultative ===== */

.social-media-caption {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #fff;
  pointer-events: none;
}

.social-media-caption strong {
  font-size: 15px;
  line-height: 1.3;
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.social-media-caption span {
  font-size: 12px;
  line-height: 1.4;
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ===== Aperçu plein écran ===== */

.social-lightbox[hidden] {
  display: none !important;
}

.social-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px 20px 20px;
  background: rgba(0, 0, 0, .94);
}

.social-lightbox-close {
  position: absolute;
  top: 10px;
  right: 18px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
}

.social-lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.social-lightbox-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100% - 90px);
  object-fit: contain;
}

.social-lightbox-text {
  max-width: 800px;
  color: #fff;
  text-align: center;
}

.social-lightbox-title {
  font-size: 16px;
}

.social-lightbox-caption {
  margin: 5px 0 0;
  font-size: 13px;
}

/* ===== Responsive ===== */

@media (max-width: 767px) {
  .social-media-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .social-media-preview {
    height: 220px;
  }

  .social-media-caption {
    right: 8px;
    bottom: 8px;
    left: 8px;
  }

  .social-media-caption strong {
    font-size: 13px;
  }

  .social-media-caption span {
    font-size: 11px;
  }
}

@media (max-width: 380px) {
  .social-media-gallery {
    grid-template-columns: 1fr;
  }

  .social-media-preview {
    height: 260px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .social-media-preview > img {
    transition: none;
  }
}

/* Centrer les indicateurs */
#SocialMediaSlider-ow + .tns-nav,
#SocialMediaSlider-ow .tns-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    margin-bottom: 30px;
}

/* Apparence des dots */
#SocialMediaSlider-ow + .tns-nav button,
#SocialMediaSlider-ow .tns-nav button {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    font-size: 0;
    margin:0;
}

/* Point actif */
#SocialMediaSlider-ow + .tns-nav button.tns-nav-active,
#SocialMediaSlider-ow .tns-nav button.tns-nav-active {
    background: #333;
}

.tns-outer .tns-nav button:focus,
.tns-outer .tns-nav button:active {
    outline: none !important;
    box-shadow: none !important;
}


#social-next:focus,
#social-next:active,
#social-prev:focus,
#social-prev:active,
#social-close:focus,
#social-close:active
 {
    outline: none !important;
    box-shadow: none !important;
}

.social-item {
    cursor: pointer;
}

.social-modal[hidden],
#social-consent[hidden],
#social-viewer[hidden] {
    display: none !important;
}

.social-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: #323232;
    color: #fff;
}

#social-viewer {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.social-toolbar {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 64px;
    padding: 10px 20px;
    background: #171717;
}

.social-toolbar h2 {
    flex: 1;
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.social-toolbar button {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: #303030;
    color: #fff;
    font-size: 23px;
    cursor: pointer;
}

.social-toolbar button:hover {
    background: #505050;
}

#social-counter {
    white-space: nowrap;
    font-size: 13px;
}

.social-stage {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000;
    background: #232323;
}

#social-player {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#social-player iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Format vertical des Shorts */
#social-player iframe.short-player {
    width: min(100%, calc((100vh - 64px) * 9 / 16));
    height: 100%;
    max-height: 100%;
    aspect-ratio: 9 / 16;
}

.social-consent {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(32, 32, 32, .92);
}

.social-consent-box {
    width: 100%;
    max-width: 480px;
    padding: 28px;
    border-radius: 8px;
    background: #fff;
    color: #222;
}

.social-consent-box button {
    margin: 8px 8px 0 0;
    padding: 10px 16px;
    cursor: pointer;
}

@media (max-width: 600px) {
    .social-toolbar {
        gap: 8px;
        min-height: 56px;
        padding: 6px 8px;
    }

    .social-toolbar button {
        width: 36px;
        height: 36px;
    }

    .social-toolbar h2 {
        font-size: 13px;
    }

    #social-player iframe.short-player {
        width: auto;
        height: 100%;
        max-width: 100%;
        aspect-ratio: 9 / 16;
    }
}

.social-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 15px 24px 28px;
    color: #fff;
    text-align: center;
    background: linear-gradient(
        to bottom,
        rgba(23, 23, 23, 0),
        rgba(23, 23, 23, 0.55) 35%,
        rgba(23, 23, 23, 0.75)
    );
}

.social-caption-description {
    margin: 0 auto;
    max-width: 700px;
    font-size: 1rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.95);
}

#social-player img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}