/* Humanitas: ritmo dos cartões, quatro cores e contraste dos atalhos. */
html[data-theme] body main :is(.quick-card, .h-card, .home-infra-links > a):nth-child(4n + 1) {
  --tile-brand: #fec12b; --tile-soft: #fff9e8; --tile-end: #ffedb2;
  --tile-edge: #e8c35c; --tile-ink: #755415; --tile-glyph: #2e3563;
  --tile-dark: #423820; --tile-dark-end: #514325; --tile-light: #ffcf57;
}
html[data-theme] body main :is(.quick-card, .h-card, .home-infra-links > a):nth-child(4n + 2) {
  --tile-brand: #7fc360; --tile-soft: #f0f8e9; --tile-end: #dceecf;
  --tile-edge: #9ac780; --tile-ink: #305b30; --tile-glyph: #183d24;
  --tile-dark: #243c2b; --tile-dark-end: #304c34; --tile-light: #b0df96;
}
html[data-theme] body main :is(.quick-card, .h-card, .home-infra-links > a):nth-child(4n + 3) {
  --tile-brand: #1e91d0; --tile-soft: #edf7fd; --tile-end: #d7edf9;
  --tile-edge: #8fc6e4; --tile-ink: #125c87; --tile-glyph: #fff;
  --tile-dark: #1c3045; --tile-dark-end: #25465e; --tile-light: #97d8f8;
}
html[data-theme] body main :is(.quick-card, .h-card, .home-infra-links > a):nth-child(4n) {
  --tile-brand: #ab3335; --tile-soft: #fff1ef; --tile-end: #f6d9d5;
  --tile-edge: #d69896; --tile-ink: #8d292c; --tile-glyph: #fff;
  --tile-dark: #42272d; --tile-dark-end: #583139; --tile-light: #ffb6b5;
}
html[data-theme="dark"] body main :is(.quick-card, .h-card, .home-infra-links > a):nth-child(n) {
  --tile-soft: var(--tile-dark); --tile-end: var(--tile-dark-end);
  --tile-ink: var(--tile-light);
}

/* Uma sequência contínua por grupo, inclusive ao quebrar linhas. */
html[data-theme] body main .quick-section--vivid .quick-card[data-color] {
  --qc-a: #ffffff; --qc-b: #eef0f3;
  --qc-accent: #68717d; --qc-border: #d8dde3; --qc-text: #2e3563;
  --qc-badge-a: var(--tile-brand); --qc-badge-b: var(--tile-brand);
  --qc-glyph: var(--tile-glyph); --qc-secondary: var(--tile-glyph);
  --qc-shadow: 46 53 99;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  grid-template-rows: 50px auto;
  align-content: start;
  align-items: center;
  gap: 10px 6px;
  min-height: 0;
  padding: 16px;
}
html[data-theme] body main .quick-section--vivid .quick-card .quick-icon {
  grid-column: 1; grid-row: 1;
  width: 50px; height: 50px; margin: 0; border-radius: 14px;
}
html[data-theme] body main .quick-section--vivid .quick-card h3 {
  grid-column: 1 / -1; grid-row: 2;
  margin: 0; min-height: 0; padding: 0;
  font-size: .94rem; line-height: 1.4;
}
html[data-theme] body main .quick-section--vivid .quick-card .quick-arrow {
  position: static; grid-column: 2; grid-row: 1; align-self: center;
  width: 28px; height: 28px; margin: 0;
  background: #e1e5ea; color: #4a5563;
}
html[data-theme] body main .quick-card .quick-wave { opacity: .11; }

html[data-theme] body main .h-card[data-hue]:nth-child(n) {
  --h-a: var(--tile-soft); --h-b: var(--tile-end); --h-line: var(--tile-edge);
  --h-accent: var(--tile-ink); --h-badge-a: var(--tile-brand); --h-badge-b: var(--tile-brand);
  --h-glyph: var(--tile-glyph); --h-detail: var(--tile-glyph); --h-shadow: 46 53 99;
  background: linear-gradient(145deg, var(--tile-soft), var(--tile-end));
  border-color: var(--tile-edge);
}

/* Marcas das redes sociais: cores próprias, fora da sequência institucional. */
.home-social-links > a { background: var(--surface); border-color: #bfc8d3; }
.home-social-links > a > span { width: 38px; height: 38px; }
.home-social-links > a[href*="instagram.com"] > span {
  color: #fff;
  background: radial-gradient(circle at 28% 105%, #feda75 0%, #fa7e1e 24%, #d62976 52%, #962fbf 75%, #4f5bd5 100%);
}
.home-social-links > a[href*="facebook.com"] > span { background: #0866ff; color: #fff; }
.home-social-links > a[href*="youtube.com"] > span { background: #ff0033; color: #fff; }
.home-social-links > a[href*="tiktok.com"] > span { background: #000; color: #fff; }
.home-social-links > a[href*="tiktok.com"] > span .icon {
  filter: drop-shadow(-1px -1px 0 #25f4ee) drop-shadow(1px 1px 0 #fe2c55);
}
.home-social-links > a > span .icon { width: 23px; height: 23px; stroke-width: 1.9; }
.home-social-links > a > .icon { opacity: 1; }

/* Infraestrutura: área de clique e iconografia com presença e contraste. */
html[data-theme] body main .home-infra-links > a {
  min-height: 88px; padding: 16px 20px; gap: 16px;
  border: 1px solid var(--tile-edge); border-left: 5px solid var(--tile-brand);
  background: linear-gradient(120deg, var(--tile-soft), var(--tile-end));
  color: var(--text); font-size: 1.05rem; font-weight: 750;
  box-shadow: 0 4px 12px rgb(19 24 44 / .06);
}
html[data-theme] body main .home-infra-links > a > .icon:first-child {
  width: 52px; height: 52px; padding: 12px; flex-shrink: 0;
  border-radius: 14px; background: var(--tile-brand); color: var(--tile-glyph);
  stroke-width: 2;
}
html[data-theme] body main .home-infra-links > a > .icon:last-child {
  width: 32px; height: 32px; padding: 7px; flex-shrink: 0;
  border-radius: 50%; background: var(--tile-ink); color: var(--tile-soft);
  stroke-width: 2.2;
}
.home-infra-links > a:hover { box-shadow: 0 8px 20px rgb(19 24 44 / .13); }

/* Três canais ocupam toda a largura, sem uma quarta coluna vazia. */
html[data-theme] body main .channels.channels--featured {
  grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px;
}
html[data-theme] body main .channels--featured .channel {
  min-height: 185px; padding: 24px; gap: 18px;
}
html[data-theme] body main .channels--featured .h-card .h-icon {
  width: 64px; height: 64px; border-radius: 18px;
}
html[data-theme] body main .channels--featured .channel-name {
  min-height: 0; padding-right: 40px; font-size: 1.125rem;
}
html[data-theme] body main .channels--featured .h-route {
  top: auto; bottom: 24px; right: 24px; width: 32px; height: 32px;
  background: var(--tile-ink); color: var(--tile-soft);
}

/* Faixas da marca na mesma ordem dos cartões. */
.hero-color-rail { grid-template-columns: repeat(4, 1fr); }
.hero-color-rail span:nth-child(1) { background: var(--yellow); }
.hero-color-rail span:nth-child(2) { background: var(--green); }
.hero-color-rail span:nth-child(3) { background: var(--blue); }
.hero-color-rail span:nth-child(4) { background: var(--red); }
.home-finance-panel::before {
  background: linear-gradient(var(--yellow) 0 25%, var(--green) 25% 50%, var(--blue) 50% 75%, var(--red) 75%);
}

@media (max-width: 760px) {
  html[data-theme] body main .home-infra-links { grid-template-columns: 1fr; }
  html[data-theme] body main .channels.channels--featured { grid-template-columns: 1fr; gap: 12px; }
  html[data-theme] body main .channels--featured .channel {
    display: grid; grid-template-columns: 54px minmax(0, 1fr) 32px;
    align-items: center; min-height: 0; gap: 16px; padding: 20px;
  }
  html[data-theme] body main .channels--featured .h-card .h-icon { width: 54px; height: 54px; }
  html[data-theme] body main .channels--featured .h-glyph { width: 34px; height: 34px; }
  html[data-theme] body main .channels--featured .channel-name { padding: 0; font-size: 1rem; }
  html[data-theme] body main .channels--featured .h-route { position: static; }
}
@media (max-width: 420px) {
  html[data-theme] body main .quick-section--vivid .quick-card { padding: 13px; gap: 10px 4px; }
  html[data-theme] body main .quick-section--vivid .quick-card h3 { font-size: .84rem; }
  .home-social-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .home-social-links > a { gap: 8px; padding: 10px; }
  .home-social-links > a > span { flex-shrink: 0; }
}
@media (forced-colors: active) {
  html[data-theme] body main :is(.home-infra-links > a, .home-social-links > a > span) {
    background: Canvas; color: LinkText; border: 1px solid LinkText;
  }
  html[data-theme] body main .home-infra-links > a > .icon {
    background: Canvas; color: LinkText; border: 1px solid LinkText;
  }
}

/* Acesso rápido: superfície escura */
html[data-theme="dark"] body main .quick-section--vivid .quick-card[data-color] {
  --qc-a: #242b3b; --qc-b: #192131; --qc-border: #414b5c;
  --qc-accent: #aeb8c8; --qc-text: #f4f6fa;
}
html[data-theme="dark"] body main .quick-section--vivid .quick-card .quick-arrow {
  background: #374254; color: #eef2f8;
}
