/* TERRAVENE — Carte interactive. Géré par le plugin De Nos Jours. */
/* ============================================================
     TERRAVENE — Carte interactive des départements
     Couleurs modifiables ci-dessous
     ============================================================ */
  :root{
    --tv-acquis:      #005B70;   /* départements avec projet acquis */
    --tv-acquis-h:    #007A96;   /* survol */
    --tv-prospection: #BFD6DB;   /* départements de prospection — trame 25% du pétrole */
    --tv-prospection-h:#ABC9D0;  /* survol — trame 33% */
    --tv-neutre:      #EFECE4;   /* autres départements */
    --tv-trait:       #FFFFFF;   /* liseré entre départements */
    --tv-soleil:      #BECF0F;   /* point d'implantation */
    --tv-titre:       #385723;   /* couleur du titre */
    --tv-encre:       #22301F;
    --tv-encre-2:     #5C6B57;
    --tv-fond:        #FBFAF7;
    --tv-carte-fond:  #FFFFFF;
    --tv-radius:      15px;
    --tv-echelle:     1.2;      /* facteur global des tailles de texte */
    --tv-font: "Quicksand", sans-serif;
  }
  /* Reset scopé au composant : ne doit jamais toucher le reste de la page */
  .tv-carte,.tv-carte *,.tv-scrim{box-sizing:border-box;margin:0;padding:0}

  .tv-carte{max-width:1080px;margin:0 auto;
            font-family:var(--tv-font);color:var(--tv-encre);
            -webkit-font-smoothing:antialiased;
            /* Le crème était sur le <body> du fichier de démo. Il est reporté ici pour
               que les blocs blancs se détachent. À supprimer si la section Elementor
               porte déjà ce fond. */
            background:var(--tv-fond);padding:clamp(16px,3vw,36px)}
  .tv-entete h2{font-family:"Quicksand", sans-serif;
                font-size:2.5em;
                font-weight:500;
                line-height:1.2em;
                letter-spacing:0;
                word-spacing:0;
                /* variable globale Elementor ; repli sur la valeur d'origine hors WordPress */
                color:var(--e-global-color-02b47d9, var(--tv-titre))}
  @media (max-width:820px){.tv-entete h2{font-size:1.4em}}
  .tv-entete .tv-chiffres{margin-top:12px;
                          text-align:start;
                          font-family:"Quicksand", sans-serif;
                          font-size:1.25em;
                          font-weight:500;
                          line-height:1.2em;
                          letter-spacing:0;
                          word-spacing:0;
                          color:var(--e-global-color-02b47d9, var(--tv-titre))}

  /* Légende ancrée dans le vide atlantique de la carte */
  .tv-legende{position:absolute;left:3%;bottom:5%;max-width:32%;z-index:3;
              display:flex;flex-direction:column;gap:11px;
              font-size:calc(13px * var(--tv-echelle));line-height:1.25;color:var(--tv-encre-2)}
  .tv-legende span{display:inline-flex;align-items:flex-start;gap:9px}
  .tv-legende i{width:14px;height:14px;border-radius:4px;flex:none;margin-top:1px}
  .tv-legende .l-acquis i{background:var(--tv-acquis)}
  .tv-legende .l-prosp i{background:var(--tv-prospection)}
  .tv-legende .l-point i{width:15px;height:15px;border-radius:50%;background:var(--tv-soleil)}
  /* Sous 980px la carte devient trop étroite : la légende repasse sous le tracé */
  @media (max-width:1040px){
    .tv-legende{position:static;max-width:none;flex-direction:row;flex-wrap:wrap;
                gap:18px;margin-top:14px}
  }

  .tv-grille{display:grid;
             grid-template-columns:minmax(0,1fr) 320px;
             grid-template-areas:"titre ."
                                 "carte fiche";
             grid-template-rows:auto 1fr;
             column-gap:30px;row-gap:36px;align-items:start}
  .tv-entete{grid-area:titre;margin-bottom:0}
  .tv-svgbox{grid-area:carte}
  .tv-fiche{grid-area:fiche}
  @media (max-width:820px){
    .tv-grille{grid-template-columns:1fr;
               grid-template-areas:"titre" "carte" "fiche";
               grid-template-rows:auto}
  }

  .tv-svgbox{background:var(--tv-carte-fond);border-radius:var(--tv-radius);
             padding:14px;position:relative}
  .tv-svgbox svg{display:block;width:100%;height:auto}

  .tv-dept{fill:var(--tv-neutre);stroke:var(--tv-trait);stroke-width:.7;transition:fill .18s}
  .tv-dept.prospection{fill:var(--tv-prospection);cursor:default}
  .tv-dept.prospection:hover{fill:var(--tv-prospection-h)}
  .tv-dept.acquis{fill:var(--tv-acquis);cursor:pointer}
  .tv-dept.acquis:hover{fill:var(--tv-acquis-h)}

  /* Marqueurs d'implantation */
  .tv-marqueur{cursor:pointer}
  .tv-marqueur .coeur{fill:var(--tv-soleil);stroke:var(--tv-soleil);stroke-width:1.6}
  .tv-marqueur .halo{fill:var(--tv-soleil);opacity:.3;transform-origin:center;
                  animation:tvPulse 2.4s ease-out infinite}
  .tv-marqueur:hover .coeur,.tv-marqueur:focus-visible .coeur{stroke-width:2.2}
  .tv-marqueur:focus,.tv-marqueur:focus-visible{outline:none;box-shadow:none}
  .tv-marqueur:focus-visible .coeur{stroke:var(--tv-encre)}
  .tv-marqueur.actif .coeur{fill:#fff;stroke:var(--tv-soleil);stroke-width:3}
  @keyframes tvPulse{0%{transform:scale(.6);opacity:.45}70%{transform:scale(1.6);opacity:0}100%{opacity:0}}
  @media (prefers-reduced-motion:reduce){.tv-marqueur .halo{animation:none;opacity:.18}}

  /* Infobulle départements */
  .tv-bulle{position:absolute;pointer-events:none;background:var(--tv-encre);color:#fff;
            font-size:calc(12.5px * var(--tv-echelle));line-height:1.35;padding:7px 11px;border-radius:8px;
            opacity:0;transform:translate(-50%,-130%);transition:opacity .12s;white-space:nowrap;z-index:5}
  .tv-bulle small{display:block;opacity:.65;font-size:calc(11px * var(--tv-echelle))}
  .tv-bulle.visible{opacity:1}

  /* Fiche exploitation */
  .tv-fiche{background:var(--tv-carte-fond);border-radius:var(--tv-radius);overflow:hidden;
            position:sticky;top:20px}
  .tv-fiche .tv-photo{aspect-ratio:3/2;background:linear-gradient(135deg,var(--tv-acquis-h),var(--tv-acquis));
                   display:flex;align-items:center;justify-content:center;position:relative}
  .tv-fiche .tv-photo img{width:100%;height:100%;object-fit:cover;display:block}
  .tv-fiche .tv-corps{padding:18px 20px 22px}
  .tv-fiche .tv-badge{display:inline-block;font-size:calc(10px * var(--tv-echelle));letter-spacing:.1em;text-transform:uppercase;
                   font-weight:700;color:#fff;background:var(--tv-soleil);
                   padding:.55em 1.15em;border-radius:99px;margin-bottom:10px}
  .tv-fiche .tv-nom{font-size:calc(19px * var(--tv-echelle));font-weight:600;margin-bottom:4px;line-height:1.2}
  .tv-fiche .tv-lieu{font-size:calc(13.5px * var(--tv-echelle));color:var(--tv-encre-2);margin-bottom:12px}
  .tv-fiche .tv-agri{font-size:calc(14px * var(--tv-echelle));line-height:1.5;border-top:1px solid #ECE9E1;padding-top:12px}
  .tv-fiche.vide .tv-corps{padding:26px 22px}
  .tv-fiche.vide p{font-size:calc(14px * var(--tv-echelle));color:var(--tv-encre-2);line-height:1.55}

  /* ============================================================
     Panneau ancré — mobile uniquement (sous 820px)
     ============================================================ */
  .tv-invite{display:none}
  .tv-fiche .tv-poignee,.tv-fiche .tv-fermer,.tv-scrim{display:none}

  @media (max-width:820px){
    /* Marges latérales propres au mobile */
    .tv-carte{padding-left:7%;padding-right:7%}

    /* Le groupe titre + sous-titre est rentré à 10% au lieu de 7%.
       Les 7% du parent laissent 86% de large : 3,49% de cette largeur
       valent 3% de la largeur totale, d'où les 10% recherchés.
       La carte et la fiche restent à 7%. */
    .tv-entete{margin-left:3.49%;margin-right:3.49%}
    .tv-entete .tv-chiffres{font-size:1.125em}

    .tv-invite{display:block;margin-top:26px;font-size:calc(13.5px * var(--tv-echelle));line-height:1.45;
               color:var(--tv-encre-2);text-align:center}
    .tv-invite b{color:var(--tv-soleil);font-weight:400}

    .tv-scrim{display:block;position:fixed;inset:0;background:rgba(34,48,31,.18);
              opacity:0;visibility:hidden;z-index:55;
              transition:opacity .28s,visibility 0s .28s}
    .tv-scrim.visible{opacity:1;visibility:visible;transition:opacity .28s,visibility 0s}

    .tv-fiche{position:fixed;left:0;right:0;bottom:0;top:auto;z-index:60;
              border-radius:20px 20px 0 0;max-height:72vh;overflow-y:auto;
              -webkit-overflow-scrolling:touch;
              box-shadow:0 -6px 30px rgba(34,48,31,.20);
              transform:translateY(101%);visibility:hidden;
              transition:transform .32s cubic-bezier(.22,.61,.36,1),visibility 0s .32s}
    .tv-fiche.ouverte{transform:none;visibility:visible;
                      transition:transform .32s cubic-bezier(.22,.61,.36,1),visibility 0s}
    .tv-fiche.glisse{transition:none}

    .tv-fiche .tv-corps{padding-bottom:calc(22px + env(safe-area-inset-bottom))}

    .tv-fiche .tv-poignee{display:block;position:absolute;top:9px;left:50%;z-index:2;
                          width:40px;height:4px;margin-left:-20px;border-radius:99px;
                          background:rgba(255,255,255,.75);pointer-events:none}
    .tv-fiche .tv-fermer{display:flex;align-items:center;justify-content:center;
                         position:absolute;top:10px;right:10px;z-index:2;
                         width:34px;height:34px;border:0;border-radius:50%;
                         background:rgba(34,48,31,.45);color:#fff;
                         font-size:calc(19px * var(--tv-echelle));line-height:1;cursor:pointer}
    .tv-fiche .tv-fermer:focus-visible{outline:2px solid #fff;outline-offset:2px}
  }
  @media (prefers-reduced-motion:reduce){
    .tv-fiche,.tv-scrim{transition:none}
  }
