/* ✦ NEW — Categories page 2.0 (Dark). Every rule is scoped to .dx-cats. */

.dx-cats {
  --dx-cats-fg: var(--text-color-primary-bg, #fff);
  --dx-cats-accent: #bb9e7b;
  --dx-cats-line: color-mix(in srgb, currentColor 12%, transparent);
  max-width: 1320px;
  margin: 0 auto;
  padding: 48px 24px 88px;
  color: inherit;
}
.dx-cats *, .dx-cats *::before, .dx-cats *::after { box-sizing: border-box; }
.dx-cats a { color: inherit; text-decoration: none; }
.dx-cats svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .dx-cats svg { transform: scaleX(-1); }

/* Heading */
.dx-cats__head { margin-bottom: 40px; }
.dx-cats__crumb { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; font-size: .85rem; opacity: .6; }
.dx-cats__crumb a:hover { opacity: 1; color: var(--dx-cats-accent); }
.dx-cats__title { margin: 0; font-size: clamp(2rem, 4.5vw, 3.25rem); font-weight: 800; line-height: 1.15; }
.dx-cats__sub { margin: 12px 0 0; opacity: .65; font-size: 1rem; }

/* Grid */
.dx-cats__grid { display: grid; gap: 28px 20px; margin: 0; padding: 0; list-style: none; }
.dx-cats__grid--1 { grid-template-columns: minmax(0, 520px); }
.dx-cats__grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dx-cats__grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dx-cats__grid--many { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* 5, 6 and 9 categories sit in rows of three; rows that aren't full are centred instead of leaving a gap */
.dx-cats__grid--3x, .dx-cats__grid--many { display: flex; flex-wrap: wrap; justify-content: center; }
.dx-cats__grid--3x > .dx-cats__item { flex: 0 0 calc((100% - 40px) / 3); }
.dx-cats__grid--many > .dx-cats__item { flex: 0 0 calc((100% - 60px) / 4); }
.dx-cats__item { min-width: 0; }

.dx-cats__card {
  position: relative; display: block; overflow: hidden;
  border-radius: 14px;
  background: color-mix(in srgb, currentColor 6%, transparent);
  isolation: isolate;
}
.dx-cats__media { display: block; aspect-ratio: 4 / 5; }
.dx-cats__grid--1 .dx-cats__media, .dx-cats__grid--2 .dx-cats__media { aspect-ratio: 5 / 4; }
.dx-cats__media img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  transition: transform .7s cubic-bezier(.2, .8, .2, 1);
}
.dx-cats__card::after {
  content: ''; position: absolute; inset: 40% 0 0; z-index: 1;
  background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, 0));
  pointer-events: none;
}
.dx-cats__ph {
  display: block; width: 100%; height: 100%; padding: 18px 22px;
  background:
    radial-gradient(circle at 80% 15%, color-mix(in srgb, var(--dx-cats-accent) 22%, transparent), transparent 55%),
    color-mix(in srgb, currentColor 5%, transparent);
  color: var(--dx-cats-accent);
  font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 800; line-height: 1; opacity: .55;
}
.dx-cats__label {
  position: absolute; inset-inline: 20px 64px; bottom: 20px; z-index: 2;
  display: flex; flex-direction: column; gap: 2px;
  color: #fff;
}
.dx-cats__name {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
  font-size: clamp(1.05rem, 1.8vw, 1.45rem); font-weight: 700; line-height: 1.3; overflow-wrap: anywhere;
}
.dx-cats__count { font-size: .82rem; opacity: .75; }
.dx-cats__go {
  position: absolute; inset-inline-end: 18px; bottom: 20px; z-index: 2;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255, 255, 255, .14); color: #fff;
  backdrop-filter: blur(6px);
  transition: background-color .25s ease, color .25s ease, transform .25s ease;
}
.dx-cats__card:hover .dx-cats__media img { transform: scale(1.05); }
.dx-cats__card:hover .dx-cats__go { background: var(--dx-cats-accent); color: #161313; }
.dx-cats__card:focus-visible { outline: 2px solid var(--dx-cats-accent); outline-offset: 3px; }

/* Sub-categories */
.dx-cats__subs { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.dx-cats__subs a {
  display: inline-block; padding: 6px 14px;
  border: 1px solid var(--dx-cats-line); border-radius: 999px;
  font-size: .85rem; opacity: .85;
  transition: border-color .2s ease, color .2s ease, opacity .2s ease;
}
.dx-cats__subs a:hover { border-color: var(--dx-cats-accent); color: var(--dx-cats-accent); opacity: 1; }

/* Empty + footer link */
.dx-cats__empty { padding: 64px 0; text-align: center; opacity: .7; }
.dx-cats__foot { display: flex; justify-content: center; margin-top: 56px; }
.dx-cats__all {
  display: inline-flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 28px;
  border: 1px solid var(--dx-cats-line); border-radius: 999px;
  font-weight: 600;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
.dx-cats__all:hover { border-color: var(--dx-cats-accent); background: var(--dx-cats-accent); color: #161313; }

@media (max-width: 1023.98px) {
  .dx-cats__grid--many > .dx-cats__item { flex-basis: calc((100% - 40px) / 3); }
}
@media (max-width: 767.98px) {
  .dx-cats { padding: 28px 16px 64px; }
  .dx-cats__head { margin-bottom: 24px; }
  .dx-cats__grid--2, .dx-cats__grid--3, .dx-cats__grid--3x, .dx-cats__grid--many { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .dx-cats__grid--3x > .dx-cats__item, .dx-cats__grid--many > .dx-cats__item { flex-basis: calc((100% - 12px) / 2); }
  .dx-cats__grid--1 { grid-template-columns: 1fr; }
  .dx-cats__grid--2 .dx-cats__media { aspect-ratio: 4 / 5; }
  .dx-cats__grid--3 .dx-cats__item:first-child { grid-column: 1 / -1; }
  .dx-cats__grid--3 .dx-cats__item:first-child .dx-cats__media { aspect-ratio: 16 / 10; }
  .dx-cats__label { inset-inline: 14px 52px; bottom: 14px; }
  .dx-cats__go { inset-inline-end: 12px; bottom: 14px; width: 34px; height: 34px; }
  .dx-cats__subs a { padding: 5px 11px; font-size: .8rem; }
}
@media (prefers-reduced-motion: reduce) {
  .dx-cats * { transition: none !important; }
}

/* A mouse click or tap leaves no browser focus box; keyboard users still get the focus-visible outline */
:where(.dx-cats) :is(a, button, summary, input, select, textarea, video, [tabindex]):focus:not(:focus-visible) {
  outline: none;
}
