/* =========================================================
   Ideias — lista, artigo e faixa da Home.
   Usa só tokens existentes de styles.css. Contrastes conferidos (AAA, 7:1+):
   foreground-muted em branco 8.2, em background-subtle 7.4, em surface-muted 7.0.
   ========================================================= */

/* ---------- Artigo ---------- */
.idea { padding-block: var(--space-5) var(--space-8); }
.idea > * { max-width: 720px; }
.idea-header { display: flex; flex-direction: column; gap: var(--space-4); margin-bottom: var(--space-6); }
.idea-title {
  font-weight: 900; font-size: 34px; line-height: 1.12; letter-spacing: -0.5px;
  color: var(--primary); margin: 0; text-wrap: balance;
}
@media (min-width: 768px) { .idea-title { font-size: 52px; line-height: 1.08; letter-spacing: -1.2px; } }
.idea-sub { font-size: 19px; line-height: 1.45; color: var(--foreground-muted); margin: 0; }
@media (min-width: 768px) { .idea-sub { font-size: 22px; } }
.idea-meta { font-size: 14px; color: var(--foreground-muted); margin: 0; }
.idea-tags { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 0; margin: 0; }
.idea-tag--tema { background: var(--surface-muted); border: 1px solid var(--border); }

/* Introdução escrita à mão pelo Érick: separada do texto principal */
.idea-intro {
  border-inline-start: 4px solid var(--accent);
  padding-inline-start: var(--space-4);
  margin-bottom: var(--space-5);
}
.idea-intro p { font-size: 20px; line-height: 1.6; color: var(--foreground); margin: 0 0 var(--space-3); }
.idea-intro p:last-child { margin-bottom: 0; }

/* Bloco fixo: nota de IA + aviso legal (sempre no mesmo lugar) */
.idea-notes {
  background: var(--background-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-2);
  margin-bottom: var(--space-7);
}
.idea-note { font-size: 14px; line-height: 1.5; color: var(--foreground-muted); margin: 0; }
.idea-note a { color: var(--foreground); text-underline-offset: 2px; }
.idea-note--ia::before { content: "IA · "; font-weight: 600; color: var(--foreground); }
.idea-note--aviso::before { content: "Aviso · "; font-weight: 600; color: var(--foreground); }
.idea[lang="en"] .idea-note--aviso::before { content: "Notice · "; }
.idea[lang="en"] .idea-note--ia::before { content: "AI · "; }

/* Texto principal */
.idea-body { font-size: 18px; line-height: 1.7; color: var(--foreground); }
.idea-body > * { margin: 0 0 var(--space-5); }
.idea-body h2 { font-size: 26px; line-height: 1.25; font-weight: 700; margin: var(--space-7) 0 var(--space-4); color: var(--primary); }
.idea-body h3 { font-size: 21px; line-height: 1.3; font-weight: 600; margin: var(--space-6) 0 var(--space-3); }
.idea-body ul, .idea-body ol { padding-inline-start: 1.4em; }
.idea-body li { margin-bottom: var(--space-2); }
.idea-body blockquote {
  border-inline-start: 4px solid var(--primary);
  padding-inline-start: var(--space-4);
  font-size: 20px; line-height: 1.55; font-weight: 500;
}
.idea-body blockquote p { margin: 0; }
.idea-body a { color: var(--primary); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.idea-body a:hover { text-decoration-thickness: 2px; }

/* Figuras — rascunhos: sem filtro, sombra nem borda arredondada; largura total do texto */
.idea-fig { margin: var(--space-6) 0; }
.idea-fig img { width: 100%; height: auto; border-radius: 0; box-shadow: none; filter: none; }
.idea-fig-link { display: block; cursor: zoom-in; }
.idea-fig figcaption { font-size: 14px; line-height: 1.5; color: var(--foreground-muted); margin-top: var(--space-2); }

/* Imagem de terceiros: moldura própria, nunca com cara de trabalho do Érick */
.idea-fig--ref {
  background: var(--background-subtle);
  border: 1px dashed var(--foreground-muted);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-3) var(--space-4);
}
.idea-fig--ref img { width: auto; max-width: min(100%, 420px); max-height: 70vh; margin-inline: auto; }
.idea-fig-ref-label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--foreground-muted); margin: 0 0 var(--space-3);
}

.idea-case { padding-block: 0 var(--space-7); }

/* ---------- Lista ---------- */
.idea-list { padding-block: 0 var(--space-8); }
.idea-tools[hidden] { display: none; }
.idea-tools { display: flex; flex-direction: column; gap: var(--space-4); margin-bottom: var(--space-6); max-width: 900px; }
.idea-search { max-width: 480px; }
.idea-filters-label { font-size: 14px; font-weight: 500; color: var(--foreground-muted); margin: 0 0 var(--space-2); }
.idea-filters { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 0; margin: 0; }
.idea-filter {
  font: inherit; font-size: 14px; font-weight: 500;
  min-height: 44px; padding: 0 var(--space-4);
  border-radius: var(--radius-pill); border: 1px solid var(--border);
  background: var(--background); color: var(--foreground); cursor: pointer;
  transition: background-color .15s ease, transform .1s ease;
}
.idea-filter:hover { background: var(--surface-muted); }
.idea-filter:active { transform: scale(0.97); }
.idea-filter[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.idea-count { font-size: 14px; color: var(--foreground-muted); margin: 0; min-height: 1.5em; }
.idea-empty { font-size: 16px; color: var(--foreground-muted); }

.idea-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
@media (min-width: 768px) { .idea-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .idea-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.idea-item[hidden] { display: none; }

.idea-card {
  position: relative; height: 100%;
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
  background: var(--background);
  transition: transform .2s ease, box-shadow .2s ease;
}
.idea-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(23, 53, 42, 0.10); }
.idea-card:focus-within { outline: 3px solid var(--primary); outline-offset: 2px; }
.idea-card-img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: center; background: var(--surface-muted); }
.idea-card-text { padding: var(--space-4) var(--space-4) var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.idea-card-meta { font-size: 13px; color: var(--foreground-muted); margin: 0; }
.idea-card-title { font-size: 20px; line-height: 1.3; font-weight: 700; margin: 0; }
.idea-card-title a { text-decoration: none; color: var(--foreground); }
.idea-card-title a:focus-visible { outline: none; }
.idea-card-title a::after { content: ""; position: absolute; inset: 0; }
.idea-card-resumo { font-size: 16px; line-height: 1.5; color: var(--foreground-muted); margin: 0; }
.idea-tags--card { margin-top: auto; padding-top: var(--space-2); }

/* ---------- Faixa da Home ---------- */
.idea-strip {
  padding-inline: max(var(--gutter, var(--space-4)), calc((100% - var(--page-max, 1280px)) / 2));
  padding-block: var(--space-7) var(--space-8);
}
.idea-strip-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-5); }
.idea-strip-head .section-title { margin: 0; }
.idea-strip-all { font-size: 18px; }
@media (min-width: 1200px) { .idea-grid--strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

@media (prefers-reduced-motion: reduce) {
  .idea-card, .idea-card:hover, .idea-filter:active { transform: none; transition: none; }
}

/* Protótipo navegável dentro do artigo (usa .proto-frame/.proto-caption de styles.css) */
.idea-proto { margin: var(--space-6) 0; display: flex; flex-direction: column; align-items: center; }
.idea-proto .proto-caption { align-items: center; text-align: center; }
.idea > .idea-body { max-width: none; }
.idea-body > * { max-width: 720px; }
.idea-body > .idea-proto { max-width: none; }
/* Imagem de terceiros larga (várias telas): ocupa a largura do texto */
.idea-fig--ref.idea-fig--wide img { max-width: 100%; width: 100%; max-height: none; }

/* Aviso de autoria no fim da ideia */
.idea-autoria { max-width: 720px; margin: var(--space-8, 48px) 0 0; padding-top: var(--space-4, 16px); border-top: 1px solid var(--border); font-size: 15px; line-height: 1.5; color: var(--foreground-muted); }
.idea-autoria a { color: var(--foreground); text-underline-offset: 2px; }
