/* ================================================================
   NSG — Design system des outils et calculateurs (.nsi-*)
   Fichier du thème enfant : generatepress-child/nsi-outils.css

   Extrait du <style> de page-outil.php le 20/09/2026, pour pouvoir être
   chargé à la demande : le shortcode [calculateur] affiche un calculateur
   dans un guide ou un comparatif, où ce CSS n'existait pas.

   Chargé par le snippet « NSG — Shortcode calculateur », sur les pages
   d'outils ET sur toute page contenant le shortcode. Pas ailleurs : 11 ko
   imposés à tout le site pour 18 pages seraient un gâchis.
   ================================================================ */

/* ============================================================
   DESIGN SYSTEM OUTILS / CALCULATEURS — Nutrition & Santé (.nsi-*)
   ============================================================ */
.nsi { max-width: 1040px; margin: 0 auto; padding: 1.25rem 1.5rem 3rem; font-family: 'Roboto', sans-serif; color: #1a1a1a; }
.nsi h1, .nsi h2, .nsi h3 { font-family: 'Cormorant Garamond', Georgia, serif; }

/* Fil d'ariane */
.nsi-bread { font-size: 14px; color: #666; padding: 10px 0 18px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.nsi-bread a { color: #3B6D11; text-decoration: none; }
.nsi-bread a:hover { text-decoration: underline; }
.nsi-bread .sep { color: #bbb; font-size: 18px; line-height: 1; display: inline-flex; align-items: center; padding: 0 2px; }
.nsi-bread .current { color: #1a1a1a; font-weight: 600; }

/* Hero */
.nsi-hero { text-align: center; padding: 0.5rem 0 2rem; border-bottom: 1px solid #eee; margin-bottom: 2rem; }
.nsi-hero h1 { font-size: 48px; font-weight: 600; line-height: 1.05; margin: 0 0 14px; letter-spacing: -0.015em; }
.nsi-hero p { font-size: 17px; color: #555; max-width: 680px; margin: 0 auto; line-height: 1.55; }

/* Layout : formulaire + résultat */
.nsi-app { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.nsi-card { background: white; border: 1px solid #ececec; border-radius: 20px; padding: 1.75rem; }
.nsi-card h2 { font-size: 24px; font-weight: 600; margin: 0 0 1.25rem; }

/* Champs */
.nsi-field { margin-bottom: 1.25rem; }
.nsi-label { display: block; font-size: 14px; font-weight: 500; color: #333; margin-bottom: 8px; }
.nsi-input { width: 100%; border: 1px solid #ddd; border-radius: 12px; padding: 13px 15px; font-size: 16px; font-family: 'Roboto', sans-serif; outline: 0; transition: border-color 0.2s; box-sizing: border-box; }
.nsi-input:focus { border-color: #3B6D11; box-shadow: 0 0 0 3px rgba(59,109,17,0.1); }
.nsi-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.nsi-unit-hint { font-size: 12.5px; color: #999; margin-top: 6px; }

/* Select stylé */
.nsi-select { width: 100%; border: 1px solid #ddd; border-radius: 12px; padding: 13px 15px; font-size: 15px; font-family: 'Roboto', sans-serif; outline: 0; background: white; cursor: pointer; box-sizing: border-box; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 42px; }
.nsi-select:focus { border-color: #3B6D11; }

/* Sexe : 2 boutons toggle */
.nsi-sex { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nsi-sex button { border: 1px solid #ddd; background: white; border-radius: 12px; padding: 13px; font-size: 15px; font-family: 'Roboto', sans-serif; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.18s; color: #555; }
.nsi-sex button i { font-size: 19px; }
.nsi-sex button.active { border-color: #3B6D11; background: #eef6e3; color: #2C520C; }

/* Objectif : cartes radio */
.nsi-goals { display: flex; flex-direction: column; gap: 10px; }
.nsi-goal { display: flex; align-items: center; gap: 13px; border: 1px solid #ddd; border-radius: 12px; padding: 13px 15px; cursor: pointer; transition: all 0.18s; }
.nsi-goal:hover { border-color: #bbb; }
.nsi-goal.active { border-color: #3B6D11; background: #eef6e3; }
.nsi-goal__icon { width: 40px; height: 40px; border-radius: 11px; background: #f0ede4; color: #666; display: flex; align-items: center; justify-content: center; font-size: 21px; flex-shrink: 0; }
.nsi-goal.active .nsi-goal__icon { background: #3B6D11; color: white; }
.nsi-goal__txt { flex: 1; }
.nsi-goal__title { font-size: 15px; font-weight: 600; line-height: 1.2; }
.nsi-goal__desc { font-size: 12.5px; color: #777; margin-top: 1px; }

/* Résultat */
.nsi-result { background: linear-gradient(160deg, #f3f8ec 0%, #e9f3dd 100%); border: 1px solid #d8e8c4; border-radius: 20px; padding: 1.75rem; position: sticky; top: 1.5rem; }
.nsi-result h2 { font-size: 24px; font-weight: 600; margin: 0 0 1.25rem; }
.nsi-result__main { text-align: center; padding: 1.5rem 1rem; background: white; border-radius: 16px; margin-bottom: 1.25rem; }
.nsi-result__val { font-family: 'Cormorant Garamond', serif; font-size: 72px; font-weight: 600; line-height: 1; color: #3B6D11; transition: color 0.3s; }
.nsi-result__kcal { font-family: 'Cormorant Garamond', serif; font-size: 64px; font-weight: 600; line-height: 1; color: #3B6D11; }
.nsi-result__kcal small { font-size: 22px; color: #888; font-weight: 500; }
.nsi-result__label { font-size: 14px; color: #555; margin-top: 8px; }
.nsi-result__cat { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 15px; font-weight: 600; padding: 7px 16px; border-radius: 100px; transition: all 0.3s; }

/* Jauge colorée */
.nsi-gauge { margin-bottom: 1.25rem; }
.nsi-gauge__track { display: flex; height: 14px; border-radius: 100px; overflow: hidden; }
.nsi-gauge__seg { height: 100%; }
.nsi-gauge__seg--under { background: #4DABF7; }
.nsi-gauge__seg--normal { background: #51CF66; }
.nsi-gauge__seg--over { background: #FFD43B; }
.nsi-gauge__seg--obese1 { background: #FF922B; }
.nsi-gauge__seg--obese2 { background: #FA5252; }
.nsi-gauge__cursor { position: relative; height: 0; }
.nsi-gauge__pin { position: absolute; top: 4px; transform: translateX(-50%); transition: left 0.4s cubic-bezier(0.34,1.2,0.64,1); }
.nsi-gauge__pin i { font-size: 22px; color: #1a1a1a; }
.nsi-gauge__scale { display: flex; justify-content: space-between; font-size: 11px; color: #888; margin-top: 16px; padding: 0 2px; }

/* Détails résultat */
.nsi-result__rows { display: flex; flex-direction: column; gap: 2px; }
.nsi-result__row { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: rgba(255,255,255,0.6); font-size: 14px; }
.nsi-result__row:first-child { border-radius: 10px 10px 0 0; }
.nsi-result__row:last-child { border-radius: 0 0 10px 10px; }
.nsi-result__row .k { color: #555; display: flex; align-items: center; gap: 8px; }
.nsi-result__row .k i { font-size: 17px; color: #3B6D11; }
.nsi-result__row .v { font-weight: 600; font-family: 'Cormorant Garamond', serif; font-size: 19px; color: #1a1a1a; }
.nsi-result__hint { font-size: 12.5px; color: #777; line-height: 1.5; margin: 16px 0 0; text-align: center; }

/* Macros suggérées */
.nsi-macros { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid #d8e8c4; }
.nsi-macros h3 { font-size: 18px; font-weight: 600; margin: 0 0 12px; }
.nsi-macros-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.nsi-macro { text-align: center; background: white; border-radius: 12px; padding: 14px 8px; }
.nsi-macro__val { font-family: 'Cormorant Garamond', serif; font-size: 28px; font-weight: 600; line-height: 1; }
.nsi-macro__val.prot { color: #3B6D11; }
.nsi-macro__val.gluc { color: #854F0B; }
.nsi-macro__val.lip { color: #993C1D; }
.nsi-macro__unit { font-size: 13px; color: #888; }
.nsi-macro__name { font-size: 12px; color: #666; margin-top: 5px; }

/* CTA */
.nsi-cta-row { display: flex; gap: 10px; margin-top: 1.25rem; flex-wrap: wrap; }
.nsi-cta { flex: 1; min-width: 140px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; text-decoration: none; transition: all 0.2s; }
.nsi-cta--primary { background: #3B6D11; color: white; }
.nsi-cta--primary:hover { background: #2C520C; }
.nsi-cta--ghost { background: white; color: #3B6D11; border: 1px solid #cfe0b8; }
.nsi-cta--ghost:hover { border-color: #3B6D11; }

/* Tableau */
.nsi-table-wrap { max-width: 760px; margin: 3.5rem auto 0; }
.nsi-table-wrap h2 { font-size: 30px; font-weight: 600; margin: 0 0 1.25rem; text-align: center; }
.nsi-table { width: 100%; border-collapse: collapse; border: 1px solid #eee; border-radius: 12px; overflow: hidden; }
.nsi-table th, .nsi-table td { padding: 13px 16px; text-align: left; font-size: 15px; border-bottom: 1px solid #eee; }
.nsi-table th { background: #FBFAF6; font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: #666; }
.nsi-table tr:last-child td { border-bottom: 0; }
.nsi-table__dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; }
.nsi-table a { color: #3B6D11; font-weight: 600; text-decoration: none; }
.nsi-table a:hover { text-decoration: underline; }

/* Contenu éditorial */
.nsi-content { max-width: 760px; margin: 3.5rem auto 0; }
.nsi-content h2 { font-size: 30px; font-weight: 600; margin: 2rem 0 1rem; }
.nsi-content h3 { font-size: 22px; font-weight: 600; margin: 1.75rem 0 0.6rem; }
.nsi-content p { font-size: 16px; line-height: 1.7; color: #333; margin: 0 0 1rem; }
.nsi-content ul { font-size: 16px; line-height: 1.7; color: #333; padding-left: 1.4rem; margin: 0 0 1rem; }
.nsi-content li { margin-bottom: 6px; }
.nsi-content a { color: #3B6D11; }
.nsi-content strong { font-weight: 600; }

/* FAQ */
.nsi-faq { max-width: 760px; margin: 2.5rem auto 0; }
.nsi-faq h2 { font-size: 30px; font-weight: 600; margin: 0 0 1.25rem; text-align: center; }
.nsi-faq details { border: 1px solid #eee; border-radius: 12px; padding: 0; margin-bottom: 10px; overflow: hidden; }
.nsi-faq summary { padding: 16px 18px; font-size: 16px; font-weight: 500; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.nsi-faq summary::-webkit-details-marker { display: none; }
.nsi-faq summary::after { content: '+'; font-size: 26px; font-weight: 400; color: #3B6D11; flex-shrink: 0; line-height: 1; }
.nsi-faq details[open] summary::after { content: '\2212'; }
.nsi-faq details[open] summary { border-bottom: 1px solid #eee; }
.nsi-faq__body { padding: 14px 18px 18px; font-size: 15px; line-height: 1.65; color: #444; }
.nsi-faq__body a { color: #3B6D11; }

/* Disclaimer */
.nsi-disclaimer { max-width: 760px; margin: 2rem auto 0; padding: 16px 18px; background: #FBFAF6; border: 1px solid #eee; border-radius: 12px; font-size: 13.5px; color: #777; line-height: 1.55; display: flex; gap: 12px; align-items: flex-start; }
.nsi-disclaimer i { font-size: 20px; color: #999; flex-shrink: 0; margin-top: 1px; }

/* Responsive */
@media (max-width: 880px) {
    .nsi-app { grid-template-columns: 1fr; }
    .nsi-result { position: static; }
}
@media (max-width: 560px) {
    .nsi-hero h1 { font-size: 34px; }
    .nsi-row { grid-template-columns: 1fr; }
    .nsi-cta-row { flex-direction: column; }
    .nsi-table th, .nsi-table td { padding: 11px 12px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .nsi *, .nsi-gauge__pin { transition: none !important; }
}
