/* ==========================================================================
   PADC — finitions v0.3 : accueil du portail épuré, harmonisation des pages
   secondaires (catalogue de recherche, textes sources, fiches, résumés).
   Structure et moteur de recherche inchangés : seul le rendu est affiné.
   ========================================================================== */

/* --- Utilitaires ------------------------------------------------------------------- */
.lien-fleche { display: inline-flex; align-items: center; gap: var(--e-2); font-weight: 650; white-space: nowrap; }
.lien-fleche .icone { transition: transform var(--duree-courte) var(--courbe-standard); }
.lien-fleche:hover .icone { transform: translateX(3px); }
.section__entete--ligne { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--e-3) var(--e-6); max-width: none; }
.section__entete--ligne > div { max-width: 46rem; }
.section__entete--ligne h2 { margin-bottom: var(--e-2); }
.section__entete--ligne p { margin: 0; }

/* --- Accueil du portail : héros avec visuel thématique --------------------------------- */
.accueil-heros {
  position: relative;
  overflow: hidden;
  background: #f5f8fb;
  border-bottom: 1px solid var(--trait);
}
.accueil-heros__grille { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); padding-block: var(--e-8) var(--e-7); }
.accueil-heros__texte { position: relative; z-index: 2; max-width: 45rem; }
.accueil-heros h1 { max-width: 17ch; margin-bottom: var(--e-3); font-size: clamp(2rem, 1.25rem + 2.7vw, 3.15rem); line-height: 1.12; }
/* Titre de bienvenue : nom complet du portail, sur trois à quatre lignes au plus. */
.accueil-heros .accueil-heros__titre { max-width: 25ch; margin-bottom: var(--e-5); font-size: clamp(1.55rem, 1.05rem + 1.7vw, 2.4rem); line-height: 1.18; text-wrap: balance; }
.accueil-heros .chapo { max-width: 34rem; margin-bottom: var(--e-5); color: var(--encre-2); }
.accueil-heros__visuel { position: absolute; inset-block: 0; inset-inline: 34% 0; z-index: 1; margin: 0; }
.accueil-heros__visuel img { width: 100%; height: 100%; object-fit: cover; object-position: 78% 30%; }
.accueil-heros__visuel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #f5f8fb 0%, rgba(245, 248, 251, 0.94) 16%, rgba(245, 248, 251, 0.55) 34%, rgba(245, 248, 251, 0) 56%),
              linear-gradient(0deg, rgba(245, 248, 251, 0.85) 0%, rgba(245, 248, 251, 0) 22%);
}

.recherche-accueil {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 10.5rem) auto;
  align-items: end;
  gap: var(--e-2);
  max-width: 45rem;
  padding: var(--e-3);
  border: 1px solid var(--trait);
  border-radius: var(--r-4);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--ombre-3);
}
.recherche-accueil__champ { min-width: 0; }
.recherche-accueil__label { display: block; margin: 0 0 4px; margin-inline-start: 2px; color: var(--encre-3); font-size: var(--taille-xs); font-weight: 700; letter-spacing: 0.02em; }
.recherche-accueil .recherche__saisie { width: 100%; min-height: 52px; border-inline-end: 2px solid var(--vert-700); border-radius: var(--r-2); font-size: var(--taille-m); }
.recherche-accueil .selection { min-height: 52px; }
.recherche-accueil__bouton { min-height: 52px; padding-inline: 1.25rem; }
@media (max-width: 63.99rem) {
  .accueil-heros__grille { padding-block: var(--e-6) var(--e-5); }
  .accueil-heros__visuel { position: relative; inset: auto; margin-top: var(--e-5); border-radius: var(--r-4); overflow: hidden; aspect-ratio: 16 / 9; box-shadow: var(--ombre-2); }
  .accueil-heros__visuel::after { display: none; }
  .accueil-heros__texte { max-width: none; }
}
@media (max-width: 40rem) {
  .recherche-accueil { grid-template-columns: minmax(0, 1fr); }
  .recherche-accueil__bouton { width: 100%; }
  .accueil-heros__visuel { aspect-ratio: 4 / 3; }
}

/* --- Accueil du portail : textes récents -------------------------------------------------- */
.textes-recents { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr)); gap: var(--e-4); margin: 0; padding: 0; list-style: none; }
.textes-recents > li { display: flex; margin: 0; }
.texte-recent {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--trait);
  border-radius: var(--r-3);
  background: var(--surface);
  box-shadow: var(--ombre-1);
}
.texte-recent__vignette { display: block; height: 11rem; overflow: hidden; border-bottom: 1px solid var(--trait); background: linear-gradient(180deg, #e9eeec, #f6f8f7); }
.texte-recent__vignette img { display: block; width: 78%; height: auto; margin: var(--e-4) auto 0; border: 1px solid var(--trait); box-shadow: 0 10px 24px -14px rgba(10, 53, 48, 0.6); transform: rotate(-1.5deg); transition: transform var(--duree-moyenne) var(--courbe-sortie); }
.texte-recent:hover .texte-recent__vignette img { transform: rotate(0) translateY(-4px); }
.texte-recent__corps { display: flex; flex-direction: column; gap: var(--e-1); padding: var(--e-3) var(--e-4) var(--e-4); }
.texte-recent__pays { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e-2); color: var(--encre-3); font-size: var(--taille-xs); font-weight: 650; }
.texte-recent__ref { color: var(--encre); font-weight: 700; text-decoration: none; }
.texte-recent__titre { color: var(--encre-2); font-family: var(--police-document); font-size: var(--taille-s); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* --- Accueil du portail : aperçu de la comparaison ---------------------------------------- */
.apercu-comparaison { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: var(--e-6); align-items: center; padding: var(--e-6); background: linear-gradient(120deg, var(--surface) 0%, var(--vert-50) 100%); }
.apercu-comparaison h2 { margin-bottom: var(--e-2); }
.apercu-comparaison p { color: var(--encre-2); }
.apercu-comparaison__valeurs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--e-3); margin: 0; padding: 0; list-style: none; }
.apercu-comparaison__valeurs li { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; gap: 2px var(--e-3); margin: 0; padding: var(--e-3) var(--e-4); border: 1px solid var(--trait); border-radius: var(--r-3); background: var(--surface); }
.apercu-comparaison__valeurs .drapeau { grid-row: span 2; width: 2.1rem; height: 1.4rem; }
.apercu-comparaison__pays { color: var(--encre-2); font-size: var(--taille-s); font-weight: 650; }
.apercu-comparaison__valeurs strong { color: var(--vert-800); font-family: var(--police-titre); font-size: var(--taille-xl); font-variant-numeric: tabular-nums; }
.apercu-comparaison__valeurs a { text-decoration: none; }
.apercu-comparaison__valeurs a:hover strong { text-decoration: underline; }
@media (max-width: 56rem) { .apercu-comparaison { grid-template-columns: minmax(0, 1fr); padding: var(--e-5); } }
@media (max-width: 30rem) { .apercu-comparaison__valeurs { grid-template-columns: minmax(0, 1fr); } }
.comparer__notes { margin-top: var(--e-4); color: var(--encre-2); font-size: var(--taille-s); }
.comparer__notes p { display: flex; gap: var(--e-2); align-items: flex-start; }
.comparer__notes .icone { flex: none; margin-top: 3px; color: var(--vert-600); }

/* --- Accueil du portail : appel à contribuer ------------------------------------------------- */
.appel-contribution { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: var(--e-7); align-items: center; }
.appel-contribution__image { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 35%; border-radius: var(--r-4); box-shadow: var(--ombre-3); }
.appel-contribution__texte h2 { margin-bottom: var(--e-3); font-size: var(--taille-2xl); }
.appel-contribution__texte p { max-width: 36rem; color: var(--encre-2); }
@media (max-width: 56rem) { .appel-contribution { grid-template-columns: minmax(0, 1fr); gap: var(--e-5); } .appel-contribution__image { aspect-ratio: 16 / 9; } }

/* ==========================================================================
   Pages secondaires : rendu harmonisé
   ========================================================================== */

/* --- En-têtes de page : dégradé léger et trame hexagonale du logo, en décor ---------- */
.entete-page {
  position: relative;
  overflow: hidden;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 190' fill='none' stroke='%23c3e3dc' stroke-width='1.3'%3E%3Cpath d='M70 10l26 15v30L70 70 44 55V25zM122 10l26 15v30l-26 15-26-15V25zM174 10l26 15v30l-26 15-26-15V25zM226 10l26 15v30l-26 15-26-15V25zM96 55l26 15v30l-26 15-26-15V70zM148 55l26 15v30l-26 15-26-15V70zM200 55l26 15v30l-26 15-26-15V70zM122 100l26 15v30l-26 15-26-15v-30zM174 100l26 15v30l-26 15-26-15v-30zM226 100l26 15v30l-26 15-26-15v-30zM200 145l26 15v30l-26 15-26-15v-30z'/%3E%3C/svg%3E") no-repeat right -3rem top -1.5rem / 21rem auto,
    linear-gradient(180deg, var(--surface) 0%, #f0f7f5 100%);
}
.entete-page h1 { font-size: clamp(1.75rem, 1.15rem + 1.9vw, 2.55rem); line-height: 1.15; text-wrap: balance; }
.entete-page .chapo { max-width: 62ch; }
.entete-page .ariane li:last-child > span { display: inline-block; max-width: min(56ch, 70vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.entete-page--fiche h1 { font-size: clamp(1.55rem, 1.1rem + 1.4vw, 2.2rem); max-width: 46ch; }
@media (max-width: 40rem) {
  .entete-page { background-size: 13rem auto, auto; background-position: right -4rem top -2rem, 0 0; }
}

/* --- Titres de section : filet d'accent ------------------------------------------------ */
.bloc-fiche > h2,
.lecteur__annexes h2,
.bloc-metadonnees > h2,
.section-etroite > h2 { display: flex; align-items: center; gap: var(--e-3); text-wrap: balance; }
.bloc-fiche > h2::before,
.lecteur__annexes h2::before,
.bloc-metadonnees > h2::before,
.section-etroite > h2::before { content: ""; flex: none; width: 4px; height: 1.05em; border-radius: 2px; background: var(--vert-500); }
.groupe-documents__titre { padding-bottom: var(--e-3); border-bottom: 1px solid var(--trait); }

/* --- Cartes : relief et survol harmonisés ---------------------------------------------- */
.carte--interactive { transition: box-shadow var(--duree-moyenne) var(--courbe-standard), border-color var(--duree-moyenne), transform var(--duree-moyenne) var(--courbe-sortie); }
.carte--interactive:hover { transform: translateY(-2px); }
.mouvement-reduit .carte--interactive:hover { transform: none; }
.carte-regle__titre { line-height: 1.3; text-wrap: pretty; }
.carte-regle__pied { padding-top: var(--e-3); border-top: 1px dashed var(--trait); }

/* --- Tableaux ------------------------------------------------------------------------------------ */
.tableau thead th { background: var(--vert-50); color: var(--vert-900); border-bottom: 2px solid var(--vert-200); }
.tableau tbody tr:nth-child(even) > * { background: rgba(244, 247, 246, 0.6); }
.tableau tbody tr:hover > * { background: var(--vert-50); }
.tableau-conteneur { box-shadow: var(--ombre-1); }

/* --- Catalogue de recherche ------------------------------------------------------------------------ */
.filtres__panneau { box-shadow: var(--ombre-1); }
.filtres__groupe legend { color: var(--vert-900); }
.barre-resultats { padding-bottom: var(--e-3); border-bottom: 1px solid var(--trait); }
.barre-filtres { box-shadow: var(--ombre-1); }

/* --- Textes sources et résumés (lecteur) --------------------------------------------------------- */
.document__resume { padding: var(--e-4) var(--e-5); border-inline-start: 4px solid var(--vert-400); border-radius: 0; border-start-end-radius: var(--r-2); border-end-end-radius: var(--r-2); background: var(--surface); font-family: var(--police-document); line-height: 1.6; box-shadow: var(--ombre-1); }
.lecteur__vue { padding: var(--e-4); border: 1px solid var(--trait); border-radius: var(--r-3); background: var(--surface); box-shadow: var(--ombre-1); min-width: 0; }
.lecteur__titre-vue { padding-bottom: var(--e-2); border-bottom: 1px solid var(--trait); }
.lecteur__pages { padding: var(--e-2) var(--e-3); border: 1px solid var(--trait); border-radius: var(--r-pilule); background: var(--surface); }
.fiche-lecture li::marker { color: var(--vert-600); font-weight: 700; }
.fiche-lecture li { padding-block: var(--e-2); padding-inline: var(--e-2) 0; border-bottom: 1px solid var(--trait); }
.fiche-lecture li:last-child { border-bottom: 0; }
.bloc-metadonnees { padding: var(--e-5); border: 1px solid var(--trait); border-radius: var(--r-3); background: var(--surface); box-shadow: var(--ombre-1); }
.carte-document { transition: box-shadow var(--duree-moyenne), border-color var(--duree-moyenne); }

/* --- Fiches de règle ----------------------------------------------------------------------------- */
.reponse { box-shadow: var(--ombre-2); }
.fiche__aside .carte { box-shadow: var(--ombre-1); }
.preuve .citation, .preuve blockquote { box-shadow: var(--ombre-1); }

/* --- Pages pays et zones ---------------------------------------------------------------------------- */
.statistique { box-shadow: var(--ombre-1); }
.statistique__valeur { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .carte--interactive, .lien-fleche .icone, .texte-recent__vignette img { transition: none; }
  .carte--interactive:hover, .texte-recent:hover .texte-recent__vignette img { transform: none; }
}
