/* style-halving.css
   Styles dédiés à la page /halving-bitcoin-countdown/ — compte à rebours
   live du prochain halving Bitcoin. Loadé conditionnellement via base.njk
   uniquement quand page.url == "/halving-bitcoin-countdown/".
*/

/* ============================================
   COUNTDOWN CARD — flip-clock XXL
   ============================================ */
.halving-section {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px 0 48px;
}

/* v152 Lot D — Modernisation countdown card.
   AVANT : gradient hardcodé dark (#17171e → #1a1a24) qui apparaissait
   en sombre sur le thème clair (= surface contraste sur fond cream).
   APRÈS : container theme-aware (transparent + border accent subtle),
   cellules bg-card avec hover lift, séparateurs ':' entre cellules style
   flip-clock, numbers en accent gold avec léger glow. Travail sur les 2
   thèmes sans hardcoded color. */
.halving-countdown-card {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px 24px;
  margin-bottom: 32px;
  text-align: center;
  position: relative;
}

.halving-countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
  position: relative;
}

.halving-countdown-cell {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  /* v152 Lot D : layout en grid 2 rows (digit / label) avec position
     déterministe (vs flex+justify-content qui rendait le centrage colons
     fragile). Hauteur fixe digit = 1fr, label = auto au bottom. */
  display: grid;
  grid-template-rows: 1fr auto;
  row-gap: 6px;
  align-items: center;
  justify-items: center;
  padding: 18px 8px 14px;
  min-height: 120px;
  position: relative;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.halving-countdown-cell:hover {
  border-color: var(--accent-border);
  transform: translateY(-2px);
}

/* v152 Lot D : séparateurs ':' retirés (centrage fragile + n'apportait
   pas grand-chose visuellement, les cells sont assez distinctes via le
   gap 14px + border). */

.halving-countdown-num {
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: clamp(36px, 7vw, 60px);
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  /* v152 : margin-bottom retiré (grid template gère le spacing entre digit
     et label, donc plus besoin de margin manuel qui décentralait le digit). */
  text-shadow: 0 0 24px color-mix(in srgb, var(--accent) 18%, transparent);
}

.halving-countdown-label {
  font-family: var(--font-sans, Inter);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.halving-countdown-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.halving-countdown-meta strong {
  color: var(--text-primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Pulse dot "live" — vert quand fetch live OK, gris si fallback estimation */
.halving-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
  animation: halving-pulse-green 2s ease-out infinite;
  flex-shrink: 0;
}

@keyframes halving-pulse-green {
  0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
  70%  { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

/* ============================================
   KPI grid (4 cards)
   ============================================ */
.halving-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.halving-kpi-card {
  background: var(--bg-card, #0e0e16);
  border: 1px solid var(--border, #23232d);
  border-radius: 14px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.halving-kpi-label {
  font-family: var(--font-sans, Inter);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted, #999);
}

.halving-kpi-value {
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 700;
  color: var(--text-primary, #f5f5f0);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.halving-kpi-next {
  color: var(--accent, #FFCB73);
}

.halving-kpi-sub {
  font-size: 11.5px;
  color: var(--text-faint, #777);
}

/* ============================================
   Chart section (SVG inline)
   ============================================ */
.halving-chart-section {
  max-width: 980px;
  margin: 24px auto;
}

.halving-chart-intro {
  max-width: 720px;
  margin: -8px 0 16px;
  color: var(--text-muted, #999);
  font-size: 14px;
  line-height: 1.6;
}

.halving-chart-wrap {
  background: var(--bg-card, #0e0e16);
  border: 1px solid var(--border, #23232d);
  border-radius: 14px;
  padding: 20px;
}

/* ============================================
   Table — historique des halvings
   ============================================ */
.halving-table-wrap {
  overflow-x: auto;
  background: var(--bg-card, #0e0e16);
  border: 1px solid var(--border, #23232d);
  border-radius: 14px;
}

.halving-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.halving-table thead {
  background: var(--bg-secondary, #14141c);
}

.halving-table th {
  text-align: left;
  padding: 14px 16px;
  font-family: var(--font-sans, Inter);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #999);
  border-bottom: 1px solid var(--border, #23232d);
  white-space: nowrap;
}

.halving-table td {
  padding: 14px 16px;
  color: var(--text-primary, #f5f5f0);
  border-bottom: 1px solid var(--border, #23232d);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.halving-table tbody tr:last-child td {
  border-bottom: none;
}

.halving-table tbody tr:hover {
  background: rgba(255, 203, 115, 0.03);
}

.halving-row-future td {
  color: var(--text-muted, #999);
  font-style: normal;
}

.halving-row-future td:first-child,
.halving-row-future td:nth-child(2) {
  color: var(--accent, #FFCB73);
  font-weight: 600;
}

.halving-roi-pos {
  color: #4ade80;
  font-weight: 600;
}

.halving-table-note {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--text-faint, #777);
  line-height: 1.5;
}

/* ============================================
   Explainer section — Qu'est-ce que le halving ?
   ============================================ */
.halving-explainer-body {
  max-width: 760px;
  margin: 0 auto;
  color: var(--text-primary, #f5f5f0);
  font-size: 15.5px;
  line-height: 1.7;
}

.halving-explainer-body h3 {
  font-family: var(--font-serif, "Newsreader", serif);
  font-size: 22px;
  font-weight: 600;
  margin: 32px 0 12px;
  color: var(--text-primary, #f5f5f0);
}

.halving-explainer-body p {
  margin: 0 0 14px;
}

.halving-explainer-body ul {
  margin: 0 0 16px;
  padding-left: 24px;
}

.halving-explainer-body ul li {
  margin: 0 0 10px;
}

.halving-explainer-body strong {
  color: var(--text-primary, #f5f5f0);
  font-weight: 700;
}

.halving-explainer-body a {
  color: var(--accent, #FFCB73);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.halving-explainer-body a:hover {
  text-decoration-thickness: 2px;
}

/* ============================================
   FAQ : utilise .conv-faq-list / .conv-faq-item définis dans style.css
   (~line 8961). Pattern partagé par toutes les pages outils du site
   (convertisseur, ETF Bitcoin, Fear & Greed, heatmap, halving).
   Aucune règle dédiée ici pour rester cohérent.
   ============================================ */

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 720px) {
  .halving-countdown-card { padding: 20px 14px; border-radius: 18px; }
  .halving-countdown-grid { gap: 8px; }
  .halving-countdown-cell { min-height: 92px; padding: 16px 4px 12px; border-radius: 12px; }
  .halving-countdown-num { font-size: clamp(28px, 12vw, 44px); margin-bottom: 6px; }
  .halving-countdown-label { font-size: 9.5px; letter-spacing: 0.08em; }
  .halving-countdown-meta {
    font-size: 12px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 8px 12px;
  }

  .halving-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .halving-kpi-card { padding: 14px 12px; }
  .halving-kpi-value { font-size: 20px; }

  .halving-chart-wrap { padding: 12px 8px; }

  .halving-table { font-size: 12.5px; }
  .halving-table th,
  .halving-table td { padding: 10px 12px; }

  .halving-explainer-body { font-size: 15px; }
  .halving-explainer-body h3 { font-size: 20px; margin: 24px 0 10px; }
}

@media (max-width: 480px) {
  .halving-countdown-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .halving-countdown-num { font-size: 38px; }

  .halving-kpi-grid {
    grid-template-columns: 1fr;
  }
}
