/* ============================================
   BICIKLIZAM GLOSSARY — STYLES
   ============================================ */

.bg-glossary {
  font-family: 'Inter', 'Helvetica Neue', sans-serif;
  margin: 2rem 0;
}

/* Search */
.bg-search-wrap {
  position: relative;
  margin-bottom: 1.25rem;
}
.bg-search {
  width: 100%;
  padding: 0.75rem 2.75rem 0.75rem 1rem;
  border: 1.5px solid #d6d3ce;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.bg-search:focus { border-color: #e8380d; }
.bg-search-icon {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9b9690;
  pointer-events: none;
}

/* Category filter */
.bg-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}
.bg-cat-btn {
  padding: 0.3rem 0.85rem;
  border-radius: 100px;
  border: 1.5px solid #d6d3ce;
  background: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  color: #6b6760;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.bg-cat-btn:hover { border-color: #e8380d; color: #e8380d; }
.bg-cat-btn.active { background: #e8380d; border-color: #e8380d; color: #fff; }

/* A-Z index */
.bg-az-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid #1a1917;
}
.bg-az-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #f0eeeb;
  color: #1a1917;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s;
  letter-spacing: 0.04em;
}
.bg-az-btn:hover { background: #e8380d; color: #fff; }
.bg-az-btn.has-results { background: #1a1917; color: #fff; }

/* Letter groups */
.bg-letter-group {
  margin-bottom: 2.5rem;
}
.bg-letter-heading {
  font-size: 2rem;
  font-weight: 800;
  color: #e8380d;
  line-height: 1;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e2dfd9;
  letter-spacing: 0.04em;
}
.bg-letter-items {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Individual term */
.bg-term {
  border-bottom: 1px solid #e2dfd9;
}
.bg-term:last-child { border-bottom: none; }
.bg-term-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 0;
  cursor: pointer;
  user-select: none;
}
.bg-term-header:hover .bg-term-title { color: #e8380d; }
.bg-term-title {
  font-weight: 600;
  font-size: 0.95rem;
  flex: 1;
  transition: color 0.15s;
}
.bg-term-cat {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.15rem 0.5rem;
  background: #f0eeeb;
  border-radius: 100px;
  color: #6b6760;
  white-space: nowrap;
}
.bg-term-arrow {
  color: #9b9690;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.bg-term.open .bg-term-arrow { transform: rotate(180deg); }

/* Term body (accordion) */
.bg-term-body {
  display: none;
  padding: 0 0 1.1rem;
}
.bg-term.open .bg-term-body { display: block; }
.bg-term-content {
  font-size: 0.88rem;
  color: #6b6760;
  line-height: 1.65;
  margin-bottom: 0.75rem;
}
.bg-term-content p { margin: 0; }
.bg-term-link {
  font-size: 0.78rem;
  font-weight: 700;
  color: #e8380d;
  text-decoration: none;
  letter-spacing: 0.03em;
}
.bg-term-link:hover { text-decoration: underline; }

/* No results */
.bg-no-results p {
  text-align: center;
  color: #9b9690;
  padding: 3rem 0;
  font-size: 0.9rem;
}
.bg-empty {
  color: #9b9690;
  font-style: italic;
}

/* Hidden term/group */
.bg-term.bg-hidden { display: none; }
.bg-letter-group.bg-hidden { display: none; }

/* ============================================
   INLINE TOOLTIP LINK IN ARTICLES
   ============================================ */
.bg-inline-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: #e8380d;
  text-underline-offset: 3px;
  cursor: help;
  position: relative;
}
.bg-inline-link:hover { color: #e8380d; }

/* Tooltip */
.bg-tooltip {
  position: absolute;
  z-index: 9999;
  background: #1a1917;
  color: #fff;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  max-width: 280px;
  font-size: 0.8rem;
  line-height: 1.5;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
}
.bg-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}
.bg-tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 16px;
  border: 6px solid transparent;
  border-bottom-color: #1a1917;
}

/* ============================================
   SINGLE TERM PAGE
   ============================================ */
.bg-single-term {
  max-width: 760px;
}
.bg-term-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #6b6760;
  text-decoration: none;
  margin-bottom: 1.5rem;
  transition: color 0.15s;
}
.bg-term-back:hover { color: #e8380d; }

/* Responsive */
@media (max-width: 600px) {
  .bg-az-btn { width: 30px; height: 30px; font-size: 0.75rem; }
  .bg-term-header { padding: 0.75rem 0; }
}
