/**
 * Nova CMS Dynamic Content Engine — frontend styles
 */
.ncms-dynamic {
  --ncms-dynamic-gap: 1rem;
  --ncms-dynamic-muted: color-mix(in srgb, currentColor 55%, transparent);
  width: 100%;
}

.ncms-dynamic[data-dynamic-loading="1"] {
  position: relative;
  min-height: 3rem;
  opacity: 0.65;
  pointer-events: none;
}

.ncms-dynamic[data-dynamic-loading="1"]::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: ncms-dynamic-spin 0.7s linear infinite;
}

@keyframes ncms-dynamic-spin {
  to {
    transform: rotate(360deg);
  }
}

.ncms-dynamic.is-empty .ncms-dynamic-empty {
  margin: 0;
  padding: 0.75rem 0;
  color: var(--ncms-dynamic-muted);
  font-style: italic;
}

.ncms-dynamic-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ncms-dynamic-page-grid .ncms-dynamic-list,
.ncms-dynamic-featured-pages .ncms-dynamic-list,
.ncms-dynamic-search-results .ncms-dynamic-list:has(.ncms-dynamic-card) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: var(--ncms-dynamic-gap);
}

.ncms-dynamic-item,
.ncms-dynamic-card {
  margin: 0;
}

.ncms-dynamic-card a,
.ncms-dynamic-item a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.ncms-dynamic-card a {
  height: 100%;
  padding: 0.85rem 0;
  border-bottom: 1px solid color-mix(in srgb, currentColor 12%, transparent);
}

.ncms-dynamic-card strong,
.ncms-dynamic-item a {
  font-weight: 600;
}

.ncms-dynamic-excerpt {
  display: block;
  margin-top: 0.35rem;
  color: var(--ncms-dynamic-muted);
  font-size: 0.925em;
  font-weight: 400;
  line-height: 1.45;
}

.ncms-dynamic-breadcrumb .ncms-dynamic-list {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.ncms-dynamic-crumb:not(:last-child)::after {
  content: "/";
  margin-left: 0.5rem;
  color: var(--ncms-dynamic-muted);
}

.ncms-dynamic-crumb.is-current span {
  font-weight: 600;
}

.ncms-dynamic-pagination {
  margin-top: 1.25rem;
}

.ncms-dynamic-pagination ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ncms-dynamic-pagination a,
.ncms-dynamic-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.35rem 0.55rem;
  text-decoration: none;
  color: inherit;
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
}

.ncms-dynamic-pagination .is-active span,
.ncms-dynamic-pagination .is-active a {
  font-weight: 700;
  border-color: currentColor;
}

@media (max-width: 640px) {
  .ncms-dynamic-page-grid .ncms-dynamic-list,
  .ncms-dynamic-featured-pages .ncms-dynamic-list {
    grid-template-columns: 1fr;
  }
}
