.clients__link {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.clients__link:focus-visible,
.projects-tabs__btn:focus-visible,
.clients-filter input:focus-visible {
  outline: 2px solid #31b4d5;
  outline-offset: 3px;
}

.projects-content[hidden],
.clients-content[hidden],
.client-directory-card[hidden],
.clients-filter__empty[hidden],
.projects-map__map[hidden] {
  display: none !important;
}

.custom-toggle__flag {
  display: inline-flex;
  width: 30px;
  height: 23px;
  margin-right: 15px;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
}

.clients-filter .custom-toggle__img {
  width: 30px;
  height: 23px;
  margin-right: 15px;
  flex: 0 0 30px;
  object-fit: cover;
}

.clients-filter .page-filter__btns [type="reset"],
#projects-directory .page-filter__btns [type="reset"] {
  display: inline-flex;
  padding: 10px 16px;
  align-items: center;
  opacity: 1;
  pointer-events: auto;
}

.projects-map__input .custom-toggle {
  min-width: 0;
  flex: 1 1 auto;
}

.projects-map__count {
  flex: 0 0 auto;
  margin-left: auto !important;
}

.projects-map__input.is-unavailable {
  opacity: 0.42;
}

.projects-map__map-toggle {
  min-width: 174px;
  justify-content: center;
}

.clients-filter {
  margin: 60px 0 16px;
}

.clients-filter__search {
  margin-left: auto;
}

.clients-filter__search input {
  font-size: 16px;
}

.clients-filter .page-filter__filter {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
}

.clients-filter .page-filter__fieldsets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.clients-filter .clients-filter__fieldset {
  display: block;
  min-width: 0;
}

.clients-filter .clients-filter__fieldset--location {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: stretch;
  display: flex;
  flex-direction: column;
}

.clients-filter .clients-filter__fieldset--location .clients-filter__options {
  max-height: none;
  flex: 1 1 auto;
}

.clients-filter .clients-filter__fieldset legend {
  margin-bottom: 14px;
  color: #1e1e1e;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.clients-filter__options {
  display: grid;
  max-height: 290px;
  gap: 10px;
  padding-right: 10px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.clients-filter__options .custom-toggle {
  display: block;
}

.clients-filter__options .custom-toggle label {
  display: flex;
  min-height: 32px;
  align-items: center;
}

.clients-filter__result {
  margin: 0 0 28px;
  color: #5d6469;
  font-size: 14px;
}

.clients-filter__result strong {
  color: #1e1e1e;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.clients-filter__empty {
  padding: 48px 24px;
  text-align: center;
}

.client-directory-card {
  min-width: 0;
  min-height: 290px;
  padding: 24px;
  border: 1px solid #d8dde0;
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.client-directory-card:hover {
  border-color: #8f9aa1;
  background-color: #fcfcfc;
  box-shadow: none;
  transform: none;
}

.clients-grid,
.map-clients-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.client-directory-card .map-client-header {
  min-height: 56px;
  margin-bottom: 20px;
  align-items: flex-start;
}

.client-directory-card .map-client-logo {
  display: flex;
  width: 104px;
  max-width: 104px;
  height: 56px;
  align-items: flex-start;
  justify-content: flex-end;
}

.client-directory-card .map-client-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top right;
}

.client-directory-card .map-client-body {
  margin-bottom: 20px;
}

.client-directory-card .map-client-compact__name {
  margin-bottom: 10px;
  color: #1e1e1e;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.client-directory-card .map-client-desc {
  display: -webkit-box;
  min-height: 59px;
  overflow: hidden;
  color: #62696e;
  font-size: 14px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.client-directory-card .client-directory-card__tags {
  align-content: flex-start;
  gap: 6px;
}

.client-directory-card .tag-link {
  padding: 5px 8px;
  border: 0;
  border-radius: 4px;
  background: #f1f3f4;
  color: #555d62;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
}

.client-directory-card .tag-link:nth-child(n + 3) {
  display: none;
}

.client-directory-card .map-client-compact__bottom {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid #eceff1;
}

.client-directory-card .map-client-meta {
  margin-bottom: 14px;
}

.client-directory-card .badge--info {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #737b80;
  font-size: 13px;
  font-weight: 500;
}

.client-directory-card .map-client-actions {
  gap: 8px;
  flex-wrap: nowrap;
}

.client-directory-card .map-client-actions .btn,
.client-directory-card .map-client-compact__btn {
  min-width: 0;
  min-height: 42px;
  flex: 0 1 auto;
  padding: 10px 16px;
  border: 1px solid #b8c0c5;
  border-radius: 6px;
  background: transparent;
  color: #1e1e1e;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
}

.client-directory-card .map-client-actions a:last-child {
  border-color: #1e1e1e;
  background: #1e1e1e;
  color: #fff;
}

.client-directory-card .map-client-actions .btn:hover,
.client-directory-card .map-client-actions .btn:focus-visible {
  border-color: #37b4d2;
  background: #eef8fa;
  color: #176b81;
}

.client-directory-card .map-client-actions a:last-child:hover,
.client-directory-card .map-client-actions a:last-child:focus-visible {
  border-color: #176b81;
  background: #176b81;
  color: #fff;
}

[data-client-grid][aria-busy="true"] {
  opacity: 0.55;
}

.client-pagination {
  margin: 8px 0 56px;
}

.client-directory-card__tags {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.client-directory-card .map-client-compact__name a {
  color: inherit;
  text-decoration: none;
}

.client-directory-card .map-client-compact__name a:hover {
  color: #249cbc;
}

/* Карточки проектов с отдельной областью для текста. */
.project-card-bg.project-card-modern {
  display: flex;
  min-width: 0;
  min-height: 390px;
  padding: 0;
  flex-direction: column;
  flex-wrap: nowrap;
  overflow: hidden;
  border: 1px solid #d8dde0;
  border-radius: 14px;
  background: #fff;
  box-shadow: none;
  color: #1e1e1e;
  isolation: isolate;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.project-card-bg.project-card-modern::after {
  display: none;
}

.project-card-bg.project-card-modern:hover {
  border-color: #8f9aa1;
}

.project-card-modern__link {
  z-index: 3;
}

.project-card-modern__link:focus-visible {
  border-radius: 13px;
  outline: 3px solid #37b4d2;
  outline-offset: -4px;
}

.project-card-modern__media {
  position: relative;
  height: 176px;
  flex: 0 0 176px;
  overflow: hidden;
  background: #e9edef;
}

.project-card-modern__placeholder {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  background: #e9edef;
  color: #68747a;
}

.project-card-modern__placeholder svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.project-card-modern__placeholder span {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.project-card-bg.project-card-modern .project-card-modern__media img {
  position: static;
  z-index: auto;
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: cover;
  transition: transform 220ms ease;
}

.project-card-modern:hover .project-card-modern__media img {
  transform: scale(1.025);
}

.project-card-modern__content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 0;
  padding: 22px 24px 20px;
  flex: 1;
  flex-direction: column;
  background: #fff;
}

.project-card-modern--no-media .project-card-modern__content {
	background: #fff;
}

.project-card-modern__meta {
  display: flex;
  min-height: 28px;
  margin-bottom: 18px;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.project-card-bg.project-card-modern .project-card-modern__type,
.project-card-bg.project-card-modern .project-card-modern__tag {
  position: static;
  z-index: auto;
  display: inline-flex;
  width: auto;
  min-height: 26px;
  margin: 0;
  padding: 5px 8px;
  align-items: center;
  border-radius: 4px;
  background: #e9edef;
  color: #555d62;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
}

.project-card-bg.project-card-modern .project-card-modern__type {
  background: #1e1e1e;
  color: #fff;
}

.project-card-bg.project-card-modern .project-card-modern__title {
  display: -webkit-box;
  width: 100%;
  margin: 0 0 12px;
  overflow: hidden;
  color: #1e1e1e;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.015em;
  transition: color 140ms ease;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.project-card-bg.project-card-modern .project-card-modern__summary {
  display: -webkit-box;
  width: 100%;
  margin: 0 0 22px;
  overflow: hidden;
  color: #62696e;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.48;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.project-card-modern__footer {
  display: flex;
  width: 100%;
  margin-top: auto;
  padding-top: 16px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #dfe3e5;
}

.project-card-bg.project-card-modern .project-card-modern__country {
  width: auto;
  color: #737b80;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}

.project-card-modern__action {
  margin-left: auto;
  color: #1e1e1e;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  transition: color 140ms ease;
}

.project-card-modern__action span {
  display: inline-block;
  margin-left: 4px;
  transition: transform 140ms ease;
}

.project-card-modern:hover .project-card-modern__title,
.project-card-modern:focus-within .project-card-modern__title,
.project-card-modern:hover .project-card-modern__action,
.project-card-modern:focus-within .project-card-modern__action {
  color: #176b81;
}

.project-card-modern:hover .project-card-modern__action span,
.project-card-modern:focus-within .project-card-modern__action span {
  transform: translateX(3px);
}

@media (max-width: 1279px) {
  .clients-grid,
  .map-clients-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .clients-filter {
    margin: 0 0 20px;
  }

  .clients-filter form,
  #projects-directory .projects-map form {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .clients-filter__search,
  #projects-directory .projects-map .search-field {
    order: 1;
    width: 100%;
    margin: 0 0 20px;
  }

  .clients-filter .page-filter__button,
  #projects-directory .page-filter__button {
    order: 2;
    width: 100%;
  }

  .clients-filter .page-filter__filter,
  #projects-directory .page-filter__filter {
    order: 3;
    position: static;
    display: none;
    min-width: 0;
    margin-top: 20px;
  }

  .clients-filter .page-filter__button.is-active ~ .page-filter__filter {
    display: block;
    max-height: none !important;
    opacity: 1;
  }

  .clients-filter .page-filter__fieldsets {
    grid-template-columns: 1fr;
  }

  .clients-filter .clients-filter__fieldset--location {
    grid-column: auto;
    grid-row: auto;
    display: block;
  }

  .clients-filter .clients-filter__fieldset--location .clients-filter__options {
    max-height: 290px;
  }

  #projects-directory .page-filter__button.is-active ~ .page-filter__filter {
    display: block;
    max-height: none !important;
    opacity: 1;
  }

  .clients-grid,
  .map-clients-grid {
    grid-template-columns: 1fr;
  }

  .client-directory-card {
    min-height: 0;
    padding: 20px;
  }

  .client-directory-card .map-client-actions {
    flex-direction: column;
  }

  .client-directory-card .map-client-actions .btn {
    width: 100%;
  }

  .project-card-bg.project-card-modern {
    min-height: 0;
  }

  .project-card-modern__media {
    height: 164px;
    flex-basis: 164px;
  }

	.project-card-modern__content {
    min-height: 280px;
    padding: 20px;
  }

  .project-card-bg.project-card-modern .project-card-modern__title {
    font-size: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .clients-content {
    animation: none !important;
  }
}
