/* ============================================================================
 * T01 · Início (hub de Decodes) — camada da página sobre assets/dc.css.
 * Só tokens --dc-* / --bl-*; mobile-first 390 px; alvos >= 44 px; dado >= 14 px.
 * ========================================================================== */

/* ── Cabeçalho da página ── */
.dc-hub-head { padding-bottom: var(--bl-space-5); }
.dc-hub-head__text { display: grid; gap: var(--bl-space-3); }
.dc-hub-head .dc-h1 { max-width: 22ch; }
.dc-hub-meta { display: inline-flex; align-items: center; gap: 6px; }
.dc-hub-meta .dc-i { color: var(--dc-text-3); }

/* ── Escopo em números ── */
.dc-hub-kpis { margin-bottom: var(--bl-space-2); }
/* telefone (contêiner de 330 a 430 px): valor um degrau menor para "14,9 mil" caber sem reticências (AP-009) */
@container dc-kpis (max-width: 430px) { .dc-hub-kpis .dc-kpi__value { font-size: var(--bl-text-lg); } }

/* desktop: título à esquerda, números à direita (2 × 2) */
@media (min-width: 1024px) {
  .dc-hub-hero {
    display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    column-gap: var(--bl-space-10); align-items: end;
    padding-bottom: var(--bl-space-2);
  }
  .dc-hub-hero .dc-hub-head { padding-bottom: 0; }
  .dc-hub-hero .dc-hub-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 0; }
}

/* ── Barra de filtro e ordenação ── */
.dc-hub-bar { display: grid; gap: var(--bl-space-3); margin-bottom: var(--bl-space-4); }
.dc-hub-bar__filter { min-width: 0; }
.dc-hub-chips { padding-block: 2px; }
.dc-hub-chips .dc-chip { font-size: var(--bl-text-xs); }
.dc-hub-bar__sort {
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--bl-space-3);
  padding-top: var(--bl-space-3); border-top: 1px solid var(--dc-line);
}
.dc-hub-count {
  min-height: 44px; display: inline-flex; align-items: center;
  font: 500 var(--bl-text-xs)/1.3 var(--bl-font-mono); letter-spacing: var(--bl-tracking-wide);
  color: var(--dc-text-2); white-space: nowrap;
}
.dc-hub-sort { flex: 0 1 230px; min-width: 0; }
.dc-hub-sort .dc-select { font-size: var(--bl-text-sm); }

@media (min-width: 768px) {
  .dc-hub-bar {
    display: flex; align-items: flex-end; justify-content: space-between; gap: var(--bl-space-4);
    padding-bottom: var(--bl-space-4); border-bottom: 1px solid var(--dc-line);
  }
  .dc-hub-bar__filter { flex: 1 1 auto; }
  .dc-hub-bar__sort { flex: 0 0 auto; padding-top: 0; border-top: 0; gap: var(--bl-space-4); }
  .dc-hub-sort { flex-basis: 240px; }
}

/* ── Aviso interno (localhost) ── */
.dc-hub-internal {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--bl-space-2) var(--bl-space-4);
  margin-bottom: var(--bl-space-4); padding: var(--bl-space-2) var(--bl-space-2) var(--bl-space-2) var(--bl-space-4);
  background: color-mix(in srgb, var(--dc-warn) 7%, var(--dc-surface));
  border: 1px dashed color-mix(in srgb, var(--dc-warn) 45%, transparent); border-radius: var(--bl-radius-lg);
}
.dc-hub-internal__text { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--bl-space-2); flex: 1 1 320px; font-size: var(--bl-text-xs); line-height: 1.5; color: var(--dc-text-2); }
.dc-hub-internal__text strong { color: var(--dc-text); font-weight: 600; }
.dc-hub-internal__btn { flex: 0 0 auto; }
@media (max-width: 639.98px) { .dc-hub-internal__btn { width: 100%; } }

/* ── Grade de cartões ── */
.dc-hub-grid { align-items: stretch; }
.dc-hub-grid > .dc-dcard { align-content: start; }
.dc-hub-grid .dc-dcard__facts { align-content: start; }
.dc-hub-grid > .dc-dcard .dc-dcard__depths { margin-top: auto; align-self: end; }
.dc-hub-grid > .dc-skel-group,
.dc-hub-grid > .dc-state { grid-column: 1 / -1; }
/* esqueleto com a altura real de um cartão de Decode (evita salto ao carregar) */
.dc-hub-grid .dc-skel--card { height: 400px; }
.dc-dcard__fact dd.dc-hub-theme { font-family: var(--bl-font-sans); font-weight: 500; }
.dc-hub-card--preview { border-style: dashed; }
@media (min-width: 640px) {
  /* cartões da mesma linha com a mesma altura e atalhos alinhados na base */
  .dc-hub-grid > .dc-dcard { grid-template-rows: auto auto 1fr auto; }
}

/* ── Como funciona: etapas ── */
.dc-hub-steps { display: grid; gap: var(--bl-space-3); counter-reset: none; }
.dc-hub-step {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--bl-space-3);
  padding: var(--bl-space-4); background: var(--dc-surface);
  border: 1px solid var(--dc-line); border-radius: var(--bl-radius-lg);
}
.dc-hub-step__num {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  /* texto puxado para --bl-text-primary (como o dc-badge): AA sobre o fundo tingido nos dois temas */
  font: 600 var(--bl-text-xs)/1 var(--bl-font-mono); color: color-mix(in srgb, var(--dc-accent-text) 68%, var(--bl-text-primary));
  background: var(--dc-accent-soft); border: 1px solid var(--dc-accent-line); border-radius: var(--bl-radius-md);
}
.dc-hub-step__body { display: grid; gap: var(--bl-space-1); min-width: 0; }
.dc-hub-step__title { font: 600 var(--bl-text-sm)/1.3 var(--bl-font-sans); color: var(--dc-text); padding-top: 6px; }
.dc-hub-step__text { font-size: var(--bl-text-sm); line-height: 1.55; color: var(--dc-text-2); }
@media (min-width: 768px) {
  .dc-hub-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--bl-space-4); }
}
@media (min-width: 1024px) {
  .dc-hub-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dc-hub-step { grid-template-columns: minmax(0, 1fr); align-content: start; padding: var(--bl-space-5); }
  .dc-hub-step__title { padding-top: 0; }
}

/* ── Três profundidades ── */
.dc-hub-subtitle { margin: var(--bl-space-8) 0 var(--bl-space-3); }
.dc-hub-depths { display: grid; gap: var(--bl-space-2); }
.dc-hub-depth {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--bl-space-3); align-items: start;
  padding: var(--bl-space-3) var(--bl-space-4);
  border-left: 3px solid var(--dc-line-2); background: var(--dc-sunken); border-radius: 0 var(--bl-radius-md) var(--bl-radius-md) 0;
}
.dc-hub-depth__icon { color: var(--dc-text-2); margin-top: 2px; }
.dc-hub-depth__name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--bl-space-2); font: 600 var(--bl-text-sm)/1.3 var(--bl-font-sans); color: var(--dc-text); }
.dc-hub-depth__time { font: 500 var(--bl-text-xs)/1.3 var(--bl-font-mono); color: var(--dc-text-3); }
.dc-hub-depth__text { margin-top: 2px; font-size: var(--bl-text-sm); line-height: 1.5; color: var(--dc-text-2); }
@media (min-width: 768px) {
  .dc-hub-depths { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--bl-space-3); }
}

.dc-hub-actions { margin-top: var(--bl-space-5); gap: var(--bl-space-2) var(--bl-space-3); }
@media (max-width: 479.98px) {
  .dc-hub-actions .dc-btn { flex: 1 1 0; }
}

/* ── Para ler junto ── */
.dc-hub-link { gap: var(--bl-space-2); }
.dc-hub-link__icon { color: var(--dc-accent-text); }
.dc-hub-link .dc-card__title a { display: inline-flex; align-items: center; min-height: 32px; }
@media (max-width: 639.98px) {
  /* telefone: linha compacta, ícone à esquerda do título e do texto */
  .dc-hub-link { grid-template-columns: auto minmax(0, 1fr); column-gap: var(--bl-space-3); row-gap: 0; padding: var(--bl-space-3) var(--bl-space-4); }
  .dc-hub-link__icon { grid-row: span 2; margin-top: 6px; }
}

/* ── Sem JavaScript: lista simples dos Decodes (gerada pelo build em <noscript>) ── */
html:not(.dc-js) .dc-skel-group { display: none; }
.dc-nojs { display: grid; gap: var(--bl-space-3); padding: var(--bl-space-4); border: 1px solid var(--dc-line); border-radius: var(--bl-radius-lg); background: var(--dc-surface); }
.dc-nojs__title { font: 600 var(--bl-text-sm)/1.35 var(--bl-font-sans); color: var(--dc-text); }
.dc-nojs__list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.dc-nojs__item { display: grid; gap: 2px; padding-block: var(--bl-space-2); border-top: 1px solid var(--dc-line); }
.dc-nojs__name { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--dc-text); }
.dc-nojs__meta { font-size: var(--bl-text-xs); color: var(--dc-text-3); }
.dc-nojs__depths, .dc-nojs__pages { font-size: var(--bl-text-sm); color: var(--dc-text-2); }
.dc-nojs__depths a, .dc-nojs__pages a { display: inline-flex; align-items: center; min-height: 44px; color: var(--dc-text); }
