/**
 * Bengal SSG Default Theme
 * Tag & Badge Components
 */

/* ============================================
   ARTICLE FOOTER (Tags Section)
   ============================================ */

.docs-footer {
  margin-top: var(--space-12);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}

.docs-footer-label {
  display: block;
  margin-bottom: var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--color-text-tertiary);
}

/* ============================================
   TAGS
   ============================================ */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}.tag{
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: var(--leading-none);
  color: var(--color-primary);
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all var(--transition-fast) var(--ease-out),
              transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Satisfying squeeze on press */
.tag:active {
  transform: scale(0.92);
  transition: transform 0.1s ease-out;
}

/* Tags with icons */
.tag-link:has(.tag-icon) {
  gap: var(--space-2);
}
.tag:hover {
    color: var(--color-text-inverse);
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    text-decoration: none;
  }

/* XXS adjustments (<= --breakpoint-xxs): fit chip rows without wrapping */
@media (max-width: 399px) {
  .tags {
    gap: var(--space-1);
  }

  .tag {
    padding: 2px 8px;
    font-size: var(--text-xxs);
    gap: 0.25rem;
  }
}

/* ============================================
   TAG VARIANTS
   ============================================ */

.tag-primary {
  color: var(--color-text-inverse);
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.tag-secondary {
  color: var(--color-text-inverse);
  background-color: var(--color-secondary);
  border-color: var(--color-secondary);
}

.tag-outline {
  color: var(--color-primary);
  background-color: transparent;
  border-color: var(--color-primary);
}

.tag-outline:hover {
  color: var(--color-text-inverse);
  background-color: var(--color-primary);
}

/* (removed glass enhancement) */

/* ============================================
   BADGES
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-none);
  color: var(--color-text-inverse);
  background-color: var(--color-primary);
  border-radius: var(--radius-sm);
}

.badge-success {
  background-color: var(--color-success);
}

.badge-warning {
  background-color: var(--color-warning);
}

.badge-error {
  background-color: var(--color-error);
}

.badge-info {
  background-color: var(--color-info);
}

/* ============================================
   TAG LIST WITH ICON
   ============================================ */

.tag-with-icon {
  display: flex;
  align-items: center;
  gap: var(--space-1-5);
}

.tag-icon {
  width: 14px;
  height: 14px;
}

/* Tag page layouts */
.tag-page {
  max-width: var(--container-lg);
  margin: 0 auto;
  padding-inline: var(--space-4);
}

.tag-page .tag-icon {
  color: var(--color-primary);
  font-weight: var(--weight-bold);
  margin-right: var(--space-2);
}

.tag-page .tag-nav {
  margin-top: var(--space-12);
  text-align: center;
}

.tags-page {
  max-width: var(--container-lg);
  margin: 0 auto;
  padding-inline: var(--space-4);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-8);
}

.tag-item {
  flex: 0 1 auto;
}

.tag-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all var(--transition-base) var(--ease-out);
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.tag-link:hover {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-text-inverse);
  transform: translate3d(0, -2px, 0);
  box-shadow: var(--elevation-medium);
}

.tag-name {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
}

.tag-link:hover .tag-name {
  color: var(--color-text-inverse);
}

.tag-count {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding: var(--space-1) var(--space-2);
  background-color: var(--color-bg-tertiary);
  border-radius: var(--radius-full);
}

.tag-link:hover .tag-count {
  background-color: rgba(255, 255, 255, 0.2);
  color: var(--color-text-inverse);
}

/* ============================================
   TAG NAVIGATION SIDEBAR
   ============================================ */

.tag-nav-name {
  display: inline-block;
}

.tag-nav-count {
  display: inline-block;
  margin-left: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: var(--weight-normal);
}

.docs-nav-link.active .tag-nav-count {
  color: var(--color-text-secondary);
}

.docs-nav-link:hover .tag-nav-count {
  color: var(--color-text-secondary);
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .tag,
  .tag:active,
  .tag-link,
  .tag-link:hover {
    animation: none !important;
    transition: color 0s, background-color 0s, border-color 0s !important;
    transform: none !important;
  }
}
