/* ===========================================================================
   Espace Conseils — /conseils et /conseils/<slug>
   ===========================================================================
   N'ajoute que ce qui manque a style.css : les couleurs (--ink, --ink-soft,
   --card, --line, --ocre, --blue), les polices (Fraunces pour les titres,
   JetBrains Mono pour les libelles) et les boutons (.btn-primary,
   .btn-secondary) en viennent deja. Meme convention que assets/prestation.css,
   dont ce fichier reprend volontairement les proportions : les deux familles de
   pages doivent se ressembler.

   Le prefixe « cs- » evite toute collision avec les classes generiques de
   style.css, partagees par toutes les pages du site.
   =========================================================================== */

.cs-hero,
.cs-tri,
.cs-une,
.cs-liste,
.cs-vide,
.cs-cta,
.cs-entete,
.cs-visuel,
.cs-corpus,
.cs-outil,
.cs-liens,
.cs-realisations,
.cs-suite {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Le texte long se lit dans une colonne etroite : au-dela de 70 caracteres
   par ligne, l'oeil perd le debut de la ligne suivante. */
.cs-corpus { max-width: 76ch; }

/* --- Libelles et fil d'Ariane -------------------------------------------- */
.cs-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ocre);
  margin: 0 0 0.8rem;
}
.cs-eyebrow a { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; }
.cs-eyebrow a:hover, .cs-eyebrow a:focus-visible { border-bottom-color: var(--ocre); }

.cs-fil ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.cs-fil li + li::before { content: '/'; margin-right: 0.5rem; opacity: 0.5; }
.cs-fil a { color: var(--ink-soft); text-decoration: none; }
.cs-fil a:hover, .cs-fil a:focus-visible { color: var(--ocre); }
.cs-fil [aria-current='page'] {
  color: var(--ink);
  /* Le titre d'un article est long : on evite qu'il pousse le fil sur trois
     lignes en le tronquant proprement. */
  max-width: 46ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===========================================================================
   PAGE DE LISTE
   =========================================================================== */

.cs-hero { padding-top: 2.5rem; }
.cs-hero h1 {
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  line-height: 1.1;
  margin: 0 0 1.3rem;
}
.cs-hero-intro {
  font-size: 1.06rem;
  line-height: 1.75;
  color: var(--ink-soft);
  max-width: 62ch;
  margin: 0;
}

/* --- Recherche et filtres ------------------------------------------------ */
/* Des LIENS, pas des boutons : chaque combinaison est une adresse a part
   entiere, partageable et utilisable sans JavaScript. Meme parti pris que la
   galerie des realisations. */
.cs-tri { padding-top: 3rem; }

.cs-recherche { max-width: 640px; margin: 0 0 2rem; }
.cs-recherche label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.6rem;
}
.cs-recherche-champ { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.cs-recherche input[type='search'] {
  flex: 1 1 240px;
  min-width: 0;
  padding: 0.85rem 1.1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}
.cs-recherche input[type='search']:focus-visible {
  outline: 2px solid var(--ocre);
  outline-offset: 1px;
  border-color: var(--ocre);
}

.cs-groupe { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.cs-groupe legend {
  float: left;
  width: 100%;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 0;
  margin-bottom: 0.6rem;
}
.cs-filtre {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.86rem;
  transition: border-color 0.2s, color 0.2s;
}
.cs-filtre:hover, .cs-filtre:focus-visible { color: var(--ink); border-color: var(--ocre); }
.cs-filtre.is-actif { color: #1a1410; background: var(--ocre); border-color: var(--ocre); font-weight: 600; }
.cs-compte { font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; opacity: 0.7; }

/* --- Article mis en avant ------------------------------------------------ */
.cs-une { padding-top: 3.5rem; }
.cs-une-bloc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.cs-une-sans-image { grid-template-columns: 1fr; }
.cs-une-visuel img { width: 100%; height: 100%; min-height: 260px; object-fit: cover; display: block; }
.cs-une-texte { padding: 2rem 2.2rem 2.2rem; }
.cs-une-sans-image .cs-une-texte { padding: 2.2rem; }
.cs-une h2 { font-size: clamp(1.4rem, 2.8vw, 2rem); line-height: 1.2; margin: 0 0 1rem; }
.cs-une h2 a { color: inherit; text-decoration: none; }
.cs-une h2 a:hover, .cs-une h2 a:focus-visible { color: var(--ocre); }
.cs-une-chapo { font-size: 1rem; line-height: 1.7; color: var(--ink-soft); margin: 0 0 1rem; }

/* --- Grille de cartes ---------------------------------------------------- */
.cs-liste { padding-top: 4rem; }
.cs-liste-tete {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}
.cs-liste-tete h2, .cs-cta h2, .cs-outil h2, .cs-liens h2, .cs-realisations h2, .cs-suite h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin: 0;
}
.cs-resume {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin: 0;
}

.cs-grille {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.2rem;
}
.cs-carte {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.cs-carte::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--blue);
  opacity: 0.75;
}
.cs-carte h3 { font-size: 1.05rem; line-height: 1.35; margin: 0 0 0.7rem; }
.cs-carte h3 a { color: inherit; text-decoration: none; }
.cs-carte h3 a:hover, .cs-carte h3 a:focus-visible { color: var(--ocre); }
.cs-carte-cat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ocre);
  margin: 0 0 0.7rem;
}
.cs-carte-chapo { font-size: 0.9rem; line-height: 1.65; color: var(--ink-soft); margin: 0 0 1rem; }
.cs-carte-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin: 0 0 1rem;
}
.cs-carte-meta:empty { display: none; }
.cs-carte-lien {
  margin-top: auto;
  align-self: flex-start;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ocre);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.cs-carte-lien:hover, .cs-carte-lien:focus-visible { border-bottom-color: var(--ocre); }

/* --- Etat vide ----------------------------------------------------------- */
/* Deux messages distincts : « rien de publie » et « rien pour cette
   recherche ». Les confondre ferait croire que le site est vide. */
.cs-vide { padding-top: 3.5rem; text-align: center; }
.cs-vide p { color: var(--ink-soft); line-height: 1.7; margin: 0 0 0.8rem; }
.cs-vide a { color: var(--ocre); }

/* ===========================================================================
   PAGE D'UN ARTICLE
   =========================================================================== */

.cs-entete { padding-top: 2.5rem; }
.cs-entete h1 {
  font-size: clamp(1.9rem, 4.2vw, 2.9rem);
  line-height: 1.12;
  margin: 0 0 1.2rem;
  max-width: 24ch;
}
.cs-chapo {
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--ink-soft);
  max-width: 62ch;
  margin: 0 0 1.4rem;
}
.cs-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin: 0;
}
.cs-meta span + span::before { content: '·'; margin-right: 1.4rem; opacity: 0.5; }

.cs-visuel { margin: 2.5rem auto 0; }
.cs-visuel img {
  width: 100%;
  height: auto;
  max-height: 460px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: block;
}

.cs-corpus { padding-top: 3rem; }
.cs-intro {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--ink);
  margin: 0 0 2rem;
  padding-left: 1.2rem;
  border-left: 3px solid var(--ocre);
}

/* --- Sommaire cliquable -------------------------------------------------- */
.cs-sommaire {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.4rem 1.6rem;
  margin: 0 0 3rem;
}
.cs-sommaire-titre {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ocre);
  margin: 0 0 0.9rem;
}
.cs-sommaire ol { margin: 0; padding: 0 0 0 1.3rem; display: grid; gap: 0.5rem; }
.cs-sommaire li { color: var(--ink-soft); font-size: 0.93rem; line-height: 1.5; }
.cs-sommaire a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid transparent; }
.cs-sommaire a:hover, .cs-sommaire a:focus-visible { color: var(--ink); border-bottom-color: var(--ocre); }

/* Un titre vise depuis le sommaire ne doit pas se coller sous la barre de
   navigation fixe : on lui reserve la place au-dessus. */
.cs-corps h2, .cs-corps h3 { scroll-margin-top: 6rem; }

/* --- Corps editorial ----------------------------------------------------- */
/* Le HTML de ces sections est ecrit a la main, sans class ni style : la mise
   en forme est donc entierement portee par les selecteurs de descendance
   ci-dessous. C'est voulu — l'auteur n'a pas a connaitre le nom des classes. */
.cs-corps .cs-bloc { margin: 0 0 2.8rem; }
.cs-corps h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  line-height: 1.25;
  margin: 0 0 1.2rem;
}
.cs-corps h3 {
  font-size: 1.08rem;
  line-height: 1.4;
  margin: 2rem 0 0.8rem;
  color: var(--ink);
}
.cs-corps p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink-soft);
  margin: 0 0 1.3rem;
}
.cs-corps strong { color: var(--ink); font-weight: 600; }
.cs-corps ul, .cs-corps ol { margin: 0 0 1.4rem; padding-left: 1.4rem; }
.cs-corps li {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink-soft);
  margin-bottom: 0.6rem;
}
.cs-corps ul li::marker { color: var(--ocre); }
.cs-corps ol li::marker { color: var(--ocre); font-family: 'JetBrains Mono', monospace; font-size: 0.85em; }
.cs-corps a { color: var(--ocre); }

/* --- Tableaux ------------------------------------------------------------ */
/* Le tableau des finitions est large : il defile dans SON conteneur, et jamais
   la page. tabindex="0" et role="region" (poses par inc/articles.php) rendent
   la zone atteignable au clavier et annoncee comme telle. */
.cs-tableau {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 1.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 100%;
}
.cs-tableau:focus-visible { outline: 2px solid var(--ocre); outline-offset: 2px; }
.cs-corps table {
  border-collapse: collapse;
  width: 100%;
  min-width: 560px;
  font-size: 0.92rem;
}
.cs-corps th, .cs-corps td {
  text-align: left;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  line-height: 1.6;
  vertical-align: top;
}
.cs-corps thead th {
  background: var(--card);
  color: var(--ink);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.cs-corps tbody tr:last-child td { border-bottom: 0; }

/* --- Encadres ------------------------------------------------------------ */
/* Trois natures, trois couleurs : « a savoir » informe, « attention » borne,
   « astuce » aide. La couleur seule ne porte pas l'information — le libelle en
   tete de l'encadre la dit en toutes lettres. */
.cs-encadre {
  margin: 0 0 2.4rem;
  padding: 1.3rem 1.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 6px;
}
.cs-encadre--info      { border-left-color: var(--blue); }
.cs-encadre--attention { border-left-color: var(--ocre); }
.cs-encadre--astuce    { border-left-color: var(--green); }
.cs-encadre-type {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 0.5rem !important;
  color: var(--blue-glow);
}
.cs-encadre--attention .cs-encadre-type { color: var(--ocre); }
.cs-encadre--astuce .cs-encadre-type    { color: var(--green); }
.cs-encadre-titre { color: var(--ink); font-weight: 600; margin: 0 0 0.5rem !important; }
.cs-encadre p:last-child { margin-bottom: 0 !important; }

/* --- FAQ visible --------------------------------------------------------- */
.cs-faq { padding-top: 2rem; }
.cs-faq h2 { font-size: clamp(1.35rem, 2.6vw, 1.85rem); margin: 0 0 1.5rem; }
.cs-faq-liste { display: grid; gap: 0.7rem; }
.cs-faq-item { background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.cs-faq-item summary {
  cursor: pointer;
  padding: 1.05rem 1.3rem;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--ink);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}
.cs-faq-item summary::-webkit-details-marker { display: none; }
.cs-faq-item summary::after {
  content: '+';
  font-family: 'JetBrains Mono', monospace;
  color: var(--ocre);
  flex: none;
  transition: transform 0.2s;
}
.cs-faq-item[open] summary::after { content: '−'; }
.cs-faq-item summary:focus-visible { outline: 2px solid var(--ocre); outline-offset: -2px; }
.cs-faq-reponse { padding: 0 1.3rem 1.2rem; }
.cs-faq-reponse p { font-size: 0.93rem; line-height: 1.7; color: var(--ink-soft); margin: 0; }

/* --- Contenus lies ------------------------------------------------------- */
.cs-outil, .cs-liens, .cs-realisations, .cs-suite { padding-top: 4rem; }

.cs-outil { max-width: 76ch; }
.cs-outil h2 { margin-bottom: 0.9rem; }
.cs-outil p { color: var(--ink-soft); line-height: 1.75; margin: 0 0 1.5rem; max-width: 60ch; }

.cs-section-tete {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}
.cs-lien-plus {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ocre);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.cs-lien-plus:hover, .cs-lien-plus:focus-visible { border-bottom-color: var(--ocre); }

.cs-liens h2 { margin-bottom: 1.4rem; }
.cs-puces { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.7rem; }
.cs-puces a {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.88rem;
}
.cs-puces a:hover, .cs-puces a:focus-visible { color: var(--ink); border-color: var(--ocre); }

/* --- Appel a l'action ---------------------------------------------------- */
.cs-cta {
  margin-top: 5rem;
  margin-bottom: 5rem;
  padding-top: 3rem;
  padding-bottom: 3rem;
  text-align: center;
  border-top: 1px solid var(--line);
}
.cs-cta p { color: var(--ink-soft); max-width: 60ch; margin: 1rem auto 2rem; line-height: 1.7; }
.cs-cta-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; justify-content: center; }

/* ===========================================================================
   Adaptations ecran et accessibilite
   =========================================================================== */
@media (max-width: 900px) {
  .cs-une-bloc { grid-template-columns: 1fr; gap: 0; }
  .cs-une-visuel { order: -1; }
  .cs-une-visuel img { min-height: 200px; max-height: 260px; }
  .cs-une-texte { padding: 1.6rem; }
  .cs-liste, .cs-outil, .cs-liens, .cs-realisations, .cs-suite { padding-top: 3rem; }
  .cs-corpus { padding-top: 2.2rem; }
  .cs-entete h1 { max-width: none; }
}

@media (max-width: 560px) {
  .cs-hero, .cs-tri, .cs-une, .cs-liste, .cs-vide, .cs-cta,
  .cs-entete, .cs-visuel, .cs-corpus, .cs-outil, .cs-liens,
  .cs-realisations, .cs-suite { padding-left: 1.1rem; padding-right: 1.1rem; }
  .cs-fil [aria-current='page'] { max-width: 22ch; }
  .cs-intro { padding-left: 1rem; }
  .cs-cta-actions { flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  .cs-filtre, .cs-faq-item summary::after { transition: none; }
  .cs-tableau { scroll-behavior: auto; }
}
