/* ============================================================
   PaysagePro — 10-reset.css
   Remise a plat et style par defaut des elements nus.

   PIECE MAITRESSE DE LA MIGRATION.

   Le rendu de l'ancien socle tenait parce que zip15.css stylait les
   elements NUS (table, th, td, input, select, label) en !important :
   c'est ce qui sauvait les 84 <table> sans classe et les 101 <input>
   sans .form-control repartis dans les 224 vues.

   Ce fichier reprend cette responsabilite, mais a specificite ZERO
   grace a :where(). Consequence : n'importe quelle classe reelle
   (.pp-table--compact, .pp-input, une regle de vue) gagne sans avoir
   besoin d'un !important. On ne migre pas 224 vues, on rend le HTML
   sans classe correct par defaut.

   Un seul !important dans ce fichier, pour prefers-reduced-motion.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 16px;              /* 15px auparavant */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--pp-font-sans);
  font-size: var(--pp-fs-500);
  line-height: var(--pp-lh-normal);
  color: var(--pp-text);
  background: var(--pp-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ------------------------------------------------------------
   Titres
   ------------------------------------------------------------ */
:where(h1, h2, h3, h4, h5, h6) {
  margin: 0 0 var(--pp-space-3);
  font-weight: var(--pp-fw-semibold);
  line-height: var(--pp-lh-tight);
  letter-spacing: var(--pp-ls-tight);
  color: var(--pp-text);
  text-wrap: balance;
}
:where(h1) { font-size: var(--pp-fs-900); }
:where(h2) { font-size: var(--pp-fs-800); }
:where(h3) { font-size: var(--pp-fs-700); }
:where(h4) { font-size: var(--pp-fs-600); letter-spacing: normal; }
:where(h5, h6) { font-size: var(--pp-fs-500); letter-spacing: normal; }

:where(p) { margin: 0 0 var(--pp-space-4); }
:where(p:last-child) { margin-bottom: 0; }

:where(small) { font-size: var(--pp-fs-300); }
:where(strong, b) { font-weight: var(--pp-fw-semibold); }
:where(code, kbd, samp, pre) { font-family: var(--pp-font-mono); font-size: 0.92em; }
:where(hr) {
  border: 0;
  border-top: 1px solid var(--pp-border);
  margin: var(--pp-space-6) 0;
}

/* ------------------------------------------------------------
   Liens
   ------------------------------------------------------------ */
:where(a) {
  color: var(--pp-link);
  text-decoration: none;
}
:where(a:hover) {
  color: var(--pp-link-hover);
  text-decoration: underline;
}

/* ------------------------------------------------------------
   Medias
   ------------------------------------------------------------ */
:where(img, svg, video, canvas) {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ------------------------------------------------------------
   Tableaux

   Ces quatre regles remplacent le bloc table{...!important} de
   zip15.css et couvrent les 84 tableaux sans classe.
   ------------------------------------------------------------ */
:where(table) {
  width: 100%;
  border-collapse: collapse;
  color: var(--pp-text);
  font-size: var(--pp-fs-400);
}
:where(th) {
  text-align: left;
  font-weight: var(--pp-fw-semibold);
  color: var(--pp-th-text);
  background: var(--pp-th-bg);
  padding: var(--pp-space-3);
  border-bottom: 1px solid var(--pp-border-strong);
}
:where(td) {
  padding: var(--pp-space-3);
  border-bottom: 1px solid var(--pp-border);
  vertical-align: middle;
}
:where(caption) {
  caption-side: bottom;
  padding-top: var(--pp-space-2);
  font-size: var(--pp-fs-300);
  color: var(--pp-text-muted);
  text-align: left;
}

/* ------------------------------------------------------------
   Formulaires

   Remplace le bloc de zip15.css qui ciblait chaque type d'input en
   !important. Couvre les 101 champs sans .form-control.
   ------------------------------------------------------------ */
:where(input, select, textarea, button) {
  font: inherit;
  color: inherit;
}

/* Le selecteur compose doit tenir sur UNE ligne : un retour a la ligne
   entre deux :not() serait interprete comme un combinateur descendant. */
:where(input:not([type="checkbox"], [type="radio"], [type="submit"], [type="button"], [type="reset"], [type="range"], [type="color"], [type="file"], [type="image"]), select, textarea) {
  padding: var(--pp-space-2) var(--pp-space-3);
  background: var(--pp-input-bg);
  color: var(--pp-text);
  border: 1px solid var(--pp-border);
  border-radius: var(--pp-radius-sm);
  font-size: var(--pp-fs-400);
  transition: border-color var(--pp-dur-fast) var(--pp-ease-standard),
              box-shadow var(--pp-dur-fast) var(--pp-ease-standard);
}

:where(textarea) { min-height: 5rem; resize: vertical; }

:where(input, select, textarea)::placeholder {
  color: var(--pp-text-subtle);
  opacity: 1;
}

/* Interdit tout label colore dans l'ancien socle (zip15 posait
   color:var(--pp-text)!important) : ici la couleur reste surchargeable. */
:where(label) {
  color: var(--pp-text);
  font-size: var(--pp-fs-400);
}

:where(fieldset) {
  border: 1px solid var(--pp-border);
  border-radius: var(--pp-radius);
  padding: var(--pp-space-4);
  margin: 0 0 var(--pp-space-4);
}
:where(legend) {
  padding: 0 var(--pp-space-2);
  font-weight: var(--pp-fw-semibold);
  font-size: var(--pp-fs-400);
}

:where(input[type="checkbox"], input[type="radio"]) {
  accent-color: var(--pp-primary);
  inline-size: 1rem;
  block-size: 1rem;
}

/* ------------------------------------------------------------
   Focus visible

   L'ancien socle n'avait AUCUNE regle globale : ni les boutons ni les
   liens de la sidebar n'avaient d'etat de focus, ce qui rendait la
   navigation au clavier impossible a suivre.
   ------------------------------------------------------------ */
:where(a, button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])):focus-visible {
  outline: 2px solid var(--pp-focus-color);
  outline-offset: 2px;
  border-radius: var(--pp-radius-xs);
}

/* Dans la sidebar, l'anneau vert primaire serait invisible sur le fond
   vert profond : on prend un vert clair, en trait interieur. */
.app-sidebar :focus-visible {
  outline-color: var(--pp-g-300, #92cba9);
  outline-offset: -2px;
}

:where(:focus:not(:focus-visible)) { outline: none; }

/* ------------------------------------------------------------
   Mouvement

   Le seul !important du fichier, et il est justifie : il doit battre
   toute transition posee ailleurs, y compris en style inline.
   Supprime au passage le scroll-behavior:smooth de zip15.css:611,
   qui ignorait la preference systeme.
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------
   Impression
   ------------------------------------------------------------ */
@media print {
  .app-sidebar, .app-header, .app-footer, .app-scrim,
  .pp-skip-link, .breadcrumb-trail, .pp-toast-region { display: none !important; }
  body, .app-main { background: #fff; color: #000; overflow: visible; }
  .app-main { padding: 0; }
  :where(a)::after { content: ""; }
}
