/* OBJECTIFS DU JOUR / DE LA SEMAINE (js/objectifs.js, 22/10) — liste à cocher façon Notion / Obsidian :
   on écrit dans la ligne, la case se remplit en violet et l'objectif se barre. PC seulement (jetons V5),
   comme les autres feuilles de page. */

.obj{
  --obj-texte: var(--v5-texte);
  --obj-texte-2: var(--v5-texte-2);
  --obj-texte-3: var(--v5-texte-3);
  --obj-fond: var(--v5-fond-groupe);
  --obj-survol: var(--v5-rempli-3);
  --obj-trait: var(--v5-separateur);
  --obj-violet: var(--v5-violet);
  --obj-r: var(--v5-r-groupe);
}

/* en-tête : titre à gauche, deux onglets texte à droite (le choisi en pastille sombre, comme les autres choix à options : Lucas, 03/11) */
.obj-tete{ flex-wrap: nowrap; }
.obj-onglets{ display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--v5-r-presse); background: var(--v5-seg-piste); }
.obj-onglet{
  display: inline-flex; align-items: center; gap: 5px; height: 24px; margin: 0; padding: 0 10px; border: 0; border-radius: var(--v5-r-presse);
  background: none; box-shadow: none; color: var(--obj-texte-3); font: 500 12px/16px var(--v5-police); white-space: nowrap; cursor: default;
}
.obj-onglet:hover{ background: var(--obj-survol); color: var(--obj-texte-2); }
.obj-onglet[aria-selected="true"]{ background: var(--v5-seg-pilule); color: var(--v5-seg-pilule-texte); }
.obj-onglet[aria-selected="true"] small{ color: color-mix(in srgb, var(--v5-seg-pilule-texte) 72%, transparent); }
.obj-onglet small{ font-size: 11px; font-variant-numeric: tabular-nums; color: var(--obj-texte-3); }

.obj-carte{ position: relative; padding: 6px 4px 6px; border-radius: var(--obj-r); background: var(--obj-fond); }
.obj-progres{ position: absolute; top: 0; left: 0; right: 0; height: 2px; overflow: hidden; border-radius: var(--obj-r) var(--obj-r) 0 0; background: transparent; }
.obj-progres i{ display: block; height: 100%; background: var(--obj-violet); border-radius: 0 2px 2px 0; transition: width .35s cubic-bezier(.2,.8,.2,1); }
.obj-charge{ padding: 6px 10px; font-size: 13px; color: var(--obj-texte-3); }

/* ligne : case + texte modifiable ; comme un bloc Notion, pas de fond au survol (la marge apparaît), un fond seulement quand
   son menu est ouvert ou qu'on la fait glisser */
.obj-liste{ position: relative; }
/* la marge « + ⋮⋮ » dépasse à gauche de la carte : le bloc ne la coupe pas */
html.v5 .aj-bloc.obj{ overflow: visible; }
.obj-ligne{ position: relative; display: flex; align-items: flex-start; gap: 9px; min-height: 30px; padding: 5px 8px; border-radius: 6px; }
.obj-ligne.menu-ouvert{ background: var(--v5-violet-doux); }
.obj-ligne.glisse{ opacity: var(--v5-opacite-inactif); }
/* la marge de gauche (hors de la carte) : « + » et « ⋮⋮ », visibles au survol de la ligne ; le remplissage à droite la relie à la
   ligne pour que le survol ne se perde pas en chemin */
.obj-marge{ position: absolute; top: 3px; right: 100%; display: flex; padding-right: 6px; opacity: 0; transition: opacity .15s ease-in; }
.obj-ligne:hover .obj-marge, .obj-ligne.menu-ouvert .obj-marge, .obj-ligne.glisse .obj-marge, .obj-marge:focus-within{ opacity: 1; }
.obj-plus, .obj-poignee{
  display: grid; place-items: center; width: 22px; height: 24px; min-width: 0; margin: 0; padding: 0; border: 0; border-radius: 4px;
  background: none; box-shadow: none; color: var(--obj-texte-3); cursor: default;
}
.obj-poignee{ width: 18px; cursor: grab; touch-action: none; }
.obj-ligne.glisse .obj-poignee{ cursor: grabbing; }
.obj-plus:hover, .obj-poignee:hover{ background: var(--obj-survol); color: var(--obj-texte-2); }
.obj-plus svg{ width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.obj-poignee svg{ width: 14px; height: 14px; fill: currentColor; }
/* repère de dépôt pendant un glissement : un trait violet entre deux lignes */
.obj-repere{ position: absolute; left: 8px; right: 8px; height: 2px; border-radius: 1px; background: var(--obj-violet); pointer-events: none; }
.obj-case{
  flex: none; display: grid; place-items: center; width: 16px; height: 16px; min-width: 0; margin: 2px 0 0; padding: 0;
  border: 1.5px solid var(--obj-texte-3); border-radius: 4px; background: transparent; box-shadow: none; cursor: default;
  transition: background-color .15s, border-color .15s;
}
.obj-case:hover{ border-color: var(--obj-texte-2); }
.obj-case svg{ width: 12px; height: 12px; fill: none; stroke: var(--v5-sur-violet); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 16; stroke-dashoffset: 16; }
.obj-ligne.fait .obj-case{ border-color: var(--obj-violet); background: var(--obj-violet); }
.obj-ligne.fait .obj-case svg{ stroke-dashoffset: 0; }
.obj-ligne.vient-de-cocher .obj-case svg{ transition: stroke-dashoffset .22s ease-out .05s; }
.obj-texte{
  flex: 1; min-width: 0; min-height: 20px; padding: 0; outline: none; border: 0; background: none;
  font: 400 14px/20px var(--v5-police); color: var(--obj-texte); overflow-wrap: anywhere; cursor: text;
  text-decoration: line-through; text-decoration-color: transparent; text-decoration-thickness: 1px; transition: color .2s, text-decoration-color .2s;
}
.obj-texte:empty::before{ content: attr(data-vide); color: var(--obj-texte-3); pointer-events: none; }
.obj-ligne.fait .obj-texte{ color: var(--obj-texte-3); text-decoration-color: currentColor; }

/* « Ajouter un objectif » : ligne grise, comme « + Nouveau » dans Notion */
.obj-ajouter{
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 30px; margin: 0; padding: 5px 8px; border: 0; border-radius: 6px;
  background: none; box-shadow: none; color: var(--obj-texte-3); font: 400 14px/20px var(--v5-police); text-align: left; cursor: default;
}
.obj-ajouter svg{ flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.obj-ajouter:hover{ background: var(--obj-survol); color: var(--obj-texte-2); }

.obj-idees{ display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 8px 6px 33px; }
.obj-idee{
  height: 24px; margin: 0; padding: 0 9px; border: 1px dashed var(--obj-trait); border-radius: 6px; background: none; box-shadow: none;
  color: var(--obj-texte-2); font: 400 12px/22px var(--v5-police); white-space: nowrap; cursor: default;
}
.obj-idee:hover{ border-style: solid; background: var(--obj-survol); color: var(--obj-texte); }
.obj-reporter{
  display: block; margin: 2px 0 0; padding: 6px 8px 4px 33px; border: 0; background: none; box-shadow: none;
  color: var(--v5-violet-texte); font: 500 12px/16px var(--v5-police); text-align: left; cursor: default;
}
.obj-reporter:hover{ text-decoration: underline; }
@media (prefers-reduced-motion: reduce){ .obj-progres i, .obj-case, .obj-texte, .obj-marge, .obj-ligne.vient-de-cocher .obj-case svg{ transition: none; } }

/* 25/10 (Lucas : « ajouter un objectif, ça fait trop moche ») : même style que le reste d'Aujourd'hui (gamme Notion) — plus de boîte
   grise autour de la liste ; « + Ajouter un objectif » aligné sur les lignes (le + à la place de la case) ; les idées deviennent de
   petites pastilles pleines et discrètes, précédées de « Idées », au lieu de cadres en pointillés. */
html.v5 .obj-carte{ padding: 2px 0 0; background: none; }
html.v5 .obj-ligne{ padding-left: 6px; padding-right: 6px; }
html.v5 .obj-ajouter{ padding: 5px 6px; color: var(--obj-texte-3); }
html.v5 .obj-ajouter svg{ width: 16px; height: 16px; }
html.v5 .obj-ajouter:hover{ background: var(--v5-survol); color: var(--obj-texte-2); --v5-texte-3: var(--v5-texte-2); }
html.v5 .obj-idees{ align-items: center; gap: 6px; padding: 6px 6px 4px 31px; }
html.v5 .obj-idees-lib{ margin-right: 2px; font: 500 12px/16px var(--v5-police); color: var(--obj-texte-3); }
html.v5 .obj-idee{
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px 0 8px; border: 0; border-radius: var(--v5-r-sel);
  background: var(--v5-rempli-3); color: var(--obj-texte-2); font: 400 12.5px/16px var(--v5-police);
}
html.v5 .obj-idee::before{ content: "+"; font-weight: 500; color: var(--obj-texte-3); }
html.v5 .obj-idee:hover{ border-style: none; background: var(--v5-survol); color: var(--obj-texte); --obj-texte-3: var(--obj-texte-2); --v5-texte-3: var(--v5-texte-2); }
html.v5 .obj-reporter{ padding-left: 31px; }
