:root {
  --jw-ucg-text: #0A0A0A;
  --jw-ucg-title: #242424;
  --jw-ucg-subtle: #717182;
  --jw-ucg-bg: #F6F9FC;
  --jw-ucg-card-bg: #fff;
  --jw-ucg-card-top: #F5F7FF;
  --jw-ucg-border: rgba(10, 37, 64, .10);
  --jw-ucg-shadow: 0 12px 24px rgba(186, 205, 226, .42);
  --jw-ucg-purple: #635BFF;
  --jw-ucg-purple-dark: #5459DE;
  --jw-ucg-blue-soft: #DBEAFE;
  --jw-ucg-blue: #3B82F6;
}

.jw-classes-grid-wrap,
.jw-classes-grid-wrap * {
  box-sizing: border-box;
}

.jw-classes-grid-wrap {
  width: 100%;
  color: var(--jw-ucg-text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.jw-classes-title {
  margin: 0 0 20px;
  color: var(--jw-ucg-title);
  font-family: Figtree, Inter, sans-serif;
  font-size: clamp(22px, 2vw, 24px);
  font-weight: 700;
  line-height: 1.2;
}

.jw-month-group + .jw-month-group {
  margin-top: 24px;
}

.jw-class-section {
  padding: 19px;
  background: var(--jw-ucg-card-bg);
  box-shadow: var(--jw-ucg-shadow);
  border-radius: 20px;
}

.jw-section-label {
  display: grid;
  grid-template-columns: max-content 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 0 15px;
  color: #000;
  font-family: "Noto Sans Hebrew", Inter, sans-serif;
  font-size: 15px;
  line-height: 1;
}

.jw-section-label::after {
  content: "";
  height: 1px;
  background: rgba(0, 0, 0, .10);
}

.jw-class-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.jw-class-card {
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--jw-ucg-border);
  border-radius: 14px;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.jw-teacher {
  min-height: 124px;
  padding: 19px 24px;
  background: var(--jw-ucg-card-top);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-bottom: 1px solid var(--jw-ucg-border);
}

.jw-class-card .jw-teacher img.jw-teacher-photo,
.jw-class-card .jw-teacher img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  aspect-ratio: 1 / 1;
}

.jw-teacher-info {
  min-width: 0;
  width: 150px;
}

.jw-teacher-name {
  margin: 0;
  color: #0A0A0A;
  font-size: 14.4px;
  font-weight: 600;
  line-height: 1.5;
}

.jw-teacher-meta {
  margin: 0;
  color: var(--jw-ucg-subtle);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.5;
}


.jw-course-pill {
  display: inline-flex;
  max-width: 100%;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(99, 91, 255, .10);
  color: var(--jw-ucg-purple);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}

.jw-card-body {
  padding: 14px 15px 15px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  flex: 1;
}

.jw-date-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 138px;
  gap: 14px;
  align-items: end;
}

.jw-date-range {
  margin: 0 0 2px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
}

.jw-target-dates {
  margin: 0;
  color: #474755;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: .06px;
}

.jw-capacity {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.jw-capacity-track {
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #E5E7EB;
}

.jw-capacity-fill {
  display: block;
  height: 100%;
  width: var(--fill, 40%);
  border-radius: inherit;
  background: var(--status, #10B981);
}

.jw-capacity-text {
  color: var(--status, #10B981);
  font-size: 9.6px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .11px;
}

.jw-schedule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.jw-days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.jw-day {
  min-width: 34px;
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--jw-ucg-blue-soft);
  color: var(--jw-ucg-blue);
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
}

.jw-time {
  color: #575757;
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
}

.jw-card-action {
  width: 100%;
  min-height: 53px;
  border: 0;
  border-radius: 999px;
  background: var(--jw-ucg-purple);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 600 13.5px/1.4 Inter, sans-serif;
  text-decoration: none;
  transition: transform .2s ease, background-color .2s ease;
}

.jw-card-action:hover {
  background: var(--jw-ucg-purple-dark);
  color: #fff;
  transform: translateY(-1px);
}

.jw-class-card.is-full .jw-card-action {
  background: #FFE4E4;
  color: #D4183D;
  cursor: not-allowed;
}

.jw-class-card.is-full .jw-card-action:hover {
  transform: none;
}

.jw-classes-error,
.jw-classes-empty {
  padding: 16px 18px;
  border-radius: 14px;
  background: #fff;
  color: #435366;
  font-family: Inter, sans-serif;
  box-shadow: var(--jw-ucg-shadow);
}

@media (max-width: 1100px) {
  .jw-class-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .jw-class-section {
    padding: 14px;
  }

  .jw-class-grid {
    grid-template-columns: 1fr;
  }

  .jw-teacher {
    justify-content: flex-start;
  }

  .jw-teacher-info {
    width: auto;
  }

  .jw-date-row {
    grid-template-columns: 1fr;
  }

  .jw-capacity {
    max-width: 220px;
  }

  .jw-schedule-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .jw-time {
    white-space: normal;
  }
}

@media (max-width: 430px) {
  .jw-teacher {
    padding-inline: 16px;
  }
}

.jw-classes-debug {
  max-width: 960px;
  padding: 20px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 24px #EAF1F9;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.jw-classes-debug ul {
  margin: 12px 0 0;
  padding-left: 20px;
}

.jw-classes-debug li {
  margin: 6px 0;
}

.jw-classes-debug code {
  padding: 2px 6px;
  border-radius: 6px;
  background: #F6F9FC;
}


/* =========================================================================
 * PROGRESS LAYOUT  (v2.3 — Figma redesign)
 *
 * Selector prefix: .jw-progress-card
 * Goal: visually distinct from Classic, brand-aligned, dual-CTA action row.
 * ========================================================================= */

.jw-progress-card {
    --pc-brand:        #635BFF;
    --pc-brand-soft:   #F0F4FF;
    --pc-brand-border: #E0E0FF;
    --pc-navy:         #0A2540;
    --pc-ink:          #0F172A;
    --pc-muted:        #6D6E78;
    --pc-meta:         #999999;
    --pc-text-body:    #435366;
    --pc-track:        #E5E7EB;
    --pc-danger:       #DC2626;
    --pc-cta-outline:  #635BFF;
    --pc-cta-disabled-bg:     #F6F9FC;
    --pc-cta-disabled-border: #C8D7F0;
    --pc-cta-disabled-text:   #93AAD1;
    --pc-card-bg:      #FFFFFF;
    --pc-card-shadow:  0px 12.48px 24px #EAF1F9;
    --pc-panel-bg:     #F5F7FF;
    --pc-radius:       15px;

    width: 100%;
    max-width: 376px;
    background: var(--pc-card-bg);
    padding: 10px;
    border-radius: var(--pc-radius);
    box-shadow: var(--pc-card-shadow);
    display: flex;
    flex-direction: column;
    gap: 11.52px;
    font-family: "Figtree", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
    box-sizing: border-box;
}
.jw-progress-card *,
.jw-progress-card *::before,
.jw-progress-card *::after { box-sizing: border-box; }

/* Instructor panel — top */
.jw-pc-instructor {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 30px;
    background: var(--pc-panel-bg);
    border-radius: 6px;
    min-height: 161px;
}
.jw-progress-card .jw-pc-instructor__photo,
.jw-pc-instructor img.jw-pc-instructor__photo {
    width: 107.13px;
    height: 107.13px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
    aspect-ratio: 1 / 1;
}
.jw-pc-instructor__photo--placeholder {
    background: linear-gradient(135deg, var(--pc-brand) 0%, #4338CA 100%);
}
.jw-pc-instructor__text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.jw-pc-instructor__name {
    font-size: 16px;
    font-weight: 600;
    color: var(--pc-navy);
    line-height: 18.4px;
    word-wrap: break-word;
}
.jw-pc-instructor__meta {
    font-size: 16px;
    font-weight: 600;
    color: var(--pc-meta);
    line-height: 18.4px;
    word-wrap: break-word;
}
.jw-pc-instructor__course-row {
    margin-top: 6px;
    /* line-height was 0 to collapse the inline-flex baseline; the new pill
       can wrap to two lines, so use a normal line-height context instead. */
}
.jw-pc-course-pill {
    display: inline-block;
    padding: 3px 11px;
    background: var(--pc-brand-soft);
    border: 1px solid var(--pc-brand-border);
    border-radius: 5px;
    color: var(--pc-brand);
    font-family: "Inter", "Figtree", Arial, sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    letter-spacing: 0.01em;
    /* No nowrap / no fixed height. Pill grows with its content and wraps
       to a second line if the course name is long. max-width caps it at
       the parent so it can't blow out the card. */
    max-width: 100%;
    word-break: break-word;
}

/* Body */
.jw-pc-body {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 10px;
}

/* Dates */
.jw-pc-dates {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.jw-pc-dates__range {
    font-size: 16px;
    font-weight: 600;
    color: var(--pc-navy);
    line-height: 18.4px;
}
.jw-pc-dates__targets {
    font-family: "Noto Sans", "Figtree", Arial, sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: var(--pc-text-body);
    line-height: 28px;
}

/* Schedule row */
.jw-pc-schedule {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.jw-pc-schedule__days {
    display: flex;
    align-items: center;
    gap: 9.6px;
    flex-wrap: wrap;
}
.jw-pc-day-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22.4px;
    padding: 0 11px;
    background: var(--pc-brand-soft);
    border: 1px solid var(--pc-brand-border);
    border-radius: 5px;
    color: var(--pc-brand);
    font-family: "Inter", "Figtree", Arial, sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
}
.jw-pc-schedule__time {
    color: var(--pc-muted);
    font-family: "Inter", "Figtree", Arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 19.5px;
    flex-shrink: 0;
}

/* Availability */
.jw-pc-availability {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.jw-pc-progress {
    height: 5px;
    background: var(--pc-track);
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}
.jw-pc-progress__fill {
    display: block;
    height: 100%;
    width: var(--fill, 0%);
    background: var(--bar-color, var(--pc-brand));
    border-radius: 9999px;
    transition: width 0.3s ease;
}
.jw-pc-availability__text {
    font-family: "Inter", "Figtree", Arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 18.72px;
    letter-spacing: 0.15px;
    color: var(--text-color, var(--pc-text-body));
}
.jw-progress-card.is-full .jw-pc-availability__text { color: var(--pc-danger); }

/* Actions */
.jw-pc-actions {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}
.jw-pc-btn {
    flex: 1 1 0;
    height: 50px;
    padding: 10px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-family: "Inter", "Figtree", Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
    box-sizing: border-box;
    border: 0;
}
.jw-pc-btn--learn {
    background: transparent;
    color: var(--pc-cta-outline);
    border: 1.5px solid var(--pc-cta-outline);
}
.jw-pc-btn--learn:hover {
    background: var(--pc-brand-soft);
    color: var(--pc-brand);
    text-decoration: none;
}
.jw-pc-btn__chevron {
    display: inline-block;
    transition: transform 0.15s ease;
}
.jw-pc-btn--learn:hover .jw-pc-btn__chevron { transform: translateX(2px); }

.jw-pc-btn--enroll {
    background: var(--pc-brand);
    color: #FFFFFF;
    border: 1px solid var(--pc-brand);
}
.jw-pc-btn--enroll:hover {
    background: #4338CA;
    color: #FFFFFF;
    transform: translateY(-1px);
    text-decoration: none;
}

.jw-pc-btn--full {
    background: var(--pc-cta-disabled-bg);
    color: var(--pc-cta-disabled-text);
    border: 1px solid var(--pc-cta-disabled-border);
    text-align: center;
    cursor: not-allowed;
}

/* Hide Learn More button if no URL was resolved (don't render an empty link).
   We can't easily detect missing href without JS, but linking to "" results in
   the current page. Marketing should set learn_more_url; if blank, the API value
   is used. Worst case it links to the current page — visible but harmless. */
.jw-pc-btn--learn[href=""] { display: none; }

/* Mobile */
@media (max-width: 480px) {
    .jw-progress-card { max-width: 100%; }
    .jw-pc-instructor {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 18px;
        min-height: auto;
    }
    .jw-pc-instructor__photo {
        width: 88px;
        height: 88px;
    }
    .jw-pc-schedule {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}


/* =========================================================================
 * FLAT MODE wrapper (v2.5+)
 *
 * Used when group_by="none". Intentionally minimal: only the CSS Grid
 * behavior and gap. No background, no padding, no border. Elementor
 * authors compose those at the parent section level. The columns / gap
 * widget controls in the Style tab still target this selector.
 * ========================================================================= */

.jw-classes-flat {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    align-items: start;
}

/* Cards inside the flat wrapper stretch to fill their grid cell so all
   cards in a row stay the same height. */
.jw-classes-flat > .jw-progress-card,
.jw-classes-flat > .jw-class-card {
    max-width: none;
    width: 100%;
}
