/* News Listing Shortcode — base styles (WP 4.9.8-compatible) */
.nlp-wrapper {
  position: relative;
}
.nlp-grid {
  display: grid;
  grid-gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.nlp-item {
  display: flex;
  flex-direction: column;
}
div.nlp-wrapper article.nlp-item h3.nlp-title {
  font-size: 1.1rem;
  line-height: 1.3;
  margin: 10px 0;
}
div.nlp-wrapper article.nlp-item h3.nlp-title a {
  color: #333;
}
.nlp-excerpt {
  font-size: 0.95rem;
  color: #333;
}
.nlp-empty {
  opacity: 0.8;
}

/* Thumbnail with 3:2 fallback (padding-top) */
.nlp-thumb {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 3/2;
}
.nlp-thumb::before {
  content: "";
  display: block;
  padding-top: 66.666%;
  background: #f2f2f2;
}
.nlp-thumb .nlp-thumb__img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.nlp-thumb__placeholder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #e9e9e9;
}

/* Tags badges overlay */
.nlp-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  z-index: 2;
}
.nlp-badge {
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 4px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Category icons row */
.nlp-icons {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
}
.nlp-icon {
  width: 32px;
  height: 32px;
  display: inline-block;
  border: 0.5px solid #fff;
  box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.2);
}
/* Overlay icons inside thumbnail, bottom-right */
.nlp-thumb {
  position: relative;
}
.nlp-thumb .nlp-icons {
  position: absolute;
  right: 4px;
  bottom: 4px;
  z-index: 2;
}

/* Pagination */
.nlp-pagination {
  margin-top: 16px;
  text-align: center;
}
.nlp-pagination .page-numbers {
  padding: 6px 10px;
  border: 0;
  margin-right: 6px;
  text-decoration: none;
}
.nlp-pagination .current {
  background: #222;
  color: #fff;
  border-color: #222;
}
/* T-112: horizontal list and simplified prev/next */
.nlp-pagination ul {
  display: inline-flex;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.nlp-pagination li {
  display: inline;
}
.nlp-pagination .prev,
.nlp-pagination .next {
  border: 0;
  background: transparent;
  padding: 6px 10px;
}
.nlp-pagination a:focus,
.nlp-pagination span:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Carousel base (scroll-snap) */
.nlp-wrapper[data-layout="carousel"] {
  /*
  display: flex;
  align-items: center;
  gap: 8px; 
  */
}
.nlp-nav.nlp-nav--prev {
  position: absolute;
  top: 22%;
  left: -50px;
}
.nlp-nav.nlp-nav--next {
  position: absolute;
  top: 22%;
  right: -50px;
}
.nlp-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 32px;
  outline: 0;
}
/* Ensure exactly N visible cards fit without cropping when --nlp-visible is provided */
.nlp-carousel .nlp-item {
  min-width: 280px;
  scroll-snap-align: start;
}
@supports (width: calc(100%)) {
  .nlp-wrapper[data-layout="carousel"]
    .nlp-carousel[style*="--nlp-visible"]
    .nlp-item {
    /* Each card width = (container - total gaps) / N */
    width: calc((100% - (var(--nlp-visible) - 1) * 32px) / var(--nlp-visible));
    min-width: 0;
    flex: 0 0 auto;
  }
}
.nlp-nav {
  background: transparent;
  color: #333;
  border: 0;
  border-radius: 4px;
  width: 48px;
  height: 48px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  line-height: 1;
}
.nlp-nav:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}
span.nlp-badge {
  font-size: 1em;
  line-height: 1;
  padding: 6px 12px;
  border-radius: 12px;
  background: #9a1220;
}
