/* ==========================================================================
   PanneCI — Reset et primitives de mise en page
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--pc-bg);
  color: var(--pc-text);
  font-family: var(--pc-font-sans);
  font-size: var(--pc-text-base);
  line-height: var(--pc-leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--pc-3);
  font-weight: 700;
  line-height: var(--pc-leading-tight);
  letter-spacing: -0.02em;
  color: var(--pc-text);
}
h1 { font-size: var(--pc-text-4xl); }
h2 { font-size: var(--pc-text-3xl); }
h3 { font-size: var(--pc-text-2xl); }
h4 { font-size: var(--pc-text-xl); }
h5 { font-size: var(--pc-text-lg); }
h6 { font-size: var(--pc-text-base); }

p { margin: 0 0 var(--pc-4); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--pc-text-brand);
  text-decoration: none;
  transition: color var(--pc-transition);
}
a:hover { text-decoration: underline; }

img, svg, video { max-width: 100%; height: auto; display: block; }

hr {
  border: 0;
  border-top: 1px solid var(--pc-border);
  margin: var(--pc-6) 0;
}

code, pre, kbd, samp { font-family: var(--pc-font-mono); font-size: 0.9em; }
code {
  background: var(--pc-bg-sunken);
  border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius-sm);
  padding: 0.12em 0.4em;
}
pre {
  background: var(--pc-gray-950);
  color: #e2e8f0;
  border-radius: var(--pc-radius);
  padding: var(--pc-4);
  overflow-x: auto;
  margin: 0 0 var(--pc-4);
  line-height: 1.55;
}
pre code { background: none; border: 0; padding: 0; color: inherit; }

/* Focus visible — jamais supprimé, c'est le seul repère au clavier */
:focus-visible {
  outline: 2px solid var(--pc-border-focus);
  outline-offset: 2px;
}

::selection { background: var(--pc-orange-200); color: var(--pc-gray-900); }

/* ---------- Accessibilité ---------- */
.pc-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.pc-skip-link {
  position: absolute;
  left: var(--pc-4); top: -60px;
  z-index: 200;
  background: var(--pc-primary);
  color: var(--pc-primary-fg);
  padding: var(--pc-3) var(--pc-5);
  border-radius: var(--pc-radius);
  font-weight: 600;
  transition: top var(--pc-transition);
}
.pc-skip-link:focus { top: var(--pc-4); text-decoration: none; }

/* ---------- Conteneurs ---------- */
.pc-container {
  width: 100%;
  max-width: var(--pc-container);
  margin-inline: auto;
  padding-inline: var(--pc-4);
}
.pc-container--narrow { max-width: var(--pc-container-narrow); }
.pc-container--wide { max-width: 1440px; }

.pc-section { padding-block: var(--pc-12); }
.pc-section--sm { padding-block: var(--pc-8); }
.pc-section--lg { padding-block: var(--pc-20); }

/* ---------- Grille ---------- */
.pc-grid { display: grid; gap: var(--pc-5); }
.pc-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pc-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pc-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pc-grid--auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pc-grid--auto-sm { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
/* Contenu principal + colonne latérale, repliée sur une colonne en mobile. */
.pc-grid--sidebar { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .pc-grid--sidebar { grid-template-columns: minmax(0, 1fr); } }

@media (max-width: 1024px) {
  .pc-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pc-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .pc-grid--2, .pc-grid--3, .pc-grid--4 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Flex utilitaires ---------- */
.pc-row { display: flex; align-items: center; gap: var(--pc-3); }
.pc-row--between { justify-content: space-between; }
.pc-row--wrap { flex-wrap: wrap; }
.pc-row--top { align-items: flex-start; }
.pc-col { display: flex; flex-direction: column; gap: var(--pc-3); }
.pc-spacer { flex: 1 1 auto; }

/* ---------- Texte ---------- */
.pc-muted   { color: var(--pc-text-muted); }
.pc-subtle  { color: var(--pc-text-subtle); }
.pc-xs      { font-size: var(--pc-text-xs); }
.pc-sm      { font-size: var(--pc-text-sm); }
.pc-lg      { font-size: var(--pc-text-lg); }
.pc-bold    { font-weight: 700; }
.pc-medium  { font-weight: 500; }
.pc-semi    { font-weight: 600; }
.pc-center  { text-align: center; }
.pc-right   { text-align: right; }
.pc-nowrap  { white-space: nowrap; }
.pc-mono    { font-family: var(--pc-font-mono); }
.pc-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pc-lead {
  font-size: var(--pc-text-lg);
  color: var(--pc-text-muted);
  line-height: var(--pc-leading-normal);
}

/* ---------- Marges ponctuelles ---------- */
.pc-mt-0 { margin-top: 0; }
.pc-mt-2 { margin-top: var(--pc-2); }
.pc-mt-4 { margin-top: var(--pc-4); }
.pc-mt-6 { margin-top: var(--pc-6); }
.pc-mt-8 { margin-top: var(--pc-8); }
.pc-mb-0 { margin-bottom: 0; }
.pc-mb-2 { margin-bottom: var(--pc-2); }
.pc-mb-4 { margin-bottom: var(--pc-4); }
.pc-mb-6 { margin-bottom: var(--pc-6); }
.pc-mb-8 { margin-bottom: var(--pc-8); }

.pc-hide-mobile { }
@media (max-width: 768px) { .pc-hide-mobile { display: none !important; } }
.pc-show-mobile { display: none !important; }
@media (max-width: 768px) { .pc-show-mobile { display: block !important; } }
