/* ═══════════════════════════════════════════════════════════════════
   dashboard-downloads-v11.css — Onglet "Téléchargement" du dashboard
   Scope : .dld-* (locked, ne touche aucune autre classe du dashboard)
   Mobile-first, anti-cliché v11, glass cards, premium polish
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --dld-red:        #DC2626;
  --dld-red-2:      #991B1B;
  --dld-red-glow:   rgba(220, 38, 38, 0.18);
  --dld-red-line:   rgba(220, 38, 38, 0.28);
  --dld-text:       #F1F5F9;
  --dld-text-2:     #CBD5E1;
  --dld-text-3:     #94A3B8;
  --dld-mono:       'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --dld-serif:      'Instrument Serif', 'Times New Roman', serif;
  --dld-sans:       'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --dld-glass-bg:   rgba(255, 255, 255, 0.018);
  --dld-glass-bd:   rgba(255, 255, 255, 0.06);
  --dld-glass-bd-2: rgba(255, 255, 255, 0.10);
  --dld-radius:     14px;
  --dld-radius-sm:  10px;
}

/* Light mode override (matches dashboard-v9 light theme tokens) */
body.theme-light .dld-root {
  --dld-text:       #1A1A1F;
  --dld-text-2:     #334155;
  --dld-text-3:     #64748B;
  --dld-glass-bg:   rgba(0, 0, 0, 0.018);
  --dld-glass-bd:   rgba(0, 0, 0, 0.08);
  --dld-glass-bd-2: rgba(0, 0, 0, 0.12);
}

/* ═══ ROOT — espacement vertical entre sections ═══ */
.dld-root {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 0;
  font-family: var(--dld-sans);
  color: var(--dld-text);
}
@media (max-width: 1023px) {
  .dld-root { gap: 18px; }
}

/* ═══ SECTION — wrapper glass commun ═══ */
.dld-sec {
  position: relative;
  background: var(--dld-glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--dld-glass-bd);
  border-radius: var(--dld-radius);
  padding: 28px;
  opacity: 0;
  animation: dld-fade-in 0.45s ease-out forwards;
}
.dld-sec:nth-child(1) { animation-delay: 0ms; }
.dld-sec:nth-child(2) { animation-delay: 80ms; }
.dld-sec:nth-child(3) { animation-delay: 160ms; }
.dld-sec:nth-child(4) { animation-delay: 240ms; }
.dld-sec:nth-child(5) { animation-delay: 320ms; }
.dld-sec:nth-child(6) { animation-delay: 380ms; }

@media (max-width: 1023px) { .dld-sec { padding: 20px; } }
@media (max-width: 640px)  { .dld-sec { padding: 18px 16px; border-radius: 12px; } }

@keyframes dld-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .dld-sec { animation: none; opacity: 1; }
  .dld-card { transition: none !important; }
  .dld-pulse { animation: none !important; }
}

/* ═══ EYEBROW — étiquette mono rouge (anti-cliché v11, sans pill) ═══ */
.dld-eyebrow {
  display: inline-block;
  font-family: var(--dld-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dld-red);
  margin: 0 0 14px 0;
}

/* ═══════════════════════════════════════════════════════════════════
   1) HERO TÉLÉCHARGEMENT
   ═══════════════════════════════════════════════════════════════════ */
.dld-hero { padding-top: 32px; padding-bottom: 32px; }
@media (max-width: 640px) { .dld-hero { padding-top: 22px; padding-bottom: 22px; } }

.dld-hero__title {
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--dld-text);
  margin: 0 0 12px 0;
}
.dld-hero__title em {
  font-family: var(--dld-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--dld-text);
}
.dld-hero__lede {
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--dld-text-2);
  margin: 0 0 18px 0;
  max-width: 60ch;
}
@media (max-width: 640px) {
  .dld-hero__lede { font-size: 0.9375rem; }
}

.dld-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* Pill mono "STABLE / BETA / ALPHA" avec dot pulsé */
.dld-channel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--dld-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dld-text);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--dld-glass-bd-2);
  background: rgba(255, 255, 255, 0.025);
}
body.theme-light .dld-root .dld-channel { background: rgba(0, 0, 0, 0.025); }

.dld-channel__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
  animation: dld-pulse 2s ease-out infinite;
}
.dld-channel--beta  .dld-channel__dot { background: #f59e0b; box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55); }
.dld-channel--alpha .dld-channel__dot { background: var(--dld-red); box-shadow: 0 0 0 0 var(--dld-red-glow); }
.dld-pulse { animation: dld-pulse 2s ease-out infinite; }
@keyframes dld-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  60%  { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.dld-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--dld-mono);
  font-size: 0.78rem;
  color: var(--dld-text-3);
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--dld-glass-bd);
}
body.theme-light .dld-root .dld-meta-chip { background: rgba(0, 0, 0, 0.025); }

/* ═══════════════════════════════════════════════════════════════════
   2) DUAL CARDS — installateur / mise à jour
   ═══════════════════════════════════════════════════════════════════ */
.dld-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 0;
  background: transparent;
  border: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
@media (min-width: 1024px) {
  .dld-cards { grid-template-columns: 1fr 1fr; gap: 18px; }
}

.dld-card {
  position: relative;
  background: var(--dld-glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--dld-glass-bd);
  border-radius: var(--dld-radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.dld-card:hover {
  transform: translateY(-2px);
  border-color: var(--dld-red-line);
  box-shadow: 0 14px 38px -18px var(--dld-red-glow);
}
.dld-card--primary { border-color: var(--dld-red-line); }
@media (max-width: 640px) { .dld-card { padding: 20px; } }

.dld-card__head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.dld-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--dld-red), var(--dld-red-2));
  color: #fff;
  font-size: 1.05rem;
  flex-shrink: 0;
  box-shadow: 0 6px 18px -6px var(--dld-red-glow);
}
.dld-card__icon--soft {
  background: rgba(255, 255, 255, 0.04);
  color: var(--dld-text-2);
  box-shadow: none;
  border: 1px solid var(--dld-glass-bd);
}
body.theme-light .dld-root .dld-card__icon--soft { background: rgba(0, 0, 0, 0.04); }

.dld-card__title-wrap { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dld-card__kicker {
  font-family: var(--dld-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dld-text-3);
}
.dld-card__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--dld-text);
  margin: 0;
  letter-spacing: -0.01em;
}

.dld-card__file {
  font-family: var(--dld-mono);
  font-size: 0.84rem;
  color: var(--dld-text-2);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--dld-glass-bd);
  border-radius: var(--dld-radius-sm);
  padding: 10px 12px;
  word-break: break-all;
  line-height: 1.45;
}
body.theme-light .dld-root .dld-card__file { background: rgba(0, 0, 0, 0.025); }

.dld-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-family: var(--dld-mono);
  font-size: 0.75rem;
  color: var(--dld-text-3);
}
.dld-card__meta b {
  font-weight: 600;
  color: var(--dld-text-2);
}

/* SHA hash row */
.dld-sha {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--dld-mono);
  font-size: 0.72rem;
  color: var(--dld-text-3);
  margin-top: 2px;
}
.dld-sha__label { color: var(--dld-text-3); flex-shrink: 0; }
.dld-sha__val {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--dld-text-2);
}
.dld-sha__copy {
  flex-shrink: 0;
  min-width: 32px;
  min-height: 32px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--dld-glass-bd);
  border-radius: 6px;
  background: transparent;
  color: var(--dld-text-3);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  font-size: 0.78rem;
}
.dld-sha__copy:hover {
  color: var(--dld-red);
  border-color: var(--dld-red-line);
  background: rgba(220, 38, 38, 0.05);
}
.dld-sha__copy:focus-visible {
  outline: 2px solid var(--dld-red);
  outline-offset: 2px;
}
.dld-sha__copy.is-ok { color: #22c55e; border-color: rgba(34, 197, 94, 0.45); }

/* CTA primary solid (anti-cliché v11) */
.dld-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--dld-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  padding: 14px 22px;
  min-height: 46px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.15s ease;
  text-decoration: none;
  width: 100%;
}
.dld-btn--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--dld-red), var(--dld-red-2));
  box-shadow: 0 10px 22px -10px var(--dld-red-glow);
}
.dld-btn--primary:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -12px var(--dld-red-glow); }
.dld-btn--primary:active { transform: translateY(0); }
.dld-btn--primary[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }
.dld-btn--primary:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.dld-btn--secondary {
  background: transparent;
  color: var(--dld-text);
  border: 1px solid var(--dld-glass-bd-2);
}
.dld-btn--secondary:hover { border-color: var(--dld-red-line); color: var(--dld-red); }
.dld-btn--secondary:focus-visible { outline: 2px solid var(--dld-red); outline-offset: 2px; }

.dld-btn.is-loading { pointer-events: none; }

/* Text-link with chevron (anti-cliché v11 secondary) */
.dld-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--dld-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--dld-red);
  text-decoration: none;
  background: transparent;
  border: 0;
  padding: 6px 0;
  cursor: pointer;
  transition: gap 0.18s ease;
  min-height: 44px;
}
.dld-link:hover { gap: 10px; }
.dld-link:focus-visible {
  outline: 2px solid var(--dld-red);
  outline-offset: 4px;
  border-radius: 3px;
}
.dld-link__arrow { font-family: var(--dld-mono); transition: transform 0.18s ease; }
.dld-link:hover .dld-link__arrow { transform: translateX(2px); }

/* Soon / disabled state */
.dld-card--soon { opacity: 0.65; }
.dld-card--soon .dld-btn--primary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--dld-text-3);
  cursor: not-allowed;
  box-shadow: none;
  border: 1px solid var(--dld-glass-bd);
}
body.theme-light .dld-root .dld-card--soon .dld-btn--primary { background: rgba(0, 0, 0, 0.04); }

/* ═══════════════════════════════════════════════════════════════════
   3) STEPS — instructions 01 / 02 / 03
   ═══════════════════════════════════════════════════════════════════ */
.dld-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 16px;
}
@media (min-width: 1024px) {
  .dld-steps { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

.dld-step {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.012);
  border: 1px solid var(--dld-glass-bd);
  border-radius: var(--dld-radius-sm);
}
body.theme-light .dld-root .dld-step { background: rgba(0, 0, 0, 0.018); }

.dld-step__num {
  font-family: var(--dld-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--dld-red);
}
.dld-step__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--dld-text);
  margin: 0;
  letter-spacing: -0.005em;
}
.dld-step__sub {
  font-size: 0.85rem;
  color: var(--dld-text-3);
  margin: 0;
  line-height: 1.45;
}

/* ═══════════════════════════════════════════════════════════════════
   4) TIMELINE — historique versions
   ═══════════════════════════════════════════════════════════════════ */
.dld-tl {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}
.dld-tl__item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.012);
  border: 1px solid var(--dld-glass-bd);
  border-radius: var(--dld-radius-sm);
  transition: border-color 0.18s ease, background 0.18s ease;
}
body.theme-light .dld-root .dld-tl__item { background: rgba(0, 0, 0, 0.018); }
.dld-tl__item:hover { border-color: var(--dld-glass-bd-2); }

.dld-tl__head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-family: var(--dld-mono);
  font-size: 0.78rem;
}
.dld-tl__ver {
  font-weight: 600;
  color: var(--dld-text);
}
.dld-tl__date { color: var(--dld-text-3); }
.dld-tl__chan {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  color: var(--dld-text-3);
  padding: 2px 8px;
  border: 1px solid var(--dld-glass-bd);
  border-radius: 4px;
}
.dld-tl__chan--critical { color: var(--dld-red); border-color: var(--dld-red-line); }

.dld-tl__notes {
  font-size: 0.9rem;
  color: var(--dld-text-2);
  line-height: 1.55;
  margin: 0;
}
.dld-tl__more {
  margin-top: 14px;
  display: flex;
  justify-content: flex-start;
}

/* ═══════════════════════════════════════════════════════════════════
   5) DETAILS — config requise pliable
   ═══════════════════════════════════════════════════════════════════ */
.dld-details {
  border: 1px solid var(--dld-glass-bd);
  border-radius: var(--dld-radius-sm);
  background: rgba(255, 255, 255, 0.012);
  overflow: hidden;
}
body.theme-light .dld-root .dld-details { background: rgba(0, 0, 0, 0.018); }
.dld-details__sum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  font-family: var(--dld-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--dld-text);
  cursor: pointer;
  list-style: none;
  min-height: 48px;
}
.dld-details__sum::-webkit-details-marker { display: none; }
.dld-details__sum:focus-visible { outline: 2px solid var(--dld-red); outline-offset: -2px; }
.dld-details__sum::after {
  content: '+';
  font-family: var(--dld-mono);
  font-size: 1.1rem;
  color: var(--dld-text-3);
  transition: transform 0.18s ease;
}
.dld-details[open] .dld-details__sum::after { content: '–'; }

.dld-details__body {
  padding: 4px 18px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dld-spec {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--dld-text-2);
  line-height: 1.5;
}
.dld-spec__k {
  font-family: var(--dld-mono);
  font-size: 0.78rem;
  color: var(--dld-text-3);
  min-width: 110px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  flex-shrink: 0;
}
.dld-spec__v { color: var(--dld-text); }
@media (max-width: 640px) {
  .dld-spec { flex-direction: column; gap: 2px; }
  .dld-spec__k { min-width: 0; }
}

/* ═══════════════════════════════════════════════════════════════════
   6) SUPPORT
   ═══════════════════════════════════════════════════════════════════ */
.dld-support__title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 8px 0;
  color: var(--dld-text);
}
.dld-support__title em {
  font-family: var(--dld-serif);
  font-style: italic;
  font-weight: 400;
}
.dld-support__txt {
  font-size: 0.9375rem;
  color: var(--dld-text-2);
  line-height: 1.55;
  margin: 0 0 14px 0;
  max-width: 56ch;
}

/* ═══════════════════════════════════════════════════════════════════
   ÉTAT VIDE / ERREUR / SKELETON
   ═══════════════════════════════════════════════════════════════════ */
.dld-skel {
  height: 120px;
  background: linear-gradient(90deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.02) 100%);
  background-size: 200% 100%;
  animation: dld-shimmer 1.6s linear infinite;
  border-radius: var(--dld-radius);
  border: 1px solid var(--dld-glass-bd);
  margin-bottom: 16px;
}
body.theme-light .dld-root .dld-skel {
  background: linear-gradient(90deg, rgba(0,0,0,0.02) 0%, rgba(0,0,0,0.06) 50%, rgba(0,0,0,0.02) 100%);
  background-size: 200% 100%;
}
@keyframes dld-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .dld-skel { animation: none; }
}

.dld-empty {
  text-align: center;
  padding: 36px 20px;
}
.dld-empty__icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(220, 38, 38, 0.08);
  color: var(--dld-red);
  font-size: 1.4rem;
  margin: 0 auto 14px auto;
}
.dld-empty__title { font-size: 1.05rem; font-weight: 600; color: var(--dld-text); margin: 0 0 6px 0; }
.dld-empty__txt   { font-size: 0.9rem; color: var(--dld-text-2); margin: 0; }

/* ═══════════════════════════════════════════════════════════════════
   FOCUS GLOBAL — WCAG 2.2 (2px outline rouge, 24px target min)
   ═══════════════════════════════════════════════════════════════════ */
.dld-root :focus-visible {
  outline: 2px solid var(--dld-red);
  outline-offset: 2px;
}
.dld-root [role="button"], .dld-root button, .dld-root a.dld-link, .dld-root summary {
  min-height: 24px;
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE — safe-area & input fontsize
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .dld-root { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  .dld-card__file { font-size: 0.8rem; }
  .dld-hero__title { line-height: 1.15; }
}


/* light-theme override block (auto-generated) */
[data-theme="light"] {
    --dld-red-glow:   rgba(220, 38, 38, 0.16);
    --dld-red-line:   rgba(220, 38, 38, 0.30);
    --dld-text:       #1A1A1F;
    --dld-text-2:     #3B3B3D;
    --dld-text-3:     #6F6E6A;
    --dld-glass-bg:   rgba(20, 18, 12, 0.025);
    --dld-glass-bd:   rgba(20, 18, 12, 0.10);
    --dld-glass-bd-2: rgba(20, 18, 12, 0.18);
}

/* ═══════════════════════════════════════════════════════════════════════════
   scroll-x guard 2026-05-03
   Cause root: .dld-spec__k a min-width:110px et flex layout dans .dld-spec.
   Sur écran <360px le label uppercase peut pousser la value hors viewport.
   Le media query 640px existe déjà et passe en column, on étend la garde
   pour les autres breakpoints intermédiaires.
   ═══════════════════════════════════════════════════════════════════════════ */
.dld-shell,
.dld-card,
.dld-section,
.dld-grid,
.dld-spec,
.dld-spec__v,
.dld-sha {
    max-width: 100%;
    min-width: 0;
}
.dld-card { overflow: hidden; }

/* SHA / mono code : déjà flex avec ellipsis, on s'assure de la containment */
.dld-sha,
.dld-sha__copy { flex-shrink: 0; }
.dld-sha > *:not(.dld-sha__copy) { min-width: 0; flex: 1 1 0; }

/* Spec rows : entre 480 et 640px le layout reste flex row, on raccourcit
   le min-width du label pour éviter qu'il pousse la value. */
@media (max-width: 480px) {
    .dld-spec { flex-direction: column !important; gap: 2px !important; }
    .dld-spec__k { min-width: 0 !important; }
}

/* CTA primary buttons : déjà width:100%. Le min-height:46px et padding
   peuvent over-extend sur 320px si flex parent; on cap. */
.dld-btn { max-width: 100%; min-width: 0; }

/* Support cards / titres */
.dld-support__title,
.dld-section__title { max-width: 100%; word-break: break-word; }

/* Code blocks éventuels (changelog notes, install instructions) */
.dld-card pre,
.dld-card code {
    max-width: 100%;
    overflow-x: auto;
    word-break: break-word;
    white-space: pre-wrap;
}
