/* Influencer.mk — Category Discovery V4.2 */
.cd4 {
  --cd4-ink: #0a0a0a;
  --cd4-body: #4a4f57;
  --cd4-muted: #8b909a;
  --cd4-accent: #e20246;
  --cd4-border: #ebecee;
  --cd4-card: #111111;
  --cd4-card-soft: #1a1a1a;
  --cd4-radius: 18px;
  --cd4-gap: 20px;
  overflow-x: clip;
}

.cd4__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.cd4__header {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 24px 48px;
  align-items: center;
  margin-bottom: 32px;
}

.cd4__heading-block {
  min-width: 0;
}

.cd4__title {
  margin: 0;
  font-size: clamp(2.25rem, 4.2vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--cd4-ink);
}

.cd4__title-line {
  display: block;
}

.cd4__title-line--accent {
  color: var(--cd4-accent);
}

.cd4__aside {
  min-width: 0;
}

.cd4__subtitle {
  margin: 0;
  max-width: 34em;
  font-size: clamp(1rem, 1.05vw, 1.125rem);
  line-height: 1.6;
  color: #292e33;
}

.cd4__carousel {
  position: relative;
  width: 100%;
}

.cd4__viewport {
  overflow: hidden;
  min-width: 0;
  width: 100%;
  outline: none;
}

.cd4__track {
  display: flex;
  gap: var(--cd4-gap);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .cd4__track {
    transition: none;
  }
}

/* Overlay arrows — do not consume layout width */
.cd4__nav {
  position: absolute;
  top: 42%;
  z-index: 3;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.88);
  color: var(--cd4-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15, 18, 24, 0.14);
  transition: background 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.cd4__nav--prev {
  left: 10px;
}

.cd4__nav--next {
  right: 10px;
}

.cd4__nav:hover:not(:disabled) {
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 18, 24, 0.18);
}

.cd4__nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.cd4__nav:focus-visible {
  outline: 2px solid var(--cd4-accent);
  outline-offset: 2px;
}

/* Desktop ≥1200px: exactly 3 cards, full content width */
.cd4__card {
  flex: 0 0 calc((100% - (2 * var(--cd4-gap))) / 3);
  min-width: 0;
  background: var(--cd4-card);
  color: #f5f5f5;
  border-radius: var(--cd4-radius);
  overflow: hidden;
  border: 1px solid #222;
  display: flex;
  flex-direction: column;
}

.cd4__card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 10px;
}

.cd4__head-chrome {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
  color: rgba(245, 245, 245, 0.78);
  pointer-events: none;
  user-select: none;
}

.cd4__star,
.cd4__more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.cd4__star svg,
.cd4__more svg {
  display: block;
}

.cd4__avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  object-fit: cover;
  background: #2a2a2a;
  flex-shrink: 0;
}

.cd4__meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.cd4__username {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}

.cd4__cat-label {
  font-size: 12px;
  color: var(--cd4-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cd4__photo-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.cd4__photo {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--cd4-card-soft);
  overflow: hidden;
}

.cd4__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cd4__photo-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #1e1e1e, #2c2c2c 45%, #121212);
  font-size: 3rem;
  font-weight: 700;
  color: #555;
}

.cd4__icons {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 2px;
  color: rgba(242, 242, 242, 0.78);
  pointer-events: none;
  user-select: none;
}

.cd4__icon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  line-height: 1;
}

.cd4__icon svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.cd4__eng {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(242, 242, 242, 0.88);
  font-variant-numeric: tabular-nums;
}

.cd4__icon--end {
  margin-left: auto;
}

.cd4__icon--end .cd4__eng {
  display: none;
}

.cd4__body {
  padding: 6px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.cd4__name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
}

.cd4__desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #b8bcc3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cd4__counts {
  margin: 0;
  font-size: 12px;
  color: var(--cd4-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.cd4__dot {
  opacity: 0.7;
}

.cd4__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}

.cd4__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.cd4__btn:hover {
  transform: translateY(-1px);
}

.cd4__btn--primary {
  background: var(--cd4-accent);
  color: #fff;
  border: 1px solid transparent;
}

.cd4__btn--primary:hover {
  background: #c4013c;
}

.cd4__btn--ghost {
  background: transparent;
  color: #fff;
  border: 1px solid #3a3a3a;
}

.cd4__btn--ghost:hover {
  border-color: #666;
  background: #1a1a1a;
}

.cd4__btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.cd4__footer {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px 20px;
  margin-top: 40px;
  padding-top: 28px;
}

.cd4__footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 520px);
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #ebecee 18%,
    #e0e3e8 50%,
    #ebecee 82%,
    transparent 100%
  );
  pointer-events: none;
}

.cd4__footer-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.cd4__footer-divider {
  display: inline-block;
  width: 1px;
  height: 24px;
  background: #d7dbe2;
  flex: 0 0 auto;
}

.cd4__view-all {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid var(--cd4-border);
  background: #fff;
  color: #1e242e;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.cd4__view-all:hover {
  background: #f8f9fb;
}

.cd4__view-all--primary {
  background: var(--cd4-accent);
  border-color: var(--cd4-accent);
  color: #fff;
}

.cd4__view-all--primary:hover {
  background: #c4013c;
  border-color: #c4013c;
  color: #fff;
}

.cd4__view-all--ink {
  background: #1e242e;
  border-color: #1e242e;
  color: #fff;
}

.cd4__view-all--ink:hover {
  background: #0f1318;
  border-color: #0f1318;
  color: #fff;
}

.cd4__view-all:focus-visible {
  outline: 2px solid var(--cd4-accent);
  outline-offset: 2px;
}

@media (max-width: 700px) {
  .cd4__footer-divider {
    display: none;
  }

  .cd4__footer {
    gap: 12px;
  }

  .cd4__footer-group {
    width: 100%;
  }

  .cd4__footer-group .cd4__view-all {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
    text-align: center;
    padding: 0 12px;
  }
}

.cd4__empty {
  margin: 0;
  color: var(--cd4-body);
  font-size: 1rem;
}

/* Tablet / laptop <1200: 2 cards */
@media (max-width: 1199px) {
  .cd4__card {
    flex-basis: calc((100% - var(--cd4-gap)) / 2);
  }
}

@media (max-width: 900px) {
  .cd4__header {
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: start;
  }
}

@media (max-width: 480px) {
  .cd4__actions {
    grid-template-columns: 1fr;
  }

  .cd4__btn {
    white-space: normal;
  }
}

/* Mobile: ~1.15 cards + swipe */
@media (max-width: 640px) {
  .cd4__inner {
    padding: 0 16px;
  }

  .cd4__header {
    margin-bottom: 24px;
  }

  .cd4__nav {
    display: none;
  }

  .cd4__viewport {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .cd4__viewport::-webkit-scrollbar {
    display: none;
  }

  .cd4__track {
    transform: none !important;
  }

  .cd4__card {
    flex-basis: 86%;
    scroll-snap-align: start;
  }

  .cd4__footer {
    margin-top: 28px;
  }
}
