/* ==========================================================================
   InnovX — Cartes Flash « texte » stylées (façon stories)
   Partagé par la carte du fil (templates/feed/card_experience.html), la page
   de détail Flash et l'éditeur (experiences/publier_maintenant.html).
   Toutes les classes sont préfixées « ixf- » ; les valeurs possibles sont des
   listes blanches côté serveur (experiences/flash_styles.py).
   ========================================================================== */

.ixf-carte {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  overflow: clip;            /* rogne le motif sans bloquer la hauteur : la carte grandit avec le texte */
  container-type: inline-size;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  aspect-ratio: 16 / 11;
  min-height: auto;
  padding: 30px 26px;
  padding: clamp(22px, 8cqw, 48px) clamp(18px, 7cqw, 44px);
  text-align: center;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 700;
  line-height: 1.3;
  word-break: break-word;
  overflow-wrap: anywhere;
  --ixf-k: 1;
  --ixf-kp: 1;
}

/* Calque du motif décoratif : dessiné dans la couleur du texte (toujours contrastée) */
.ixf-carte::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: none;
  background: currentColor;
  opacity: .16;
  -webkit-mask-repeat: repeat;
  mask-repeat: repeat;
}

.ixf-texte {
  position: relative;
  z-index: 2;
  display: block;
  max-width: 100%;
  white-space: pre-wrap;
  font-size: calc(1.2rem * var(--ixf-k) * var(--ixf-kp));
}
.ixf-l1 .ixf-texte { font-size: calc(1.55rem * var(--ixf-k) * var(--ixf-kp)); font-size: calc(clamp(1.3rem, 6.4cqw, 2.15rem) * var(--ixf-k) * var(--ixf-kp)); }
.ixf-l2 .ixf-texte { font-size: calc(1.2rem * var(--ixf-k) * var(--ixf-kp)); font-size: calc(clamp(1.05rem, 4.7cqw, 1.6rem) * var(--ixf-k) * var(--ixf-kp)); }
.ixf-l3 .ixf-texte { font-size: calc(1rem * var(--ixf-k) * var(--ixf-kp)); font-size: calc(clamp(.92rem, 3.7cqw, 1.22rem) * var(--ixf-k) * var(--ixf-kp)); line-height: 1.38; }

/* Tailles */
.ixf-t-xs { --ixf-k: .72; }
.ixf-t-s  { --ixf-k: .86; }
.ixf-t-m  { --ixf-k: 1; }
.ixf-t-l  { --ixf-k: 1.2; }
.ixf-t-xl { --ixf-k: 1.42; }

/* Alignements */
.ixf-align-left  { justify-content: flex-start; }
.ixf-align-left .ixf-texte  { text-align: left; width: 100%; }
.ixf-align-center .ixf-texte { text-align: center; }
.ixf-align-right { justify-content: flex-end; }
.ixf-align-right .ixf-texte { text-align: right; width: 100%; }

/* Polices */
.ixf-police-classique .ixf-texte { font-family: 'Poppins', system-ui, sans-serif; font-weight: 700; }
.ixf-police-impact .ixf-texte { font-family: 'Anton', Impact, 'Arial Narrow', 'Helvetica Neue', sans-serif; font-weight: 400; text-transform: uppercase; letter-spacing: .02em; line-height: 1.12; }
.ixf-police-impact { --ixf-kp: 1.12; }
.ixf-police-manuscrit .ixf-texte { font-family: 'Caveat', 'Segoe Script', 'Bradley Hand', 'Comic Sans MS', cursive; font-weight: 700; line-height: 1.15; }
.ixf-police-manuscrit { --ixf-kp: 1.38; }
.ixf-police-machine .ixf-texte { font-family: 'Courier Prime', 'Courier New', Courier, ui-monospace, monospace; font-weight: 700; letter-spacing: -.01em; }
.ixf-police-machine { --ixf-kp: .96; }
.ixf-police-neon .ixf-texte { font-family: 'Poppins', system-ui, sans-serif; font-weight: 600; letter-spacing: .02em;
  text-shadow: 0 0 .04em #fff, 0 0 .22em currentColor, 0 0 .55em currentColor, 0 0 1.1em currentColor; }
.ixf-police-elegant .ixf-texte { font-family: 'Playfair Display', Georgia, 'Times New Roman', serif; font-style: italic; font-weight: 700; line-height: 1.22; }
.ixf-police-elegant { --ixf-kp: 1.06; }

/* Effets de lisibilité */
.ixf-effet-ombre .ixf-texte { text-shadow: 0 .06em .28em rgba(0, 0, 0, .55), 0 .02em .05em rgba(0, 0, 0, .45); }
.ixf-effet-contour .ixf-texte {
  text-shadow: -.045em -.045em 0 #000, .045em -.045em 0 #000, -.045em .045em 0 #000, .045em .045em 0 #000,
               0 -.06em 0 #000, 0 .06em 0 #000, -.06em 0 0 #000, .06em 0 0 #000;
}
.ixf-encre-sombre.ixf-effet-contour .ixf-texte {
  text-shadow: -.045em -.045em 0 #fff, .045em -.045em 0 #fff, -.045em .045em 0 #fff, .045em .045em 0 #fff,
               0 -.06em 0 #fff, 0 .06em 0 #fff, -.06em 0 0 #fff, .06em 0 0 #fff;
}
.ixf-effet-surligne .ixf-surl {
  background: rgba(0,0,0,0.62);
  padding: .06em .32em;
  border-radius: .22em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.ixf-encre-sombre.ixf-effet-surligne .ixf-surl { background: rgba(255, 255, 255, .78); }

/* Stickers (émojis) posés sur la carte : position/échelle/rotation en variables validées */
.ixf-sticker {
  position: absolute;
  z-index: 3;
  transform: translate(-50%, -50%) rotate(var(--ixf-r, 0deg));
  font-size: calc(2.4rem * var(--ixf-s, 1));
  font-size: calc(9cqw * var(--ixf-s, 1));
  line-height: 1;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  font-style: normal;
  font-weight: 400;
  text-shadow: none;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .28));
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ---------- Motifs ---------- */
.ixf-carte[class*="ixf-motif-"]::before { display: block; }

.ixf-motif-cercles::before {
  opacity: .2;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 280' preserveAspectRatio='none'%3E%3Ccircle cx='40' cy='30' r='90' fill='none' stroke='black' stroke-width='14'/%3E%3Ccircle cx='370' cy='250' r='120' fill='black'/%3E%3Ccircle cx='350' cy='40' r='22' fill='black'/%3E%3Ccircle cx='60' cy='240' r='12' fill='black'/%3E%3Ccircle cx='300' cy='120' r='6' fill='black'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 280' preserveAspectRatio='none'%3E%3Ccircle cx='40' cy='30' r='90' fill='none' stroke='black' stroke-width='14'/%3E%3Ccircle cx='370' cy='250' r='120' fill='black'/%3E%3Ccircle cx='350' cy='40' r='22' fill='black'/%3E%3Ccircle cx='60' cy='240' r='12' fill='black'/%3E%3Ccircle cx='300' cy='120' r='6' fill='black'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.ixf-motif-vagues::before {
  opacity: .22;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 280' preserveAspectRatio='none'%3E%3Cpath d='M0 215 C70 185 130 245 200 215 S330 185 400 210 V280 H0Z' fill='black'/%3E%3Cpath d='M0 245 C80 225 140 270 210 248 S340 228 400 250 V280 H0Z' fill='black'/%3E%3Cpath d='M0 40 C60 70 120 20 190 45 S320 70 400 35 V0 H0Z' fill='black' opacity='.6'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 280' preserveAspectRatio='none'%3E%3Cpath d='M0 215 C70 185 130 245 200 215 S330 185 400 210 V280 H0Z' fill='black'/%3E%3Cpath d='M0 245 C80 225 140 270 210 248 S340 228 400 250 V280 H0Z' fill='black'/%3E%3Cpath d='M0 40 C60 70 120 20 190 45 S320 70 400 35 V0 H0Z' fill='black' opacity='.6'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
/* Confettis : multicolores (calque d'image, pas de masque) */
.ixf-motif-confettis::before {
  opacity: .9;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Crect x='12' y='18' width='10' height='4' rx='2' fill='%23FEDA48' transform='rotate(35 17 20)'/%3E%3Crect x='92' y='12' width='10' height='4' rx='2' fill='%23ff5c7a' transform='rotate(-25 97 14)'/%3E%3Ccircle cx='58' cy='44' r='3' fill='%234fc3f7'/%3E%3Crect x='112' y='70' width='10' height='4' rx='2' fill='%233ddc97' transform='rotate(60 117 72)'/%3E%3Ccircle cx='24' cy='92' r='2.6' fill='%23b388ff'/%3E%3Crect x='66' y='104' width='10' height='4' rx='2' fill='%23ffab40' transform='rotate(-50 71 106)'/%3E%3Ccircle cx='128' cy='124' r='2.4' fill='%23FEDA48'/%3E%3Crect x='38' y='128' width='8' height='3' rx='1.5' fill='%23ffffff' transform='rotate(15 42 129)'/%3E%3Ccircle cx='96' cy='46' r='2' fill='%23ffffff'/%3E%3C/svg%3E") 0 0 / 140px 140px repeat;
}
.ixf-motif-pois::before {
  opacity: .16;
  -webkit-mask: radial-gradient(circle, #000 0 26%, transparent 28%) 0 0 / 26px 26px repeat;
  mask: radial-gradient(circle, #000 0 26%, transparent 28%) 0 0 / 26px 26px repeat;
}
.ixf-motif-rayures::before {
  opacity: .13;
  -webkit-mask: repeating-linear-gradient(-45deg, #000 0 12px, transparent 12px 30px);
  mask: repeating-linear-gradient(-45deg, #000 0 12px, transparent 12px 30px);
}
.ixf-motif-etoiles::before {
  opacity: .32;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cpath d='M30 14 l3 8 8 3 -8 3 -3 8 -3 -8 -8 -3 8 -3z' fill='black'/%3E%3Cpath d='M118 40 l2 5.5 5.5 2 -5.5 2 -2 5.5 -2 -5.5 -5.5 -2 5.5 -2z' fill='black'/%3E%3Ccircle cx='80' cy='22' r='1.6' fill='black'/%3E%3Ccircle cx='140' cy='110' r='1.8' fill='black'/%3E%3Ccircle cx='20' cy='70' r='1.4' fill='black'/%3E%3Cpath d='M72 108 l3.5 9.5 9.5 3.5 -9.5 3.5 -3.5 9.5 -3.5 -9.5 -9.5 -3.5 9.5 -3.5z' fill='black'/%3E%3Ccircle cx='110' cy='148' r='1.4' fill='black'/%3E%3Ccircle cx='48' cy='150' r='2' fill='black'/%3E%3C/svg%3E") 0 0 / 160px 160px repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cpath d='M30 14 l3 8 8 3 -8 3 -3 8 -3 -8 -8 -3 8 -3z' fill='black'/%3E%3Cpath d='M118 40 l2 5.5 5.5 2 -5.5 2 -2 5.5 -2 -5.5 -5.5 -2 5.5 -2z' fill='black'/%3E%3Ccircle cx='80' cy='22' r='1.6' fill='black'/%3E%3Ccircle cx='140' cy='110' r='1.8' fill='black'/%3E%3Ccircle cx='20' cy='70' r='1.4' fill='black'/%3E%3Cpath d='M72 108 l3.5 9.5 9.5 3.5 -9.5 3.5 -3.5 9.5 -3.5 -9.5 -9.5 -3.5 9.5 -3.5z' fill='black'/%3E%3Ccircle cx='110' cy='148' r='1.4' fill='black'/%3E%3Ccircle cx='48' cy='150' r='2' fill='black'/%3E%3C/svg%3E") 0 0 / 160px 160px repeat;
}
.ixf-motif-coeurs::before {
  opacity: .16;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90' viewBox='0 0 90 90'%3E%3Cpath d='M22 30 c-4-6-14-4-14 4 0 7 14 15 14 15 s14-8 14-15 c0-8-10-10-14-4z' fill='black'/%3E%3Cpath d='M67 66 c-3-4.5-10.5-3-10.5 3 0 5.2 10.5 11.2 10.5 11.2 s10.5-6 10.5-11.2 c0-6-7.5-7.5-10.5-3z' fill='black'/%3E%3C/svg%3E") 0 0 / 90px 90px repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90' viewBox='0 0 90 90'%3E%3Cpath d='M22 30 c-4-6-14-4-14 4 0 7 14 15 14 15 s14-8 14-15 c0-8-10-10-14-4z' fill='black'/%3E%3Cpath d='M67 66 c-3-4.5-10.5-3-10.5 3 0 5.2 10.5 11.2 10.5 11.2 s10.5-6 10.5-11.2 c0-6-7.5-7.5-10.5-3z' fill='black'/%3E%3C/svg%3E") 0 0 / 90px 90px repeat;
}
.ixf-motif-grille::before {
  opacity: .2;
  -webkit-mask: linear-gradient(#000 0 0) 0 0 / 28px 1.5px repeat, linear-gradient(#000 0 0) 0 0 / 1.5px 28px repeat;
  mask: linear-gradient(#000 0 0) 0 0 / 28px 1.5px repeat, linear-gradient(#000 0 0) 0 0 / 1.5px 28px repeat;
}
.ixf-motif-bulles::before {
  opacity: .22;
  -webkit-mask: radial-gradient(circle at 15% 25%, #000 0 9%, transparent 9.5%), radial-gradient(circle at 85% 18%, #000 0 5%, transparent 5.5%),
                radial-gradient(circle at 78% 82%, #000 0 14%, transparent 14.5%), radial-gradient(circle at 30% 85%, #000 0 4%, transparent 4.5%),
                radial-gradient(circle at 55% 12%, #000 0 2.5%, transparent 3%), radial-gradient(circle at 8% 70%, #000 0 6%, transparent 6.5%);
  mask: radial-gradient(circle at 15% 25%, #000 0 9%, transparent 9.5%), radial-gradient(circle at 85% 18%, #000 0 5%, transparent 5.5%),
        radial-gradient(circle at 78% 82%, #000 0 14%, transparent 14.5%), radial-gradient(circle at 30% 85%, #000 0 4%, transparent 4.5%),
        radial-gradient(circle at 55% 12%, #000 0 2.5%, transparent 3%), radial-gradient(circle at 8% 70%, #000 0 6%, transparent 6.5%);
}
.ixf-motif-eclats::before {
  opacity: .12;
  -webkit-mask: repeating-conic-gradient(from 0deg at 50% 50%, #000 0 7.5deg, transparent 7.5deg 15deg);
  mask: repeating-conic-gradient(from 0deg at 50% 50%, #000 0 7.5deg, transparent 7.5deg 15deg);
}

/* Mise en forme choisie dans l'éditeur (gras par défaut ; « ixf-fin » = gras désactivé) */
.ixf-carte.ixf-fin .ixf-texte { font-weight: 400; }
.ixf-carte.ixf-italique .ixf-texte { font-style: italic; }
.ixf-carte.ixf-souligne .ixf-surl { text-decoration: underline; text-decoration-thickness: .08em; text-underline-offset: .16em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* ==========================================================================
   Texte simple (sans fond coloré) : police, taille, alignement, gras / italique / souligné.
   Le conteneur porte « ixf-simple ixf-police-* ixf-ts-* ixf-sa-* [ixf-gras|ixf-italique|ixf-souligne] » ;
   le texte porte « ixf-st » (fil : templates/feed/card_experience.html, éditeur, aperçu).
   !important : les règles globales (typography-innovx-standard.css) imposent police/taille/graisse aux <p>.
   ========================================================================== */
.ixf-simple { --ixf-sb: .95rem; --ixf-k: 1; --ixf-kp: 1; }
.ixf-simple .ixf-st { font-size: calc(var(--ixf-sb) * var(--ixf-k) * var(--ixf-kp)) !important; font-weight: 400 !important; font-style: normal !important; }
.ixf-simple.ixf-ts-xs { --ixf-k: .8; }
.ixf-simple.ixf-ts-s  { --ixf-k: .9; }
.ixf-simple.ixf-ts-m  { --ixf-k: 1; }
.ixf-simple.ixf-ts-l  { --ixf-k: 1.18; }
.ixf-simple.ixf-ts-xl { --ixf-k: 1.4; }
.ixf-simple.ixf-sa-left .ixf-st, .ixf-simple.ixf-sa-left .ixf-sp { text-align: left !important; }
.ixf-simple.ixf-sa-center .ixf-st, .ixf-simple.ixf-sa-center .ixf-sp { text-align: center !important; }
.ixf-simple.ixf-sa-right .ixf-st, .ixf-simple.ixf-sa-right .ixf-sp { text-align: right !important; }
.ixf-simple.ixf-police-classique .ixf-st { font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif !important; }
.ixf-simple.ixf-police-impact .ixf-st { font-family: 'Anton', Impact, 'Arial Narrow', 'Helvetica Neue', sans-serif !important; text-transform: uppercase; letter-spacing: .02em; }
.ixf-simple.ixf-police-manuscrit .ixf-st { font-family: 'Caveat', 'Segoe Script', 'Bradley Hand', 'Comic Sans MS', cursive !important; }
.ixf-simple.ixf-police-manuscrit { --ixf-kp: 1.3; }
.ixf-simple.ixf-police-machine .ixf-st { font-family: 'Courier Prime', 'Courier New', Courier, ui-monospace, monospace !important; }
.ixf-simple.ixf-police-neon .ixf-st { font-family: 'Poppins', system-ui, sans-serif !important; letter-spacing: .02em; text-shadow: 0 0 .04em #fff, 0 0 .22em currentColor, 0 0 .55em currentColor; }
.ixf-simple.ixf-police-elegant .ixf-st { font-family: 'Playfair Display', Georgia, 'Times New Roman', serif !important; }
.ixf-simple.ixf-gras .ixf-st { font-weight: 700 !important; }
.ixf-simple.ixf-italique .ixf-st { font-style: italic !important; }
.ixf-simple.ixf-souligne .ixf-st { text-decoration: underline; text-decoration-thickness: .07em; text-underline-offset: .16em; }
/* Accueil web (templates/home.html agrandit le texte des Flash à 1.05rem avec un sélecteur très spécifique) : même base, tailles conservées */
.ixh-on section.feed-section .flash-card-article .flash-card-text-container.ixf-simple { --ixf-sb: 1.05rem; }
.ixh-on section.feed-section .flash-card-article .flash-card-text-container.ixf-simple .ixf-st { font-size: calc(var(--ixf-sb) * var(--ixf-k) * var(--ixf-kp)) !important; }

/* ===== Squelette de chargement des images (publications flash et pubs du fil, style Instagram) =====
   Classes posées par static/js/ix-media-skeleton.js, uniquement sur les zones d'image des cartes :
   les icônes de réactions, avatars et badges ne sont jamais concernés. Ordinateur et mobile identiques. */
.ix-sk {
  position: relative !important;
  background: var(--ix-sk-base, var(--ixc-surface-2,#242526)) !important;
}
/* Photo seule en hauteur automatique : zone réservée (portrait 4:5, plafonnée) le temps du chargement */
.ix-sk--auto {
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: var(--ix-flash-media-max, 520px);
}
/* Reflet qui balaie la zone */
.ix-sk::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(100deg,
    transparent 20%,
    var(--ix-sk-reflet, rgba(255,255,255,0.07)) 45%,
    var(--ix-sk-reflet-fort, rgba(255,255,255,0.12)) 50%,
    var(--ix-sk-reflet, rgba(255,255,255,0.07)) 55%,
    transparent 80%) 0 0 / 250% 100% no-repeat;
  animation: ix-sk-reflet 1.3s ease-in-out infinite;
}
/* Balayage par position du fond : reste dans la zone sans rogner son contenu (avatar des pubs qui déborde) */
@keyframes ix-sk-reflet {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}
/* Image encore en chargement : invisible (le squelette est visible derrière), puis apparition en fondu */
img.ix-sk-media {
  opacity: 0 !important;
  background: transparent !important;
  animation: none !important;
}
img.ix-sk-revele {
  animation: ix-sk-fondu 0.35s ease-out both;
}
@keyframes ix-sk-fondu {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .ix-sk::after { animation: none; background: var(--ix-sk-reflet, rgba(var(--ixc-encre-rgb,255,255,255),0.07)); }
  img.ix-sk-revele { animation: none; }
}

/* Texte simple coloré (--ixf-cs = couleur claire choisie) : assombri en thème clair pour rester lisible sur fond blanc */
:root[data-theme="light"] [style*="--ixf-cs:"] { color: color-mix(in srgb, var(--ixf-cs) 50%, #000) !important; }
