/* ══════════════════════════════════════════════════════════════
   utilities.css — étuCook
   ─────────────────────────────────────────────────────────────
   Classes utilitaires pour remplacer les styles inline.
   Chargé après tous les autres CSS.
   ══════════════════════════════════════════════════════════════ */


/* ══ 1. UTILITAIRES DE BASE ══════════════════════════════════ */

/* Espacement */
.u-m-0  { margin: 0; }
.u-mt-0 { margin-top: 0; }
.u-mt-1 { margin-top: 4px; }
.u-mt-2 { margin-top: 8px; }
.u-mt-3 { margin-top: 12px; }
.u-mt-4 { margin-top: 20px; }
.u-mt-6 { margin-top: 6px; }
.u-mb-0 { margin-bottom: 0; }
.u-mb-2 { margin-bottom: 8px; }
.u-mb-3 { margin-bottom: 12px; }
.u-mb-4 { margin-bottom: 20px; }
.u-ml-auto { margin-left: auto; }

.u-p-0 { padding: 0; }
.u-p-2 { padding: 8px; }
.u-p-3 { padding: 12px; }

/* Layout */
.u-flex          { display: flex; }
.u-flex-center   { display: flex; align-items: center; justify-content: center; }
.u-flex-between  { display: flex; align-items: center; justify-content: space-between; }
.u-flex-col      { display: flex; flex-direction: column; }
.u-flex-wrap     { flex-wrap: wrap; }
.u-items-center  { align-items: center; }
.u-gap-1         { gap: 4px; }
.u-gap-2         { gap: 8px; }
.u-gap-3         { gap: 12px; }
.u-gap-4         { gap: 16px; }

/* Texte */
.u-text-center   { text-align: center; }
.u-text-left     { text-align: left; }
.u-text-right    { text-align: right; }
.u-text-xs       { font-size: 10px; }
.u-text-sm       { font-size: 12px; }
.u-text-md       { font-size: 14px; }
.u-text-lg       { font-size: 16px; }
.u-text-muted    { color: var(--muted); }
.u-text-forest   { color: var(--forest); }
.u-text-danger   { color: var(--danger); }
.u-text-caramel  { color: var(--caramel); }
.u-font-normal   { font-weight: 400; }
.u-font-bold     { font-weight: 700; }

/* Largeur */
.u-w-full        { width: 100%; }
.u-w-auto        { width: auto; }

/* Position */
.u-relative      { position: relative; }
.u-absolute      { position: absolute; }
.u-hidden        { display: none; }
.u-block         { display: block; }
.u-inline-block  { display: inline-block; }
.u-contents      { display: contents; }

/* Overflow */
.u-overflow-auto { overflow: auto; }
.u-truncate      { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* ══ 2. CLASSES SPÉCIFIQUES REMPLAÇANT DES INLINE STYLES ══════ */

/* Boutons de recherche/reset */
.search-panel__submit { padding: 9px 18px; font-size: 13px; }
.search-panel__reset  { font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }

/* Comptes dans la sidebar */
.sidebar__count { margin-left: auto; font-size: 11px; color: var(--muted); }

/* Bouton "Calculer" IMC dans sidebar */
.sidebar__btn--imc-submit { margin-top: 6px; }

/* Notes des recettes */
.meta-tag__count { font-size: 10px; color: var(--muted); }

/* Bannière d'info dans le formulaire recette */
.form-info-banner {
  display: flex; align-items: center; gap: 8px;
  background: rgba(230,126,34,.07);
  border: 1px solid rgba(230,126,34,.2);
  border-radius: var(--r-md);
  padding: 10px 13px;
  margin-bottom: 14px;
  font-size: 12px;
  color: #e67e22;
  font-weight: 600;
}

/* Bannière succès soumission */
.submit-success-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  margin-bottom: 18px;
  background: rgba(27,74,54,.08);
  border: 1px solid rgba(27,74,54,.2);
  border-radius: var(--r-lg);
  font-size: 13px;
  font-weight: 600;
  color: var(--forest);
}

/* Input fichier caché (choix via label) */
.file-input-hidden { display: none; }

/* Zone d'actions bas du formulaire */
.form-actions { margin-top: 20px; }

/* Message d'erreur global */
.general-error {
  display: none;
  color: var(--danger);
  font-size: 12px;
  text-align: center;
  margin-top: 8px;
}
.general-error.visible { display: block; }

/* Forms inside recipe cards (no margin) */
.recipe-card__form { margin: 0; }


/* ══ 3. ÉTAT "FAVORI ACTIF" — voir accueil.css .btn-overlay--fav ══ */


/* ══ 4. CARD EN COURS DE SUPPRESSION ═════════════════════════ */

.recipe-card--removing {
  animation: cardRemove .3s ease forwards;
  pointer-events: none;
}
@keyframes cardRemove {
  0%   { opacity: 1; transform: scale(1); }
  50%  { opacity: .5; transform: scale(.95); }
  100% { opacity: 0; transform: scale(.9); }
}


/* ══ 5. STYLE PAR DÉFAUT DES ICÔNES SVG ══════════════════════ */

.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.btn .icon,
.nav-btn .icon,
.sidebar__btn .icon,
.btn-admin .icon,
.bottom-nav__item .icon { vertical-align: -3px; }


/* ══ 6. TRANSITION SKELETON → CONTENU ════════════════════════ */

.recipe-card-skeleton { transition: opacity .3s ease; }
.recipe-card-skeleton.is-leaving { opacity: 0; pointer-events: none; }


/* ══ 7. CLASSES SPÉCIFIQUES AUX PAGES ════════════════════════ */

/* moderation-row : refactor de l'ancien inline style pour le motif */
.moderation-row__motif__icon { flex-shrink: 0; }

/* Pour la page admin — badges avec icônes SVG au lieu d'emoji */
.ia-badge__icon,
.admin-tab__icon { flex-shrink: 0; }

/* Menu déroulant — arrow avec SVG */
.select-header .arrow svg { transition: transform var(--t); }
.select-container.open .arrow svg { transform: rotate(180deg); }

/* Champ hint (info dans label) */
.field__hint {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 4px;
}

/* Bloc info dans mise à jour de compte */
.auth-info-migration {
  background: rgba(27,74,54,.06);
  border: 1px solid rgba(27,74,54,.15);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin: 12px 0 20px;
  font-size: 13px;
  color: var(--forest);
}


/* ══ 8. FIX — Skip-to-content link ═══════════════════════════
   Ce lien est un standard d'accessibilité pour les utilisateurs
   au clavier. Il doit être invisible sauf quand focus.            */

.skip-to-content {
  position: absolute;
  top: -60px;
  left: 0;
  z-index: 9999;
  padding: 10px 16px;
  background: var(--forest, #1b4a36);
  color: var(--white, #fff);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  border-radius: 0 0 8px 0;
  text-decoration: none;
  transition: top .2s ease;
}
.skip-to-content:focus {
  top: 0;
  outline: 3px solid var(--caramel, #d9a97e);
}


/* ══ 9. FIX — Boutons navbar : pas de soulignement ══════════════ */

.navbar__links .nav-btn,
.navbar__links a,
.nav-btn,
a.nav-btn {
  text-decoration: none !important;
}

.navbar__logo,
a.navbar__logo {
  text-decoration: none;
}


/* ══ 10. Logo navbar — responsive + rendu net ═════════════════
   Desktop : logo complet étuCook1.png avec texte
   Mobile  : icône carrée étuCook2.png                              */

/* Container du logo — espacement du bord */
.navbar__logo {
  padding: 6px 12px !important;
  display: inline-flex !important;
  align-items: center !important;
}

.navbar__logo-full,
.navbar__logo-compact {
  width: auto !important;
  margin: 0 !important;
  object-fit: contain;
  display: block;
  /* Rendu smooth (défaut du navigateur, optimal pour les logos) */
  image-rendering: auto;
}

/* Desktop : logo complet visible */
.navbar__logo-full    { display: block; height: 52px !important; }
.navbar__logo-compact { display: none; }

/* Mobile : bascule sur l'icône carrée */
@media (max-width: 640px) {
  .navbar__logo {
    padding: 4px 10px !important;
  }
  .navbar__logo-full    { display: none; }
  .navbar__logo-compact { display: block; height: 44px !important; }
}

/* Très petit écran (iPhone SE, etc.) */
@media (max-width: 380px) {
  .navbar__logo {
    padding: 4px 8px !important;
  }
  .navbar__logo-compact { height: 40px !important; }
}


/* ══ 11. ÉTAT VIDE PARTAGÉ — icône + titre + sous-texte + CTA ══
   Patron unique repris de .frigo-empty (frigo.php), pour que
   "il n'y a rien à afficher" ait le même traitement partout.    */

.empty-card {
  display:flex; flex-direction:column; align-items:center; gap:14px;
  padding:48px 20px; text-align:center;
}
.empty-card__icon  { font-size:52px; opacity:.32; }
.empty-card__title { font-family:'Playfair Display',serif; font-size:1.25rem; font-weight:700; color:var(--ink); }
.empty-card__sub   { font-size:13px; color:var(--muted); max-width:270px; line-height:1.6; }
.empty-card__cta {
  display:inline-flex; align-items:center; gap:6px;
  padding:10px 20px; margin-top:2px;
  background:var(--forest); color:var(--white);
  border:none; border-radius:var(--r-pill);
  font-family:'DM Sans',sans-serif; font-size:13px; font-weight:700;
  cursor:pointer; text-decoration:none; white-space:nowrap;
  min-height:var(--touch);
  transition:background .2s ease, transform .15s ease;
  -webkit-tap-highlight-color:transparent;
}
.empty-card__cta:active { transform:scale(.96); }