/* 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 > .nx-product-archive__region--content {
  background: var(--nxpost-content-background, var(--nxp-page-bg, #f8f6ef));
}

.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;overflow-wrap:anywhere;}

.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{overflow-wrap:anywhere;}

.nx-post-category-archive .nx-product-card__description{overflow-wrap:anywhere;}

.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;overflow-wrap:anywhere;}

.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%;overflow-wrap:anywhere;white-space:normal;}





/* 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;
  }
}


/* MARV46 2.5.739 — Post category module slots.
   Danh mục Bài viết dùng cùng ba slot độc lập với Hạng mục. Gutter chỉ thuộc
   vùng Hero/nội dung; module đặt ngoài nội dung không bị nhốt trong container. */
.nx-product-archive.nx-post-category-archive {
  padding-right: 0;
  padding-left: 0;
}

.nx-post-category-archive > .nx-product-archive__region {
  width: 100%;
  padding-right: 24px;
  padding-left: 24px;
}

.nx-post-category-module-shortcodes {
  width: 100%;
  max-width: none;
  margin: 0;
}

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

@media (max-width: 767px) {
  .nx-post-category-archive > .nx-product-archive__region {
    padding-right: 16px;
    padding-left: 16px;
  }
}

/* Editorial posts index: category tabs, one featured story and a compact text list.
   This preset belongs only to the root posts archive; category archives retain
   their existing Grid/List/Masonry contract. */
.nx-post-category-archive.is-root-archive.is-layout-editorial_index .nx-product-archive__region--content {
  padding-top: var(--nxpost-gap-hero-tabs);
  padding-bottom: var(--nxpost-section-padding);
}

/* The listing width setting belongs only to the editorial content region.
   The root Hero remains full-bleed and must not inherit Max width section. */
.nx-post-category-archive.is-root-archive.is-layout-editorial_index
  > .nx-product-archive__region--content
  > .nx-product-archive__container {
  width: min(100%, var(--nxpost-section-width));
}

.nx-post-category-archive.is-root-archive.is-layout-editorial_index
  > .nx-product-archive__region--hero {
  padding-right: 0;
  padding-left: 0;
}

.nx-post-category-archive.is-root-archive.is-layout-editorial_index
  > .nx-product-archive__region--hero
  > .nx-product-archive__container {
  width: 100%;
  max-width: none;
  margin: 0;
}

.nx-post-category-archive.is-root-archive.is-layout-editorial_index
  .nx-product-archive__header.is-archive-root {
  width: 100%;
  margin-right: 0;
  margin-left: 0;
}

.nxpost-editorial-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  width: 100%;
  margin: 0 0 var(--nxpost-gap-tabs-featured);
  border-bottom:1px solid color-mix(in srgb,var(--nxds-meta-color) 22%,transparent);
}

.nxpost-editorial-tabs a {
  display: flex;
  min-height: calc(var(--nxpost-section-padding) * .8);
  align-items: center;
  justify-content: center;
  padding: calc(var(--nxpost-section-padding) * .18) calc(var(--nxpost-section-padding) * .28);
  color:var(--nxds-meta-color);font-family:var(--nxds-meta-font);font-size:var(--nxds-meta-size-d);font-weight:var(--nxds-meta-weight);line-height:var(--nxds-meta-line-height);letter-spacing:var(--nxds-meta-letter-spacing);text-decoration:none;text-transform:var(--nxds-meta-transform);transition:opacity var(--nxds-state-transition-ms) ease,border-color var(--nxds-state-transition-ms) ease;
}

.nxpost-editorial-tabs a::after {
  content: "";
  position: absolute;
  right: 18%;
  bottom: -1px;
  left: 18%;
  height:1px;
  background: transparent;
}

.nxpost-editorial-tabs a { position: relative; }
.nxpost-editorial-tabs a:hover,
.nxpost-editorial-tabs a.is-active{color:var(--nxds-meta-hover-color);}
.nxpost-editorial-tabs a:hover::after,
.nxpost-editorial-tabs a.is-active::after { background: currentColor; }

.nxpost-editorial-block + .nxpost-editorial-block { margin-top: var(--nxpost-gap-featured-list); }

.nxpost-editorial-block__title{margin:0 0 var(--nxpost-card-gap);}

.nxpost-editorial-featured {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--nxpost-featured-gap);
  min-height: var(--nxpost-featured-height);
  overflow: hidden;
  border-radius: var(--nxpost-card-radius);
}

.nxpost-editorial-featured__media {
  position: relative;
  display: block;
  min-height: 100%;
  overflow: hidden;
}

.nxpost-editorial-featured__media img,
.nxpost-editorial-featured__media .nx-product-card__placeholder {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
}

.nxpost-editorial-featured__body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: var(--nxpost-section-padding);
}

.nxpost-editorial-featured__category,.nxpost-editorial-card__category{margin-bottom:calc(var(--nxpost-card-gap)*.42);text-decoration:none;}

.nxpost-editorial-featured h2,.nxpost-editorial-card h2{display:-webkit-box;overflow:hidden;margin:0;-webkit-box-orient:vertical;-webkit-line-clamp:var(--nxpost-root-title-lines);}

.nxpost-editorial-featured h2 a,
.nxpost-editorial-card h2 a { color: inherit; text-decoration: none; }

.nxpost-editorial-featured p,.nxpost-editorial-card p{display:-webkit-box;overflow:hidden;margin:calc(var(--nxpost-card-gap)*.5) 0 0;-webkit-box-orient:vertical;-webkit-line-clamp:var(--nxpost-root-description-lines);}

.nxpost-editorial-featured__button,.nxpost-editorial-card__button{width:max-content;max-width:100%;margin-top:auto;text-decoration:none;}

.nxpost-editorial-featured__button { margin-top: var(--nxpost-card-gap); }

.nxpost-editorial-grid {
  display: grid;
  grid-template-columns: repeat(var(--nxpost-root-cols-desktop), minmax(0, 1fr));
  gap: var(--nxpost-card-gap);
}

.nxpost-editorial-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--nxpost-card-radius);
}

.nxpost-editorial-card__media {
  display: block;
  aspect-ratio: var(--nxpost-card-image-ratio);
  overflow: hidden;
}

.nxpost-editorial-card.is-frame-circle .nxpost-editorial-card__media { border-radius: 50%; }
.nxpost-editorial-card__media img,
.nxpost-editorial-card__media .nx-product-card__placeholder { width: 100%; height: 100%; object-fit: cover; }

.nxpost-editorial-card__body {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 0;
  padding: var(--nxpost-card-gap);
}

.nxpost-editorial-card__button { margin-top: var(--nxpost-card-gap); }

.nxpost-editorial-card.is-placement-inside .nxpost-editorial-card__body {
  position: absolute;
  inset: 0;
  justify-content: flex-end;
  background: linear-gradient(to top, var(--nxp-overlay-color), transparent);
}

.nxpost-editorial-card.is-placement-inside :is(h2,p,.nxpost-editorial-card__category) { color: var(--nxp-button-color); }
.nxpost-editorial-featured.is-ratio-55_45 { grid-template-columns: minmax(0, 55fr) minmax(0, 45fr); }
.nxpost-editorial-featured.is-ratio-60_40 { grid-template-columns: minmax(0, 60fr) minmax(0, 40fr); }
.nxpost-editorial-featured.is-media-right .nxpost-editorial-featured__media { order: 2; }
.nxpost-editorial-featured.is-media-right .nxpost-editorial-featured__body { order: 1; }
.nxpost-editorial-tabs.is-align-left { grid-template-columns: repeat(auto-fit, minmax(150px, max-content)); justify-content: start; }
.nxpost-editorial-tabs.is-align-center { grid-template-columns: repeat(auto-fit, minmax(150px, max-content)); justify-content: center; }

@media (max-width: 1100px) {
  .nxpost-editorial-grid { grid-template-columns: repeat(var(--nxpost-root-cols-tablet), minmax(0, 1fr)); }
}

@media (max-width: 780px) {
  .nxpost-editorial-tabs { grid-template-columns: 1fr 1fr; }
  .nxpost-editorial-tabs.is-mobile-scroll { display:flex; overflow-x:auto; scroll-snap-type:x proximity; }
  .nxpost-editorial-tabs.is-mobile-scroll a { min-width:max-content; flex:0 0 auto; scroll-snap-align:start; }
  .nxpost-editorial-featured { grid-template-columns: 1fr; }
  .nxpost-editorial-featured.is-mobile-content-first .nxpost-editorial-featured__body { order:1; }
  .nxpost-editorial-featured.is-mobile-content-first .nxpost-editorial-featured__media { order:2; }
  .nx-post-category-archive.is-featured-hidden-mobile .nxpost-editorial-block--featured { display:none; }
  .nxpost-editorial-grid { grid-template-columns: repeat(var(--nxpost-root-cols-mobile), minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .nxpost-editorial-tabs:not(.is-mobile-scroll) { grid-template-columns: 1fr; }
}



/* Post archive Hero height is content-driven. Category Setting controls only
   explicit top/bottom padding; the shared Product hero min-height contract is
   intentionally disabled in this scoped archive. */
.nx-post-category-archive .nx-product-archive__header,
.nx-post-category-archive.is-root-archive .nx-product-archive__header.is-archive-root,
.nx-post-category-archive.is-term-archive .nx-product-archive__header.is-term-header,
.nx-post-category-archive .nx-product-archive__header.has-banner {
  height: auto !important;
  min-height: 0 !important;
  align-items: stretch !important;
}
.nx-post-category-archive .nx-product-archive__header-content,
.nx-post-category-archive.is-root-archive .nx-product-archive__header.is-archive-root .nx-product-archive__header-content,
.nx-post-category-archive.is-term-archive .nx-product-archive__header.is-term-header .nx-product-archive__header-content {
  min-height: 0 !important;
  max-height: none !important;
  padding-top: var(--nxpost-hero-padding-top, 96px) !important;
  padding-bottom: var(--nxpost-hero-padding-bottom, 96px) !important;
  overflow: visible !important;
}

/* v2.6.004 — Post archive/category Hero background is canonical and must not be
   hidden by the inherited Product archive gradient. Inline banner-image styles
   still win when a Hero image is configured. */
.nx-post-category-archive .nx-product-archive__header.is-archive-root,
.nx-post-category-archive .nx-product-archive__header.is-term-header {
  background-color: var(--nxpost-hero-background, transparent) !important;
  background-image: none;
}
