/* Post Category Setting layout layer.
   Product CSS remains the shared foundation; this file normalizes the Post archive
   shell, fixes category-only spacing and keeps Grid/List/Masonry responsive. */

body.blog .nexus-header-shell,
body.category .nexus-header-shell {
  z-index: 1200 !important;
}

.nx-post-category-archive {
  position: relative;
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  overflow: clip;
}

.nx-post-category-archive.has-hero {
  padding-top: 0;
}

.nx-post-category-archive.no-hero {
  padding-top: clamp(128px, 11vw, 184px);
}

.nx-post-category-archive .nx-product-archive__container,
.nx-post-category-archive .nx-product-results,
.nx-post-category-archive .nx-product-grid,
.nx-post-category-archive .nx-product-card,
.nx-post-category-archive .nx-product-card__body {
  min-width: 0;
}

/* The setting controls the content width of both Hero and filter. The visual
   background may remain full bleed, matching the catalogue architecture. */
.nx-post-category-archive .nx-product-archive__header-content,
.nx-post-category-archive .nx-product-filter__inner {
  width: min(100%, var(--nxp-container, 1440px));
  margin-right: auto;
  margin-left: auto;
}

.nx-post-category-archive .nx-product-archive__header-overlay,
.nx-post-category-archive .nx-post-category__header-overlay {
  background: var(--nxpost-hero-overlay, #21180f);
  opacity: var(--nxpost-hero-overlay-opacity, .64);
}

.nx-post-category-archive .nx-product-archive__header.has-banner {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.nx-post-category-archive .nx-product-archive__header.is-term-header .nx-product-archive__title-2 {
  margin-top: 4px;
  color: inherit;
  font-family: var(--nxp-archive-title-2-font, var(--nxp-heading-font, inherit));
  font-size: var(--nxp-archive-title-2-size, 96px);
  font-style: var(--nxp-archive-title-2-style, normal);
  font-weight: var(--nxp-archive-title-2-weight, 500);
  line-height: 1.02;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
  text-transform: var(--nxp-archive-title-2-transform, none);
}

.nx-post-category-archive .nx-product-archive__header h1,
.nx-post-category-archive .nx-product-archive__title-2,
.nx-post-category-archive .nx-product-archive__description {
  overflow-wrap: anywhere;
}

.nx-post-category-archive.has-hero.no-filters .nx-product-archive__header + .nx-product-results {
  margin-top: clamp(48px, 6vw, 82px);
}

.nx-post-category-archive.no-hero.has-filters .nx-product-filter {
  margin-top: 0;
}

.nx-post-category-archive.no-hero.no-filters .nx-product-results {
  margin-top: 0;
}


/* Category navigation exists only on the posts index. Without a back link the
   filter uses a clean two-column row: category tabs + real post count. */
.nx-post-category-archive.is-root-archive .nx-post-category-filter .nx-product-filter__inner {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "tabs count";
}

.nx-post-category-archive.is-root-archive .nx-post-category-filter .nx-product-filter__tabs {
  grid-area: tabs;
  justify-content: flex-start;
}

.nx-post-category-archive.is-root-archive .nx-post-category-filter .nx-product-filter__count {
  grid-area: count;
}

.nx-post-category-archive .nx-product-filter__inner > *,
.nx-post-category-archive .nx-product-filter__tabs {
  min-width: 0;
}

.nx-post-category-archive .nx-product-filter__back,
.nx-post-category-archive .nx-product-filter__count {
  max-width: 100%;
}

.nx-post-category-archive .nx-product-grid {
  width: 100%;
}

.nx-post-category-archive .nx-product-grid:not(.is-layout-masonry) {
  grid-auto-rows: 1fr;
}

.nx-post-category-archive .nx-product-grid.is-layout-list {
  grid-auto-rows: auto;
}

.nx-post-category-archive .nx-product-grid.is-layout-masonry {
  width: 100%;
}

.nx-post-category-archive .nx-product-grid.is-layout-masonry .nx-product-card {
  height: auto;
}

.nx-post-category-archive .nx-product-card:not(.is-list) {
  height: 100%;
}

.nx-post-category-archive .nx-product-card__body {
  width: 100%;
}

.nx-post-category-archive .nx-product-card__title {
  font-style: var(--nxpost-card-title-style, normal);
  overflow-wrap: anywhere;
}

.nx-post-category-archive .nx-product-card__description {
  font-family: var(--nxpost-card-description-font, inherit);
  font-style: var(--nxpost-card-description-style, normal);
  font-weight: var(--nxpost-card-description-weight, 400);
  overflow-wrap: anywhere;
  text-transform: var(--nxpost-card-description-transform, none);
}

.nx-post-category-archive .nx-product-card__category a {
  color: inherit;
  text-decoration: none;
}

.nx-post-category-archive .nx-post-card__meta {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 10px 0 0;
  color: var(--nxpost-meta-color, #7c746d);
  font-family: var(--nxpost-card-meta-font, inherit);
  font-size: var(--nxpost-card-meta-size, 13px);
  font-style: var(--nxpost-card-meta-style, normal);
  font-weight: var(--nxpost-card-meta-weight, 600);
  line-height: 1.45;
  overflow-wrap: anywhere;
  text-transform: var(--nxpost-card-meta-transform, none);
}

.nx-post-category-archive .nx-post-card__dot {
  opacity: .55;
}

.nx-post-category-archive .nx-post-card__footer {
  margin-top: auto;
}

.nx-post-category-archive .nx-post-card__button {
  width: max-content;
  max-width: 100%;
  border: var(--nxpost-button-border-width, 1px) solid var(--nxpost-button-border, transparent);
  border-radius: var(--nxpost-button-radius, 999px);
  padding: var(--nxpost-button-pad-y, 12px) var(--nxpost-button-pad-x, 20px);
  font-family: var(--nxpost-card-button-font, inherit);
  font-size: var(--nxpost-card-button-size, 15px);
  font-style: var(--nxpost-card-button-style, normal);
  overflow-wrap: anywhere;
  white-space: normal;
  transition:
    color var(--nxpost-button-transition, 220ms) ease,
    background var(--nxpost-button-transition, 220ms) ease,
    border-color var(--nxpost-button-transition, 220ms) ease,
    transform var(--nxpost-button-transition, 220ms) ease;
}

.nx-post-category-archive .nx-post-card__button.is-text {
  border-color: transparent;
  padding-right: 0;
  padding-left: 0;
  background: transparent;
  color: var(--nxp-price-color, inherit);
}

.nx-post-category-archive .nx-post-card__button.is-solid {
  border-color: var(--nxpost-button-border, transparent);
  background: var(--nxp-button-bg, transparent);
  color: var(--nxp-button-color, inherit);
}

.nx-post-category-archive .nx-post-card__button.is-outline {
  border-color: var(--nxpost-button-border, transparent);
  background: transparent;
  color: var(--nxp-button-color, inherit);
}

.nx-post-category-archive .nx-post-card__button:hover {
  border-color: var(--nxpost-button-hover-border, transparent);
  background: var(--nxpost-button-hover-bg, transparent);
  color: var(--nxpost-button-hover-color, inherit);
  transform: translateY(var(--nxpost-button-translate-y, -2px)) scale(var(--nxpost-button-scale, 1));
}

/* Circle frames are always rendered outside the image. This prevents the
   overlay body from being absolutely positioned over a circular media box. */
.nx-post-category-archive .nx-product-card.is-image-circle .nx-product-card__media {
  width: calc(100% - 48px);
  margin-right: 24px;
  margin-left: 24px;
  aspect-ratio: 1 / 1;
}

.nx-post-category-archive .nx-product-card.is-list {
  width: 100%;
  min-height: 0;
}

.nx-post-category-archive .nx-product-card.is-list .nx-product-card__media {
  min-height: clamp(300px, 34vw, 430px);
}

.nx-post-category-archive .nx-product-card.is-content-inside:not(.is-list) .nx-post-card__meta,
.nx-post-category-archive .nx-product-card.is-content-inside:not(.is-list) .nx-product-card__category,
.nx-post-category-archive .nx-product-card.is-content-inside:not(.is-list) .nx-product-card__description {
  color: rgba(255,255,255,.84);
}

.nx-post-category-archive .nx-product-card.is-content-inside:not(.is-list) .nx-product-card__title,
.nx-post-category-archive .nx-product-card.is-content-inside:not(.is-list) .nx-product-card__description {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.nx-post-category-archive .nx-product-card.is-content-inside:not(.is-list) .nx-product-card__title {
  -webkit-line-clamp: 3;
}

.nx-post-category-archive .nx-product-card.is-content-inside:not(.is-list) .nx-product-card__description {
  -webkit-line-clamp: 3;
}

.nx-post-category-archive .nx-product-pagination,
.nx-post-category-archive .nx-product-pagination ul {
  flex-wrap: wrap;
}

@media (max-width: 1024px) {
  .nx-post-category-archive .nx-product-archive__header-content,
  .nx-post-category-archive .nx-product-filter__inner {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .nx-post-category-archive .nx-product-card.is-list,
  .nx-post-category-archive .nx-product-card.is-list.is-media-right {
    display: flex;
    min-height: 0;
    flex-direction: column;
  }

  .nx-post-category-archive .nx-product-card.is-list.is-media-right .nx-product-card__media {
    order: 0;
  }

  .nx-post-category-archive .nx-product-card.is-list .nx-product-card__media {
    height: auto;
    min-height: 0;
    aspect-ratio: var(--nxp-image-ratio, 16/10);
  }

  .nx-post-category-archive .nx-product-card.is-list .nx-product-card__body {
    padding: clamp(24px, 5vw, 40px);
  }
}

@media (max-width: 767px) {

  .nx-post-category-archive.is-root-archive .nx-post-category-filter .nx-product-filter__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "count count"
      "tabs tabs";
  }

  .nx-post-category-archive.is-root-archive .nx-post-category-filter .nx-product-filter__count {
    justify-self: end;
  }

  .nx-post-category-archive.no-hero {
    padding-top: clamp(104px, 24vw, 138px);
  }

  .nx-post-category-archive .nx-product-archive__header.is-term-header .nx-product-archive__title-2 {
    font-size: min(var(--nxp-archive-title-2-size, 96px), 18vw);
  }

  .nx-post-category-archive .nx-product-filter__back,
  .nx-post-category-archive .nx-product-filter__count {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nx-post-category-archive .nx-product-card__body {
    padding: 22px;
  }

  .nx-post-category-archive .nx-product-card__title {
    font-size: min(var(--nxp-title-size, 28px), 7vw);
  }

  .nx-post-category-archive .nx-post-card__meta {
    gap: 5px;
  }

  .nx-post-category-archive .nx-post-card__button {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .nx-post-category-archive .nx-product-grid {
    gap: min(var(--nxp-gap, 28px), 18px);
  }

  .nx-post-category-archive .nx-product-card__body {
    padding: 18px;
  }

  .nx-post-category-archive .nx-product-card.is-content-inside:not(.is-list) .nx-product-card__body {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nx-post-category-archive .nx-product-card,
  .nx-post-category-archive .nx-product-card__media img,
  .nx-post-category-archive .nx-post-card__button {
    transition-duration: .01ms !important;
  }
}
