/* ═══════════════════════════════════════════════════════════
   XHub — Updates / Changelog (thème monochrome premium)
   ═══════════════════════════════════════════════════════════ */

.up-main { padding-bottom: 80px; }

.up-hero {
  text-align: center;
  padding: 48px 0 32px;
  max-width: 820px;
  margin: 0 auto;
}
.up-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.6;
  margin: 0 0 12px;
}
.up-title {
  font-family: var(--font-display, 'Fredoka', system-ui, sans-serif);
  font-size: clamp(30px, 5vw, 54px);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0 0 14px;
  line-height: 1.05;
}
.up-lead {
  font-family: var(--font, 'Fredoka', system-ui, sans-serif);
  font-size: 17px;
  opacity: 0.85;
  margin: 0 0 10px;
  line-height: 1.65;
  letter-spacing: -0.01em;
}
.up-credit {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.7;
  margin: 0 auto 22px;
  max-width: 560px;
  width: 100%;
  text-align: center;
  padding-inline-start: 0.02em;
  box-sizing: border-box;
}

.up-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 6px;
}
.up-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  opacity: 0.55;
}
.up-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
  border-radius: 4px;
  opacity: 0.8;
}
.up-empty-lead {
  margin: 0;
  opacity: 0.7;
  line-height: 1.6;
  font-size: 15px;
}
.up-loading {
  text-align: center;
  opacity: 0.6;
  padding: 40px 0;
}

.up-tts-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 auto 22px;
  padding: 10px 20px;
  border-radius: 99px;
  border: 1px solid color-mix(in srgb, currentColor 26%, transparent);
  background: color-mix(in srgb, currentColor 6%, transparent);
  color: inherit;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s, transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.up-tts-btn:hover { background: color-mix(in srgb, currentColor 14%, transparent); transform: translateY(-1px); }
.up-tts-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.up-tts-btn .up-tts-ico { font-size: 16px; line-height: 1; }
.up-tts-btn.is-on {
  border-color: #ff2d2d;
  box-shadow: 0 0 0 2px color-mix(in srgb, #ff2d2d 35%, transparent);
  animation: upTtsPulse 1.4s ease-in-out infinite;
}
@keyframes upTtsPulse {
  0%, 100% { box-shadow: 0 0 0 2px color-mix(in srgb, #ff2d2d 30%, transparent); }
  50% { box-shadow: 0 0 0 5px color-mix(in srgb, #ff2d2d 12%, transparent); }
}

.up-progress {
  height: 4px;
  border-radius: 99px;
  background: color-mix(in srgb, currentColor 12%, transparent);
  overflow: hidden;
  max-width: 420px;
  margin: 0 auto;
}
.up-progress > i {
  display: block;
  height: 100%;
  width: 0;
  background: currentColor;
  border-radius: 99px;
  transition: width 0.15s linear;
}

/* Layout : sommaire collant + journal */
.up-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 34px;
  max-width: 1080px;
  margin: 26px auto 0;
  align-items: start;
}

.up-toc {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, currentColor 4%, transparent);
  backdrop-filter: blur(6px);
}
.up-toc-title {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.55;
  margin: 0 0 8px;
}
.up-toc a {
  text-decoration: none;
  color: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 7px 10px;
  border-radius: 9px;
  opacity: 0.75;
  transition: background 0.15s, opacity 0.15s, transform 0.15s;
}
.up-toc a:hover { opacity: 1; background: color-mix(in srgb, currentColor 10%, transparent); transform: translateX(2px); }

.up-log { display: flex; flex-direction: column; gap: 18px; }

.up-card {
  border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
  border-radius: 12px;
  padding: 24px 26px;
  background: color-mix(in srgb, currentColor 4%, transparent);
  scroll-margin-top: 90px;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}
.up-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid color-mix(in srgb, currentColor 12%, transparent);
}
.up-card-num {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 15px;
  opacity: 0.5;
  border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
  border-radius: 8px;
  padding: 4px 9px;
}
.up-card-titles { flex: 1; min-width: 0; }
.up-card-head h2 {
  font-family: var(--font-display, 'Fredoka', system-ui, sans-serif);
  font-size: 21px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.03em;
}

.up-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.up-items li {
  font-size: 15px;
  line-height: 1.5;
  padding-left: 4px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.up-plus {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  opacity: 0.55;
  flex-shrink: 0;
}

/* Section currently being read aloud : subtle red/white glitch border */
.up-card.up-reading {
  border-color: #ff2d2d;
  animation: upReadGlitch 1.1s steps(2, end) infinite;
}
@keyframes upReadGlitch {
  0% {
    border-color: #ff2d2d;
    box-shadow: 0 0 0 1px color-mix(in srgb, #ff2d2d 55%, transparent), -2px 0 0 color-mix(in srgb, #ff2d2d 45%, transparent);
  }
  25% {
    border-color: #ffffff;
    box-shadow: 0 0 0 1px color-mix(in srgb, #ffffff 55%, transparent), 2px 0 0 color-mix(in srgb, #ff2d2d 45%, transparent);
  }
  50% {
    border-color: #ff2d2d;
    box-shadow: 0 0 0 2px color-mix(in srgb, #ff2d2d 40%, transparent), 0 0 22px -6px #ff2d2d;
  }
  75% {
    border-color: #ffffff;
    box-shadow: 0 0 0 1px color-mix(in srgb, #ffffff 45%, transparent), -2px 0 0 color-mix(in srgb, #ff2d2d 40%, transparent);
  }
  100% {
    border-color: #ff2d2d;
    box-shadow: 0 0 0 1px color-mix(in srgb, #ff2d2d 55%, transparent), 2px 0 0 color-mix(in srgb, #ff2d2d 45%, transparent);
  }
}
@media (prefers-reduced-motion: reduce) {
  .up-card.up-reading { animation: none; box-shadow: 0 0 0 2px color-mix(in srgb, #ff2d2d 40%, transparent); }
}

/* Reprise via le bouton Discord : surbrillance "glitch" à l'arrivée */
.up-card.up-focus {
  border-color: #ff2d2d;
  box-shadow: 0 0 0 2px color-mix(in srgb, #ff2d2d 40%, transparent), 0 18px 50px -20px #ff2d2d;
  animation: upFocusFlash 0.9s ease-out 1;
}
@keyframes upFocusFlash {
  0% { transform: translateY(6px); box-shadow: 0 0 0 3px #ff2d2d; }
  30% { transform: translateY(0); }
  100% { }
}

.up-foot {
  display: block;
  width: 100%;
  text-align: center;
  margin: 60px auto 0;
  max-width: 720px;
  opacity: 0.85;
  box-sizing: border-box;
}
.up-foot p {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin: 0 auto 12px;
  opacity: 0.7;
  text-align: center;
  padding-inline-start: 0.03em;
  box-sizing: border-box;
}
.up-back { text-decoration: none; color: inherit; font-weight: 600; font-size: 14px; opacity: 0.85; }
.up-back:hover { opacity: 1; }

.up-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, currentColor 24%, transparent);
  background: color-mix(in srgb, currentColor 8%, transparent);
  color: inherit;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.2s, transform 0.2s, background 0.2s;
  backdrop-filter: blur(8px);
}
.up-top.is-show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.up-top:hover { background: color-mix(in srgb, currentColor 18%, transparent); }

@media (max-width: 860px) {
  .up-layout { grid-template-columns: 1fr; gap: 20px; }
  .up-toc { position: static; order: -1; }
}

/* ── Legal reader (terms / privacy) ─────────────────────────── */

.legal-reader-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 18px auto 14px;
  max-width: 520px;
}

.legal-ctrl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 46px;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 99px;
  border: 1px solid color-mix(in srgb, currentColor 26%, transparent);
  background: color-mix(in srgb, currentColor 6%, transparent);
  color: inherit;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s, transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.legal-ctrl:hover:not(:disabled) {
  background: color-mix(in srgb, currentColor 14%, transparent);
  transform: translateY(-1px);
}
.legal-ctrl:disabled { opacity: 0.42; cursor: not-allowed; transform: none; }
.legal-ctrl.is-active {
  border-color: #ff2d2d;
  box-shadow: 0 0 0 2px color-mix(in srgb, #ff2d2d 35%, transparent);
}
.legal-ctrl--icon { padding: 10px 14px; min-width: 46px; }
.legal-ctrl-ico { font-size: 17px; line-height: 1; }

.legal-progress {
  height: 4px;
  border-radius: 99px;
  background: color-mix(in srgb, currentColor 12%, transparent);
  overflow: hidden;
  max-width: 420px;
  margin: 0 auto 8px;
}
.legal-progress > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ff2d2d, color-mix(in srgb, currentColor 80%, #ff2d2d));
  border-radius: 99px;
  transition: width 0.2s linear;
}

.legal-autoplay-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 16px auto 10px;
  padding: 18px 22px;
  max-width: 480px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, #ff2d2d 45%, transparent);
  background: color-mix(in srgb, #ff2d2d 8%, transparent);
  text-align: center;
  animation: legalPromptIn 0.45s ease-out;
}
.legal-autoplay-prompt.hidden { display: none; }
.legal-autoplay-prompt p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.9;
}
.legal-autoplay-start {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 99px;
  border: 1px solid #ff2d2d;
  background: color-mix(in srgb, #ff2d2d 18%, transparent);
  color: inherit;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
}
.legal-autoplay-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px -10px #ff2d2d;
}
@keyframes legalPromptIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.up-items li.up-chunk-reading {
  color: inherit;
  background: color-mix(in srgb, #ff2d2d 14%, transparent);
  border-radius: 10px;
  padding: 8px 10px 8px 6px;
  margin-left: -6px;
  box-shadow: inset 3px 0 0 #ff2d2d;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
@media (prefers-reduced-motion: reduce) {
  .legal-autoplay-prompt { animation: none; }
  .up-items li.up-chunk-reading { transition: none; }
}
