/* ==========================================================
   _cards.css — Sistema de cards genérico (projetos, etc.)
   Uso: <div class="cards"> <article> ... </article> </div>
   ========================================================== */

/* --- cards: grid genérica --------------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 20px;
}

/* Fluxo vertical reutilizável para seções, listas e grupos de campos. */
.stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.stack>* {
  min-width: 0;
  overflow-wrap: anywhere;
}


/* --- cards: artigo ou li (card) --------------------------------- */

.cards :is(li, article) {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow var(--t), transform var(--t), border-color var(--t);
  cursor: pointer;
}

.cards.stack :is(li, article) {
  flex-flow: row wrap;
}

.cards :is(li, article):hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: var(--brand-border);
  text-decoration: none;
  color: var(--text);
}

/* Imagem principal do card */
.cards :is(li, article)>img {
  width: 160px;
  height: 160px;
  object-fit: contain;
  display: block;
  background: linear-gradient(135deg, var(--brand-soft), var(--bg));
  border-radius: 100em;
  margin: 1em auto;
}

/* Placeholder de imagem */
.cards :is(li, article) .placeholder {
  width: 100%;
  height: 140px;
  background: linear-gradient(135deg, var(--brand-soft) 0%, #e0f2fe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cards :is(li, article) .placeholder svg {
  opacity: .25;
}

/* --- cards: corpo ----------------------------------------- */
.cards :is(li, article) .body {
  padding: 18px 20px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
}

/* Organização */
.cards :is(li, article) .org {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.cards :is(li, article) .org .logo {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg), var(--surface));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .5rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.cards :is(li, article) .org .logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Nome do projeto */
.cards :is(li, article) h3 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  margin: 0;
}

/* Descrição / objetivo */
.cards :is(li, article) .desc {
  font-size: .8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  line-clamp: 2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- cards: rodapé ---------------------------------------- */
.cards :is(li, article) footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px 14px;
  border-top: 1px solid var(--line);
  gap: 8px;
  flex-wrap: wrap;
}

.cards :is(li, article) footer .meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .75rem;
  color: var(--text-muted);
}

.cards :is(li, article) footer .meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cards :is(li, article) footer .role {
  font-size: .7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cards :is(li, article) footer .status {
  font-size: .7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.cards :is(li, article) footer .status--ativo {
  background: #dcfce7;
  color: #166534;
}

.cards :is(li, article) footer .status--concluido {
  background: #dbeafe;
  color: #1e40af;
}

.cards :is(li, article) footer .status--cancelado {
  background: var(--danger-soft);
  color: var(--danger);
}

/* --- Botão favoritar -------------------------------------- */
.fav-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  background: rgba(255, 255, 255, .9);
  color: #94a3b8;
  transition: transform var(--t), background var(--t), color var(--t);
}

.fav-btn:hover {
  transform: scale(1.04);
  background: #fff;
}

.fav-btn:active {
  transform: scale(0.9);
  background: #fff;
}

.fav-btn.is-active {
  color: #f59e0b;
}

.cards article .fav-btn,
.cards article .fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}