/* Utility helpers — використовувати без зловживань. */

/* ── Breadcrumbs (глобально — використовуються в article, gallery, documents) */
.breadcrumb {
  margin-bottom: var(--sp-24);
}

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--sp-6);
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: var(--fs-14);
  color: var(--c-text-muted);
}

.breadcrumb__item + .breadcrumb__item::before {
  content: "/";
  color: var(--c-text-muted);
  margin-right: var(--sp-6);
}

.breadcrumb__link {
  color: var(--c-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb__link:hover,
.breadcrumb__link:focus-visible {
  text-decoration: underline;
  color: var(--c-primary-700);
}

.breadcrumb__current {
  color: inherit;
}

/* ── Container ───────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--sp-24);
}

@media (max-width: 480px) {
  .container { padding-inline: var(--sp-16); }
}

/* ── Display ─────────────────────────────────────────────────────────────── */
.is-hidden       { display: none; }
.is-visible      { display: block; }

/* Responsive visibility */
@media (max-width: 1023px) { .hide-tablet  { display: none; } }
@media (min-width: 1024px) { .hide-desktop { display: none; } }
@media (max-width: 767px)  { .hide-mobile  { display: none; } }
@media (min-width: 768px)  { .show-mobile-only { display: none; } }

/* ── Text alignment ──────────────────────────────────────────────────────── */
.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-right   { text-align: right; }

/* ── Spacing helpers ─────────────────────────────────────────────────────── */
.mt-0  { margin-top: 0; }
.mb-0  { margin-bottom: 0; }
.mt-8  { margin-top: var(--sp-8); }
.mb-8  { margin-bottom: var(--sp-8); }
.mt-16 { margin-top: var(--sp-16); }
.mb-16 { margin-bottom: var(--sp-16); }
.mt-32 { margin-top: var(--sp-32); }
.mb-32 { margin-bottom: var(--sp-32); }

/* ── Flex helpers ────────────────────────────────────────────────────────── */
.d-flex          { display: flex; }
.align-center    { align-items: center; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap       { flex-wrap: wrap; }
.gap-8           { gap: var(--sp-8); }
.gap-16          { gap: var(--sp-16); }

/* ── Visually hidden (accessible) ────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Truncate text ───────────────────────────────────────────────────────── */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
