.category-page {
  position: relative;
  overflow: hidden;
  padding-bottom: 10px;
}

.category-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 0% -20%, rgba(255, 82, 82, 0.16) 0, rgba(255, 82, 82, 0) 45%),
    radial-gradient(circle at 100% 0%, rgba(75, 89, 102, 0.12) 0, rgba(75, 89, 102, 0) 38%),
    linear-gradient(180deg, #f8fafe 0, #ffffff 42%);
  pointer-events: none;
}

.category-page > .container {
  position: relative;
  z-index: 1;
}

.category-page .category-hero {
  background: #ffffff;
  border: 1px solid #e8edf5;
  border-radius: 24px;
  box-shadow: 0 20px 38px rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 30px 34px;
  margin-bottom: 20px;
}

.category-page .category-kicker {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #ff5252;
  background: rgba(255, 82, 82, 0.12);
  border: 1px solid rgba(255, 82, 82, 0.28);
  border-radius: 999px;
  padding: 6px 11px;
  margin-bottom: 12px;
}

.category-page .category-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.1;
  color: #273546;
  font-weight: 700;
}

.category-page .category-hero p {
  margin: 0;
  max-width: 690px;
  color: #6c7a8a;
  font-size: 15px;
}

.category-page .category-hero-link {
  flex-shrink: 0;
  height: 46px;
  min-width: 110px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
  color: #ffffff;
  padding: 0 20px;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(255, 82, 82, 0.26);
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.category-page .category-hero-link:hover {
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(255, 82, 82, 0.32);
}

.category-page .category-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.category-page .category-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e8edf5;
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.category-page .category-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 82, 82, 0.35);
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.1);
}

.category-page .category-card-image {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(180deg, #f7faff 0, #edf2f9 100%);
}

.category-page .category-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.category-page .category-card:hover .category-card-image img {
  transform: scale(1.05);
}

.category-page .category-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 16px;
}

.category-page .category-card-title {
  font-size: 20px;
  line-height: 1.2;
  color: #2b3a4b;
  font-weight: 700;
  min-height: 48px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.category-page .category-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-page .category-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 82, 82, 0.1);
  color: #ff5252;
  border: 1px solid rgba(255, 82, 82, 0.22);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
}

.category-page .category-pill-muted {
  background: #f3f7fc;
  border-color: #dde6f1;
  color: #5f6f81;
}

.category-page .category-card-arrow {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #e0e7f1;
  color: #ff5252;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.1);
}

.category-page .category-empty-state {
  background: #ffffff;
  border: 1px solid #e8edf5;
  border-radius: 20px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.07);
  padding: 28px 24px;
  text-align: center;
}

.category-page .category-empty-state h3 {
  margin: 0 0 8px;
  color: #2a3a4d;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
}

.category-page .category-empty-state p {
  margin: 0;
  color: #6f7f90;
  font-size: 15px;
}

@media only screen and (max-width: 1199px) {
  .category-page .category-hero {
    border-radius: 20px;
    padding: 24px;
  }

  .category-page .category-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

  .category-page .category-card-title {
    font-size: 18px;
    min-height: 44px;
  }
}

@media only screen and (max-width: 991px) {
  .category-page .category-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    border-radius: 18px;
    padding: 20px;
  }
}

@media only screen and (max-width: 767px) {
  .category-page .category-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .category-page .category-card {
    border-radius: 15px;
  }

  .category-page .category-card-body {
    padding: 12px 12px 14px;
  }

  .category-page .category-card-title {
    font-size: 16px;
    min-height: 40px;
  }
}

@media only screen and (max-width: 575px) {
  .category-page .category-card-grid {
    grid-template-columns: 1fr;
  }
}

/* Match the editorial category treatment used by the sub-category page. */
.category-page {
  margin-top: 0 !important;
  padding-bottom: 60px;
  overflow: visible;
  background: #fff;
}

.category-page::before {
  display: none;
}

.category-page .category-hero {
  position: relative;
  display: block;
  width: 100%;
  min-height: clamp(360px, 31vw, 520px);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background-position: center;
  background-size: cover;
  box-shadow: none;
  overflow: hidden;
}

.category-page .category-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, .68), rgba(0, 0, 0, .26) 48%, rgba(0, 0, 0, .06));
}

.category-page .category-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  min-height: clamp(360px, 31vw, 520px);
}

.category-page .category-hero-content {
  width: min(620px, 55%);
  color: #fff;
}

.category-page .category-kicker {
  margin-bottom: 15px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, .86);
  font-size: 11px;
  letter-spacing: .22em;
}

.category-page .category-hero h1 {
  margin: 0 0 18px;
  color: #fff;
  font-size: clamp(42px, 5vw, 76px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.04em;
}

.category-page .category-hero p {
  max-width: 580px;
  color: rgba(255, 255, 255, .9);
  font-size: 15px;
  line-height: 1.7;
}

.category-page .category-reference-breadcrumb {
  border-bottom: 1px solid #e8e5df;
}

.category-page .category-reference-breadcrumb .container {
  max-width: 1460px;
}

.category-page .category-reference-breadcrumb nav {
  min-height: 48px;
  padding: 8px 0;
}

.category-page .category-reference-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #8a8782;
  font-size: 12px;
}

.category-page .category-reference-breadcrumb li + li::before {
  content: "/";
  margin-right: 8px;
  color: #c3beb7;
}

.category-page .category-reference-breadcrumb a {
  color: #252525;
  text-decoration: none;
}

.category-page .category-content {
  max-width: 1460px;
  padding-top: 42px;
}

.category-page .category-card-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 28px 12px;
}

.category-page .category-card {
  display: block;
  padding: 0 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.category-page .category-card:hover {
  transform: none;
  border-color: transparent;
  box-shadow: none;
}

.category-page .category-card-image {
  aspect-ratio: 1;
  border-radius: 10px;
  background: #f2f1ee;
}

.category-page .category-card-image img {
  transition: transform .35s ease;
}

.category-page .category-card:hover .category-card-image img {
  transform: scale(1.035);
}

.category-page .category-card-body {
  gap: 3px;
  padding: 12px 2px 0;
}

.category-page .category-card-title {
  min-height: 0;
  color: #252525;
  font-size: 14px;
  font-weight: 600;
}

.category-page .category-card-meta {
  color: #8a8782;
  font-size: 11px;
}

.category-page .category-card-arrow {
  display: none;
}

@media (max-width: 1199px) {
  .category-page .category-card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .category-page .category-hero,
  .category-page .category-hero-inner { min-height: 440px; }
  .category-page .category-hero-content { width: 90%; }
  .category-page .category-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 8px; }
  .category-page .category-content { padding-top: 30px; }
}

/* The all-categories page uses the same image tile treatment as the homepage. */
.category-index-page {
  margin: 0 !important;
  padding: 72px 0 76px;
  overflow: hidden;
  background: #f5f3ef;
}
.category-index-page::before { display: none; }
.category-index-page .category-index-content {
  position: relative;
  z-index: 1;
  max-width: 1460px;
}
.category-index-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 30px;
}
.category-index-eyebrow {
  display: block;
  margin-bottom: 10px;
  color: #77736c;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.category-index-heading h1 {
  margin: 0;
  color: #171717;
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 400;
  line-height: 1.1;
}
.category-index-home-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid #171717;
  color: #171717;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.category-index-home-link i { transition: transform .3s ease; }
.category-index-home-link:hover { color: #77736c; }
.category-index-home-link:hover i { transform: translateX(4px); }
.category-index-grid {
  display: grid;
  grid-template-columns: repeat(var(--category-columns, 4), minmax(0, 1fr));
  gap: 18px;
}
.category-index-tile {
  position: relative;
  display: flex;
  aspect-ratio: 1;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  padding: 22px;
  border-radius: 24px;
  color: #fff;
  background: #222;
  text-decoration: none;
  transition: transform .4s cubic-bezier(.22, 1, .36, 1);
}
.category-index-tile::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  background: rgba(0, 0, 0, .68);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.category-index-image,
.category-index-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.category-index-image img {
  object-fit: cover;
  transition: transform .7s cubic-bezier(.2, .65, .3, 1);
}
.category-index-caption,
.category-index-hover-caption {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-sizing: border-box;
  max-width: calc(100% - 24px);
  min-height: 50px;
  padding: 13px 16px 10px;
  border-radius: 22px 0 0 0;
  color: #303030;
  background: #fff;
  transition: opacity .25s ease;
}
.category-index-caption::before,
.category-index-caption::after,
.category-index-hover-caption::before,
.category-index-hover-caption::after {
  position: absolute;
  width: 22px;
  height: 22px;
  content: "";
  border-radius: 0 0 22px 0;
  box-shadow: 7px 7px 0 7px #fff;
  pointer-events: none;
}
.category-index-caption::before,
.category-index-hover-caption::before { left: -22px; bottom: 0; }
.category-index-caption::after,
.category-index-hover-caption::after { right: 0; top: -22px; }
.category-index-name {
  max-width: 190px;
  color: #303030;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.category-index-hover-name {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: #fff;
  font-size: clamp(18px, 1.6vw, 24px);
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: anywhere;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.category-index-hover-caption {
  width: auto;
  min-width: 60px;
  min-height: 60px;
  padding: 10px 12px 10px 16px;
  color: #303030;
  font-size: 11px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
}
.category-index-arrow {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  background: #000;
}
.category-index-arrow svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.category-index-tile:focus-visible { outline: 2px solid #171717; outline-offset: 4px; }
.category-index-tile:focus-visible::after,
.category-index-tile:focus-visible .category-index-hover-name,
.category-index-tile:focus-visible .category-index-hover-caption { opacity: 1; }
.category-index-tile:focus-visible > .category-index-caption { opacity: 0; }
@media (hover: hover) and (pointer: fine) {
  .category-index-tile:hover { transform: translateY(-4px); }
  .category-index-tile:hover::after,
  .category-index-tile:hover .category-index-hover-name,
  .category-index-tile:hover .category-index-hover-caption { opacity: 1; }
  .category-index-tile:hover .category-index-image img { transform: scale(1.055); }
  .category-index-tile:hover > .category-index-caption { opacity: 0; }
}
@media (max-width: 991px) {
  .category-index-page { padding: 54px 0 58px; }
  .category-index-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
}
@media (max-width: 767px) {
  .category-index-page { padding: 42px 0 44px; }
  .category-index-heading { align-items: flex-start; margin-bottom: 22px; }
  .category-index-home-link { display: none; }
  .category-index-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .category-index-tile { padding: 14px; border-radius: 18px; }
  .category-index-caption { min-height: 44px; max-width: calc(100% - 12px); padding: 10px 11px 8px; border-radius: 16px 0 0 0; }
  .category-index-name { font-size: 14px; }
  .category-index-hover-caption { display: none; }
}
@media (max-width: 359px) {
  .category-index-grid { grid-template-columns: 1fr; }
  .category-index-tile { border-radius: 20px; }
  .category-index-name { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .category-index-tile,
  .category-index-tile img,
  .category-index-home-link i { transition: none; }
}
