/* Clients (klienci.php): the running names under the hero, the toolbar, the A-Z index and the
   clients grouped by letter. */

.cl-hero {
  padding-bottom: clamp(36px, 5vw, 64px);
}

/* ---------- Running names (template-parts/clients-marquee.php, css/design.css) ---------- */

.cl-marquee {
  margin: 0 0 clamp(48px, 6vw, 88px);
  padding: clamp(24px, 3.5vw, 44px) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* ---------- Toolbar: search, categories, results ---------- */

.cl-toolbar {
  display: grid;
  gap: 20px;
  margin: 0 0 24px;
}

.cl-toolbar .gtp-search {
  max-width: 640px;
}

/* ---------- A-Z index ---------- */

.cl-index {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 0 0 clamp(40px, 5vw, 64px);
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.cl-index__letter {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  font-family: var(--ff-display);
  font-size: 1.25rem;
  line-height: 1;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

a.cl-index__letter:hover,
a.cl-index__letter:focus-visible {
  background: var(--accent);
  color: var(--navy);
}

.cl-index__letter.is-empty,
.cl-index__letter.is-dimmed {
  color: rgba(255, 255, 255, 0.22);
}

a.cl-index__letter.is-dimmed {
  pointer-events: none;
}

/* Phones: one row that scrolls sideways. */
@media (max-width: 699px) {
  .cl-index {
    flex-wrap: nowrap;
    margin-left: calc(-1 * var(--gutter));
    margin-right: calc(-1 * var(--gutter));
    padding-left: calc(var(--gutter) - 8px);
    padding-right: var(--gutter);
    overflow-x: auto;
    scrollbar-width: none;
    /* Fades out at the right edge, so the row reads as one that scrolls on. */
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent);
  }

  .cl-index::-webkit-scrollbar {
    display: none;
  }

  /* With a mouse: a thin scrollbar under the letters (js/site.js adds wheel and drag scrolling). */
  @media (hover: hover) and (pointer: fine) {
    .cl-index {
      scrollbar-width: thin;
      scrollbar-color: var(--line-accent) transparent;
    }
  }

  .cl-index.is-dragging {
    cursor: grabbing;
    user-select: none;
  }

  /* Room after the last letter, so it can scroll out of the fade. */
  .cl-index::after {
    content: "";
    flex: 0 0 32px;
  }
}

/* ---------- Clients grouped by letter ---------- */

.cl-list {
  padding-bottom: clamp(24px, 4vw, 56px);
}

.cl-letter {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding-top: clamp(20px, 2.5vw, 32px);
  border-top: 1px solid var(--line);
}

.cl-letter + .cl-letter {
  margin-top: clamp(32px, 4vw, 56px);
}

.cl-letter__label {
  margin: 0 0 8px;
  padding: 0;
  color: var(--accent);
  font-family: var(--ff-display);
  font-size: clamp(3rem, 2rem + 3.4vw, 5.25rem);
  font-weight: 400;
  line-height: 1;
  text-transform: none;
}

.cl-letter__label span {
  display: block;
}

@media (min-width: 1000px) {
  .cl-letter {
    grid-template-columns: 140px minmax(0, 1fr);
    column-gap: clamp(32px, 4vw, 64px);
  }

  .cl-letter__label {
    margin: 0;
  }

  .cl-letter__label span {
    position: sticky;
    top: calc(var(--header-h) + 24px);
  }
}

.cl-letter__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 0 clamp(24px, 3vw, 40px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.cl-client {
  position: relative;
  margin: 0;
  padding: 16px 0 20px;
  border-bottom: 1px solid var(--line);
  list-style: none;
}

.cl-client__category {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}

.cl-client__name {
  margin: 0;
  padding: 0;
  color: #fff;
  font-family: var(--ff-display);
  font-size: clamp(1.1875rem, 1.1rem + 0.35vw, 1.4375rem);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none;
  overflow-wrap: break-word;
}

.cl-client__town {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: var(--fs-small);
  line-height: 1.45;
}

.cl-client__town svg {
  flex: none;
  margin-top: 2px;
  color: var(--accent);
}

@media (max-width: 599px) {
  .cl-client {
    padding: 12px 0 14px;
  }

  .cl-client__category {
    margin-bottom: 4px;
    font-size: 0.6875rem;
  }

  .cl-client__town {
    margin-top: 4px;
  }
}
