/* ═══════════════════════════════════════════════════
   MAQUETTE INSTAGRAM — KALÉIDO SONORES
   Fichier : css/style.css
   ───────────────────────────────────────────────────
   VARIABLES GLOBALES
   → Modifie ici les couleurs, dimensions, polices
═══════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── Police système Instagram (ne pas changer) ── */
  --ig-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  /* ── Couleurs Instagram ── */
  --ig-bg:      #FAFAFA;   /* Fond général de la page */
  --ig-white:   #FFFFFF;   /* Fond de la carte post */
  --ig-border:  #DBDBDB;   /* Bordures légères */
  --ig-text:    #000000;   /* Texte principal */
  --ig-subtext: #737373;   /* Texte secondaire (dates, sous-textes) */
  --ig-blue:    #0095F6;   /* Liens, bouton Suivre, hashtags, mentions */
  --ig-red:     #FF3040;   /* Cœur J'aime activé */

  /* ── Largeur de la carte post ── */
  --ig-card-w: 614px;      /* ← Modifier ici pour changer la largeur */
}

/* ─────────────────────────────────────────────────
   BASE
───────────────────────────────────────────────── */
body {
  font-family: var(--ig-font);
  background: var(--ig-bg);
  color: var(--ig-text);
  font-size: 14px;
  line-height: 1.4;
  display: flex;
  justify-content: center;
  padding: 32px 16px 80px;
}

/* ═══════════════════════════════════════════════════
   CARTE POST INSTAGRAM
═══════════════════════════════════════════════════ */
.ig-post {
  width: var(--ig-card-w);
  background: var(--ig-white);
  border: 1px solid var(--ig-border);
  border-radius: 3px;
}

/* ─────────────────────────────────────────────────
   EN-TÊTE DU POST (avatar + nom + bouton suivre)
───────────────────────────────────────────────── */
.ig-post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}
.ig-header-left {
  display: flex; align-items: center; gap: 10px;
}

/* ── Avatar ── */
.ig-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--ig-border);
  overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, #F4950D, #0A858B); /* ← Couleurs Kaléido */
  display: flex; align-items: center; justify-content: center;
}
.ig-avatar img { width: 100%; height: 100%; object-fit: cover; }
/* Texte placeholder avatar (si pas d'image) */
.ig-avatar-placeholder {
  font-size: 10px; font-weight: 800; color: white;
  line-height: 1.1; text-align: center; padding: 2px;
}

/* ── Bloc nom d'utilisateur ── */
.ig-username-block { display: flex; flex-direction: column; }
.ig-username {
  font-size: 14px; font-weight: 600; color: var(--ig-text);
  display: flex; align-items: center; gap: 4px;
  cursor: pointer;
}
.ig-username:hover { opacity: .8; }

/* Badge vérifié */
.ig-verified { display: inline-flex; align-items: center; }
.ig-verified svg { width: 12px; height: 12px; }

.ig-follow-sep  { color: var(--ig-subtext); font-size: 14px; }
.ig-follow-btn  {
  font-size: 14px; font-weight: 600; color: var(--ig-blue);
  background: none; border: none; cursor: pointer; padding: 0;
}
.ig-follow-btn:hover { opacity: .7; }
.ig-location { font-size: 12px; color: var(--ig-subtext); }

/* Bouton ⋯ */
.ig-more-btn {
  background: none; border: none; cursor: pointer;
  color: var(--ig-text); padding: 4px;
  display: flex; align-items: center;
}
.ig-more-btn:hover { opacity: .6; }
.ig-more-btn svg { width: 24px; height: 24px; }

/* ═══════════════════════════════════════════════════
   CAROUSEL (zone d'images défilantes)
═══════════════════════════════════════════════════ */
.ig-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;    /* ← Carré 1:1. Changer en "4/5" pour format portrait */
  overflow: hidden;
  background: #000;
  user-select: none;
}

/* Conteneur des slides (se translate horizontalement) */
.ig-slides {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}

/* Slide individuelle */
.ig-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.ig-slide img {
  width: 100%; height: 100%;
  object-fit: contain; display: block;
}

/* Placeholder (zone grise si pas d'image) */
.ig-slide-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  background: #1a1a2e;
  color: rgba(255,255,255,.35);
  font-size: 13px;
}
.ig-slide-placeholder svg {
  width: 56px; height: 56px;
  color: rgba(255,255,255,.2);
}

/* ── Boutons de navigation (précédent / suivant) ── */
.ig-nav-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,.9);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
  z-index: 10;
  transition: background .15s, opacity .15s;
}
.ig-nav-btn:hover { background: white; }
.ig-nav-btn.prev { left: 12px; }
.ig-nav-btn.next { right: 12px; }
.ig-nav-btn svg  { width: 16px; height: 16px; }
.ig-nav-btn.hidden { opacity: 0; pointer-events: none; }

/* ── Points indicateurs (dots) ── */
.ig-dots {
  position: absolute;
  bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 4px; z-index: 10;
}
.ig-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.5);
  transition: background .2s;
}
.ig-dot.active { background: var(--ig-blue); }

/* ── Compteur "1 / 3" (coin haut droit) ── */
.ig-slide-counter {
  position: absolute;
  top: 12px; right: 14px;
  background: rgba(0,0,0,.55); color: white;
  font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 12px;
  z-index: 10;
}

/* ─────────────────────────────────────────────────
   BARRE D'ACTIONS (J'aime, Commenter, Partager, Enregistrer)
───────────────────────────────────────────────── */
.ig-actions {
  display: flex; align-items: center;
  padding: 8px 12px 0; gap: 4px;
}
.ig-action-btn {
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 8px; border-radius: 50%;
  color: var(--ig-text);
  transition: opacity .1s;
}
.ig-action-btn:hover { opacity: .6; }
.ig-action-btn svg { width: 24px; height: 24px; }

/* Bouton Enregistrer (signet) — aligné à droite */
.ig-save-btn {
  margin-left: auto;
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center;
  padding: 8px; border-radius: 50%;
  color: var(--ig-text); transition: opacity .1s;
}
.ig-save-btn:hover { opacity: .6; }
.ig-save-btn svg { width: 24px; height: 24px; }

/* ─────────────────────────────────────────────────
   COMPTEUR DE LIKES
───────────────────────────────────────────────── */
.ig-likes {
  padding: 4px 16px;
  font-size: 14px; font-weight: 600;
}

/* ─────────────────────────────────────────────────
   CAPTION (texte de la publication)
───────────────────────────────────────────────── */
.ig-caption {
  padding: 0 16px 8px;
  font-size: 14px; line-height: 1.5;
}
.ig-caption .cap-username {
  font-weight: 600; cursor: pointer; margin-right: 4px;
}
.ig-caption .cap-username:hover { opacity: .7; }

/* Lien "... plus" */
.ig-more-caption {
  color: var(--ig-subtext); cursor: pointer; font-size: 14px;
}
.ig-more-caption:hover { color: var(--ig-text); }

/* Toggle caption courte / longue */
.ig-caption-full  { display: none; }
.ig-caption-short { display: inline; }
.ig-post.cap-expanded .ig-caption-full  { display: inline; }
.ig-post.cap-expanded .ig-caption-short { display: none; }
.ig-post.cap-expanded .ig-more-caption  { display: none; }

/* Mentions et hashtags */
.ig-mention { color: var(--ig-blue); font-weight: 600; cursor: pointer; }
.ig-mention:hover { text-decoration: underline; }
.ig-hashtag  { color: var(--ig-blue); cursor: pointer; }
.ig-hashtag:hover { text-decoration: underline; }

/* ─────────────────────────────────────────────────
   LABEL "POUR VOUS"
───────────────────────────────────────────────── */
.ig-suggested-label {
  padding: 2px 16px 6px;
  font-size: 12px; color: var(--ig-subtext);
  display: flex; align-items: center; gap: 4px;
}
.ig-suggested-label span { cursor: pointer; }
.ig-chevron-down { font-size: 10px; }

/* ─────────────────────────────────────────────────
   SECTION COMMENTAIRES
───────────────────────────────────────────────── */
.ig-comments-section { padding: 0 16px 4px; }

.ig-comments-count {
  font-size: 14px; color: var(--ig-subtext);
  cursor: pointer; margin-bottom: 10px;
}
.ig-comments-count:hover { color: var(--ig-text); }

/* Ligne de commentaire */
.ig-comment {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}
.ig-comment-left {
  display: flex; gap: 10px; align-items: flex-start; flex: 1;
}

/* Avatar commentaire */
.ig-comment-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  flex-shrink: 0; overflow: hidden;
}
.ig-comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ig-comment-avatar-circle {
  width: 100%; height: 100%; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: white;
}

/* Corps du commentaire */
.ig-comment-body { flex: 1; }
.ig-comment-body .cm-username {
  font-weight: 600; font-size: 14px; cursor: pointer; margin-right: 4px;
}
.ig-comment-body .cm-username:hover { opacity: .7; }
.ig-comment-body .cm-text { font-size: 14px; }
.ig-comment-body .cm-meta {
  display: flex; gap: 12px; margin-top: 4px;
  font-size: 12px; color: var(--ig-subtext);
}
.ig-comment-body .cm-meta span { cursor: pointer; }
.ig-comment-body .cm-meta .cm-reply { font-weight: 600; }
.ig-comment-body .cm-meta .cm-reply:hover { color: var(--ig-text); }

/* Bouton cœur sur commentaire */
.ig-comment-like {
  background: none; border: none; cursor: pointer;
  color: var(--ig-subtext); padding: 4px;
  flex-shrink: 0; display: flex; align-items: flex-start;
}
.ig-comment-like:hover { color: var(--ig-text); }
.ig-comment-like svg { width: 12px; height: 12px; }

/* Lien "Afficher les réponses" */
.ig-replies-toggle {
  display: flex; align-items: center; gap: 8px;
  margin: -4px 0 12px 42px;
  font-size: 12px; font-weight: 600; color: var(--ig-subtext);
  cursor: pointer;
}
.ig-replies-toggle::before {
  content: '';
  display: block; width: 24px; height: 1px;
  background: var(--ig-subtext);
}
.ig-replies-toggle:hover { color: var(--ig-text); }

/* ─────────────────────────────────────────────────
   HORODATAGE
───────────────────────────────────────────────── */
.ig-timestamp {
  padding: 4px 16px 12px;
  font-size: 10px; color: var(--ig-subtext);
  text-transform: uppercase; letter-spacing: .3px;
}

/* ─────────────────────────────────────────────────
   ZONE "AJOUTER UN COMMENTAIRE"
───────────────────────────────────────────────── */
.ig-add-comment {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--ig-border);
}
/* Mini avatar de l'utilisateur connecté */
.ig-add-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #F4950D, #0A858B); /* ← Couleurs Kaléido */
  flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; color: white;
  font-size: 11px; font-weight: 700;
  overflow: hidden;
}
.ig-add-avatar img {
  width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%;
}
.ig-comment-input {
  flex: 1; border: none; background: none; outline: none;
  font-family: var(--ig-font); font-size: 14px; color: var(--ig-text);
}
.ig-comment-input::placeholder { color: var(--ig-subtext); }
.ig-emoji-btn {
  background: none; border: none; cursor: pointer;
  font-size: 20px; line-height: 1; padding: 0 2px; opacity: .7;
}
.ig-emoji-btn:hover { opacity: 1; }
.ig-publish-btn {
  background: none; border: none; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--ig-blue);
  padding: 0; opacity: .4;
}
.ig-publish-btn:hover { opacity: 1; }

/* ═══════════════════════════════════════════════════
   ANIMATION CŒUR (double-clic sur l'image)
═══════════════════════════════════════════════════ */
.ig-heart-anim {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none; z-index: 20;
  animation: heartPop .8s ease forwards;
}
.ig-heart-anim svg {
  width: 100px; height: 100px;
  fill: white;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.4));
}
@keyframes heartPop {
  0%   { transform: translate(-50%,-50%) scale(0);   opacity: 1; }
  30%  { transform: translate(-50%,-50%) scale(1.2); opacity: 1; }
  70%  { transform: translate(-50%,-50%) scale(1);   opacity: 1; }
  100% { transform: translate(-50%,-50%) scale(1.1); opacity: 0; }
}

/* ═══════════════════════════════════════════════════
   TAMPON MAQUETTE (coin bas droit)
═══════════════════════════════════════════════════ */
.maquette-badge {
  position: fixed; bottom: 16px; right: 16px;
  background: rgba(0,0,0,.7); color: white;
  font-size: 11px; padding: 5px 14px;
  border-radius: 20px; z-index: 999;
  letter-spacing: .3px;
}
