/* L'Imprimerie — identité de la plateforme : une imprimerie de cartes.
   Papier crème, encre noire, traits nets de 2 px, ombres dures sans flou, quadrichromie (cyan, magenta, jaune, noir),
   repères de coupe et de repérage. Aucun halo, aucun dégradé décoratif, aucun flou. */

@font-face { font-family: 'Big Shoulders'; src: url('/fonts/big-shoulders.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/fonts/barlow-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/fonts/barlow-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/fonts/barlow-700.woff2') format('woff2'); font-weight: 700 800; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('/fonts/barlow-condensed-600.woff2') format('woff2'); font-weight: 400 600; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('/fonts/barlow-condensed-800.woff2') format('woff2'); font-weight: 700 900; font-display: swap; }
@font-face { font-family: 'Baloo 2'; src: url('/fonts/baloo2-700.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Baloo 2'; src: url('/fonts/baloo2-800.woff2') format('woff2'); font-weight: 800 900; font-display: swap; }
@font-face { font-family: 'Luckiest Guy'; src: url('/fonts/luckiest-guy.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('/fonts/figtree.woff2') format('woff2'); font-weight: 300 900; font-display: swap; }

:root {
  --papier: #f2ede2;
  --papier-2: #e8e1d2;
  --papier-3: #fbf8f1;
  --encre: #151515;
  --encre-2: #3b3934;
  --gris: #77736a;
  --cyan: #009fe3;
  --magenta: #e4007c;
  --jaune: #ffd500;
  --vert-ok: #2f7d32;
  --rouge: #c8102e;
  --trait: 2px solid var(--encre);
  --ombre: 0 4px 0 var(--encre);
  --ombre-s: 0 2px 0 var(--encre);
  --rayon: 10px;
  --f-titre: 'Big Shoulders', 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --f-texte: 'Barlow', 'Segoe UI', sans-serif;
  --f-etiq: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --gouttiere: clamp(14px, 3vw, 28px);
  --haut-barre: 64px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--papier);
  color: var(--encre);
  font: 400 16px/1.45 var(--f-texte);
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  /* Grain du papier : une trame de points très légère, sans flou. */
  background-image: radial-gradient(rgba(21, 21, 21, 0.055) 0.7px, transparent 0.8px);
  background-size: 5px 5px;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.ico { display: inline-block; vertical-align: -0.14em; flex: none; }
.cache { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ─── Boutons « cube » : pastilles à trait net et ombre dure ─────────────── */
.btn {
  --fond: var(--papier-3); --txt: var(--encre);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 18px;
  background: var(--fond); color: var(--txt);
  border: var(--trait); border-radius: 999px; box-shadow: var(--ombre);
  font: 800 15px/1 var(--f-etiq); letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none;
  cursor: pointer; user-select: none; white-space: nowrap;
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--encre); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--encre); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: var(--ombre-s); }
.btn.magenta { --fond: var(--magenta); --txt: #fff; }
.btn.cyan { --fond: var(--cyan); --txt: #fff; }
.btn.jaune { --fond: var(--jaune); }
.btn.noir { --fond: var(--encre); --txt: var(--papier-3); }
.btn.rouge { --fond: var(--rouge); --txt: #fff; }
.btn.petit { min-height: 34px; padding: 5px 12px; font-size: 13px; box-shadow: var(--ombre-s); }
.btn.petit:active { transform: translateY(2px); box-shadow: none; }
.btn.carre { border-radius: 8px; }
.btn.icone { padding: 0; width: 44px; }
.btn.petit.icone { width: 34px; }
.btn.plat { box-shadow: none; background: transparent; border-color: transparent; }
.btn.plat:hover { background: var(--papier-2); transform: none; }

/* ─── Champs ───────────────────────────────────────────────────────────── */
.champ { display: grid; gap: 4px; }
.champ > span, .etiq { font: 700 12.5px/1.1 var(--f-etiq); letter-spacing: 0.08em; text-transform: uppercase; color: var(--encre-2); }
.entree, select.entree, textarea.entree {
  width: 100%; min-height: 42px; padding: 8px 12px;
  background: var(--papier-3); border: var(--trait); border-radius: 8px;
}
textarea.entree { min-height: 90px; resize: vertical; line-height: 1.4; }
.entree:focus { outline: none; box-shadow: 0 0 0 3px var(--cyan); }
.case { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.case input { width: 20px; height: 20px; accent-color: var(--magenta); }
input[type='range'] { accent-color: var(--magenta); width: 100%; }
input[type='color'] { width: 44px; height: 36px; padding: 2px; border: var(--trait); border-radius: 8px; background: var(--papier-3); cursor: pointer; }

/* ─── Panneaux, pastilles, tampons ─────────────────────────────────────── */
.panneau { background: var(--papier-3); border: var(--trait); border-radius: var(--rayon); box-shadow: var(--ombre); }
.pastille { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border: 1.5px solid var(--encre); border-radius: 999px; font: 700 12px/1.2 var(--f-etiq); letter-spacing: 0.05em; text-transform: uppercase; background: var(--papier-3); white-space: nowrap; }
.tampon {
  display: inline-block; padding: 2px 8px; border: 2px solid currentColor; border-radius: 4px;
  font: 900 12px/1.2 var(--f-etiq); letter-spacing: 0.12em; text-transform: uppercase; transform: rotate(-4deg);
}
.tampon.publie { color: var(--vert-ok); }
.tampon.brouillon { color: var(--gris); }
.tampon.prive { color: var(--magenta); }
.tampon.desactive { color: var(--rouge); }
.tampon.non_repertorie { color: var(--cyan); }

/* Repères de coupe aux quatre coins (sur les vignettes et les panneaux d'atelier). */
.coupe { position: relative; }
.coupe::before, .coupe::after {
  content: ''; position: absolute; width: 14px; height: 14px; pointer-events: none;
  border-color: var(--encre); border-style: solid; opacity: 0.55;
}
.coupe::before { top: -9px; left: -9px; border-width: 0 1.5px 1.5px 0; }
.coupe::after { bottom: -9px; right: -9px; border-width: 1.5px 0 0 1.5px; }

/* Bande de contrôle des couleurs (quadrichromie), signature de la plateforme. */
.bande-cmjn { display: flex; height: 6px; }
.bande-cmjn i { flex: 1; }
.bande-cmjn i:nth-child(1) { background: var(--cyan); }
.bande-cmjn i:nth-child(2) { background: var(--magenta); }
.bande-cmjn i:nth-child(3) { background: var(--jaune); }
.bande-cmjn i:nth-child(4) { background: var(--encre); }

/* ─── Barre du haut ────────────────────────────────────────────────────── */
.barre {
  position: sticky; top: 0; z-index: 50;
  background: var(--papier); border-bottom: var(--trait);
}
.barre-in { display: flex; align-items: center; gap: 14px; height: var(--haut-barre); padding: 0 var(--gouttiere); max-width: 1440px; margin: 0 auto; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.logo svg { width: 38px; height: 38px; }
.logo b { font: 900 25px/0.9 var(--f-titre); letter-spacing: 0.01em; text-transform: uppercase; }
.logo small { display: block; font: 700 10.5px/1 var(--f-etiq); letter-spacing: 0.18em; text-transform: uppercase; color: var(--gris); }
.nav { display: flex; gap: 4px; margin-left: 10px; }
.nav a { padding: 8px 12px; border-radius: 999px; text-decoration: none; font: 800 14px/1 var(--f-etiq); letter-spacing: 0.06em; text-transform: uppercase; border: 2px solid transparent; }
.nav a:hover { border-color: var(--encre); }
.nav a.actif { background: var(--encre); color: var(--papier-3); }
.barre .espace { flex: 1; }
.cloche { position: relative; }
.cloche .compte { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--magenta); color: #fff; border: 2px solid var(--encre); font: 800 11px/16px var(--f-etiq); text-align: center; }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: var(--trait); background: var(--c, var(--magenta)); display: grid; place-items: center; overflow: hidden; color: #fff; font: 900 16px/1 var(--f-titre); text-transform: uppercase; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.grand { width: 96px; height: 96px; font-size: 44px; border-width: 3px; }
.avatar.petit { width: 26px; height: 26px; font-size: 12px; border-width: 1.5px; }
.menu-moi { position: relative; }
.menu-deroulant { position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px; padding: 8px; display: grid; gap: 2px; z-index: 60; }
.menu-deroulant a, .menu-deroulant button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; text-decoration: none; background: none; border: none; text-align: left; cursor: pointer; font-weight: 600; }
.menu-deroulant a:hover, .menu-deroulant button:hover { background: var(--papier-2); }
.burger { display: none; }

/* Barre du bas sur téléphone. */
.nav-mobile { display: none; }
@media (max-width: 860px) {
  .nav, .barre .btn-creer-texte { display: none; }
  .nav-mobile {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--papier); border-top: var(--trait); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .nav-mobile a { display: grid; justify-items: center; gap: 2px; padding: 4px; text-decoration: none; font: 700 11px/1 var(--f-etiq); letter-spacing: 0.04em; text-transform: uppercase; border-radius: 10px; }
  .nav-mobile a .ico { width: 24px; height: 24px; }
  .nav-mobile a.actif { background: var(--encre); color: var(--papier-3); }
  .nav-mobile a.creer { background: var(--magenta); color: #fff; border: var(--trait); box-shadow: var(--ombre-s); }
  body { padding-bottom: 78px; }
}

/* ─── Mise en page ─────────────────────────────────────────────────────── */
.page { max-width: 1440px; margin: 0 auto; padding: 24px var(--gouttiere) 64px; }
.titre-page { font: 900 clamp(34px, 6vw, 64px)/0.92 var(--f-titre); text-transform: uppercase; margin: 8px 0 18px; letter-spacing: 0.005em; }
.sous-titre { font: 800 clamp(22px, 3vw, 30px)/1 var(--f-titre); text-transform: uppercase; margin: 0; }
.chapo { color: var(--encre-2); max-width: 62ch; margin: 0 0 18px; font-size: 17px; }
.ligne { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .grille-2 { grid-template-columns: 1fr; } }
.vide { padding: 28px; text-align: center; color: var(--gris); border: 2px dashed var(--gris); border-radius: var(--rayon); }

/* ─── Fenêtres, notifications ──────────────────────────────────────────── */
.voile { position: fixed; inset: 0; z-index: 100; background: rgba(21, 21, 21, 0.55); display: grid; place-items: center; padding: 16px; animation: apparait 0.15s ease-out; }
.fenetre { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 22px; animation: monte 0.2s cubic-bezier(0.2, 1.3, 0.4, 1); }
.fenetre.large { width: min(920px, 100%); }
.fenetre h2 { margin: 0 0 12px; font: 900 30px/1 var(--f-titre); text-transform: uppercase; }
.fenetre .actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
@keyframes apparait { from { opacity: 0; } }
@keyframes monte { from { transform: translateY(14px) scale(0.98); opacity: 0; } }
.toasts { position: fixed; z-index: 200; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100% - 24px)); pointer-events: none; }
@media (max-width: 860px) { .toasts { bottom: 92px; } }
.toast { pointer-events: auto; padding: 12px 16px; display: flex; gap: 10px; align-items: center; font-weight: 600; animation: monte 0.2s ease-out; }
.toast.erreur { background: #fff1f1; border-color: var(--rouge); box-shadow: 0 4px 0 var(--rouge); }
.toast.ok .ico { color: var(--vert-ok); }
.toast.erreur .ico { color: var(--rouge); }

.chargement { display: grid; place-items: center; min-height: 40vh; }
.chargement .rond { width: 46px; height: 46px; border: 4px solid var(--encre); border-right-color: var(--magenta); border-radius: 50%; animation: tourne 0.8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

/* Mode photosensible (et préférence « moins d'animations ») : tout ce qui bouge ou scintille s'arrête. */
body.photosensible *, body.photosensible *::before, body.photosensible *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; } }
