/* Badges, tags, cards, panels, avatars, flashes. */

.badges { display: flex; flex-wrap: wrap; gap: .4rem; }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  padding: .25rem .7rem;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .01em;
  background: var(--bg-tint);
  color: var(--ink-soft);
}
.badge[data-kind="sistema"]    { background: var(--sistema-tint);    color: var(--sistema); }
.badge[data-kind="auditoria"]  { background: var(--auditoria-tint);  color: var(--auditoria); }
.badge[data-kind="site"]       { background: var(--site-tint);       color: var(--site); }
.badge[data-kind="aplicativo"] { background: var(--aplicativo-tint); color: var(--aplicativo); }

.badge--quiet { background: transparent; border: 1px solid var(--line); color: var(--ink-soft); }
.badge--quiet::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-right: .45rem;
  background: var(--ink-faint);
}
.badge--quiet[data-status="em_andamento"]::before { background: var(--accent); }
.badge--quiet[data-status="concluido"]::before    { background: var(--success); }
.badge--quiet[data-status="pausado"]::before      { background: var(--warm); }
.badge--quiet[data-priority="alta"]::before       { background: var(--warm); }

.tags { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; margin: 0; padding: 0; }

.tag {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: .18rem .6rem;
  font-size: .75rem;
  color: var(--ink-soft);
  text-decoration: none;
  background: var(--surface);
}
.tag:hover { border-color: var(--accent); color: var(--accent); }

/* Project cards */

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 25%, var(--line)); }

.card__link { display: block; color: inherit; text-decoration: none; }
.card__cover { aspect-ratio: 16 / 10; background: var(--bg-tint); overflow: hidden; }
.card__cover img { width: 100%; height: 100%; object-fit: cover; }

.cover--empty {
  width: 100%; height: 100%;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 3.5rem;
  color: #fff;
  background: linear-gradient(135deg, var(--ink) 0%, var(--accent) 100%);
}
.cover--empty[data-kind="auditoria"]  { background: linear-gradient(135deg, #3b2a12 0%, var(--auditoria) 100%); }
.cover--empty[data-kind="site"]       { background: linear-gradient(135deg, #0b2b28 0%, var(--site) 100%); }
.cover--empty[data-kind="aplicativo"] { background: linear-gradient(135deg, #3a0f24 0%, var(--aplicativo) 100%); }

.card__body { padding: 1.1rem 1.25rem .9rem; }
.card__title { font-size: 1.22rem; margin: .6rem 0 .4rem; }
.card__description { color: var(--ink-soft); font-size: .92rem; margin-bottom: .6rem; }
.card__period { color: var(--ink-faint); font-size: .8rem; margin: 0; }
.card__tags { padding: 0 1.25rem 1.15rem; }

/* Panels & facts */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
}
.panel + .panel { margin-top: 1rem; }
.panel__note { font-size: .85rem; color: var(--ink-soft); }

.facts { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0 0 1rem; font-size: .9rem; }
.facts dt { color: var(--ink-faint); }
.facts dd { margin: 0; text-align: right; font-weight: 500; }

.code-link { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .82rem; word-break: break-all; }

/* Team */

.avatar {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent-tint);
  color: var(--accent-ink);
  font-size: .72rem;
  font-weight: 650;
  letter-spacing: .02em;
  flex: none;
}

.team { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .55rem; }
.team__member { display: flex; align-items: center; gap: .6rem; font-size: .9rem; }
.team__role { color: var(--ink-faint); font-style: normal; font-size: .75rem; }
.team__member .link-button { margin-left: auto; }
.team__invite { display: flex; gap: .5rem; }
.team__invite input { flex: 1; min-width: 0; }

/* Flash */

.flash {
  margin-top: 1rem;
  border-radius: var(--radius);
  padding: .75rem 1rem;
  font-size: .9rem;
  border: 1px solid;
}
.flash--notice { background: var(--success-tint); border-color: color-mix(in srgb, var(--success) 25%, transparent); color: var(--success); }
.flash--alert  { background: var(--danger-tint);  border-color: color-mix(in srgb, var(--danger) 25%, transparent);  color: var(--danger); }

/* Empty state */

.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 3.5rem 2rem;
  text-align: center;
}
.empty h2 { font-family: var(--serif); font-size: 1.8rem; font-weight: 400; margin-bottom: .5rem; }
.empty p { color: var(--ink-soft); }

/* Destaque */

.badge--featured { background: var(--warm); color: #fff; }

.card--featured { border-color: color-mix(in srgb, var(--warm) 45%, var(--line)); box-shadow: var(--shadow-md); }
.card__cover { position: relative; }

.ribbon {
  position: absolute;
  top: .75rem;
  left: .75rem;
  z-index: 1;
  background: var(--warm);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: .25rem .7rem;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}

/* Galeria de screenshots */

.gallery { margin-top: 2.5rem; }
.gallery:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: var(--radius); }

.gallery__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.gallery__position { color: var(--ink-faint); font-size: .84rem; font-variant-numeric: tabular-nums; }

.gallery__stage {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-tint);
  overflow: hidden;
}

/* Sem JavaScript todos os frames ficam empilhados e visíveis; só depois que o
   controller conecta é que passamos a mostrar um de cada vez. */
.gallery__frame { margin: 0; }
.gallery__frame + .gallery__frame { border-top: 1px solid var(--line); }
.gallery__frame img { display: block; width: 100%; max-height: 560px; object-fit: contain; }

.gallery--ready .gallery__frame { display: none; border-top: 0; }
.gallery--ready .gallery__frame.is-current { display: block; }

.gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding-bottom: .18em;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(6px);
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background .2s ease, transform .2s ease;
}
.gallery__nav:hover { background: var(--surface); transform: translateY(-50%) scale(1.06); }
.gallery__nav--previous { left: .85rem; }
.gallery__nav--next { right: .85rem; }

/* Os botões só fazem sentido com o controller ativo. */
.gallery:not(.gallery--ready) .gallery__nav { display: none; }

.gallery__thumbs {
  display: flex;
  gap: .6rem;
  margin-top: .85rem;
  padding-bottom: .25rem;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: thin;
}

.gallery__thumb {
  display: block;
  width: 108px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  opacity: .62;
  transition: opacity .2s ease, border-color .2s ease;
}
.gallery__thumb img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.gallery__thumb:hover { opacity: 1; }
.gallery__thumb.is-current { opacity: 1; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint); }

@media (max-width: 720px) {
  .gallery__nav { width: 36px; height: 36px; font-size: 1.3rem; }
  .gallery__thumb { width: 84px; }
}

/* Tela cheia dos screenshots */

.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}
.lightbox::backdrop { background: rgba(10, 10, 16, .92); backdrop-filter: blur(3px); }
.lightbox:not([open]) { display: none; }

.lightbox__inner {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: clamp(1rem, 4vw, 3.25rem);
}
.lightbox__inner img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7);
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: var(--radius-pill);
  background: rgba(20, 20, 28, .62);
  backdrop-filter: blur(6px);
  color: #fff;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.lightbox__close:hover,
.lightbox__nav:hover { background: rgba(20, 20, 28, .88); }

.lightbox__close { top: 1rem; right: 1rem; width: 44px; height: 44px; font-size: 1.6rem; padding-bottom: .12em; }

.lightbox__nav { top: 50%; width: 52px; height: 52px; font-size: 2rem; padding-bottom: .16em; transform: translateY(-50%); }
.lightbox__nav:hover { transform: translateY(-50%) scale(1.06); }
.lightbox__nav--previous { left: 1rem; }
.lightbox__nav--next { right: 1rem; }

.lightbox__position {
  position: absolute;
  bottom: 1.15rem;
  left: 50%;
  transform: translateX(-50%);
  padding: .3rem .85rem;
  border-radius: var(--radius-pill);
  background: rgba(20, 20, 28, .62);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
}

.gallery--ready .gallery__frame a { cursor: zoom-in; display: block; }

@media (max-width: 720px) {
  .lightbox__nav { width: 42px; height: 42px; font-size: 1.6rem; }
  .lightbox__close { width: 38px; height: 38px; font-size: 1.3rem; }
}
