/* =====================================================
   ============ Instant-photo (mini + wrapper) ==========
   ===================================================== */

/* 1) Style "miniature" par défaut (utilisé hors bulle) */
.instant-photo-mini,
.instant-video-mini {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 16px;
  border: 2px solid var(--accent);
  background: #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  display: block;
  margin: 8px auto;
  transition: transform .25s ease, box-shadow .25s ease;
}

.instant-photo-mini:hover,
.instant-video-mini:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 26px rgba(0,0,0,0.16);
}

/* Wrapper optionnel (si tu l’utilises ailleurs) */
.instant-photo-wrapper {
  width: fit-content;
  margin: 0 auto;
  padding: 12px;
  border-radius: 20px;
  background: linear-gradient(135deg, #e0f7fa 0%, #ffffff 100%);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

/* Badge +n (stack) */
.instant-stack {
  position: relative;
}

.instant-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 4px 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--turq-a), var(--turq-b));
  border-radius: 999px;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.15),
    0 0 12px rgba(0, 210, 255, 0.35);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.45);
  pointer-events: none;
  z-index: 6;
}


/* =====================================================
   ================ Thought-bubble (bulle) =============
   ===================================================== */

.thought-bubble {
  position: relative;
  display: block;
  margin: 22px auto;
  color: var(--accent);
  --pad-x: 26px;
  --pad-y: 24px;
  --bubble-bleed: 24px;
  padding-bottom: 1px;
  overflow: visible;
  z-index: 2;
}

/* Contenu bulle */
.thought-bubble .bubble-content {
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  align-items: center;
  justify-items: center;
  gap: 8px;
  padding: var(--pad-y) var(--pad-x) var(--pad-y);
}

/* Sans titre */
.thought-bubble.no-title .bubble-content {
  grid-template-rows: auto;
  gap: 0;
}

/* SVG contour */
.thought-bubble .bubble-outline {
  position: absolute;
  inset: 0;
  left: calc(-3 * var(--bubble-bleed));
  right: calc(-1 * var(--bubble-bleed));
  top: calc(-1 * var(--bubble-bleed));
  bottom: calc(-1 * var(--bubble-bleed));
  width: calc(100% + 6 * var(--bubble-bleed));
  height: calc(100% + 4 * var(--bubble-bleed));
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}

/* Wrapper média (dans ta bulle, il contient l’image/vidéo + le badge) */

.thought-bubble .instant-media-wrapper {
  display: grid;
  place-items: center;
  width: 100%;         
  max-width: min(520px, 88vw);
  margin: 0 auto;
}

.thought-bubble .instant-photo-mini,
.thought-bubble .instant-video-mini {
  /* on évite la taille réelle */
  width: 160px;
  height: auto;

  /* limites de hauteur pour ne pas dépasser la bulle/viewport */
  max-height: 55vh;

  /* pas de rognage */
  object-fit: contain;

  display: block;
  margin: 0 auto;

  /* Dans la bulle, le média reste nu : pas de cadre bleu ni de carte blanche. */
  border-radius: 16px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

/* Le survol reste très léger, sans recréer un encadré autour du média. */
.thought-bubble .instant-photo-mini:hover,
.thought-bubble .instant-video-mini:hover {
  transform: scale(1.015);
  box-shadow: none;
}


/* Par sécurité : les IDs instant-photo/instant-video restent "contenus" */
#instant-photo,
#instant-video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* Titre vide */
.instant-title:empty {
  display: none;
}

/* Titre */
.thought-bubble .instant-title {
  margin: 6px 0 0;
  font-size: clamp(1.15rem, 2.3vw, 1.45rem);
  font-weight: 800;
  letter-spacing: .2px;
  line-height: 1.2;
  white-space: pre-line;
  text-align: center;
  background: linear-gradient(135deg, var(--turq-a), var(--turq-b));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding: 6px 12px;
  border-radius: 12px;
}

/* Responsive */
@media (max-width: 420px) {
  .thought-bubble {
    --pad-x: 18px;
    --pad-y: 20px;
  }

  /* miniatures hors bulle */
  .instant-photo-mini,
  .instant-video-mini {
    width: 148px;
    height: 148px;
  }

  /* instant T dans la bulle : on garde l’adaptatif mais on limite un peu plus */
  .thought-bubble .instant-photo-mini,
  .thought-bubble .instant-video-mini {
    max-width: 92vw;
    max-height: 50vh;
  }
}




/* =====================================================
   Instant T — contour de pensée lumineux mais discret
   Le mouvement des couleurs est géré dans le SVG par thought-bubble.js.
   ===================================================== */
.thought-bubble .bubble-outline {
  filter: drop-shadow(0 0 3px rgba(0, 210, 255, .055));
}

@media (prefers-reduced-motion: reduce) {
  .thought-bubble .bubble-outline {
    filter: none;
  }
}


/* =====================================================
   Instant T — centrage réel quand aucun titre n'est présent
   ===================================================== */
/*
 * Le contour normal réserve davantage d'espace sous le contenu afin
 * d'accompagner visuellement le titre. Sans titre, on recentre la forme
 * autour du seul média : l'image/vidéo paraît alors réellement au milieu
 * de la bulle, et non légèrement remontée.
 */
.thought-bubble.no-title .bubble-outline {
  top: calc(-2 * var(--bubble-bleed));
  bottom: auto;
  height: calc(100% + 4 * var(--bubble-bleed));
}

.thought-bubble.no-title .bubble-content {
  grid-template-rows: auto;
  place-items: center;
  gap: 0;
}
