@layer components {
  /* Variante compacta compartilhada pelo diretório e pelos canais de um país.
     Os cards da home e da administração mantêm seu componente independente. */
  .channel-directory-card {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
    min-width: 0;
    padding: 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    text-decoration: none;
    transition: border-color 150ms ease, background-color 150ms ease;
  }

  .channel-directory-card:hover,
  .channel-directory-card:focus-visible {
    border-color: var(--directory-item-border, rgb(186 160 232 / 18%));
    background: var(--directory-item-surface, rgb(186 160 232 / 9%));
  }

  .channel-directory-card:focus-visible {
    outline: 2px solid var(--directory-focus, #baa0e8);
    outline-offset: 3px;
  }

  .channel-directory-card__avatar {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--directory-avatar-surface, rgb(186 160 232 / 12%));
  }

  .channel-directory-card__monogram {
    color: var(--text);
    font-size: 1.5rem;
    font-weight: 700;
  }

  .channel-directory-card__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .channel-directory-card__body {
    min-width: 0;
  }

  .channel-directory-card__name {
    display: -webkit-box;
    overflow: hidden;
    margin: 0 0 8px;
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .channel-directory-card__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    color: var(--muted);
    font-size: 0.8125rem;
    line-height: 1.5;
  }

  .channel-directory-card__stats > span {
    overflow-wrap: anywhere;
  }

  .channel-directory-card__stats > span + span::before {
    content: '·';
    margin-right: 10px;
  }

  @media (width <= 640px) {
    .channel-directory-card__avatar {
      flex-basis: 64px;
      width: 64px;
      height: 64px;
    }

    .channel-directory-card__stats {
      display: grid;
      gap: 3px;
    }

    .channel-directory-card__stats > span + span::before {
      content: none;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .channel-directory-card {
      transition: none;
    }
  }
}
