/* ==========================================================================
   FABRIQUE D'AFFICHES — styles propres à la page (s'appuie sur style.css)
   Même coquille d'appli que l'accueil : cartes blanches arrondies, Anybody en titres,
   orange signal. La recette est une carte encre, cerclée comme BADABOUM.
   ========================================================================== */

:root { --f-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }

/* ---------- Intro ---------- */
.fab-hero__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(20px, 3vw, 40px); align-items: center; }
.fab-how { display: grid; gap: 10px; }
.fab-how li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: center; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px; }
.fab-how p { color: var(--muted); line-height: 1.35; }
.fab-how p b { display: block; color: var(--ink); font: 900 1.35rem/1 var(--f-disp); font-stretch: 78%; font-variation-settings: "wdth" 78; text-transform: uppercase; margin-bottom: 3px; }
.fab-how li.is-hot { background: var(--signal); }
.fab-how li.is-hot p, .fab-how li.is-hot p b { color: var(--on-signal); }
.fab-how li.is-hot .step__n { background: rgba(255,255,255,.22); color: var(--on-signal); }
@media (max-width: 999px) { .fab-hero__grid { grid-template-columns: 1fr; } }

/* ---------- Grille principale ---------- */
.fab__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
@media (min-width: 1240px) {
  .fab__grid { grid-template-columns: minmax(0, 1fr) minmax(390px, 440px); }
  .recipe { align-self: stretch; }
  .recipe__ring { position: sticky; top: 20px; }
  .recipe__card { max-height: calc(100vh - 44px); }
}
.fab-form { display: grid; gap: 14px; min-width: 0; }
.fab-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fab-sm { min-height: 42px; padding: 9px 16px; font-size: .88rem; border-radius: 13px; }
.fab-note { font-size: .86rem; color: var(--muted); }
.fab-quip { font-size: 1.05rem; font-weight: 600; color: var(--muted); padding: 6px 4px; }
.fab-quip::before { content: "↳ "; color: var(--signal); }

/* Cartes du brief */
.fcard { margin: 0; border: 0; min-width: 0; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: clamp(20px, 2.6vw, 28px); }
.fcard legend { float: left; width: 100%; padding: 0; display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.fcard legend + * { clear: both; }
.fcard__t { font: 900 clamp(1.7rem, 1.3rem + 1.2vw, 2.3rem)/.9 var(--f-disp); font-stretch: 72%; font-variation-settings: "wdth" 72; text-transform: uppercase; }
.flbl { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin: 16px 0 7px; }
.fcard legend + .flbl, .fcard legend + .fhint, .fcard legend + .fchips, .fcard legend + .frow { margin-top: 0; }
.fhint { font-size: .9rem; color: var(--muted); margin: 0 0 12px; max-width: 64ch; line-height: 1.45; }
.flbl + .fhint { margin-top: -2px; }
.fcard input[type=text], .fcard textarea, .fcard select {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--bg);
  border: 1.5px solid transparent; border-radius: 14px; padding: 12px 14px; transition: border-color .15s;
}
.fcard textarea { resize: vertical; min-height: 60px; line-height: 1.5; }
.fcard select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.fcard input:focus, .fcard textarea:focus, .fcard select:focus { outline: none; border-color: var(--signal); }
.fcard ::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.frow { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 12px; }

/* Pastilles (réutilisent .chip du site) */
.fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchips .chip:hover { background: color-mix(in srgb, var(--ink) 10%, var(--bg)); }
.fchips .chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.fgrp { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.fgrp:first-child { margin-top: 0; }

/* Interrupteurs segmentés */
.seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 4px; border-radius: 16px; background: var(--bg); max-width: 100%; }
.seg button { border: 0; background: transparent; cursor: pointer; padding: 9px 14px; border-radius: 12px; font-size: .88rem; font-weight: 600; color: var(--muted); transition: background-color .15s, color .15s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* Charte */
.fcols { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.fcol { display: grid; gap: 6px; }
.fcol span { font-size: .78rem; font-weight: 600; color: var(--muted); }
.fcol div { display: flex; gap: 6px; }
.fcol input[type=color] { width: 46px; height: 46px; flex: none; padding: 4px; border: 0; border-radius: 12px; background: var(--bg); cursor: pointer; }
.fcard .fcol input[type=text] { font-family: var(--f-mono); font-size: .88rem; min-width: 0; padding-inline: 10px; }
.fcheck { display: flex; gap: 10px; align-items: center; font-size: .9rem; font-weight: 600; margin-top: 14px; cursor: pointer; }
.fcheck input { width: 18px; height: 18px; margin: 0; accent-color: var(--signal); }

/* Styles */
.famtabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 16px 0 12px; padding: 2px; }
.famtabs::-webkit-scrollbar { display: none; }
.famtab { flex: none; border: 0; cursor: pointer; padding: 8px 13px; border-radius: 999px; background: var(--bg); font-size: .84rem; font-weight: 600; color: var(--muted); }
.famtab:hover { color: var(--ink); }
.famtab[aria-pressed="true"] { background: var(--signal); color: var(--on-signal); }
.styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.sty { position: relative; display: flex; flex-direction: column; text-align: left; padding: 0; cursor: pointer; overflow: hidden; border: 0; border-radius: 18px; background: var(--bg); color: var(--ink); transition: transform .15s, box-shadow .15s; }
.sty:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.sty[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--signal); }
.sw { display: flex; height: 46px; }
.sw i { flex: 1; }
.sw i:first-child { flex: 2.2; }
.sty b { display: block; padding: 10px 12px 2px; font: 900 1.2rem/.95 var(--f-disp); font-stretch: 76%; font-variation-settings: "wdth" 76; text-transform: uppercase; }
.sty small { display: block; padding: 3px 12px 12px; font-size: .78rem; line-height: 1.35; color: var(--muted); }
.sty .badge { position: absolute; top: 8px; right: 8px; font-size: .62rem; padding: 4px 8px; }

/* ---------- La recette : carte encre cerclée comme BADABOUM ---------- */
.recipe { min-width: 0; }
.recipe__ring { border-radius: calc(var(--r) + 6px); padding: 2px; background: conic-gradient(from var(--a, 0deg), var(--signal), var(--c-foi), var(--c-culture), var(--c-planete), var(--signal)); animation: rot 6s linear infinite; }
.recipe__card { background: var(--ink); color: var(--bg); border-radius: calc(var(--r) + 4px); padding: clamp(20px, 2.4vw, 28px); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.recipe__card > .badge { align-self: flex-start; }
.recipe__t { font: 900 clamp(2.4rem, 1.8rem + 1.6vw, 3.3rem)/.86 var(--f-disp); font-stretch: 64%; font-variation-settings: "wdth" 64; text-transform: uppercase; }
.recipe__t span { display: block; color: var(--signal); }
.recipe__note, .recipe__tip { font-size: .86rem; line-height: 1.45; color: color-mix(in srgb, var(--bg) 68%, transparent); }
.recipe__tip:empty { display: none; }
.recipe__lbl { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: color-mix(in srgb, var(--bg) 60%, transparent); margin-top: 2px; }
.seg--dark { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: color-mix(in srgb, var(--bg) 10%, transparent); }
.seg--dark button { color: color-mix(in srgb, var(--bg) 72%, transparent); padding-inline: 8px; line-height: 1.2; }
.seg--dark button:hover { color: var(--bg); }
.seg--dark button[aria-pressed="true"] { background: var(--signal); color: var(--on-signal); }

.twist { border-radius: 18px; padding: 12px 14px; background: color-mix(in srgb, var(--signal) 18%, transparent); box-shadow: inset 0 0 0 1.5px var(--signal); font-size: .92rem; line-height: 1.4; }
.twist > b { display: block; font: 900 .95rem/1.05 var(--f-disp); font-stretch: 95%; font-variation-settings: "wdth" 95; text-transform: uppercase; color: var(--signal); margin-bottom: 6px; }
.twist__acts { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin-top: 8px; }
.twist .fcheck { margin-top: 0; font-size: .86rem; }
.linkbtn { border: 0; background: none; padding: 0; cursor: pointer; font-size: .88rem; font-weight: 700; color: inherit; text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 2px; text-underline-offset: 3px; }

.recipe pre {
  margin: 0; flex: 1 1 auto; min-height: 220px; max-height: 520px; overflow: auto;
  background: color-mix(in srgb, var(--bg) 7%, transparent); border-radius: 14px; padding: 14px 16px;
  font: 400 .76rem/1.6 var(--f-mono); white-space: pre-wrap; overflow-wrap: anywhere; color: color-mix(in srgb, var(--bg) 92%, transparent);
}
@media (min-width: 1240px) { .recipe pre { max-height: none; min-height: 140px; } }
.recipe__acts { display: flex; flex-wrap: wrap; gap: 8px; }
.recipe__acts .btn--block { flex: 1 0 100%; }
.recipe__acts .fab-sm { flex: 1 1 0; }
.btn--line { background: transparent; color: var(--bg); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--bg) 28%, transparent); }
.btn--line:hover { box-shadow: inset 0 0 0 1.5px var(--bg); }
.recipe__toast { min-height: 1.3em; font-size: .88rem; font-weight: 700; color: var(--signal); }

/* ---------- Passerelle ---------- */
.fab-next { background: var(--card); border-radius: calc(var(--r) + 6px); box-shadow: var(--shadow); padding: clamp(24px, 4vw, 48px); display: grid; grid-template-columns: minmax(0, 1.2fr) auto; gap: 24px 48px; align-items: end; }
.fab-next .disp { font-size: clamp(2.4rem, 1.4rem + 3.4vw, 4.4rem); margin-top: 10px; }
.fab-next__p { margin-top: 14px; color: var(--muted); font-size: 1.05rem; max-width: 50ch; }
.fab-next__cta { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 820px) { .fab-next { grid-template-columns: 1fr; } }

/* ---------- Barre « copier » (mobile, au-dessus des onglets) ---------- */
.fab-mobile { display: none; }
@media (max-width: 1239px) {
  .fab-mobile {
    display: flex; position: fixed; z-index: 75; left: 0; right: 0; gap: 12px; align-items: center; justify-content: space-between;
    bottom: 0; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--glass); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px); border-top: 1px solid var(--line);
  }
  .foot { padding-bottom: 96px; }
}
@media (max-width: 999px) {
  .fab-mobile { bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px)); padding-bottom: 10px; }
}

/* Exemple affiché comme un modèle : texte gris et italique jusqu'au premier clic */
.fab-form.is-example .fcard input[type=text], .fab-form.is-example .fcard textarea { color: var(--muted); font-style: italic; }
