/* Home categories — directory layout (former variant C) */

.wm-cats-c {
  background: var(--wm-surface-base);
  border: 1px solid var(--wm-border-light);
  border-radius: var(--wm-radius-md);
  padding: 0.65rem;
  overflow: hidden;
  contain: paint;
}

.wm-cats-c__track {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem 0.5rem;
}

.wm-cats-c__page {
  display: contents;
}

.wm-cats-c__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  border-radius: calc(var(--wm-radius-md) - 2px);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
  min-width: 0;
}

.wm-cats-c__row:hover {
  background: var(--wm-surface-muted);
}

.wm-cats-c__icon {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: var(--wm-radius);
  background: var(--wm-surface-muted);
  color: var(--wm-secondary);
  flex-shrink: 0;
}

.wm-cats-c__icon .wm-icon {
  width: 1rem;
  height: 1rem;
}

.wm-cats-c__copy {
  min-width: 0;
}

.wm-cats-c__copy h3 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 800;
  line-height: 1.2;
}

.wm-cats-c__copy p {
  margin: 0.15rem 0 0;
  font-size: 0.6875rem;
  color: var(--wm-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wm-cats-c__meta {
  text-align: right;
  flex-shrink: 0;
}

.wm-cats-c__meta strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 800;
  color: var(--wm-secondary);
}

.wm-cats-c__meta span {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--wm-accent-blue);
}

.wm-cats-c__dots {
  display: none;
}

/* Mobile: one card shell; content pages slide inside with peek */
@media (max-width: 767.98px) {
  .wm-cats-c {
    position: relative;
    padding: 0.5rem;
  }

  .wm-cats-c__track {
    display: flex;
    gap: 0.65rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .wm-cats-c__track::-webkit-scrollbar {
    display: none;
  }

  .wm-cats-c__page {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.25rem;
    flex: 0 0 calc(100% - 1.15rem);
    width: calc(100% - 1.15rem);
    max-width: calc(100% - 1.15rem);
    scroll-snap-align: start;
    scroll-snap-stop: always;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-sizing: border-box;
  }

  .wm-cats-c__page:last-child {
    flex-basis: 100%;
    width: 100%;
    max-width: 100%;
  }

  .wm-cats-c__copy p {
    display: none;
  }

  .wm-cats-c__dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.55rem;
    padding-top: 0.15rem;
  }

  /* Visual dots stay small; hit area ≥24×24 for WCAG 2.2 target-size */
  .wm-cats-c__dots button {
    appearance: none;
    box-sizing: border-box;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.15s ease;
  }

  .wm-cats-c__dots button::before {
    content: "";
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--wm-text-muted) 45%, transparent);
    transition: width 0.15s ease, background 0.15s ease;
  }

  .wm-cats-c__dots button.is-active::before {
    width: 1rem;
    background: var(--wm-secondary);
  }

  .wm-cats-c__icon {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    border-radius: 7px;
  }

  .wm-cats-c__icon .wm-icon,
  .wm-cats-c__icon svg {
    width: 17px;
    height: 17px;
  }
}
