/* Politicorama — ergonomic components */
.pol-container { width: min(100% - 2rem, var(--container)); margin-inline: auto; }

.pol-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.pol-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* POL-028 (intégration kit) : boutons en pilule, conformes à
   01-ui/buttons/btn-*.svg du kit (texte gardé en HTML, jamais incrusté dans
   l'image — les SVG du kit y contreviennent, non utilisés tels quels, voir
   rapport de mission). */
.pol-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 48px; padding: .75rem 1.4rem;
  border: 0; border-radius: var(--radius-pill);
  font: 600 1rem/1 "Montserrat", system-ui, sans-serif;
  cursor: pointer; text-decoration: none;
  transition: transform var(--duration) var(--ease), filter var(--duration) var(--ease);
}
.pol-btn:hover { transform: translateY(-1px); filter: brightness(.98); }
.pol-btn:focus-visible, .pol-input:focus-visible, .pol-chip:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--pol-teal) 55%, white);
  outline-offset: 2px;
}
/* POL-028 : convention du kit — primaire = navy (action la plus fréquente),
   secondaire = contour navy, accent = rouge (emphase ponctuelle, ex. carte
   "Sujet du moment"). Reprend exactement btn-primary/secondary/accent.svg
   du kit (couleurs et forme ; texte resté en HTML, jamais dans l'image). */
.pol-btn--primary { color: white; background: var(--pol-navy); }
.pol-btn--secondary { color: var(--pol-navy); background: white; border: 1px solid var(--pol-navy); }
.pol-btn--accent { color: white; background: var(--pol-red); }
.pol-btn--dark { color: white; background: var(--pol-navy); }

.pol-input {
  width: 100%; min-height: 46px; padding: .7rem 1rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); background: white;
  font: 400 1rem/1.3 inherit;
}
.pol-search { position: relative; }
.pol-search .pol-input { padding-left: 2.7rem; }

.pol-chip {
  display: inline-flex; align-items: center; min-height: 34px;
  padding: .35rem .8rem; border: 1px solid var(--border);
  border-radius: var(--radius-pill); background: var(--surface-soft);
  color: var(--pol-navy); font-size: .9rem; cursor: pointer;
  transition: background var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.pol-chip:hover { background: #eef4f6; transform: translateY(-1px); }

.pol-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.94); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.pol-nav__inner {
  display: flex; align-items: center; gap: 1rem; min-height: 68px;
}
.pol-nav__links { display: flex; gap: .35rem; margin-left: auto; }
.pol-nav__link {
  padding: .65rem .8rem; border-radius: 10px;
  color: var(--pol-navy); text-decoration: none; font-weight: 600;
}
.pol-nav__link:hover, .pol-nav__link[aria-current="page"] {
  color: var(--pol-red); background: #fff1f2;
}

.pol-grid { display: grid; gap: 1rem; }

/* POL-036 (conception POL-035 §6) : mosaïque asymétrique — remplace la
   grille adaptative uniforme (POL-028) support de l'ancien accordéon
   `<details>` (POL-025, retiré). POL-040 §4 (priorité 2) corrige la source
   du rythme : `.pol-theme--large`/`.pol-theme--haute` viennent désormais
   d'un motif fixe par position (`$atlasMotif`, index.php), jamais du nombre
   de sujets — POL-040 l'interdit explicitement, pour ne pas recréer de
   hiérarchie de fait. `grid-auto-flow: dense` comble les trous laissés par
   les tuiles hautes/larges. */
.pol-atlas__grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  grid-auto-flow: dense;
}
@media (min-width: 640px) {
  .pol-atlas__grid { grid-template-columns: repeat(4, 1fr); }
  .pol-theme--large { grid-column: span 2; }
  .pol-theme--haute { grid-row: span 2; }
  /* Alignements non uniformes (POL-040 §4) : légère respiration verticale en
     dents de scie sur les tuiles normales, uniquement au-delà de 640px pour
     ne jamais perturber l'empilement mobile — assez discret pour ne pas
     lire comme une erreur d'alignement. */
  .pol-theme:not(.pol-theme--large):not(.pol-theme--haute):nth-child(3n+2) { margin-block-start: var(--space-4); }
}

/* POL-036 : `.pol-theme` porté par un <a> (POL-035 §6 : « entrer dans une
   zone », pas déplier une ligne) vers `verticals/territoire.php` — plus un
   <details>/<summary> (POL-025/028, retiré). Mêmes 8 teintes dérivées de la
   palette du kit (color-mix, jamais de hex arbitraire), même logique de
   repli (teinte seule si aucun hero fiable, `.pol-theme--hero` sinon). */
.pol-theme {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; gap: var(--space-2);
  min-height: 160px; padding: var(--space-4);
  border-radius: var(--radius-md); text-decoration: none; color: var(--text);
  border: 1px solid transparent; box-shadow: var(--shadow-sm);
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.pol-theme:hover, .pol-theme:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.pol-theme:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--pol-teal) 55%, white); outline-offset: 2px;
}
.pol-theme--large, .pol-theme--haute { min-height: 220px; }
.pol-theme--eco { background: color-mix(in srgb, var(--pol-teal) 14%, white); }
.pol-theme--justice { background: color-mix(in srgb, var(--pol-red) 8%, white); }
.pol-theme--demo { background: color-mix(in srgb, var(--pol-blue) 10%, white); }
.pol-theme--international { background: color-mix(in srgb, var(--pol-orange) 12%, white); }
.pol-theme--societal { background: color-mix(in srgb, var(--pol-violet) 10%, white); }
.pol-theme--eco2 { background: color-mix(in srgb, var(--pol-green) 12%, white); }
.pol-theme--navy { background: color-mix(in srgb, var(--pol-navy) 8%, white); }
.pol-theme--pink { background: color-mix(in srgb, var(--pol-pink) 10%, white); }

/* POL-054 — même dérivation `.pol-theme--*` que la mosaïque de l'atlas
 * ci-dessus, réutilisée comme fil conducteur d'accent (une seule couleur,
 * cohérente sur toute une page sujet) par le carnet d'itinéraire de
 * decouverte.php (vertical-retraite.css `.pol-carnet`) — jamais une couleur
 * par formation politique, qui laisserait croire à un code partisan. */
.pol-theme--eco { --pol-accent: var(--pol-teal); }
.pol-theme--justice { --pol-accent: var(--pol-red); }
.pol-theme--demo { --pol-accent: var(--pol-blue); }
.pol-theme--international { --pol-accent: var(--pol-orange); }
.pol-theme--societal { --pol-accent: var(--pol-violet); }
.pol-theme--eco2 { --pol-accent: var(--pol-green); }
.pol-theme--navy { --pol-accent: var(--pol-navy); }
.pol-theme--pink { --pol-accent: var(--pol-pink); }

/* Bandeau photo pour les territoires disposant d'un hero fiable sur disque
   (voir `PoliticoramaLayout::territoireHeroUrl()`) : photo en `::before`
   plein cadre, dégradé sombre superposé pour garder le texte lisible — la
   teinte `.pol-theme--*` reste la couleur de fond, donc sert toujours de
   repli si l'image ne charge pas. `--pol-theme-hero-img` posée en style
   inline par territoire (chemin d'asset, pas une couleur). */
.pol-theme--hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: var(--pol-theme-hero-img); background-size: cover; background-position: center;
}
.pol-theme--hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(15,23,42,.72) 100%);
}
.pol-theme--hero { color: white; }
.pol-theme__label, .pol-theme__meta { position: relative; z-index: 1; }
.pol-theme__label { font: 700 1.05rem/1.25 "Montserrat", sans-serif; }
.pol-theme--large .pol-theme__label, .pol-theme--haute .pol-theme__label { font-size: 1.3rem; }
.pol-theme__meta {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  font-size: .85rem;
}
.pol-theme__count { color: var(--muted); }
.pol-theme--hero .pol-theme__count { color: rgba(255,255,255,.85); }
.pol-theme__affordance {
  font-weight: 700; color: var(--pol-navy);
  opacity: 0; transform: translateX(-4px);
  transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.pol-theme--hero .pol-theme__affordance { color: white; }
.pol-theme:hover .pol-theme__affordance, .pol-theme:focus-visible .pol-theme__affordance {
  opacity: 1; transform: translateX(0);
}

/* POL-028B (corrective visuelle) : cartes "poursuivre" à accentuation
   optionnelle (voir `PoliticoramaLayout::continueCard()`), sans nouvelle
   couleur — uniquement les tokens déjà définis. */
.pol-discovery__card--feature {
  border: 1px solid var(--pol-red);
  background: color-mix(in srgb, var(--pol-red) 5%, white);
}
.pol-discovery__card--feature .pol-discovery__card-title { font-size: 1.3rem; }
.pol-discovery__card--secondary { background: var(--surface-soft); }

.pol-progress { height: 8px; overflow: hidden; border-radius: 99px; background: #e7edf1; }
.pol-progress > span { display: block; height: 100%; width: var(--progress, 50%); border-radius: inherit; background: var(--pol-teal); }

.pol-sidebar {
  width: 250px; flex: 0 0 250px; padding: 1rem;
  border-radius: var(--radius-lg); background: var(--pol-navy); color: white;
}
.pol-sidebar a { display:block; padding:.65rem .75rem; color:white; text-decoration:none; border-radius:10px; opacity:.9; }
.pol-sidebar a:hover, .pol-sidebar a[aria-current="page"] { background: rgba(255,255,255,.12); opacity:1; }
