/* ═══════════════════════════ Le ciel de la famille ═══════════════════════════
 *
 * Servie **seulement** sur sa fiche (`views/product-affiche.liquid`).
 *
 * ── Une feuille blanche, en paysage, de deux à six ronds de ciel ──
 *
 * La feuille est **toujours blanche** ; la teinte (le choix `Style`) est celle des ronds, dessinés sur des canevas par
 * l'éditeur (`public/js/affiche-cielfamille.js`, qui porte les couleurs des ciels — des couleurs de produit, écrites une
 * seule fois). Cette feuille ne dit que la mise en page : le papier, l'encre, et la place des ronds selon leur nombre.
 *
 * Tout est mesuré en `cqw` — la largeur de l'affiche —, pour qu'un A4 et un 70 × 100 soient la même affiche à deux
 * échelles. Les ronds ont deux largeurs : celle de la **case** (`--cf-l`, ce que prennent le rond et ses deux lignes) et
 * celle du **rond** (`--cf-c`). De deux à quatre personnes, une ligne ; cinq en trois et deux, six en trois et trois : la
 * case de cinq et six (22) laisse la place d'un prénom de quatorze signes, et trois cases (66 + les écarts) tiennent dans la
 * feuille quand une quatrième n'y tient pas.
 *
 * L'éditeur resserre le texte (`--cf-ech`, de 1 à 0,6) puis les ronds (`--cf-rond`, de 1 à 0,7) quand l'affiche déborde, et
 * pose `data-deborde` au plancher : la fabrication refuse plutôt que de couper.
 *
 * ── Les palettes ──
 *
 * **Ce sont des couleurs de produit, pas de charte** (point 6 quater) : en clair, toutes ici, en tête, et nulle part
 * ailleurs.
 */
.cf {
  --cf-papier: #fff; --cf-encre: #15181f; --cf-retrait: #565d6b; --cf-vide-trait: #9aa1ad;
  --cf-l: 22cqw; --cf-c: 21cqw; --cf-ech: 1; --cf-rond: 1;
  position: relative; overflow: hidden; box-sizing: border-box;
  display: flex; flex-direction: column;
  aspect-ratio: 7 / 5;
  background: var(--cf-papier); color: var(--cf-encre);
  font-family: "Cormorant Garamond", Georgia, serif;
}
.cf [hidden] { display: none !important; }
.cf p, .cf li { margin: 0; padding: 0; }

/* La largeur des cases selon le nombre de personnes (le serveur écrit `data-n`, l'éditeur le tient à jour). */
.cf[data-n="2"] { --cf-l: 40cqw; --cf-c: 36cqw; }
.cf[data-n="3"] { --cf-l: 29cqw; --cf-c: 27cqw; }
.cf[data-n="4"] { --cf-l: 21cqw; --cf-c: 20cqw; }
.cf[data-n="5"], .cf[data-n="6"] { --cf-l: 22.5cqw; --cf-c: 16.5cqw; }

.cf__ciels {
  list-style: none; flex: 1 1 0; min-height: 0;
  /* Les marges de la feuille sont sur les enfants : `cqw` ne se mesure sur `.cf` lui-même que contre son parent. */
  margin: 4.6cqw 4cqw 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; align-content: center; align-items: flex-start;
  gap: 2.2cqw 1.6cqw;
}
.cf__item { display: flex; flex-direction: column; align-items: center; width: var(--cf-l); text-align: center; }
.cf__ciel { display: block; width: calc(var(--cf-c) * var(--cf-rond)); height: calc(var(--cf-c) * var(--cf-rond)); }
.cf__prenom {
  width: 100%; margin-top: .9cqw; white-space: nowrap; overflow: hidden; text-overflow: clip;
  font-size: calc(2.9cqw * var(--cf-ech)); font-weight: 600; line-height: 1.15; letter-spacing: .01em;
}
.cf__date {
  width: 100%; margin-top: .3cqw; min-height: 1.2em;
  font-family: Inter, system-ui, sans-serif; font-size: calc(1.45cqw * var(--cf-ech)); line-height: 1.3;
  letter-spacing: .1em; text-transform: uppercase; text-wrap: balance; overflow-wrap: anywhere; color: var(--cf-retrait);
  font-variant-numeric: lining-nums;
}
.cf[data-n="5"] .cf__prenom, .cf[data-n="6"] .cf__prenom { font-size: calc(2.3cqw * var(--cf-ech)); }
.cf[data-n="5"] .cf__date, .cf[data-n="6"] .cf__date { font-size: calc(1.2cqw * var(--cf-ech)); letter-spacing: .06em; }
.cf[data-n="2"] .cf__prenom { font-size: calc(3.4cqw * var(--cf-ech)); }

.cf__pied { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 1cqw; margin: 2.2cqw 4cqw 3.4cqw; text-align: center; }
.cf__titre {
  width: 100%; white-space: nowrap; overflow: hidden;
  font-size: calc(5.4cqw * var(--cf-ech)); font-weight: 600; font-style: italic; line-height: 1.15;
}
.cf__phrase {
  width: 100%; font-family: Inter, system-ui, sans-serif; font-size: calc(1.7cqw * var(--cf-ech)); line-height: 1.35;
  letter-spacing: .06em; text-wrap: balance; color: var(--cf-retrait);
}

/* Les exemples ne s'impriment jamais : estompés à l'écran, la fabrication les masque. */
.cf .affiche-exemple { opacity: .45; }
.cf__item--vide .cf__prenom, .cf__item--vide .cf__date { visibility: hidden; }

/* ── Le formulaire ── */
.cf-styles input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.cf-styles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.cf-styles label {
  display: flex; flex-direction: column; align-items: center; gap: .5rem; cursor: pointer; margin: 0;
  font-size: 1.4rem; font-weight: 600; text-align: center; line-height: 1.25;
  border: .15rem solid rgba(var(--color-foreground), .15); border-radius: .8rem; padding: .8rem .6rem; min-height: 4.4rem;
}
.cf-styles input:checked + label { border-color: rgb(var(--color-foreground)); }
.cf-styles input:focus-visible + label { outline: .2rem solid rgb(var(--bleu-focus)); outline-offset: .2rem; }
.cf-pastille { display: inline-flex; }
.cf-pastille i { display: block; width: 1.8rem; height: 1.8rem; border-radius: 50%; margin-left: -.5rem; border: .15rem solid rgb(var(--color-background)); background: rgba(var(--color-foreground), .3); }
.cf-pastille i:first-child { margin-left: 0; }
@media (min-width: 750px) { .cf-styles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.cf-nombres { display: flex; flex-wrap: wrap; gap: .8rem; }
.cf-nombres button {
  min-width: 4.4rem; min-height: 4.4rem; padding: 0 1.2rem; font: inherit; font-weight: 700; font-size: 1.6rem; cursor: pointer;
  border: .15rem solid rgba(var(--color-foreground), .15); border-radius: .8rem; background: transparent; color: inherit;
}
.cf-nombres button[aria-pressed="true"] { border-color: rgb(var(--color-foreground)); background: rgba(var(--color-foreground), .06); }
.cf-nombres button:focus-visible { outline: .2rem solid rgb(var(--bleu-focus)); outline-offset: .2rem; }
.cf-nombre[hidden] { display: none; }

.cf-membres { list-style: none; margin: 0 0 1.2rem; padding: 0; display: grid; gap: 1.2rem; }
.cf-membre[hidden] { display: none; }
.cf-membre fieldset { margin: 0; min-width: 0; padding: 1.2rem; border: .1rem solid rgba(var(--color-foreground), .15); border-radius: 1rem; display: grid; gap: .9rem; }
.cf-membre legend { display: flex; align-items: center; gap: .8rem; padding: 0 .4rem; font-weight: 700; font-size: 1.5rem; }
.cf-membre__rang {
  display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  background: rgb(var(--color-foreground)); color: rgb(var(--color-background)); font-size: 1.3rem;
}
.cf-membre__quand { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.cf-membre__quand .affiche__champ, .cf-membre fieldset > .affiche__champ { margin: 0; }
.cf-membre__recherche { display: flex; gap: .6rem; }
.cf-membre__recherche input { flex: 1; min-width: 0; }
.cf-chercher, .cf-meme {
  min-height: 4.4rem; padding: 0 1.2rem; font: inherit; font-size: 1.4rem; font-weight: 600; cursor: pointer;
  border: .15rem solid rgba(var(--color-foreground), .3); border-radius: .8rem; background: transparent; color: inherit;
}
.cf-meme { margin-top: .6rem; font-weight: 400; }
.cf-chercher[hidden], .cf-meme[hidden] { display: none; }
.cf-membre__retour { min-height: 1.4em; margin: .4rem 0 0; font-size: 1.3rem; color: rgba(var(--color-foreground), .75); }
.cf-ouinon { display: flex; gap: .8rem; }
.cf-ouinon input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.cf-ouinon label {
  display: inline-flex; align-items: center; justify-content: center; min-width: 6rem; min-height: 4.4rem; padding: 0 1.4rem; margin: 0; cursor: pointer;
  border: .15rem solid rgba(var(--color-foreground), .15); border-radius: .8rem; font-size: 1.5rem; font-weight: 600;
}
.cf-ouinon input:checked + label { border-color: rgb(var(--color-foreground)); }
.cf-ouinon input:focus-visible + label { outline: .2rem solid rgb(var(--bleu-focus)); outline-offset: .2rem; }

/* Cartes de la grille de fiche : les champs de la saisie, à 16 px (sous ce seuil Safari zoome au focus). */
.cf-membre input { font-size: max(1.6rem, 16px); }
