.td-directory {
  margin: 32px 0 64px;
}

.td-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 22px;
}

.td-header__title-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.td-header__title {
  margin: 0;
  color: #1f1f1f;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.td-header__search-wrap {
  flex: 0 1 580px;
  width: 100%;
  max-width: 580px;
}

.td-search {
  width: 100%;
  height: 60px;
  padding: 0 20px;
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 18px;
  background: #fff;
  color: #222;
  font-size: 18px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.td-search:focus,
.td-alpha-button:focus,
.td-card__link:focus {
  outline: 2px solid #1f1f1f;
  outline-offset: 2px;
}

.td-search:focus {
  border-color: rgba(0, 0, 0, 0.22);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
}

.td-alphabet {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 34px;
}

.td-alpha-button {
  min-width: 50px;
  height: 50px;
  padding: 0 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  background: #fff;
  color: #444;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.td-alpha-button:hover,
.td-alpha-button.is-active {
  background: #1f1f1f;
  border-color: #1f1f1f;
  color: #fff;
}

.td-grid {
  --td-columns-desktop: 6;
  --td-columns-tablet: 3;
  --td-columns-mobile: 1;
  display: grid;
  grid-template-columns: repeat(var(--td-columns-desktop), minmax(0, 1fr));
  gap: 28px;
}

.td-card {
  min-width: 0;
}

.td-card__link {
  position: relative;
  display: block;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 18px;
  background: #fff;
  color: inherit;
  text-decoration: none !important;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.td-card__link:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.10);
}

.td-card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f3f1ee;
}

.td-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease, filter 0.35s ease;
}

.td-card--grayscale .td-card__image {
  filter: grayscale(1);
}

.td-card__link:hover .td-card__image {
  transform: scale(1.04);
}

.td-card__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.45), transparent 35%),
    linear-gradient(135deg, #ece7df, #d9d1c5);
}

.td-card__placeholder span {
  color: #4f463b;
  font-size: clamp(42px, 4vw, 60px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.td-card__body {
  padding: 16px 16px 18px;
}

.td-card__title {
  margin: 0 0 7px;
  color: #1f1f1f;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.015em;
  word-break: break-word;
}

.td-card__meta {
  margin: 0;
  color: #7d7d7d;
  font-size: 14px;
  line-height: 1.45;
}

.td-card__hover {
  position: absolute;
  inset: auto 14px 14px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  border-radius: 999px;
  background: rgba(31, 31, 31, 0.92);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}

.td-card__link:hover .td-card__hover,
.td-card__link:focus .td-card__hover {
  opacity: 1;
  transform: translateY(0);
}

.td-empty {
  margin-top: 24px;
  color: #666;
  font-size: 15px;
}

@media (max-width: 1200px) {
  .td-grid {
    grid-template-columns: repeat(var(--td-columns-tablet), minmax(0, 1fr));
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .td-header {
    flex-direction: column;
    gap: 18px;
    margin-bottom: 18px;
  }

  .td-header__search-wrap {
    max-width: none;
  }

  .td-header__title {
    font-size: clamp(28px, 9vw, 40px);
  }

  .td-search {
    height: 52px;
    font-size: 16px;
  }

  .td-alphabet {
    gap: 8px;
    margin-bottom: 26px;
  }

  .td-alpha-button {
    min-width: 44px;
    height: 44px;
    font-size: 15px;
  }

  .td-grid {
    grid-template-columns: repeat(var(--td-columns-mobile), minmax(0, 1fr));
    gap: 18px;
  }

  .td-card__title {
    font-size: 16px;
  }

  .td-card__meta {
    font-size: 12px;
  }
}
