/* ---------- Outils (calculateurs) ---------- */
.tools-hero {
  position: relative; text-align: center;
  padding: clamp(9rem, 15vw, 11rem) 1.2rem clamp(2.8rem, 5vw, 3.8rem);
  background:
    radial-gradient(circle at 50% -20%, var(--tint), transparent 32rem),
    var(--bg);
}
.tools-hero h1 { max-width: 22ch; margin: 0 auto; }
.tools-hero h1 em { font-style: normal; color: var(--accent); }
.tools-hero > p { max-width: 52ch; margin: 1rem auto 0; color: var(--muted); font-size: 1.02rem; }
.tools-eyebrow {
  display: inline-flex; align-items: center; gap: 0.45rem; margin: 0 0 1rem;
  padding: 0.32rem 0.8rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700;
  color: var(--accent-ink); background: var(--tint);
}
.tools-by { margin: 1.1rem auto 0; font-size: 0.82rem; color: var(--muted); }

.tools-wrap { max-width: 720px; margin: 0 auto; padding: 0 1.2rem 4rem; }

/* carte du calculateur */
.calc {
  padding: clamp(1.1rem, 3vw, 1.8rem); border-radius: 22px;
  background: #fff; border: 1px solid rgba(17, 18, 24, 0.09);
  box-shadow: 0 20px 60px -34px rgba(40, 30, 10, 0.45);
}
.calc fieldset { min-width: 0; margin: 0 0 1.1rem; padding: 0; border: 0; }
.calc legend, .calc-label {
  display: block; margin-bottom: 0.4rem; font-size: 0.88rem; font-weight: 700;
}
.calc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.calc-field { margin-bottom: 0.9rem; }
.calc-field input, .calc-field select {
  width: 100%; padding: 0.7rem 0.8rem; font: inherit; font-size: 1rem; color: var(--ink);
  background: #fdfbf5; border: 1px solid rgba(17, 18, 24, 0.16); border-radius: 12px;
}
.calc-field input:focus, .calc-field select:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; background: #fff;
}
.calc-field small { display: block; margin-top: 0.3rem; font-size: 0.76rem; color: var(--muted); }
.segmented { display: grid; gap: 0.45rem; }
.segmented > * { min-width: 0; }
/* cartes de choix : icône à gauche, texte, coche discrète */
.seg-opt {
  position: relative; display: flex; align-items: center; gap: 0.7rem;
  padding: 0.62rem 2.4rem 0.62rem 0.7rem;
  font-size: 0.94rem; border: 1px solid rgba(17, 18, 24, 0.12); border-radius: 14px; cursor: pointer;
  background: #fdfbf5; transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.seg-opt:hover { background: #fff; border-color: rgba(17, 18, 24, 0.3); }
.seg-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg-opt .ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; }
.seg-opt .ic svg, .seg-opt .ic img { width: 40px; height: 40px; object-fit: contain; }
.seg-opt .txt { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.seg-opt span.t { font-weight: 650; font-size: 0.94rem; }
.seg-opt span.m { color: var(--muted); font-size: 0.8rem; line-height: 1.3; }
/* coche quand c'est choisi */
.seg-opt::after {
  content: ''; position: absolute; right: 0.75rem; top: 50%; width: 17px; height: 17px; margin-top: -9px;
  border-radius: 50%; border: 1.6px solid rgba(17, 18, 24, 0.2); background: #fff; transition: 0.15s;
}
.seg-opt:has(input:checked) { background: var(--tint); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.seg-opt:has(input:checked)::after { border-color: var(--accent); background: var(--accent) radial-gradient(circle, #fff 0 4px, transparent 4.5px); }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
/* choix courts (homme / femme) côte à côte */
.segmented.court { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.calc-go {
  width: 100%; margin-top: 0.4rem; padding: 0.85rem 1rem;
  font: inherit; font-size: 1.02rem; font-weight: 700; color: #fff;
  background: #111; border: 0; border-radius: 14px; cursor: pointer;
}
.calc-go:hover { background: #2a2a2a; }
.calc-note { margin: 0.9rem 0 0; font-size: 0.78rem; color: var(--muted); }

/* résultat */
.result { margin-top: 1.2rem; padding: 1.1rem 1.2rem; border-radius: 18px; background: var(--tint); border: 1px solid rgba(17, 18, 24, 0.07); }
.result[hidden] { display: none; }
.result-big { margin: 0; font-size: clamp(2rem, 7vw, 2.7rem); font-weight: 800; letter-spacing: -0.02em; }
.result-big span { font-size: 0.9rem; font-weight: 650; color: var(--muted); letter-spacing: 0; }
.result-label { margin: 0.2rem 0 0.9rem; font-size: 0.86rem; color: var(--muted); }
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.55rem; }
.result-cell { padding: 0.6rem 0.7rem; border-radius: 12px; background: rgba(255, 255, 255, 0.75); }
.result-cell b { display: block; font-size: 1.02rem; }
.result-cell small { font-size: 0.75rem; color: var(--muted); }
.result-err { margin: 0; font-size: 0.88rem; font-weight: 650; color: #a3402a; }
.result-geste { display: flex; align-items: center; justify-content: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid rgba(17, 18, 24, 0.09); }
.result-geste button {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.42rem 0.85rem;
  font: inherit; font-size: 0.85rem; font-weight: 650; cursor: pointer;
  color: var(--ink); background: #fff; border: 1px solid rgba(17, 18, 24, 0.16); border-radius: 999px;
}
.result-geste button:hover { border-color: var(--accent); background: var(--tint); }
.result-geste button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.result-disc { margin: 0.8rem 0 0; font-size: 0.76rem; color: var(--muted); }

/* tableau « et maintenant ? » */
.suite { margin-top: 1.1rem; }
.suite h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.suite table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.suite th, .suite td { padding: 0.45rem 0.5rem; text-align: left; border-bottom: 1px solid rgba(17, 18, 24, 0.08); }
.suite th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; }
.suite td:last-child, .suite th:last-child { text-align: right; }
.suite tbody tr:last-child td { border-bottom: 0; }

/* pub appli sous le calculateur */
.pub {
  position: relative; display: grid; grid-template-columns: 1fr 42%; align-items: end; gap: 0.6rem;
  margin: 1.1rem -0.2rem 0; padding: 1.3rem 0 0 1.3rem; overflow: hidden; border-radius: 22px;
  color: var(--ink); text-decoration: none; isolation: isolate;
  background:
    radial-gradient(260px 200px at 100% 100%, rgba(77, 154, 60, 0.28), transparent 70%),
    radial-gradient(240px 180px at 0% 0%, rgba(224, 165, 44, 0.16), transparent 70%),
    linear-gradient(160deg, #fffaf0, #f1f7ea);
  border: 1px solid rgba(77, 154, 60, 0.18);
  box-shadow: 0 18px 40px -26px rgba(40, 70, 20, 0.45);
  transition: transform 0.2s;
}
.pub:hover { transform: translateY(-2px); }
.pub-txt { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; padding-bottom: 1.3rem; min-width: 0; }
.pub-tag { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; font-weight: 750; color: var(--muted); }
.pub-tag img { width: 22px; height: 22px; border-radius: 6px; box-shadow: 0 2px 6px rgba(60, 40, 10, 0.18); }
.pub-titre .n { white-space: nowrap; color: var(--green-dark); }
.pub-titre { font-family: var(--round); font-size: 1.28rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; }
.pub-sous { font-size: 0.84rem; line-height: 1.4; color: var(--muted); }
.pub-note { font-size: 0.78rem; font-weight: 650; color: var(--muted); }
.pub-note b { color: #e0a52c; letter-spacing: 0.05em; margin-right: 0.2rem; }
.pub-lien {
  white-space: nowrap; display: inline-flex; align-items: center; gap: 0.45rem; margin-top: 0.2rem; padding: 0.65rem 1.05rem;
  font-size: 0.9rem; font-weight: 700; color: #fff; background: #111; border-radius: 999px;
}
.pub-lien svg { width: 17px; height: 17px; fill: currentColor; flex: none; }
.pub-visuel { position: relative; align-self: stretch; min-height: 210px; }
.pub-tel {
  position: absolute; left: 8%; top: 0.2rem; width: 86%; height: auto;
  border: 5px solid #1b1a17; border-bottom: 0; border-radius: 26px 26px 0 0;
  box-shadow: 0 14px 30px -12px rgba(30, 25, 10, 0.5);
  object-fit: cover; object-position: top; aspect-ratio: 393 / 560;
}
.pub-plat {
  position: absolute; left: -16%; bottom: 0.9rem; width: 46%; height: auto; aspect-ratio: 1; object-fit: cover;
  border-radius: 50%; border: 3px solid #fff; box-shadow: 0 10px 22px -8px rgba(40, 30, 10, 0.45);
}
@media (max-width: 560px) {
  .pub { grid-template-columns: 1fr; gap: 0; padding: 1.15rem 1.1rem 0; margin-left: -0.35rem; margin-right: -0.35rem; }
  .pub-txt { padding-bottom: 1rem; }
  .pub-titre { font-size: 1.18rem; }
  .pub-visuel { min-height: 0; height: 200px; margin: 0 -1.1rem; }
  .pub-tel { left: 50%; width: 58%; transform: translateX(-36%); border-width: 4px; border-radius: 22px 22px 0 0; top: 0; }
  .pub-plat { left: 3%; bottom: 0.5rem; width: 27%; }
}

/* page aliment */
.foods { display: grid; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.foods li { display: grid; grid-template-columns: 1fr auto; gap: 0.6rem; padding: 0.65rem 0.8rem; border-radius: 12px; background: #fdfbf5; border: 1px solid rgba(17, 18, 24, 0.08); font-size: 0.93rem; }
.foods b { color: var(--accent-ink); }
.tools-cloud { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0; padding: 0; list-style: none; }
.tools-cloud a {
  padding: 0.42rem 0.78rem; font-size: 0.86rem; font-weight: 600; text-decoration: none;
  border-radius: 999px; background: #fff; border: 1px solid rgba(17, 18, 24, 0.12); color: var(--ink);
}
.tools-cloud a:hover { border-color: var(--accent); background: var(--tint); }

/* contenu éditorial sous le calculateur */
.tools-text { max-width: 720px; margin: 0 auto; padding: 0 1.2rem 3rem; }
.tools-text h2 { margin: 2rem 0 0.7rem; font-size: clamp(1.35rem, 3vw, 1.75rem); }
.tools-text > p, .tools-text > ul, .tools-text > ol { color: var(--muted); }
.tools-text > p { margin: 0 0 0.9rem; }
.tools-text ul, .tools-text ol { margin: 0 0 1rem; padding-left: 1.2rem; display: grid; gap: 0.35rem; }
.tools-text h3 { margin: 1.4rem 0 0.5rem; font-size: 1.05rem; }
.tools-faq { display: grid; gap: 0.5rem; margin-bottom: 1rem; }
.tools-faq details { padding: 0.75rem 0.9rem; border-radius: 12px; background: #fff; border: 1px solid rgba(17, 18, 24, 0.09); }
.tools-faq details { transition: border-color 0.15s; }
.tools-faq details[open] { border-color: rgba(77, 154, 60, 0.35); }
.tools-faq summary { position: relative; list-style: none; padding-right: 2.2rem; font-weight: 680; cursor: pointer; }
.tools-faq summary::-webkit-details-marker { display: none; }
.tools-faq summary::after {
  content: ''; position: absolute; right: 0; top: 50%; width: 24px; height: 24px; margin-top: -12px; border-radius: 50%;
  background:
    linear-gradient(var(--accent-ink), var(--accent-ink)) center / 10px 2px no-repeat,
    linear-gradient(var(--accent-ink), var(--accent-ink)) center / 2px 10px no-repeat,
    var(--tint);
  transition: transform 0.2s;
}
.tools-faq details[open] summary::after { transform: rotate(45deg); }
.tools-faq p { margin: 0.6rem 0 0; color: var(--muted); font-size: 0.92rem; }

/* encart téléchargement */
.tools-cta {
  max-width: 720px; margin: 0 auto 3rem; padding: 1.5rem;
  border-radius: 22px; background: #111; color: #fff; text-align: center;
}
.tools-cta h2 { margin: 0 0 0.5rem; font-size: 1.35rem; }
.tools-cta p { margin: 0 0 1rem; font-size: 0.92rem; opacity: 0.8; }
.tools-cta a {
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.7rem 1.2rem;
  font-weight: 700; color: #111; background: #fff; border-radius: 13px; text-decoration: none;
}
.tools-cta a svg { width: 20px; height: 20px; fill: currentColor; }

/* menu trois traits : les outils directement, en tuiles */
.mobile-menu.open { overflow-y: auto; overscroll-behavior: contain; }
.mobile-menu { padding-top: 5.4rem; }
.mobile-menu .mm-label {
  margin: 0.6rem 0 0.2rem; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted);
}
.mm-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; margin-bottom: 0.4rem; }
.mobile-menu .mm-tools a {
  display: flex; align-items: center; gap: 0.55rem; min-height: 58px; padding: 0.5rem 0.6rem; border: 1px solid rgba(17, 18, 24, 0.07);
  border-radius: 16px; background: #fff; font-family: inherit; font-size: 0.86rem; font-weight: 650; line-height: 1.2; color: var(--ink);
}
.mobile-menu .mm-tools a:active { background: #f3f8ee; }
.mobile-menu .mm-tools .di { width: 36px; height: 36px; }

/* icône 3D d'un outil (menus) */
.di { flex: none; display: grid; place-items: center; width: 38px; height: 38px; }
.di svg { width: 100%; height: 100%; }

/* menu déroulant « Outils » (ordinateur) */
.nav-drop { position: relative; display: flex; align-items: flex-start; }
.nav-drop > button {
  display: inline-flex; align-items: center; gap: 0.28rem; padding: 0; border: 0; background: none;
  font: inherit; font-size: 0.93rem; font-weight: 600; color: var(--muted); cursor: pointer;
}
.nav-drop > button:hover, .nav-drop:focus-within > button { color: var(--ink); }
.nav-drop > button svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; transition: transform 0.2s; }
.nav-drop:focus-within > button svg, .nav-drop:hover > button svg { transform: rotate(180deg); }
/* pont invisible pour ne pas perdre le survol entre le bouton et le panneau */
.nav-drop::after { content: ''; position: absolute; left: -1rem; right: -1rem; top: 100%; height: 1.2rem; }
.nav-drop-panel {
  position: absolute; top: calc(100% + 1rem); right: -1rem; z-index: 60;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.15rem; width: 540px; padding: 0.5rem; border-radius: 18px; background: #fff;
  box-shadow: 0 22px 50px -18px rgba(50, 35, 10, 0.4); border: 1px solid rgba(17, 18, 24, 0.07);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity 0.16s, visibility 0.16s, transform 0.16s;
}
.nav-drop:hover .nav-drop-panel, .nav-drop:focus-within .nav-drop-panel { opacity: 1; visibility: visible; transform: none; }
.nav-drop-panel a {
  display: flex; align-items: center; gap: 0.65rem; padding: 0.55rem 0.6rem; border-radius: 12px;
  color: var(--ink); text-decoration: none;
}
.nav-drop-panel a b { display: block; font-size: 0.88rem; font-weight: 650; line-height: 1.25; }
.nav-drop-panel a small { display: block; font-size: 0.76rem; color: var(--muted); line-height: 1.3; }
.nav-drop-panel a:hover, .nav-drop-panel a:focus-visible { background: rgba(77, 154, 60, 0.1); }

@media (max-width: 980px) {
  .nav-drop { display: none; }
}
@media (max-width: 520px) {
  .calc-row { grid-template-columns: 1fr; }
  .seg-opt { padding: 0.55rem 2.1rem 0.55rem 0.55rem; gap: 0.55rem; }
  .seg-opt::after { right: 0.6rem; }
  .seg-opt .ic, .seg-opt .ic svg, .seg-opt .ic img { width: 36px; height: 36px; }
  .tools-cta { margin-left: 1.2rem; margin-right: 1.2rem; }
}

/* menu trois traits : accès à la rubrique Conseils */
.mobile-menu a.mm-conseils {
  display: flex; align-items: center; gap: 0.6rem; margin-top: 0.1rem; padding: 0.6rem 0.75rem; border: 1px solid rgba(77, 154, 60, 0.3);
  border-radius: 16px; background: #f3f8ee; font-family: inherit; font-size: 0.95rem; color: var(--ink);
}
.mm-conseils > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.mm-conseils b { font-weight: 750; }
.mm-conseils small { font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.mm-conseils .mm-fl { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); }
.mm-tools a:last-child:nth-child(odd) { grid-column: span 2; }
.di img { width: 100%; height: 100%; object-fit: contain; }
[hidden] { display: none !important; }
.mobile-menu a.mm-recettes { background: #fff6ea; border-color: rgba(201, 120, 60, 0.3); }
.mm-recettes .di img { border-radius: 10px; object-fit: cover; }

/* barre PC : 7 liens, on resserre sur les écrans moyens pour rester sur une ligne */
.nav-links a, .nav-drop > button { white-space: nowrap; }
@media (max-width: 1240px) {
  .nav-links { gap: 1.05rem; }
  .nav-links a, .nav-drop > button { font-size: 0.86rem; }
}
@media (max-width: 1080px) {
  .nav-links { gap: 0.8rem; }
  .nav-links a[href$="#repas"] { display: none; }
}

/* Pub : scanner animé (comme la section « Comprends ce que tu manges » de l'accueil), en boucle */
.pub-visuel.pub-scanv { position: relative; align-self: center; display: flex; align-items: center; justify-content: center; min-height: 250px; height: auto; padding: 0.6rem 0 1.6rem; }
.pb-plate {
  position: relative; width: min(80%, 215px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #fff8e8;
  box-shadow: inset 0 0 0 7px rgba(255, 255, 255, 0.6), 0 22px 40px -22px rgba(60, 40, 10, 0.55);
}
.pb-plate img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); }
.pb-line {
  position: absolute; left: 0; right: 0; height: 26%; top: -30%;
  background: linear-gradient(180deg, transparent, rgba(77, 154, 60, 0.28) 70%, rgba(77, 154, 60, 0.85) 96%, transparent);
}
.pub-scanv.on .pb-line { animation: pbScan 5s ease-in-out infinite; }
@keyframes pbScan { 0% { top: -30%; } 34% { top: 104%; } 100% { top: 104%; } }
.pb-tag, .pb-total {
  position: absolute; z-index: 2; display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap;
  padding: 0.3rem 0.55rem 0.3rem 0.35rem; border-radius: 11px; background: #fff; color: #2b2217;
  font-size: 0.72rem; font-weight: 650; line-height: 1.2; box-shadow: 0 8px 18px -10px rgba(80, 55, 15, 0.5);
  opacity: 0;
}
.pub-scanv.on .pb-tag, .pub-scanv.on .pb-total { animation: pbTag 5s ease infinite both; }
.pb-tag img { width: 18px; height: 18px; object-fit: contain; }
.pb-tag b { color: #3e7d2f; font-weight: 750; }
.pt1 { top: 6%; left: 0; animation-delay: 1.1s !important; }
.pt3 { top: 24%; right: 0; animation-delay: 1.4s !important; }
.pt2 { bottom: 34%; left: 0; animation-delay: 1.7s !important; }
.pt4 { bottom: 17%; right: 0; animation-delay: 2s !important; }
.pb-total { bottom: 2%; left: 50%; margin-left: -3.6rem; padding: 0.35rem 0.75rem; background: #111; color: #fff; font-size: 0.78rem; animation-delay: 2.4s !important; }
.pb-total b { color: #9fe07c; }
@keyframes pbTag { 0% { opacity: 0; transform: translateY(6px) scale(0.95); } 8% { opacity: 1; transform: none; } 80% { opacity: 1; transform: none; } 90%, 100% { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) {
  .pb-line, .pub-scanv.on .pb-line { animation: none; top: 104%; }
  .pb-tag, .pb-total, .pub-scanv.on .pb-tag, .pub-scanv.on .pb-total { animation: none; opacity: 1; }
}
@media (max-width: 560px) {
  .pub-visuel.pub-scanv { min-height: 260px; height: auto; margin: 0.2rem 0 0; padding-bottom: 2.2rem; }
  .pb-plate { width: 200px; }
  .pt1 { left: 2%; } .pt2 { left: 2%; } .pt3 { right: 2%; } .pt4 { right: 2%; }
}

/* pub Nutrily commune à tout le site : vert clair (déplacée depuis conseils.css pour les calculateurs) */
.pub.pub-sombre {
  margin-top: 1.8rem; color: var(--ink); border: 1.5px solid rgba(77, 154, 60, 0.45);
  background: #d9f0c9;
  box-shadow: 0 22px 44px -26px rgba(50, 110, 30, 0.55);
}
.pub-sombre .pub-tag, .pub-sombre .pub-note, .pub-sombre .pub-sous { color: #3f5a33; }
.pub-sombre .pub-titre { color: #1f2a18; font-size: 1.4rem; }
.pub-sombre .pub-lien { background: #111; color: #fff; padding: 0.75rem 1.2rem; font-size: 0.95rem; box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.45); }
.pub-sombre .pub-tel { border-color: #1b1a17; }
.pub-sombre .pub-plat { border-color: #fff; }
.tools-pub { padding-bottom: 1.5rem; }
