/* Articles : « moins, c'est mieux ». La liste se coche et agit en lot ; la page d'un article met le texte au centre,
   la recherche Google visée et la note face aux concurrents à droite, et replie tout le reste dans « Avant d'envoyer ».
   Mêmes jetons que le reste d'AutoSEO : aucune couleur ni police en plus, pas d'ombre au repos, pas de filet décoratif. */

/* ---------- Liste ---------- */
.art-tools .sort-menu { display: block; }
.art-table .c-state { width: 1%; white-space: nowrap; }
.art-table .c-score .unit { margin-left: 4px; color: var(--muted); font-size: var(--fs-meta); }
.art-table .c-score strong { font-weight: 600; }
.art-selectall { display: none; align-items: center; gap: 8px; font-size: 14px; color: var(--body); }
.action-menu { min-width: 280px; }
.action-menu .menu-item { padding-top: 8px; padding-bottom: 8px; }
.action-text { display: grid; gap: 1px; }
.action-text small { color: var(--muted); font-size: var(--fs-small); white-space: normal; }
.menu-item[aria-disabled='true'] { opacity: 0.5; cursor: not-allowed; }
.menu-item[aria-disabled='true']:hover { background: transparent; }

/* Le blog tel qu'il est sur le site : replié, il ne passe pas avant la liste. */
.remote > summary, .before > summary, .before-item > summary { list-style: none; cursor: pointer; }
.remote > summary::-webkit-details-marker, .before > summary::-webkit-details-marker, .before-item > summary::-webkit-details-marker { display: none; }
.remote > summary { display: flex; align-items: baseline; gap: 12px; }
.remote-title { margin-right: auto; font-weight: 600; letter-spacing: -0.02em; }
.remote[open] > summary { margin-bottom: 10px; }
.remote > .small { margin-bottom: 12px; }

/* ---------- Page d'un article ---------- */
.art-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--gap); align-items: start; }
.art-main, .art-side, .art-step { display: grid; gap: var(--gap); min-width: 0; align-content: start; }
.art-text { min-width: 0; }

/* L'étape et son unique geste */
.step { display: flex; align-items: center; justify-content: space-between; gap: 16px 28px; flex-wrap: wrap; }
.step-main { flex: 1 1 340px; display: grid; gap: 6px; min-width: 0; }
.step-main .small { color: var(--body); max-width: 64ch; }
.step-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.step-alert { display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--radius-control); background: var(--pill-negative-bg); color: var(--pill-negative-ink); font-size: 14px; }
.step-alert ul { margin: 0; padding-left: 18px; display: grid; gap: 2px; }
.step-alert .link { color: inherit; justify-self: start; text-decoration: underline; }
.publish-title .link { margin-left: auto; font-weight: 500; }

/* Face à Google, dans la colonne */
.gcard { display: grid; gap: 14px; }
.gcard .card-head { margin-bottom: 0; }
.gcard-search { display: grid; gap: 2px; }
.gcard-search strong { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
.gcard .score-lead { align-items: baseline; }
.gcard-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* « Vérifications » : replié, chaque vérification dit son état sur une ligne, avec une pastille de couleur */
.before { padding: 0; }
.before > summary { display: flex; align-items: center; gap: 10px; padding: 16px var(--pad); border-radius: var(--radius-card); }
.before-title { margin-right: auto; font-size: var(--fs-section); font-weight: 600; letter-spacing: -0.02em; }
.before > summary svg, .before-item > summary svg { flex: none; color: var(--muted); transition: transform var(--fast) var(--ease-out); }
.before[open] > summary svg, .before-item[open] > summary svg { transform: rotate(180deg); }
.before-list { display: grid; padding: 0 calc(var(--pad) / 2) 12px; }
.before-item > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; align-items: center; min-height: 52px; padding: 6px calc(var(--pad) / 2); border-radius: var(--radius-control); }
.before-item > summary:hover, .before > summary:hover { background: var(--raised); }
.before-item > summary svg { grid-column: 2; grid-row: 1 / span 2; }
.before-label { font-size: 14.5px; font-weight: 500; }
.before-note { grid-column: 1; font-size: var(--fs-small); color: var(--muted); }
.before-note.is-todo { color: var(--pill-warning-ink); }
.before-note.is-block { color: var(--negative); font-weight: 600; }
.before-content { display: grid; gap: 12px; padding: 4px calc(var(--pad) / 2) 18px; }
.card.is-bare { padding: 0; border: 0; background: transparent; }
.before-content .score, .before-content .article-presentation { gap: 12px; }

/* Panneau du détail Google */
html:has(dialog.drawer[open]) { overflow: hidden; }
.drawer {
  margin: 0 0 0 auto; padding: 0; border: 0; width: min(560px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh;
  background: var(--surface); color: var(--text); border-radius: var(--radius-card) 0 0 var(--radius-card);
  box-shadow: var(--float-shadow); /* taste-skill-ignore : panneau au premier plan */
}
.drawer[open] { display: flex; flex-direction: column; animation: drawer-in var(--medium) var(--ease-out); }
.drawer::backdrop { background: rgba(10, 14, 12, 0.42); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px 12px; }
.drawer-title { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.drawer-body { flex: 1; min-height: 0; overflow-y: auto; display: grid; gap: 24px; align-content: start; padding: 8px 24px 28px; }
.drawer-foot { display: grid; gap: 10px; padding: 14px 24px calc(14px + env(safe-area-inset-bottom)); background: var(--raised); }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@keyframes drawer-in { from { opacity: 0; transform: translateX(28px); } }
.gd-section { display: grid; gap: 10px; }
.gd-section h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.gd-pages, .gd-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.gd-page { display: grid; gap: 2px; }
.gd-page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.gd-name { min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.gd-score { display: inline-flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gd-score small { color: var(--muted); font-size: var(--fs-meta); }
.gd-points li { display: flex; align-items: flex-start; gap: 10px; }
.gd-points small { display: block; color: var(--muted); font-size: var(--fs-small); }
.gd-mark { flex: none; padding-top: 3px; color: var(--positive); }
.gd-points .is-missing .gd-mark { color: var(--pill-warning-ink); }

/* ---------- Téléphone et tablette ---------- */
@media (max-width: 1100px) {
  /* Une colonne : l'étape, la note Google, le texte, puis les contrôles. Les conteneurs s'effacent pour que l'ordre se règle ici. */
  .art-grid { display: flex; flex-direction: column; }
  .art-main, .art-side { display: contents; }
  .art-step { order: 1; }
  .gcard { order: 2; }
  .art-text { order: 3; }
  .before, .art-finish { order: 4; }
  /* En modification, le texte passe avant la note Google : on arrive sur ce qu'on vient corriger. */
  .art-grid:has(.editor) .gcard { order: 5; }
}
@media (max-width: 640px) {
  .gcard .score-rows { display: none; }
  .step-actions .btn { flex: 1 1 100%; }
  .before > summary { padding: 14px var(--pad); }
  .drawer { width: 100vw; border-radius: 0; }
  .drawer-head, .drawer-body, .drawer-foot { padding-left: 16px; padding-right: 16px; }
  .drawer-actions .btn { flex: 1 1 100%; }
  /* Liste en lignes empilées : la case, le titre et son menu, puis le statut et la note */
  .art-table tr { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: 'check main act' '. state score'; }
  .art-table .c-check { grid-area: check; align-self: start; padding-top: 2px; }
  .art-table .c-main { grid-area: main; } .art-table .c-act { grid-area: act; }
  .art-table .c-state { grid-area: state; width: auto; } .art-table .c-score { grid-area: score; }
  .art-selectall { display: flex; }
  .remote > summary { flex-wrap: wrap; }
}
@media (min-width: 641px) { .art-table .c-state { min-width: 190px; } }
/* La note expliquée une fois, en clair sous les filtres ; sur téléphone, la colonne n'a plus d'en-tête : la ligne dit « Note : ». */
.art-score-note { margin: -4px 0 10px; }
.art-score-prefix { display: none; color: var(--muted); font-size: var(--fs-meta); }
@media (max-width: 640px) {
  .art-score-prefix { display: inline; }
  /* La note sur sa propre ligne, sous le statut : un statut long (« Mise en ligne le 8 novembre ») ne la recouvre plus,
     et la colonne du titre garde toute sa largeur. */
  .art-table tr { grid-template-areas: 'check main act' '. state state' '. score score'; }
  .art-table .c-score { justify-self: start; text-align: left; padding-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .drawer[open], .drawer::backdrop { animation: none; }
}

/* Rappel d'étape : un encadré coloré, distinct de l'article, toujours affiché (c'est le guide de la page). */
.step { position: relative; }
.step-todo { background: var(--pill-warning-bg); border-color: transparent; }
.step-todo .card-title { color: var(--pill-warning-ink); }
.step-next { background: var(--accent-soft); border-color: transparent; }
.step-next .card-title { color: var(--accent-ink); }
.step-info { background: var(--raised); border-color: transparent; }
.step-title { display: flex; align-items: center; gap: 8px; }

/* Le lien vers « Vérifications » n'a de sens que lorsque les vérifications sont sous le texte */
.step-checks-link { display: none; justify-self: start; text-align: left; }
@media (max-width: 1100px) { .step-checks-link { display: inline-flex; align-items: center; } }

/* Sur téléphone, tout ce qui se touche sur la page d'un article fait au moins 44 px */
@media (max-width: 640px) {
  body:has(.art-grid) .crumb a, .art-grid .link, .art-grid .more > summary, .step-checks-link { display: inline-flex; align-items: center; min-height: 44px; }
  .art-grid .btn, .art-grid .btn-sm, .publish .btn, .editor .btn { min-height: 44px; }
  .art-grid .menu-item, body:has(.art-grid) .action-menu .menu-item { min-height: 44px; }
}
