/* ==========================================================================
   Composants AURA
   --------------------------------------------------------------------------
   Le vocabulaire de boutons et de champs vient de docs/templates/formulaires.html,
   repris tel quel pour ne pas inventer une seconde convention. Le reste convertit
   en classes les styles inline des quatre autres templates.
   ========================================================================== */

/* ==========================================================================
   1. Mise en page
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter-sm);
}

@media (min-width: 48rem) {
  .container {
    padding-inline: var(--gutter);
  }
}

.section {
  padding-block: var(--sp-section);
}

.section--flush-top    { padding-block-start: 0; }
.section--flush-bottom { padding-block-end: 0; }
.section--line         { border-top: 1px solid var(--line); }

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--sp-10);
}

/* En-tête de section : titre géant à gauche, texte d'appui à droite. */
.sec-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--sp-6);
  padding-bottom: var(--sp-7);
  border-bottom: 1px solid var(--line);
}

.sec-head--plain {
  border-bottom: 0;
  padding-bottom: 0;
}

.sec-head__text {
  max-width: 24rem;
  font-size: var(--t-md);
  line-height: 1.6;
  color: var(--muted);
}

.sec-head__count {
  font-size: 0.4em;
  color: var(--acc);
  vertical-align: top;
}

/* ==========================================================================
   2. Effets signature
   ========================================================================== */

/* Le coin bas-droit coupé, marque de fabrique des boutons AURA. */
.cut {
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - var(--cut)),
    calc(100% - var(--cut)) 100%,
    0 100%
  );
}

.cut--sm {
  --cut: var(--cut-sm);
}

/* Voiles dégradés posés sur les visuels, pour que le texte reste lisible. */
.shade,
.shade-b,
.shade-l {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.shade {
  background: linear-gradient(
    180deg,
    rgba(12, 12, 12, 0.55) 0%,
    rgba(12, 12, 12, 0) 28%,
    rgba(12, 12, 12, 0) 45%,
    rgba(12, 12, 12, 0.92) 100%
  );
}

.shade-b {
  background: linear-gradient(
    180deg,
    rgba(12, 12, 12, 0) 35%,
    rgba(12, 12, 12, 0.95) 100%
  );
}

.shade-l {
  background: linear-gradient(
    90deg,
    rgba(12, 12, 12, 0.92) 0%,
    rgba(12, 12, 12, 0.6) 45%,
    rgba(12, 12, 12, 0) 75%
  );
}

/* Léger zoom du visuel au survol de la carte entière. */
.zoom {
  overflow: hidden;
}

.zoom img {
  transition: transform 0.6s var(--ease);
}

.zoom:hover img,
.zoom:focus-visible img {
  transform: scale(1.05);
}

/* Visuel de fond d'une carte ou d'un hero. */
.cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Lien souligné d'un trait épais. */
.ulink {
  border-bottom: 2px solid currentColor;
  padding-bottom: 2px;
  font-weight: 800;
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
}

.arrow {
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: square;
}

/* ==========================================================================
   3. Boutons
   ========================================================================== */

.btn {
  font-family: var(--font-text);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  text-decoration: none;
  box-sizing: border-box;
  transition: background 0.15s, color 0.15s, transform 0.1s, filter 0.15s;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled,
.btn.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

/* Tailles. Les hauteurs respectent la cible tactile de 44 px. */
.s-l { height: 3.75rem; padding-inline: 1.875rem; font-size: var(--t-base); min-width: 15rem; }
.s-m { height: 3rem;    padding-inline: 1.375rem; font-size: var(--t-xs);   min-width: 12.5rem; }
.s-s { height: var(--tap); padding-inline: 0.875rem; font-size: var(--t-3xs); min-width: 8.75rem; }

/* En groupe, un bouton ne doit pas imposer sa largeur minimale. */
.grp .btn,
.btn--auto {
  min-width: 0;
}

.b-pri {
  background: var(--acc);
  color: var(--ink);
}

.b-pri:hover:not(:disabled) {
  filter: brightness(1.12);
  color: var(--ink);
}

.b-out {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 2px var(--text);
}

.b-out:hover:not(:disabled) {
  background: var(--text);
  color: var(--ink);
}

.b-light {
  background: var(--text);
  color: var(--ink);
}

.b-light:hover:not(:disabled) {
  background: var(--text-bright);
  color: var(--ink);
}

.b-dark {
  background: var(--surface-3);
  color: var(--text);
}

.b-dark:hover:not(:disabled) {
  background: var(--surface-4);
}

.b-ghost {
  background: transparent;
  color: var(--acc);
  padding-inline: 0;
  min-width: 0;
}

.b-ghost:hover:not(:disabled) {
  color: var(--text-bright);
}

.b-danger {
  background: var(--danger);
  color: var(--ink);
}

.b-danger:hover:not(:disabled) {
  filter: brightness(1.1);
  color: var(--ink);
}

.b-icon {
  width: 3rem;
  height: 3rem;
  padding: 0;
  min-width: 0;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
}

/* ==========================================================================
   4. Champs de formulaire
   ========================================================================== */

.fl {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
}

.lb {
  font-size: var(--t-3xs);
  font-weight: 800;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--text-3);
}

.hint {
  font-size: var(--t-2xs);
  color: var(--muted-2);
}

.in {
  width: 100%;
  box-sizing: border-box;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 0;
  color: var(--text);
  font-family: var(--font-text);
  font-size: var(--t-base);
  padding: 0.9375rem 1rem;
  min-height: 3.25rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.in::placeholder { color: var(--faint); }
.in:hover        { border-color: var(--line-3); }

.in:focus {
  border-color: var(--acc);
  box-shadow: 0 0 0 1px var(--acc);
}

.in.err {
  border-color: var(--err);
  box-shadow: 0 0 0 1px var(--err);
}

.in.ok { border-color: var(--ok); }

.in:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

textarea.in {
  min-height: 8.75rem;
  resize: vertical;
  line-height: var(--lh-normal);
}

.msg-err,
.msg-ok {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--t-2xs);
  font-weight: 600;
}

.msg-err { color: var(--err-text); }
.msg-ok  { color: var(--ok); }

/* Champ précédé d'une icône. */
.wrap-ico {
  position: relative;
  display: flex;
}

.wrap-ico .in { padding-left: 2.875rem; }

.wrap-ico > svg,
.wrap-ico > .ico {
  position: absolute;
  left: 0.9375rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--muted-2);
}

/* Liste déroulante : on masque la flèche native pour poser la nôtre. */
.sel {
  position: relative;
  display: flex;
}

.sel select {
  appearance: none;
  padding-right: 2.875rem;
  cursor: pointer;
}

.sel svg {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Champ accolé à un bouton ou à un préfixe. */
.grp {
  display: flex;
}

.grp .in { flex: 1; }

.addon {
  display: flex;
  align-items: center;
  padding-inline: 1rem;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  border-right: 0;
  color: var(--muted);
  font-size: var(--t-sm);
  font-weight: 600;
  white-space: nowrap;
}

/* ==========================================================================
   5. Cases, radios, interrupteurs
   ========================================================================== */

.ck {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  cursor: pointer;
  min-height: var(--tap);
  font-size: var(--t-base);
}

.ck input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.ck .box {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  box-sizing: border-box;
  border: 2px solid var(--line-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.ck .rd { border-radius: 50%; }

.ck:hover .box { border-color: var(--line-hover); }

.ck input:checked + .box {
  background: var(--acc);
  border-color: var(--acc);
  color: var(--ink);
}

.ck input:checked + .rd {
  background: var(--bg);
  box-shadow: inset 0 0 0 5px var(--acc);
}

.ck input:focus-visible + .box {
  outline: 3px solid var(--text);
  outline-offset: 3px;
}

.ck input:disabled + .box { opacity: 0.35; }

.ck.dis {
  cursor: not-allowed;
  color: var(--faint);
}

.sw {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  cursor: pointer;
  min-height: var(--tap);
  font-size: var(--t-base);
}

.sw input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.sw .tr {
  position: relative;
  width: 3.25rem;
  height: 1.75rem;
  flex: none;
  background: var(--surface-4);
  transition: background 0.15s;
}

.sw .tr::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 1.25rem;
  height: 1.25rem;
  background: var(--muted-2);
  transition: transform 0.18s, background 0.18s;
}

.sw input:checked + .tr { background: var(--acc); }

.sw input:checked + .tr::after {
  transform: translateX(1.5rem);
  background: var(--ink);
}

.sw input:focus-visible + .tr {
  outline: 3px solid var(--text);
  outline-offset: 3px;
}

/* Choix segmenté. */
.seg {
  display: flex;
  flex-wrap: wrap;
  border: 1px solid var(--line-2);
  width: max-content;
  max-width: 100%;
}

.seg label { position: relative; cursor: pointer; }

.seg input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.seg span {
  display: flex;
  align-items: center;
  min-height: 3rem;
  padding-inline: 1.25rem;
  font-size: var(--t-2xs);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}

.seg label:hover span { color: var(--text); }

.seg input:checked + span {
  background: var(--acc);
  color: var(--ink);
}

.seg input:focus-visible + span {
  outline: 3px solid var(--text);
  outline-offset: -3px;
}

/* Pastilles à cocher. */
.chip { position: relative; cursor: pointer; }

.chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.chip span {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: var(--tap);
  padding-inline: 1rem;
  border: 1px solid var(--line-2);
  font-size: var(--t-xs);
  font-weight: 600;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.chip:hover span { border-color: var(--muted-2); }

.chip input:checked + span {
  background: var(--text);
  color: var(--ink);
  border-color: var(--text);
}

.chip input:focus-visible + span {
  outline: 3px solid var(--text);
  outline-offset: 3px;
}

.rng {
  width: 100%;
  height: 1.75rem;
  accent-color: var(--acc);
  cursor: pointer;
}

/* Zone de dépôt de fichier. */
.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 2.25rem 1.5rem;
  border: 2px dashed var(--line-2);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.drop:hover {
  border-color: var(--acc);
  background: var(--surface);
}

.drop input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

/* ==========================================================================
   6. Cartes
   ========================================================================== */

.card {
  background: var(--surface);
  border: 1px solid #242424;
  padding: var(--sp-8);
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  min-width: 0;
  box-sizing: border-box;
}

.ttl {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--d-sm);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.state {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ==========================================================================
   7. Bandeau défilant
   ========================================================================== */

.ticker {
  /* Hauteur fixe : le hero la soustrait de 100svh pour que le bandeau tombe
     pile en bas du premier écran. */
  height: var(--ticker-h);
  display: flex;
  align-items: center;
  background: var(--acc);
  color: var(--ink);
  overflow: hidden;
  border-top: 1px solid var(--ink);
}

.ticker__track {
  display: flex;
  align-items: center;
  width: max-content;
  gap: var(--sp-10);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.5rem, 4vw, 2.125rem);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  animation: ticker-scroll 38s linear infinite;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Le défilement est décoratif : on l'arrête s'il gêne. Le bandeau reprend
   alors une hauteur libre, puisque son contenu passe à la ligne. */
@media (prefers-reduced-motion: reduce) {
  .ticker {
    height: auto;
    padding-block: var(--sp-4);
  }

  .ticker__track {
    animation: none;
    flex-wrap: wrap;
    width: auto;
    white-space: normal;
    padding-inline: var(--gutter-sm);
  }
}

/* ==========================================================================
   8. Bandes horizontales défilantes
   ========================================================================== */

.strip {
  display: flex;
  gap: var(--sp-4);
  overflow-x: auto;
  padding-inline: var(--gutter-sm);
  padding-bottom: var(--sp-4);
  scroll-snap-type: x proximity;
  scrollbar-color: #333 transparent;
}

@media (min-width: 48rem) {
  .strip { padding-inline: var(--gutter); }
}

.strip > * {
  scroll-snap-align: start;
}

.strip::-webkit-scrollbar { height: 6px; }
.strip::-webkit-scrollbar-thumb { background: #333; }

/* ==========================================================================
   9. Corps d'article
   ========================================================================== */

.prose {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  min-width: 0;
}

.prose p,
.prose li {
  font-size: var(--t-lg);
  line-height: var(--lh-prose);
  color: var(--text-3);
}

.prose h2 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 0.95;
  text-transform: uppercase;
  margin-top: var(--sp-6);
  scroll-margin-top: calc(var(--nav-h) + var(--sp-4));
}

.prose h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  text-transform: uppercase;
  margin-top: var(--sp-4);
}

.prose strong { color: var(--text); }

.prose ul,
.prose ol {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding-left: var(--sp-5);
}

.prose ul li { list-style: none; position: relative; }

.prose ul li::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--sp-5));
  top: 0.75em;
  width: 0.5rem;
  height: 2px;
  background: var(--acc);
}

.prose ol { list-style: decimal; }
.prose ol li { list-style: decimal; }

.prose a {
  color: var(--acc);
  border-bottom: 1px solid currentColor;
}

.prose code {
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  padding: 0.1em 0.35em;
  font-size: 0.9em;
}

.prose pre {
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  padding: var(--sp-4);
  overflow-x: auto;
}

.prose pre code {
  border: 0;
  padding: 0;
  background: none;
}

.prose blockquote {
  border-left: 2px solid var(--acc);
  padding-left: var(--sp-5);
  color: var(--muted);
}

.prose img {
  width: 100%;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-sm);
}

.prose th,
.prose td {
  border: 1px solid var(--line-2);
  padding: var(--sp-3);
  text-align: left;
}

.prose th {
  background: var(--surface-2);
  text-transform: uppercase;
  font-size: var(--t-3xs);
  letter-spacing: var(--ls-label);
}

/* Les tableaux d'un article doivent pouvoir défiler seuls. */
.prose__scroll {
  overflow-x: auto;
}

/* ==========================================================================
   10. Pastilles d'état
   ========================================================================== */

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--bg);
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--t-2xs);
  font-weight: 700;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  white-space: nowrap;
}

.pill--acc {
  background: var(--acc);
  color: var(--ink);
}

.dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex: none;
  background: var(--muted-2);
}

.dot--on  { background: var(--acc); }
.dot--off { background: var(--err); }
