:root{
  --bg:#faf5f0; --terracotta:#b04a32; --blue:#2a4d69; --green:#2a9d8f; --orange:#f39c12; --yellow:#f4d03f;
}
*{box-sizing:border-box}
body{font-family:Inter,Arial,Helvetica,sans-serif;background:var(--bg);margin:0;color:#222}
.site-header{display:flex;align-items:center;justify-content:space-between;padding:12px 18px;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,0.06)}
.site-header h1{margin:0;color:var(--terracotta);font-size:1.3rem}
.admin-link img{height:100px;width:100px;object-fit:contain;border-radius:6px}
.container{max-width:1100px;margin:18px auto;padding:0 12px}
.blurb{background:#fff;padding:14px;border-radius:10px;margin-bottom:12px;box-shadow:0 3px 8px rgba(0,0,0,0.05);text-align:center;font-size:15px}
.search-row{display:flex;justify-content:center;margin-bottom:12px}
#search{width:92%;max-width:720px;padding:12px;border-radius:10px;border:1px solid #ddd;font-size:16px}
.categories{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-bottom:18px}
.cat-btn{padding:8px 14px;border-radius:20px;border:none;color:#fff;cursor:pointer;font-weight:700;letter-spacing:0.2px}
.cat-dessert{background:var(--terracotta)}
.cat-viande{background:var(--blue)}
.cat-poisson{background:var(--green)}
.cat-accompagnement{background:var(--orange)}
.cat-autre{background:var(--yellow);color:#222}
.cat-favori{background:#f8d7da;color:#222}
.cat-sauce{background:#f0c75e;color:#222}
.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;padding-bottom:30px}
.card{background:#fff;border-radius:12px;overflow:hidden;box-shadow:0 6px 18px rgba(0,0,0,0.06);position:relative;cursor:pointer;transition:transform .15s}
.card:hover{transform:translateY(-6px)}
.card img{width:100%;height:200px;object-fit:cover;display:block}
.card .content{padding:12px}
.card h3{margin:0 0 8px;color:var(--terracotta);font-size:1.1rem}
.card p{margin:0 0 10px;color:#555;font-size:0.95rem}
.badge-video{position:absolute;left:10px;top:10px;background:#2a4d69;color:#fff;padding:6px 8px;border-radius:6px;font-weight:700;font-size:12px}
.rating{display:flex;align-items:center;gap:8px;margin-top:6px;font-size:0.95rem}
.stars{color:#f5c542}
.site-footer{text-align:center;padding:20px;color:#777;margin-top:20px}
@media (max-width:800px){ .grid{grid-template-columns:repeat(1,1fr)} .card img{height:170px} .admin-link img{height:42px} }

/* Uniformiser la taille des photos de recette avec un ratio fixe */
.recipe-img {
  width: 100%;
  aspect-ratio: 4 / 3; /* largeur / hauteur = 4:3 */
  object-fit: cover;   /* remplit le cadre en rognant */
  border-radius: 8px;  /* coins arrondis optionnels */
  display: block;
}

.recipe-card {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.15s;
}
.recipe-card:hover { transform: translateY(-6px); }

@media screen and (max-width: 700px) {
  .recette-header {
    flex-direction: column;
  }
  #imageRecette {
    width: 100%;
    margin-top: 15px;
  }
}

.recette-header {
  display: flex;
  gap: 20px;                 /* espace entre description et image */
  align-items: flex-start;   /* alignement vertical en haut */
  margin-bottom: 20px;
}

/* Description à gauche */
#description {
  flex: 1;                   /* prend tout l'espace disponible */
  background: #fff3e0;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  line-height: 1.5;
}

/* Image à droite */
#imageRecette {
  width: 300px;              /* taille fixe */
  height: auto;
  border-radius: 15px;
  object-fit: cover;
}

.recipe-img-wrapper {
  position: relative;
}

.video-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 0, 0, 0.85);
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.rating {
  margin-top: 4px;
  font-size: 1rem;
  display: flex;
  gap: 2px;
}

.star {
  font-size: 1.4rem;
}

.star.full {
  color: gold;
}

.star.half {
  background: linear-gradient(90deg, gold 50%, gray 50%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.star.hover,
.star.selected {
  color: #f39c12;    /* couleur orange pour survol et sélection */
}

.star.empty {
  color: gray;
}

.votes {
  font-size: 0.85em;
  color: #666;
  margin-left: 5px;
}

#createShoppingList {
  background: var(--terracotta);
  color: white;
  font-size: 1rem;
  font-weight: bold;
  padding: 12px 22px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px; /* espace entre icône et texte */
  transition: background 0.3s, transform 0.2s;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);

}

.btn-liste-courses {
  background: var(--terracotta);
  color: white;
  font-size: 1rem;
  font-weight: bold;
  padding: 12px 22px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px; /* espace entre icône et texte */
  transition: background 0.3s, transform 0.2s;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.btn-liste-courses:hover {
  background: #943a27;
  transform: translateY(-2px);
}

.btn-liste-courses:active {
  transform: translateY(0);
}

.btn-liste-courses svg {
  width: 18px;
  height: 18px;
  fill: white;
}

.newsletter {
  text-align: center;
  background:#fff;
  padding:16px;
  border-radius:12px;
  box-shadow:0 3px 8px rgba(0,0,0,0.05);
  margin-bottom:18px;
}
.newsletter h3 {
  margin-bottom:12px;
  color:var(--blue);
}
.subscriber-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;                /* espace icône / texte */
  background: var(--terracotta); 
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 0.95rem;
  box-shadow: 0 3px 8px rgba(0,0,0,0.12);
  transition: transform 0.2s, background 0.3s;
}

.subscriber-badge:hover {
  transform: translateY(-2px);
  background: #943a27;
}

/* 🌍 Langues : drapeaux */
.lang-switcher {
  display: flex;
  gap: 8px; /* espace entre les drapeaux */
  align-items: center;
}

.lang-switcher img {
  width: 28px;       /* largeur des drapeaux */
  height: 20px;
  cursor: pointer;
  border-radius: 4px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.lang-switcher img:hover {
  transform: scale(1.2);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* 🌍 Sélecteur de langues responsive et fluide */
.lang-switcher {
  display: flex;
  flex-wrap: wrap;        /* les drapeaux passent à la ligne si besoin */
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.lang-switcher img {
  width: 36px;            /* taille par défaut */
  height: 24px;
  cursor: pointer;
  transition: transform 0.2s;
}

.lang-switcher img:hover {
  transform: scale(1.2);  /* effet zoom au survol */
}

/* 🌐 Responsive fluide */
@media screen and (max-width: 900px) {
  .lang-switcher img {
    width: 34px;
    height: 22px;
  }
}

@media screen and (max-width: 600px) {
  .site-header {
    flex-direction: column; /* titre au-dessus, drapeaux en dessous */
    align-items: center;
    gap: 10px;
  }

  .lang-switcher img {
    width: 32px;
    height: 20px;
  }
}

@media screen and (max-width: 400px) {
  .lang-switcher img {
    width: 28px;
    height: 18px;
  }
}

.goog-te-banner-frame.skiptranslate { display: none !important; }
body { top: 0 !important; }

.lang-selector {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  gap: 8px;
  z-index: 1000;
}

/* Langues : drapeaux responsive */
.lang-selector {
  position: static;       /* plus absolute pour éviter chevauchement sur mobile */
  display: flex;
  flex-wrap: wrap;        /* permet aux drapeaux de passer à la ligne */
  justify-content: center;/* centre horizontalement */
  gap: 8px;               /* espace entre les drapeaux */
  margin: 10px 0;         /* espace vertical */
  z-index: 1000;
}

.lang-selector img {
  width: 36px;            /* taille par défaut */
  height: auto;
  cursor: pointer;
  border-radius: 50%;
  transition: transform 0.2s, box-shadow 0.2s;
}

.lang-selector img:hover {
  transform: scale(1.2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Ajustement pour tablette */
@media screen and (max-width: 700px) {
  .lang-selector img {
    width: 32px;
  }
}

/* Ajustement pour mobile */
@media screen and (max-width: 480px) {
  .lang-selector img {
    width: 28px;
  }
}

.map-section {
  margin: 40px 0;
  text-align: center;
}

#world-map {
  width: 100%;
  max-width: 1000px;
  height: auto;
  margin: 0 auto;
  border: 1px solid #eee;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.map-popup {
  position: absolute;
  background: #fff8f0;
  padding: 10px 15px;
  border-radius: 8px;
  border: 1px solid #e67e22;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  z-index: 100;
}

.map-popup button {
  margin-top: 6px;
  background-color: #e67e22;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.map-popup button:hover {
  background-color: #d35400;
}

.assistant-button-container {
  text-align: center;
  margin: 20px 0;
  padding: 0 10px; /* petit padding pour mobile */
}

.assistant-button {
  display: flex;
  flex-wrap: wrap; /* permet de passer sur 2 lignes sur petit écran */
  align-items: center;
  justify-content: center;
  background-color: #e07b39;
  color: white;
  padding: 15px 20px;
  border-radius: 12px;
  font-weight: bold;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.3s ease;
  max-width: 100%;
}

.assistant-button:hover {
  background-color: #ff914d;
  transform: scale(1.03);
}

.assistant-text {
  margin-right: 10px;
  text-align: center;
  flex: 1 1 100%; /* permet de prendre toute la largeur sur petit écran */
}

.assistant-icon {
  font-size: 1.5rem;
  margin-top: 10px;
}

.big-textarea {
  width: 100%;
  min-height: 100px;
  padding: 10px;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid #ccc;
  resize: vertical;
}

/* Effet "Hugo cuisine en live" */
.live-cooking {
  display: flex;
  align-items: center;
  gap: 8px;
  font-style: italic;
  opacity: 0.9;
}

.live-cooking .dots span {
  animation: blink 1.4s infinite both;
  font-size: 20px;
}

.live-cooking .dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.live-cooking .dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0%, 80%, 100% { opacity: 0; }
  40% { opacity: 1; }
}

.recette-note {
  display: flex;
  margin-top: auto;
}
.recette-note .star {
  width: 20px;
  height: 20px;
  display: inline-block;
  background: url('assets/star-empty.svg') no-repeat center/contain;
  margin-right: 2px;
}
.recette-note .star.full {
  background: url('assets/star-full.svg') no-repeat center/contain;
}
.recette-note .star.half {
  background: url('assets/star-half.svg') no-repeat center/contain;
}
#recettePhoto {
  max-width: 200px;       /* largeur max */
  max-height: 200px;      /* hauteur max */
  width: auto;            /* garde les proportions */
  height: auto;
  display: block;         /* pour que margin auto fonctionne */
  margin: 0 auto 8px;     /* centrer horizontalement + espacement en bas */
  border-radius: 12px;    /* coins arrondis */
  object-fit: cover;      /* recadrage si besoin */
}

.newsletter-container {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  flex-wrap: wrap; /* permet aux colonnes de passer en dessous si besoin */
  margin: 20px 0;
}

.newsletter-column {
  flex: 1 1 300px;
  padding: 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-sizing: border-box;
  background-color: #fff;
}

.newsletter-column h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.newsletter-column input {
  width: 100%;
  padding: 8px;
  margin-bottom: 8px;
  border-radius: 5px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

.newsletter-column button {
  width: 100%;
  padding: 10px;
  border-radius: 5px;
  border: none;
  background-color: #f06d06;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
}

.newsletter-column button:hover {
  background-color: #d85a00;
}

.newsletter-column p {
  margin-top: 6px;
  font-size: 0.9rem;
}

/* -------- Responsive Smartphone -------- */
@media (max-width: 768px) {
  .newsletter-container {
    flex-direction: column;
    gap: 15px;
  }

  .newsletter-column {
    width: 100%;
    padding: 12px;
  }

  .newsletter-column h3 {
    font-size: 1rem;
  }

  .newsletter-column input, 
  .newsletter-column button {
    font-size: 0.95rem;
  }
}

.heart {
  display: inline-block;
  width: 24px;   /* largeur du cœur */
  height: 24px;  /* hauteur du cœur */
  margin-left: 8px;
  cursor: pointer;
  user-select: none;
  vertical-align: middle;
}

/* Cœur gris par défaut */
.heart::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ccc'>\
<path d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 6 4 4 6.5 4 \
c1.74 0 3.41 1 4.13 2.5h2.74C14.09 5 15.76 4 17.5 4 \
C20 4 22 6 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/>\
</svg>") no-repeat center/contain;
}

/* Cœur rouge si favori */
.heart.favori::before {
  background: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='red'>\
<path d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 6 4 4 6.5 4 \
c1.74 0 3.41 1 4.13 2.5h2.74C14.09 5 15.76 4 17.5 4 \
C20 4 22 6 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/>\
</svg>") no-repeat center/contain;
}

/* Animation du cœur */
@keyframes pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.heart.animate {
  animation: pop 0.2s ease;
}

.preparation-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-top: 25px;
  margin-bottom: 12px;
  gap: 10px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

.preparation-header.show {
  opacity: 1;
  transform: translateY(0);
}

.preparation-header h2 {
  margin: 0;
  font-size: 1.8em;
}

.preparation-header a.button {
  font-size: 0.85em;
  padding: 6px 12px;
  white-space: nowrap;
}

/* Media queries pour petits écrans */
@media screen and (max-width: 500px) {
  .preparation-header h2 {
    font-size: 1.5em;
    flex: 1 1 100%;
  }
  .preparation-header a.button {
    font-size: 0.8em;
    flex: 1 1 100%;
    text-align: center;
  }
}

.photo {
  width: 50%;
  max-width: 200px;
  display: block;
  margin: 0 auto 20px;
  border-radius: 15px;
  transition: transform 0.5s ease;
}
.photo:hover { transform: scale(1.03); }

/* miniature photo recette */
#photo {
  width: 50%;
  max-width: 200px;
  display: block;
  margin: 0 auto 20px auto;
  border-radius: 15px;
}
.dark body {
  background: #1e1e1e;
  color: #f5f5f5;
}

.dark .container {
  background: #2c2c2c;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.dark h1, .dark h2, .dark h3 {
  color: #f39c12;
}

.dark p, .dark .section-description {
  color: #ddd;
}

.dark .btn {
  background: #f39c12;
  color: #111;
}

.dark .btn:hover {
  background: #e67e22;
}

.dark .home-link {
  color: #f39c12;
}

/* ====== Pagination ====== */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 20px 0;
}

.pagination button {
  padding: 6px 12px;
  border: 1px solid #e07a5f;
  border-radius: 6px;
  background-color: #fff;
  color: #e07a5f;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.pagination button:hover {
  background-color: #e07a5f;
  color: #fff;
}

.pagination button.active {
  background-color: #e07a5f;
  color: #fff;
  font-weight: 700;
}

/* ====== Select "Recettes par page" ====== */
#perPage {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #e07a5f;
  background-color: #fff;
  color: #333;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

#perPage:hover {
  border-color: #d45c3b;
}

#pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 15px 0;
  font-weight: 500;
  color: #333;
}

/* Animation fade-in + slide pour les cartes */
.recipe-card {
  opacity: 0;
  transform: translateY(30px) scale(0.95); /* effet plus prononcé */
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.recipe-card.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
