/* Unified course card (Phase 4): includes/webinar/alx-card.blade.php, data from App\Support\CourseCard.
   Replaces the browser patches 14, 16, 18j, 18k (custom JS) and 25, 26 (custom CSS) for grid cards.
   Colours: alfac-handoff/design/tokens.css. Every block has a fixed or content height from the server, so nothing moves after load. */
.alx-card {
  --c-navy: #1B1A4A; --c-brand: #292866; --c-ink: #1C1B3F; --c-ink2: #2C2B4F; --c-muted: #5E6080;
  --c-border: #E6E7EF; --c-chip: #EEEEF7; --c-tint: #EEEEF7;
  position: relative; display: flex; flex-direction: column; height: 100%; min-width: 0;
  background: #fff; border: 1px solid var(--c-border); border-radius: 12px; overflow: hidden;
  font-family: 'Noto Kufi Arabic', system-ui, sans-serif; color: var(--c-ink); text-align: right; direction: rtl;
  transition: box-shadow .2s ease, border-color .2s ease;
}
.alx-card:hover { border-color: #CFD0E2; box-shadow: 0 10px 28px rgba(27, 26, 74, .09); }
.alx-card:focus-within { border-color: var(--c-brand); }
.alx-card--offer { --c-tint: #F3EEE2; }
.alx-card--english { --c-tint: #E4E7F6; }
.alx-card--exams, .alx-card--cert { --c-tint: #EAE4F3; }
.alx-card--tech { --c-tint: #E6EEE4; }
.alx-card--diploma, .alx-card--admin { --c-tint: #E2EEF0; }
.alx-card--kids { --c-tint: #F6E8E4; }

.alx-card__media { aspect-ratio: 16 / 9; background: var(--c-tint); }
.alx-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.alx-card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: 56px; padding: 0 16px; background: var(--c-tint); border-bottom: 1px solid rgba(27, 26, 74, .06);
}
.alx-card__cat { font-size: 13px; font-weight: 700; color: var(--c-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.alx-card__badge {
  flex: none; padding: 3px 10px; border-radius: 999px; background: var(--c-brand); color: #fff;
  font-size: 12px; font-weight: 700; line-height: 1.6; white-space: nowrap;
}

.alx-card__body { display: flex; flex-direction: column; flex: 1; gap: 10px; padding: 16px; }
.alx-card__main { display: contents; }
.alx-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.alx-card__tags li { padding: 2px 10px; border-radius: 999px; background: var(--c-chip); color: var(--c-ink2); font-size: 12px; font-weight: 600; line-height: 1.8; }
.alx-card__title { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.7; color: var(--c-ink); }
.alx-card__title a { color: inherit; text-decoration: none; }
.alx-card__title a:hover { text-decoration: underline; text-underline-offset: 4px; }
.alx-card__title a:focus-visible { outline: 3px solid var(--c-brand); outline-offset: 2px; border-radius: 2px; }
.alx-card__students { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--c-muted); }
.alx-card__prog { height: 4px; border-radius: 4px; background: var(--c-chip); overflow: hidden; }
.alx-card__prog span { display: block; height: 100%; background: var(--c-brand); }

.alx-card__foot { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--c-border); }
.alx-card__batch { display: flex; align-items: center; gap: 6px; min-height: 24px; margin: 0; font-size: 13px; color: var(--c-ink2); }
.alx-card__batch svg { flex: none; color: var(--c-brand); }
.alx-card__batch time { font-weight: 700; color: var(--c-ink); }
.alx-card__batch em { margin-inline-start: auto; font-style: normal; font-size: 12px; font-weight: 600; color: var(--c-muted); white-space: nowrap; }
.alx-card__batch.is-none { color: var(--c-muted); }
.alx-card__batch.is-none svg { color: var(--c-muted); }

.alx-card__price { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; row-gap: 2px; }
.alx-card__from { font-size: 13px; color: var(--c-muted); }
.alx-card__monthly { font-size: 13px; color: var(--c-ink); }
.alx-card__monthly b { font-size: 22px; font-weight: 800; color: var(--c-navy); }
.alx-card__monthly small { font-size: 13px; color: var(--c-muted); }
.alx-card__total { flex-basis: 100%; font-size: 13px; color: var(--c-muted); }
.alx-card__total b { font-size: 18px; color: var(--c-navy); }
.alx-card__total del, .alx-card__price del { margin-inline-start: 6px; color: var(--c-muted); }
.alx-card__free { font-size: 20px; font-weight: 800; color: var(--c-navy); }
.alx-card__pay { display: flex; align-items: center; gap: 10px; margin: 0; height: 16px; }
.alx-card__pay img { width: 46px; height: 14px; object-fit: contain; object-position: center; }

.alx-card__actions { display: flex; align-items: center; gap: 12px; }
.alx-card .alx-card__btn {
  display: inline-flex; align-items: center; justify-content: center; flex: 1; min-height: 44px; padding: 8px 16px;
  border: 1px solid var(--c-brand); border-radius: 6px; background: var(--c-brand); color: #fff;
  font: 700 14px/1.4 'Noto Kufi Arabic', system-ui, sans-serif; text-decoration: none; cursor: pointer; box-shadow: none; width: auto; height: auto;
}
.alx-card .alx-card__btn:hover { background: var(--c-navy); border-color: var(--c-navy); color: #fff; }
.alx-card .alx-card__btn:focus-visible, .alx-card__more:focus-visible { outline: 3px solid #C9A86A; outline-offset: 2px; }
.alx-card .alx-card__btn.af-card__interest-btn--active { background: #fff; color: var(--c-brand); }
.alx-card .alx-card__btn[disabled] { opacity: .7; cursor: progress; }
.alx-card__more {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px;
  font-size: 14px; font-weight: 700; color: var(--c-brand); text-decoration: underline; text-underline-offset: 4px;
}
.alx-card__more:hover { color: var(--c-navy); }

/* Listing pages: the theme's grid columns (mt-20/mt-30 already space the rows) hold the card.
   Categories use col-6 on phones (two 150px cards); the card needs one column there. */
@media (max-width: 575.98px) {
  .row > .col-6:has(> .alx-card) { flex: 0 0 100%; max-width: 100%; }
}

/* List view (Phase 6): list-card.blade.php = the same card, horizontal from 768px. Coloured strip on the right with the
   category and badge, then title and tags, then batch, price and button in a fixed column. Phones keep the grid card. */
.alx-card--row + .alx-card--row { margin-top: 20px; }
@media (min-width: 768px) {
  .alx-card--row { flex-direction: row; height: auto; }
  .alx-card--row .alx-card__head {
    flex: 0 0 168px; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 10px;
    height: auto; padding: 16px; border-bottom: 0; border-inline-end: 1px solid rgba(27, 26, 74, .06);
  }
  .alx-card--row .alx-card__cat { white-space: normal; line-height: 1.6; }
  .alx-card--row .alx-card__body { flex-direction: row; align-items: stretch; gap: 24px; padding: 20px; min-width: 0; }
  .alx-card--row .alx-card__main { display: flex; flex-direction: column; gap: 10px; flex: 1 1 auto; min-width: 0; }
  .alx-card--row .alx-card__title { font-size: 17px; }
  .alx-card--row .alx-card__foot {
    flex: 0 0 280px; margin-top: 0; padding-top: 0; border-top: 0;
    padding-inline-start: 24px; border-inline-start: 1px solid var(--c-border);
  }
}
@media (min-width: 768px) and (max-width: 991.98px) {
  .alx-card--row .alx-card__head { flex-basis: 132px; }
  .alx-card--row .alx-card__foot { flex-basis: 240px; }
}

/* Phase 6: short description (placement-test and self-paced cards in «دوراتي») */
.alx-card__desc { margin: 0; font-size: 13px; line-height: 1.8; color: var(--c-ink2); }
