/* v981 - the academy course card, organised: chips first, then the title, one short line, the facts as a quiet row,
   and a footer that pairs the price with a clear "View course" link. Loaded last on the academy page; every rule starts
   at #courses-grid so it outranks the older layers without !important. Both themes. */
#courses-grid .course-card .course-content { display: flex; flex-direction: column; gap: 10px; }
#courses-grid .course-card .course-badge-slot { order: 0; }
#courses-grid .course-card .course-badge-slot:empty { display: none; }
#courses-grid .course-card .course-tagrow { order: 1; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
#courses-grid .course-card .course-title-link { order: 2; text-decoration: none; }
#courses-grid .course-card .course-title { margin: 0; font-size: 1.06rem; line-height: 1.45; font-weight: 800; }
#courses-grid .course-card .course-desc {
  order: 3; margin: 0; font-size: .86rem; line-height: 1.7; color: var(--text-muted, #64748b);
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* the facts: one quiet row, no box */
#courses-grid .course-card .course-byline {
  order: 4; background: none; border: 0; padding: 0; border-radius: 0; gap: 14px; flex-wrap: wrap;
  font-size: .78rem;
}
#courses-grid .course-card .course-byline .cb-part { padding: 0; border: 0; background: none; font-size: .78rem; gap: 6px; }
#courses-grid .course-card .course-byline .cb-part + .cb-part { border-inline-start: 0; position: relative; padding-inline-start: 14px; }
#courses-grid .course-card .course-byline .cb-part + .cb-part::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 50%; width: 4px; height: 4px; margin-top: -2px;
  border-radius: 50%; background: currentColor; opacity: .35;
}
#courses-grid .course-card .course-byline .cb-lessons { color: var(--text-muted, #64748b); }
#courses-grid .course-card .course-meta { order: 5; }
#courses-grid .course-card .course-meta:not(:has(*)) { display: none; }
/* the footer: price + View course */
#courses-grid .course-card .course-footer {
  order: 6; margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 12px; border-top: 1px dashed rgba(148, 163, 184, .35);
}
#courses-grid .course-card .course-pricing:empty { display: none; }
#courses-grid .course-card .course-go {
  margin-inline-start: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: 999px; font-weight: 800; font-size: .86rem; text-decoration: none; white-space: nowrap;
  background: rgba(37, 99, 235, .14); color: #93c5fd; border: 1px solid rgba(96, 165, 250, .35);
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
#courses-grid .course-card .course-go:hover { background: #2563eb; color: #fff; border-color: #2563eb; }
#courses-grid .course-card .course-go:hover svg { transform: translateX(3px); }
#courses-grid .course-card .course-go svg { transition: transform .2s ease; flex: 0 0 16px; }
html[dir="rtl"] #courses-grid .course-card .course-go svg { transform: scaleX(-1); }
html[dir="rtl"] #courses-grid .course-card .course-go:hover svg { transform: scaleX(-1) translateX(3px); }
/* day mode */
html[data-color="light"] #courses-grid .course-card .course-desc,
html[data-color="light"] #courses-grid .course-card .course-byline .cb-lessons { color: #475569; }
html[data-color="light"] #courses-grid .course-card .course-go { background: #eef4ff; color: #1d4ed8; border-color: #c7d7fe; }
html[data-color="light"] #courses-grid .course-card .course-go:hover { background: #2563eb; color: #fff; border-color: #2563eb; }
/* a phone: tighter, the button keeps its tap size */
@media (max-width: 640px) {
  #courses-grid .course-card .course-content { gap: 8px; }
  #courses-grid .course-card .course-title { font-size: 1rem; }
  #courses-grid .course-card .course-desc { font-size: .84rem; }
}

/* v1007 - the owner's phone screenshot: the price sat centred in a large chip with a "PRICE" label and pushed
   "View course" onto its own row, the facts were spread to both edges, and the title used the code font.
   Now: the title in the site's reading font, the facts from the start, price and button on ONE row. */
#courses-grid .course-card .course-title { font-family: 'Alexandria', 'Tajawal', sans-serif !important; letter-spacing: 0 !important; }
html[lang^="ar"] #courses-grid .course-card .course-title { font-family: 'Tajawal', 'Alexandria', sans-serif !important; }
#courses-grid .course-card .course-byline { justify-content: flex-start !important; text-align: start; }
#courses-grid .course-card .course-footer { flex-wrap: nowrap !important; align-items: center !important; justify-content: space-between !important; }
#courses-grid .course-card .course-footer .course-pricing { flex: 0 1 auto !important; min-width: 0; width: auto !important; display: flex !important; justify-content: flex-start !important; text-align: start !important; margin: 0 !important; }
#courses-grid .course-card .course-footer .course-price.has-cp {
  display: inline-flex !important; flex-direction: row !important; align-items: baseline !important; gap: 0 !important;
  width: auto !important; min-width: 0 !important; padding: 0 !important; margin: 0 !important;
  background: none !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important;
}
#courses-grid .course-card .course-footer .course-price.has-cp .cp-l { display: none !important; }
#courses-grid .course-card .course-footer .course-price.has-cp .cp-v { display: inline-flex !important; align-items: baseline; gap: 5px; padding: 0 !important; background: none !important; border: 0 !important; box-shadow: none !important; }
#courses-grid .course-card .course-footer .cp-n { font-size: 1.3rem !important; font-weight: 800 !important; line-height: 1 !important; color: inherit !important; font-family: 'Alexandria', sans-serif !important; }
#courses-grid .course-card .course-footer .cp-c { font-style: normal; font-size: .74rem !important; font-weight: 700 !important; opacity: .7; color: inherit !important; }
#courses-grid .course-card .course-footer .price-block { display: flex !important; flex-direction: column; align-items: flex-start !important; gap: 2px; }
#courses-grid .course-card .course-footer .price-row { display: flex !important; align-items: baseline; gap: 8px; }
#courses-grid .course-card .course-footer .course-go { margin-inline-start: auto !important; flex: 0 0 auto; }
html[data-color="light"] #courses-grid .course-card .course-footer .cp-n { color: #0f172a !important; }
@media (max-width: 640px) {
  #courses-grid .course-card .course-footer { padding-top: 10px; gap: 8px; }
  #courses-grid .course-card .course-footer .course-go { min-height: 40px; padding: 0 14px; font-size: .84rem; }
  #courses-grid .course-card .course-footer .cp-n { font-size: 1.2rem !important; }
}

/* v1027 - the owner's phone screenshot: the price read as a bare "20" (the currency word inherited WHITE from an older
   price-chip rule and vanished on the white day card) and the facts row was a GRID that stretched "Mashhor Hub" and
   "25 lessons" to the two ends. Now: the currency always shows beside the figure as a small label, the facts sit
   together from the start, and the footer is price | View course on one row at every width. */
#courses-grid .course-card .course-byline { display: flex !important; flex-wrap: wrap; align-items: center; column-gap: 14px; row-gap: 4px; }
#courses-grid .course-card .course-byline .cb-part { flex: 0 0 auto !important; width: auto !important; min-width: 0; }
#courses-grid .course-card .course-footer .cp-c {
  display: inline-block !important; color: #94a3b8 !important; opacity: 1 !important;
  font-size: .72rem !important; font-weight: 700 !important; letter-spacing: .02em;
}
#courses-grid .course-card .course-footer .cp-n { color: #fff !important; }
html[data-color="light"] #courses-grid .course-card .course-footer .cp-c { color: #475569 !important; }
html[data-color="light"] #courses-grid .course-card .course-footer .cp-n { color: #0f172a !important; }
#courses-grid .course-card .course-footer .course-price-old { font-size: .78rem; opacity: .65; text-decoration: line-through; }
#courses-grid .course-card .course-footer .discount-tag { font-size: .7rem; font-weight: 800; color: #16a34a; }

/* v1044 - the owner's iPhone screenshot: on some cards the price sat alone in the middle with "View course" under it.
   An older phone rule (.section-grid-full .course-footer, <= 768px) turns the footer into a COLUMN for the cards
   inside that grid. The footer stays one row: the price at the start, the button at the end. */
#courses-grid .course-card .course-footer { flex-direction: row !important; }
