/**
 * Sikshya LMS — Course listing (grid, cards, pagination, archives).
 * Shared by: /courses/, taxonomy archives, shortcodes, blocks.
 */

/* Archive wrapper */
.sikshya-archive-courses {
  padding: var(--sikshya-spacing-12) 0 var(--sikshya-spacing-16);
  background: transparent;
}

.sikshya-archive-courses__header {
  display: grid;
  gap: var(--sikshya-spacing-2);
  margin-bottom: 0;
}

/* Match single course LP title in masthead */
.sikshya-course-lp__masthead .sikshya-archive-courses__title {
  margin: 0 0 var(--sikshya-spacing-3);
  font-size: clamp(1.375rem, 2.2vw, 2rem);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--sik-f-text-heading, var(--sikshya-gray-900));
  max-width: 48rem;
}

.sikshya-archive-courses__title {
  margin: 0;
  font-size: var(--sikshya-font-size-4xl);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--sikshya-gray-900);
}

.sikshya-archive-courses__desc {
  margin: 0;
  max-width: 70ch;
  color: var(--sikshya-gray-600);
}

.sikshya-archive-courses__tip {
  margin: var(--sikshya-spacing-2) 0 0;
  max-width: 70ch;
  font-size: var(--sikshya-font-size-sm);
  line-height: 1.55;
  color: var(--sikshya-gray-700);
  padding: var(--sikshya-spacing-3) var(--sikshya-spacing-4);
  border-radius: var(--sikshya-radius-lg, 0.75rem);
  border: 1px solid var(--sikshya-gray-200);
  background: var(--sikshya-white);
}

/* Archive: sidebar + main */
.sikshya-archive-courses__layout {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: var(--sikshya-spacing-8);
  align-items: start;
}

.sikshya-archive-courses__main {
  min-width: 0;
}

.sikshya-archive-courses__results {
  margin: 0 0 var(--sikshya-spacing-4);
  font-size: var(--sikshya-font-size-sm);
  color: var(--sikshya-gray-600);
}

.sikshya-course-lp__masthead .sikshya-archive-courses__results {
  margin-bottom: 0;
}

/* Breadcrumb — same as .sikshya-course-lp__breadcrumb on single course */
/* .sikshya-discovery-breadcrumb rules moved to frontend.css so that
 * order/cart/checkout pages (which don't load course-listing.css) can use
 * the shared breadcrumb partial. Selectors below kept here only as
 * specificity overrides for masthead usage. */
.sikshya-course-lp__masthead .sikshya-discovery-breadcrumb {
  font-size: var(--sikshya-font-size-sm);
  margin-bottom: var(--sikshya-spacing-4);
}

/* Category / tag taxonomy — same shell as catalog; no sidebar */
.sikshya-taxonomy-courses__header {
  display: grid;
  gap: var(--sikshya-spacing-2);
  margin-bottom: 0;
}

.sikshya-taxonomy-courses__description {
  max-width: 70ch;
}

/* Single category archive — featured image from term meta */
.sikshya-taxonomy-courses__cover {
  margin-bottom: var(--sikshya-spacing-6);
  overflow: hidden;
  border-radius: var(--sikshya-radius-lg);
  border: 1px solid var(--sikshya-gray-200);
  background: var(--sikshya-gray-100);
}

.sikshya-taxonomy-courses__cover-img {
  display: block;
  width: 100%;
  max-height: min(42vh, 420px);
  height: auto;
  object-fit: cover;
}

/* Course category index (/course-category/) */
.sikshya-course-category-index__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--sikshya-spacing-4);
  list-style: none;
  margin: 0;
  padding: 0;
}

.sikshya-course-category-index__item {
  margin: 0;
}

.sikshya-course-category-index__thumb {
  display: block;
  aspect-ratio: 16 / 9;
  margin: calc(-1 * var(--sikshya-spacing-5)) calc(-1 * var(--sikshya-spacing-5)) var(--sikshya-spacing-3);
  overflow: hidden;
  border-radius: var(--sikshya-radius-lg) var(--sikshya-radius-lg) 0 0;
  background: var(--sikshya-gray-100);
}

.sikshya-course-category-index__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sikshya-course-category-index__card {
  display: flex;
  flex-direction: column;
  gap: var(--sikshya-spacing-2);
  height: 100%;
  padding: var(--sikshya-spacing-5);
  border-radius: var(--sikshya-radius-lg);
  border: 1px solid var(--sikshya-gray-200);
  background: var(--sikshya-white);
  color: var(--sikshya-gray-900);
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}

.sikshya-course-category-index__card:hover {
  border-color: var(--sikshya-primary);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.sikshya-course-category-index__name {
  font-size: var(--sikshya-font-size-lg);
  font-weight: 700;
  color: var(--sikshya-primary);
}

.sikshya-course-category-index__desc {
  font-size: var(--sikshya-font-size-sm);
  line-height: 1.5;
  color: var(--sikshya-gray-600);
}

.sikshya-course-category-index__count {
  margin-top: auto;
  font-size: var(--sikshya-font-size-sm);
  font-weight: 600;
  color: var(--sikshya-gray-700);
}

.sikshya-archive-courses__empty {
  padding: var(--sikshya-spacing-12) var(--sikshya-spacing-4);
  text-align: center;
  background: var(--sikshya-white);
  border: 1px dashed var(--sikshya-gray-300);
  border-radius: var(--sikshya-radius-lg);
}

.sikshya-archive-courses__empty-text {
  margin: 0 0 var(--sikshya-spacing-4);
  color: var(--sikshya-gray-600);
}

/* Filter sidebar */
.sikshya-archive-filters {
  position: sticky;
  top: var(--sikshya-spacing-4);
  background: var(--sikshya-white);
  border: 1px solid var(--sikshya-gray-200);
  border-radius: var(--sikshya-radius-lg);
  padding: var(--sikshya-spacing-5);
  box-shadow: var(--sikshya-shadow);
}

.sikshya-archive-filters__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sikshya-spacing-3);
  margin-bottom: var(--sikshya-spacing-5);
}

.sikshya-archive-filters__title {
  margin: 0;
  font-size: var(--sikshya-font-size-lg);
  font-weight: 700;
  color: var(--sikshya-gray-900);
}

.sikshya-archive-filters__clear {
  font-size: var(--sikshya-font-size-xs);
  font-weight: 600;
  color: var(--sikshya-primary);
  text-decoration: none;
  white-space: nowrap;
}

.sikshya-archive-filters__clear:hover {
  text-decoration: underline;
}

.sikshya-archive-filters__group {
  margin-bottom: var(--sikshya-spacing-5);
}

.sikshya-archive-filters__label {
  display: block;
  font-size: var(--sikshya-font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sikshya-gray-600);
  margin-bottom: var(--sikshya-spacing-2);
}

.sikshya-archive-filters__select {
  width: 100%;
  padding: var(--sikshya-spacing-2) var(--sikshya-spacing-3);
  border: 1px solid var(--sikshya-gray-300);
  border-radius: var(--sikshya-radius);
  background: var(--sikshya-white);
  font-size: var(--sikshya-font-size-sm);
  color: var(--sikshya-gray-800);
}

.sikshya-archive-filters__radios {
  display: flex;
  flex-direction: column;
  gap: var(--sikshya-spacing-2);
}

.sikshya-archive-filters__radio {
  display: flex;
  align-items: center;
  gap: var(--sikshya-spacing-2);
  font-size: var(--sikshya-font-size-sm);
  color: var(--sikshya-gray-700);
  cursor: pointer;
}

.sikshya-archive-filters__radio input {
  accent-color: var(--sikshya-primary);
}

/* Toolbar */
.sikshya-archive-toolbar {
  display: flex;
  flex-direction: column;
  gap: var(--sikshya-spacing-4);
  margin-bottom: var(--sikshya-spacing-4);
}

.sikshya-archive-toolbar__search {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sikshya-spacing-2);
  align-items: stretch;
}

.sikshya-archive-toolbar__search-input {
  flex: 1 1 200px;
  min-width: 0;
  padding: var(--sikshya-spacing-3) var(--sikshya-spacing-4);
  border: 1px solid var(--sikshya-gray-300);
  border-radius: var(--sikshya-radius);
  font-size: var(--sikshya-font-size-sm);
}

.sikshya-archive-toolbar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sikshya-spacing-4);
}

.sikshya-archive-toolbar__sort {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sikshya-spacing-3);
}

.sikshya-archive-toolbar__sort-label {
  font-size: var(--sikshya-font-size-sm);
  font-weight: 600;
  color: var(--sikshya-gray-700);
}

.sikshya-archive-toolbar__select {
  min-width: 200px;
  padding: var(--sikshya-spacing-2) var(--sikshya-spacing-3);
  border: 1px solid var(--sikshya-gray-300);
  border-radius: var(--sikshya-radius);
  background: var(--sikshya-white);
  font-size: var(--sikshya-font-size-sm);
}

.sikshya-archive-toolbar__view {
  display: inline-flex;
  border: 1px solid var(--sikshya-gray-300);
  border-radius: var(--sikshya-radius);
  overflow: hidden;
  background: var(--sikshya-white);
}

.sikshya-archive-toolbar__view-btn {
  padding: var(--sikshya-spacing-2) var(--sikshya-spacing-3);
  font-size: var(--sikshya-font-size-sm);
  font-weight: 600;
  color: var(--sikshya-gray-700);
  text-decoration: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sikshya-spacing-2);
  appearance: none;
  -webkit-appearance: none;
  line-height: 1;
}

.sikshya-archive-toolbar__view-icon {
  display: block;
}

.sikshya-archive-toolbar__view-btn:hover {
  background: var(--sikshya-gray-50);
}

.sikshya-archive-toolbar__view-btn.is-active {
  background: rgba(37, 99, 235, 0.1);
  color: var(--sikshya-primary);
}

/* Grid */
.sikshya-course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--sikshya-spacing-6);
  margin-bottom: var(--sikshya-spacing-8);
}

/* Taxonomy & fixed 3-column layout (matches catalog cards; responsive) */
.sikshya-course-grid--cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1024px) {
  .sikshya-course-grid--cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .sikshya-course-grid--cols-3 {
    grid-template-columns: 1fr;
  }
}

.sikshya-course-grid--featured,
.sikshya-course-grid--popular {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* List layout (single column, horizontal cards — reference: image | primary | meta column) */
.sikshya-course-grid--list {
  grid-template-columns: 1fr;
  gap: var(--sikshya-spacing-4);
}

.sikshya-course-grid--list .sikshya-course-card {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(260px, 1fr) minmax(220px, 280px);
  grid-template-areas: "image primary aside";
  align-items: stretch;
  column-gap: var(--sikshya-spacing-5);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.08);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.sikshya-course-grid--list .sikshya-course-card-body {
  display: contents;
}

.sikshya-course-grid--list .sikshya-course-card-image {
  grid-area: image;
  align-self: stretch;
  position: relative;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  margin: 0;
  border-radius: var(--sikshya-radius-lg) 0 0 var(--sikshya-radius-lg);
  border: none;
  border-right: 1px solid var(--sikshya-gray-100);
  box-shadow: none;
  background: var(--sikshya-gray-100);
}

.sikshya-course-grid--list .sikshya-course-card-primary {
  grid-area: primary;
  padding: var(--sikshya-spacing-5) var(--sikshya-spacing-3) var(--sikshya-spacing-5) 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.sikshya-course-grid--list .sikshya-course-card-aside {
  grid-area: aside;
  align-self: stretch;
  margin: 0;
  padding: var(--sikshya-spacing-5) var(--sikshya-spacing-5) var(--sikshya-spacing-5) var(--sikshya-spacing-4);
  border-left: 1px solid var(--sikshya-gray-100);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.95) 0%, rgba(241, 245, 249, 0.55) 100%);
  border-radius: 0 var(--sikshya-radius-lg) var(--sikshya-radius-lg) 0;
  display: flex;
  flex-direction: column;
  gap: var(--sikshya-spacing-3);
  min-width: 0;
  box-sizing: border-box;
  justify-content: center;
}

/* List: bottom price row is in the aside (reference layout); hide duplicate footer */
.sikshya-course-grid--list .sikshya-course-card-footer {
  display: none;
}

.sikshya-course-grid--list .sikshya-course-card:hover {
  transform: none;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.05);
  border-color: var(--sikshya-gray-300);
}

/* List: fill image cell — photo covers full thumbnail area */
.sikshya-course-grid--list .sikshya-course-card-image-link {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.sikshya-course-grid--list .sikshya-course-thumbnail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: none;
}

.sikshya-course-grid--list .sikshya-course-card:hover .sikshya-course-thumbnail {
  transform: scale(1.03);
}

.sikshya-course-grid--list .sikshya-course-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Card */
.sikshya-course-card {
  display: flex;
  flex-direction: column;
  background: var(--sikshya-white);
  border: 1px solid var(--sikshya-gray-200);
  border-radius: var(--sikshya-radius-lg);
  /* visible so curriculum stat CSS tooltips are not clipped (children handle their own overflow) */
  overflow: visible;
  box-shadow: var(--sikshya-shadow);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  position: relative;
}

.sikshya-course-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sikshya-shadow-lg);
  border-color: var(--sikshya-gray-300);
}

.sikshya-course-card-image {
  position: relative;
  aspect-ratio: 16 / 9;
  height: auto;
  overflow: hidden;
  background: var(--sikshya-gray-100);
}

/* Card uses overflow:visible for stat tooltips; clip top corners on the hero image */
.sikshya-course-card > .sikshya-course-card-image:first-child {
  border-radius: var(--sikshya-radius-lg) var(--sikshya-radius-lg) 0 0;
}

.sikshya-course-card-image-link {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.sikshya-course-card .sikshya-course-thumbnail,
.sikshya-course-thumbnail {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: var(--sikshya-transition);
}

.sikshya-course-card:hover .sikshya-course-thumbnail {
  transform: scale(1.05);
}

.sikshya-course-card:focus-within {
  border-color: var(--sikshya-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--sikshya-accent) 14%, transparent), var(--sikshya-shadow-lg);
}

.sikshya-course-card a:focus-visible {
  outline: 2px solid var(--sikshya-primary);
  outline-offset: 2px;
}

.sikshya-course-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sikshya-gray-100);
  color: var(--sikshya-gray-400);
}

.sikshya-course-badge {
  position: absolute;
  top: var(--sikshya-spacing-3);
  left: var(--sikshya-spacing-3);
  z-index: 2;
  padding: var(--sikshya-spacing-1) var(--sikshya-spacing-2);
  border-radius: var(--sikshya-radius);
  font-size: var(--sikshya-font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sikshya-course-badge--sale {
  background: var(--sikshya-error);
  color: var(--sikshya-white);
}

.sikshya-course-badge--featured {
  background: var(--sikshya-secondary);
  color: var(--sikshya-white);
}

.sikshya-course-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  padding: 0;
}

.sikshya-course-card-primary {
  padding: var(--sikshya-spacing-5);
  flex: 1;
  min-width: 0;
}

/* Grid view: hide aside price + duplicate CTA (footer row is used) */
.sikshya-course-grid:not(.sikshya-course-grid--list) .sikshya-course-aside-price,
.sikshya-course-grid:not(.sikshya-course-grid--list) .sikshya-course-aside-cta {
  display: none;
}

.sikshya-course-card-aside {
  margin: 0;
}

.sikshya-course-aside-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sikshya-aside-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sikshya-spacing-2);
  color: var(--sikshya-gray-700);
  font-size: var(--sikshya-font-size-sm);
}

.sikshya-aside-item__icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--sikshya-gray-500);
}

.sikshya-aside-item__text {
  line-height: 1.4;
}

/* Chips (compact meta labels) */
.sikshya-meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--sikshya-gray-300);
  background: var(--sikshya-white);
  color: var(--sikshya-gray-800);
  font-size: var(--sikshya-font-size-xs);
  font-weight: 600;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

.sikshya-meta-chip--muted {
  background: var(--sikshya-gray-50);
  color: var(--sikshya-gray-700);
}

/* Rating (course card) */
.sikshya-rating-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #f5a623;
  line-height: 1;
  font-size: 0.95rem;
}
.sikshya-rating-star { color: #d1d5db; display: inline-block; }
.sikshya-rating-star--full { color: #f5a623; }
.sikshya-rating-star--half {
  background: linear-gradient(90deg, #f5a623 50%, #d1d5db 50%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sikshya-course-card-author {
  margin: 8px 0 6px;
  font-size: 0.875rem;
  color: var(--sikshya-gray-600);
  display: flex;
  gap: 6px;
  align-items: baseline;
}
.sikshya-course-card-author__label {
  color: var(--sikshya-gray-500);
}
.sikshya-course-card-author__name {
  color: var(--sikshya-gray-800);
  font-weight: 600;
}

.sikshya-course-card-submeta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 2px;
}
.sikshya-course-card-rating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--sikshya-gray-800);
}
.sikshya-course-card-rating__count {
  font-size: 0.8125rem;
  color: var(--sikshya-gray-500);
  font-weight: 600;
}
.sikshya-course-card-level {
  margin-left: auto;
  display: inline-flex;
  justify-content: flex-end;
}

/* List view: rating + level live in the right aside */
.sikshya-course-aside-rating,
.sikshya-course-aside-level {
  display: none;
}
.sikshya-course-grid--list .sikshya-course-card-submeta {
  display: none;
}
.sikshya-course-grid--list .sikshya-course-aside-rating,
.sikshya-course-grid--list .sikshya-course-aside-level {
  display: flex;
}
.sikshya-course-grid--list .sikshya-course-card-rating--aside .sikshya-rating-stars {
  font-size: 0.95rem;
}

.sikshya-course-card-action--icon {
  padding-left: 10px;
  padding-right: 10px;
}
.sikshya-course-card-action--icon .sikshya-button__label {
  display: none;
}

/* Match the curriculum badge tooltip style for icon-only actions */
.sikshya-course-card-action--icon {
  position: relative;
}
.sikshya-course-card-action__tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  box-sizing: border-box;
  width: max-content;
  max-width: min(220px, calc(100vw - 1.5rem));
  padding: 5px 8px;
  border-radius: var(--sikshya-radius);
  background: var(--sikshya-gray-900);
  color: var(--sikshya-white);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
  text-align: center;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.14s ease, visibility 0.14s ease;
  z-index: 50;
}
.sikshya-course-card-action--icon:hover .sikshya-course-card-action__tooltip,
.sikshya-course-card-action--icon:focus-visible .sikshya-course-card-action__tooltip,
.sikshya-course-card-action--icon:focus-within .sikshya-course-card-action__tooltip {
  opacity: 1;
  visibility: visible;
}

.sikshya-course-aside-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sikshya-spacing-2);
}

.sikshya-course-aside-cta {
  margin-top: var(--sikshya-spacing-2);
}

/* Grid (non-list): meta reads as one compact row block above footer */
.sikshya-course-grid:not(.sikshya-course-grid--list) .sikshya-course-card-aside {
  padding: 0 var(--sikshya-spacing-5);
  border-top: 1px solid var(--sikshya-gray-200);
  margin-top: auto;
}

.sikshya-course-grid:not(.sikshya-course-grid--list) .sikshya-course-aside-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sikshya-spacing-3) var(--sikshya-spacing-5);
  padding: var(--sikshya-spacing-4) 0;
}

.sikshya-course-grid:not(.sikshya-course-grid--list) .sikshya-aside-item {
  align-items: center;
}

.sikshya-course-grid:not(.sikshya-course-grid--list) .sikshya-aside-item__icon {
  margin-top: 0;
}

/* List view: compact meta (no heavy row borders) */
.sikshya-course-grid--list .sikshya-course-aside-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sikshya-course-grid--list .sikshya-aside-item {
  padding: 5px 0;
  border-bottom: 0;
}

/* List aside: rating row uses ★ in .sikshya-rating-stars — no extra outline star icon */
.sikshya-course-grid--list .sikshya-aside-item--no-leading-icon .sikshya-aside-item__text {
  padding-left: calc(18px + var(--sikshya-spacing-2));
}

.sikshya-course-grid--list .sikshya-aside-item__icon {
  color: var(--sikshya-gray-400);
}

.sikshya-course-grid--list .sikshya-course-aside-price {
  margin-top: var(--sikshya-spacing-1);
  padding-top: var(--sikshya-spacing-4);
  margin-bottom: var(--sikshya-spacing-1);
  border-top: 1px solid rgba(148, 163, 184, 0.35);
}

.sikshya-course-grid--list .sikshya-course-aside-cta {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  justify-content: center;
  margin-top: var(--sikshya-spacing-2);
  margin-inline: 0;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.sikshya-course-card-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: var(--sikshya-spacing-2) var(--sikshya-spacing-3);
  margin-bottom: var(--sikshya-spacing-3);
}

.sikshya-course-card-kicker .sikshya-course-categories {
  margin-bottom: 0;
}

.sikshya-course-categories {
  display: flex;
  gap: var(--sikshya-spacing-2);
  margin-bottom: var(--sikshya-spacing-3);
}

.sikshya-course-category {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.08);
  color: var(--sikshya-primary);
  font-size: var(--sikshya-font-size-xs);
  font-weight: 700;
  text-decoration: none;
}

a.sikshya-course-category:hover {
  color: var(--sikshya-primary-dark);
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.26);
  text-decoration: none;
}

a.sikshya-course-category:focus-visible {
  outline: 2px solid var(--sikshya-primary);
  outline-offset: 2px;
}

.sikshya-course-title {
  font-size: var(--sikshya-font-size-lg);
  font-weight: 600;
  color: var(--sikshya-gray-900);
  margin-bottom: var(--sikshya-spacing-2);
  line-height: 1.4;
}

.sikshya-course-title a {
  color: inherit;
  text-decoration: none;
  transition: var(--sikshya-transition);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sikshya-course-title a:hover {
  color: var(--sikshya-primary);
}

.sikshya-course-excerpt {
  font-size: var(--sikshya-font-size-sm);
  color: var(--sikshya-gray-600);
  margin-bottom: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Pro/addon meta items injected via `sikshya_course_card_meta` */
.sikshya-course-card__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--sikshya-gray-200);
  background: var(--sikshya-gray-50);
  color: var(--sikshya-gray-700);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  max-width: 100%;
}

.sikshya-course-card-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.sikshya-course-card-byline .sikshya-course-card__meta-item {
  margin-top: 0;
}
.sikshya-course-card__meta-item .dashicons {
  width: 16px;
  height: 16px;
  font-size: 16px;
  line-height: 16px;
  color: var(--sikshya-gray-500);
}
.sikshya-course-card__meta-item > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Marketplace vendor on cards: remove hard-coded dot separator */
.sik-marketplace-card-vendor > span[aria-hidden="true"] {
  display: none;
}

/* Primary CTA left, curriculum badges right — grid + list (single row; scroll if tight) */
.sikshya-course-card-meta-actions {
  margin-top: var(--sikshya-spacing-4);
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sikshya-spacing-2);
  overflow: visible;
}

.sikshya-course-card-meta-actions--action-only {
  justify-content: flex-start;
}

.sikshya-course-card-meta-actions .sikshya-course-card-actions {
  margin-top: 0;
  flex: 0 0 auto;
  flex-shrink: 0;
}

.sikshya-course-curriculum-stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}

.sikshya-course-curriculum-stats__item {
  display: inline-flex;
  margin: 0;
  flex-shrink: 0;
}

/* Icon + number; rectangle chips; tooltip is a real child so it stays anchored to this badge */
.sikshya-course-curriculum-stats__badge--icon-value {
  position: relative;
  z-index: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 1.625rem;
  padding: 2px 7px 2px 6px;
  border-radius: var(--sikshya-radius);
  border: 1px solid var(--sikshya-gray-300);
  background: var(--sikshya-white);
  color: var(--sikshya-gray-800);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
  cursor: default;
  flex-shrink: 0;
  transform: translateZ(0);
}

.sikshya-course-curriculum-stats__badge--icon-value:hover,
.sikshya-course-curriculum-stats__badge--icon-value:focus-visible {
  background: var(--sikshya-gray-50);
  border-color: var(--sikshya-gray-400);
  z-index: 40;
}

.sikshya-course-curriculum-stats__badge--icon-value:focus-visible {
  outline: 2px solid var(--sikshya-primary);
  outline-offset: 2px;
}

.sikshya-course-curriculum-stats__tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  top: auto;
  transform: translateX(-50%);
  box-sizing: border-box;
  width: max-content;
  min-width: 0;
  max-width: min(220px, calc(100vw - 1.5rem));
  padding: 5px 8px;
  border-radius: var(--sikshya-radius);
  background: var(--sikshya-gray-900);
  color: var(--sikshya-white);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  white-space: normal;
  text-align: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.14s ease, visibility 0.14s ease;
  z-index: 50;
}

.sikshya-course-curriculum-stats__badge--icon-value:hover .sikshya-course-curriculum-stats__tooltip,
.sikshya-course-curriculum-stats__badge--icon-value:focus-visible .sikshya-course-curriculum-stats__tooltip {
  opacity: 1;
  visibility: visible;
}

.sikshya-course-curriculum-stats__value {
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.sikshya-course-curriculum-stats__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
}

.sikshya-course-curriculum-stats__icon svg {
  display: block;
  width: 14px;
  height: 14px;
}

.sikshya-course-card-actions {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
}

.sikshya-course-card-action-form {
  margin: 0;
  display: inline-block;
  max-width: 100%;
}

.sikshya-course-card-actions .sikshya-course-card-action {
  width: auto;
  max-width: 100%;
  justify-content: center;
  box-sizing: border-box;
}

/* Course grid CTAs — logo secondary (accent purple), not primary navy. */
.sikshya-course-card-actions .sikshya-btn--primary {
  background: var(--sikshya-accent);
  color: var(--sikshya-white);
  border-color: transparent;
}

.sikshya-course-card-actions .sikshya-btn--primary:hover,
.sikshya-course-card-actions .sikshya-btn--primary:focus-visible {
  background: var(--sikshya-accent-dark);
  color: var(--sikshya-white);
  border-color: transparent;
}

/* Wider primary CTAs (Buy now / Enroll now / Continue learning) vs outline View course */
.sikshya-course-card-meta-actions .sikshya-button.sikshya-button--small {
  padding: var(--sikshya-spacing-2) var(--sikshya-spacing-5);
  font-size: var(--sikshya-font-size-sm);
  font-weight: 600;
  min-width: 9rem;
}

.sikshya-course-grid--list .sikshya-course-title {
  margin-bottom: var(--sikshya-spacing-2);
  font-size: var(--sikshya-font-size-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.sikshya-course-grid--list .sikshya-course-excerpt {
  -webkit-line-clamp: 2;
  line-height: 1.45;
  color: var(--sikshya-gray-600);
}

.sikshya-course-counts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sikshya-spacing-2);
  margin-bottom: var(--sikshya-spacing-4);
}

.sikshya-course-counts__pill {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 var(--sikshya-spacing-3);
  border-radius: 999px;
  border: 1px solid var(--sikshya-gray-200);
  background: var(--sikshya-gray-50);
  color: var(--sikshya-gray-700);
  font-size: var(--sikshya-font-size-xs);
  font-weight: 600;
}

.sikshya-course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sikshya-spacing-3);
  margin-bottom: var(--sikshya-spacing-4);
  font-size: var(--sikshya-font-size-sm);
}

.sikshya-course-instructor {
  display: flex;
  align-items: center;
  gap: var(--sikshya-spacing-1);
  color: var(--sikshya-gray-600);
}

.sikshya-course-instructor-label {
  color: var(--sikshya-gray-500);
}

.sikshya-course-instructor-name {
  font-weight: 500;
  color: var(--sikshya-gray-700);
}

.sikshya-course-duration {
  display: flex;
  align-items: center;
  gap: var(--sikshya-spacing-1);
  color: var(--sikshya-gray-600);
}

.sikshya-difficulty-badge {
  padding: var(--sikshya-spacing-1) var(--sikshya-spacing-2);
  border-radius: var(--sikshya-radius);
  font-size: var(--sikshya-font-size-xs);
  font-weight: 500;
  text-transform: capitalize;
}

.sikshya-difficulty-badge--beginner {
  background: var(--sikshya-success);
  color: var(--sikshya-white);
}

.sikshya-difficulty-badge--intermediate {
  background: var(--sikshya-warning);
  color: var(--sikshya-white);
}

.sikshya-difficulty-badge--advanced {
  background: var(--sikshya-error);
  color: var(--sikshya-white);
}

.sikshya-course-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sikshya-spacing-4);
  padding: var(--sikshya-spacing-5) var(--sikshya-spacing-5);
  margin-top: auto;
  border-top: 1px solid var(--sikshya-gray-200);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.95) 0%, var(--sikshya-white) 60%);
  border-radius: 0 0 var(--sikshya-radius-lg) var(--sikshya-radius-lg);
}

.sikshya-course-card-footer .sikshya-course-price {
  flex: 1 1 auto;
  min-width: 0;
}

.sikshya-course-card-footer .sikshya-button--outline {
  flex-shrink: 0;
  border: 1px solid var(--sikshya-gray-300);
  background: var(--sikshya-white);
  color: var(--sikshya-gray-800);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.sikshya-course-card-footer .sikshya-button--outline:hover {
  background: var(--sikshya-gray-50);
  border-color: var(--sikshya-gray-400);
  color: var(--sikshya-gray-900);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

/* Course card pricing (grid footer + list aside) */
.sikshya-course-price {
  display: flex;
  align-items: center;
  gap: var(--sikshya-spacing-2);
  min-width: 0;
  font-variant-numeric: tabular-nums;
}

.sikshya-course-price--sale {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sikshya-spacing-2);
}

/* Same size as paid price; only color (and strike) differ */
.sikshya-course-price--sale .sikshya-course-price-original,
.sikshya-course-price--sale .sikshya-course-price-current {
  font-size: var(--sikshya-font-size-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.sikshya-course-price--sale .sikshya-course-price-original {
  /* Fade via color only — opacity was hiding the strike along with the glyphs */
  color: var(--sikshya-gray-300);
  text-decoration-line: line-through;
  text-decoration-thickness: max(2px, 0.09em);
  text-decoration-color: var(--sikshya-gray-600);
  text-underline-offset: 0;
  -webkit-text-decoration-line: line-through;
}

@supports (color: color-mix(in srgb, white, black)) {
  .sikshya-course-price--sale .sikshya-course-price-original {
    color: color-mix(in srgb, var(--sikshya-gray-500) 38%, var(--sikshya-white));
  }
}

.sikshya-course-price--sale .sikshya-course-price-current {
  color: var(--sikshya-primary);
}

.sikshya-course-price--paid .sikshya-course-price-current {
  font-size: var(--sikshya-font-size-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--sikshya-gray-900);
  line-height: 1.15;
}

.sikshya-course-price--free .sikshya-course-price-free {
  font-size: var(--sikshya-font-size-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--sikshya-success);
  line-height: 1.15;
}

/* Pagination (WP core paginate_links output) */
.sikshya-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--sikshya-spacing-2);
  margin-top: var(--sikshya-spacing-8);
}

.sikshya-pagination ul.page-numbers {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sikshya-spacing-2);
  padding: 0;
  margin: 0;
  justify-content: center;
  border:none;
  background:none;
}

.sikshya-pagination ul.page-numbers li {
  margin: 0;
}

.sikshya-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 var(--sikshya-spacing-3);
  border: 1px solid var(--sikshya-gray-300);
  border-radius: var(--sikshya-radius);
  background: var(--sikshya-white);
  color: var(--sikshya-gray-700);
  text-decoration: none;
  font-size: var(--sikshya-font-size-sm);
  transition: var(--sikshya-transition);
}

.sikshya-pagination .page-numbers.current {
  background: var(--sikshya-primary);
  border-color: var(--sikshya-primary);
  color: var(--sikshya-white);
}

.sikshya-pagination .page-numbers.current:hover {
  background: var(--sikshya-primary-dark);
  border-color: var(--sikshya-primary-dark);
}

.sikshya-pagination .page-numbers.dots {
  border-color: transparent;
  background: transparent;
  min-width: auto;
  padding: 0 6px;
}

.sikshya-pagination .page-numbers.dots:hover {
  background: transparent;
  border-color: transparent;
}

/* Responsive */
@media (max-width: 1024px) {
  .sikshya-archive-courses__layout {
    grid-template-columns: 1fr;
  }

  .sikshya-archive-filters {
    position: static;
  }

  .sikshya-course-grid--list .sikshya-course-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "image"
      "primary"
      "aside";
  }

  .sikshya-course-grid--list .sikshya-course-card-image {
    grid-row: auto;
    align-self: stretch;
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-block: 0;
    border-radius: var(--sikshya-radius-lg) var(--sikshya-radius-lg) 0 0;
    min-height: 0;
    aspect-ratio: 16 / 9;
    max-height: none;
    border: none;
    border-bottom: 1px solid var(--sikshya-gray-100);
    box-shadow: none;
  }

  .sikshya-course-grid--list .sikshya-course-card-aside {
    border-left: none;
    border-top: 1px solid var(--sikshya-gray-200);
    border-radius: 0 0 var(--sikshya-radius-lg) var(--sikshya-radius-lg);
    background: var(--sikshya-gray-50);
  }

  .sikshya-course-card-primary {
    padding: var(--sikshya-spacing-4);
  }

  .sikshya-course-card-footer {
    flex-direction: column;
    gap: var(--sikshya-spacing-3);
    align-items: stretch;
  }
}

@media (max-width: 768px) {
  .sikshya-course-grid {
    grid-template-columns: 1fr;
  }
  .sikshya-archive-courses__title {
    font-size: var(--sikshya-font-size-3xl);
  }
  .sikshya-pagination {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .sikshya-course-card-primary {
    padding: var(--sikshya-spacing-4);
  }

  .sikshya-course-card-footer {
    flex-direction: column;
    gap: var(--sikshya-spacing-3);
    align-items: stretch;
  }
}

@media print {
  .sikshya-pagination {
    display: none;
  }
  .sikshya-course-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid var(--sikshya-gray-300);
  }
}

/* ----------------------------------------------------------------------
 * Archive view FOUC prevention.
 *
 * A blocking inline script in <head> (Frontend::addFrontendMeta) reads the
 * learner's saved preference from localStorage and sets
 * `<html data-sikshya-archive-view="grid|list">` before the body paints.
 *
 * These rules override whatever class PHP server-rendered on
 * `.sikshya-course-grid` and `.sikshya-archive-toolbar__view-btn` so the
 * preferred layout is visible from the very first paint — no JS-driven
 * class swap after DOMContentLoaded. The existing `--list` class rules
 * are kept intact for non-JS users and for runtime toggles by frontend.js.
 * ---------------------------------------------------------------------- */

/* When user prefers LIST, force list layout regardless of server class. */
html[data-sikshya-archive-view="list"] .sikshya-archive-courses .sikshya-course-grid {
  grid-template-columns: 1fr;
  gap: var(--sikshya-spacing-4);
}

html[data-sikshya-archive-view="list"] .sikshya-archive-courses .sikshya-course-card {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(260px, 1fr) minmax(220px, 280px);
  grid-template-areas: "image primary aside";
  align-items: stretch;
  column-gap: var(--sikshya-spacing-5);
}

html[data-sikshya-archive-view="list"] .sikshya-archive-courses .sikshya-course-card-body {
  display: contents;
}

html[data-sikshya-archive-view="list"] .sikshya-archive-courses .sikshya-course-card-image {
  grid-area: image;
}

html[data-sikshya-archive-view="list"] .sikshya-archive-courses .sikshya-course-card-primary {
  grid-area: primary;
}

/* When user prefers GRID, force grid layout regardless of server class. */
html[data-sikshya-archive-view="grid"] .sikshya-archive-courses .sikshya-course-grid {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--sikshya-spacing-6);
}

html[data-sikshya-archive-view="grid"] .sikshya-archive-courses .sikshya-course-card {
  display: flex;
  grid-template-columns: none;
  grid-template-areas: none;
}

html[data-sikshya-archive-view="grid"] .sikshya-archive-courses .sikshya-course-card-body {
  display: flex;
}

/* Toolbar view-toggle buttons: derive active state from html attribute so
 * the hardcoded `is-active` on the grid button (in the server template)
 * doesn't briefly highlight the wrong button. */
html[data-sikshya-archive-view="list"] .sikshya-archive-toolbar__view-btn[data-sikshya-archive-view="grid"],
html[data-sikshya-archive-view="grid"] .sikshya-archive-toolbar__view-btn[data-sikshya-archive-view="list"] {
  background: transparent;
  color: var(--sikshya-gray-700);
}

html[data-sikshya-archive-view="list"] .sikshya-archive-toolbar__view-btn[data-sikshya-archive-view="list"],
html[data-sikshya-archive-view="grid"] .sikshya-archive-toolbar__view-btn[data-sikshya-archive-view="grid"] {
  background: rgba(37, 99, 235, 0.1);
  color: var(--sikshya-primary);
}


