/* Himam «تصفّح الدورات» (himam-browse.php, himam-browse.js) — /courses/. The platform's look (himam.css, Cairo) and
   colours: navy #24255C, ink #1E1F4D, pink #F06CAB, sky #32B8E4. Right to left first: logical properties throughout.
   Hand-written; loaded in this page's head only. */
.hb { --hb-navy: #24255c; --hb-ink: #1e1f4d; --hb-muted: #626584; --hb-faint: #9799b6; --hb-line: rgb(36 37 92 / 0.14); --hb-soft: #f5f6fa; --hb-sky-soft: #e6f6fc; --hb-sky-deep: #1a86ad; --hb-pink: #f06cab; --hb-pink-deep: #c2397a;
  display: flex; flex-direction: column; gap: 0.75rem; }
.hb [hidden] { display: none !important; }
.hb-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
html.hb-locked { overflow: hidden; }
.hb button:focus-visible, .hb a:focus-visible, .hb input:focus-visible { outline: 2px solid var(--hb-pink); outline-offset: 2px; }

/* ── the toolbar: one row on a computer, kept under the site header while scrolling ── */
.hb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding-block: 0.625rem; background: #fff; }
@media (min-width: 48rem) {
  .hb-bar { position: sticky; top: 4.5rem; z-index: 30; margin-inline: -1.5rem; padding-inline: 1.5rem; border-bottom: 1px solid var(--hb-line); }
}
@media (min-width: 64rem) { .hb-bar { margin-inline: -2.5rem; padding-inline: 2.5rem; } }
@media (min-width: 96rem) { .hb-bar { margin-inline: -3.5rem; padding-inline: 3.5rem; } }

.hb-tabs { display: inline-flex; flex: none; gap: 0.125rem; padding: 0.1875rem; border-radius: 999px; background: var(--hb-soft); }
.hb-tab { display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem; min-height: 2.25rem; padding: 0 0.875rem; border: 0; border-radius: 999px; background: none; font: inherit; font-size: 0.875rem; font-weight: 700; color: var(--hb-muted); white-space: nowrap; cursor: pointer; transition: background-color 0.15s, color 0.15s; }
.hb-tab:hover { color: var(--hb-navy); }
.hb-tab[aria-selected="true"] { background: var(--hb-navy); color: #fff; box-shadow: 0 2px 6px -2px rgb(30 31 77 / 0.45); }
.hb-tab-n { font-size: 0.75rem; font-weight: 700; opacity: 0.7; font-variant-numeric: tabular-nums; }

.hb-search { position: relative; flex: 0 1 18.5rem; min-width: 11rem; transition: flex-basis 0.2s ease; }
.hb-search:focus-within { flex-basis: 22rem; }
.hb-search svg { position: absolute; top: 50%; inset-inline-start: 0.875rem; color: var(--hb-muted); transform: translateY(-50%); pointer-events: none; }
.hb-search input { width: 100%; min-height: 2.5rem; padding-block: 0; padding-inline: 2.5rem 0.875rem; border: 1px solid var(--hb-line); border-radius: 999px; background: #fff; font: inherit; font-size: 0.9375rem; color: var(--hb-ink); outline: none; -webkit-appearance: none; appearance: none; }
.hb-search input:focus { border-color: var(--hb-navy); box-shadow: 0 0 0 3px rgb(36 37 92 / 0.12); }
.hb-search label { position: absolute; top: 50%; inset-inline-start: 2.5rem; max-width: calc(100% - 3.5rem); overflow: hidden; font-size: 0.9375rem; color: var(--hb-faint); white-space: nowrap; text-overflow: ellipsis; transform: translateY(-50%); pointer-events: none; }
.hb-search input:focus + label, .hb-search input:not(:placeholder-shown) + label { display: none; }

.hb-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; }
.hb-chip-wrap { position: relative; }
.hb-chip { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 2.5rem; padding: 0 0.875rem; border: 1px solid var(--hb-line); border-radius: 999px; background: #fff; font: inherit; font-size: 0.875rem; font-weight: 700; color: var(--hb-navy); white-space: nowrap; cursor: pointer; transition: border-color 0.15s, background-color 0.15s, color 0.15s; }
.hb-chip:hover { border-color: var(--hb-navy); }
.hb-chip.is-on { border-color: var(--hb-navy); background: var(--hb-navy); color: #fff; }
.hb-chip svg { transition: transform 0.15s; }
.hb-chip[aria-expanded="true"] svg { transform: rotate(180deg); }
.hb-pop { position: absolute; top: calc(100% + 0.375rem); inset-inline-start: 0; z-index: 40; width: max-content; min-width: 14rem; max-width: min(22rem, 90vw); max-height: min(24rem, 70vh); overflow-y: auto; padding: 0.5rem; border: 1px solid var(--hb-line); border-radius: 1rem; background: #fff; box-shadow: 0 18px 40px -16px rgb(30 31 77 / 0.38); }
.hb-pop-end { inset-inline-start: auto; inset-inline-end: 0; }
.hb-set { min-width: 0; margin: 0; padding: 0; border: 0; }
.hb-set + .hb-set { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--hb-line); }
.hb-set legend { padding: 0.25rem 0.5rem; font-size: 0.75rem; font-weight: 800; color: var(--hb-muted); }
.hb-opt { display: flex; align-items: center; gap: 0.625rem; min-height: 2.5rem; padding: 0 0.5rem; border-radius: 0.625rem; font-size: 0.9375rem; color: var(--hb-ink); cursor: pointer; }
.hb-opt:hover { background: var(--hb-soft); }
.hb-opt input { flex: none; width: 1.125rem; height: 1.125rem; margin: 0; accent-color: var(--hb-navy); }
.hb-opt-l { flex: 1; min-width: 0; }
.hb-opt-n { flex: none; font-size: 0.75rem; color: var(--hb-muted); font-variant-numeric: tabular-nums; }
.hb-opt.is-off { opacity: 0.45; cursor: default; }
.hb-opt.is-off:hover { background: none; }
.hb-pop-foot { display: flex; justify-content: flex-end; margin-top: 0.25rem; padding: 0.5rem 0.5rem 0.125rem; border-top: 1px solid var(--hb-line); }
.hb-link { padding: 0.25rem; border: 0; background: none; font: inherit; font-size: 0.875rem; font-weight: 700; color: var(--hb-pink-deep); cursor: pointer; }
.hb-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.hb-end { display: flex; align-items: center; gap: 0.375rem; margin-inline-start: auto; }
.hb-views { display: inline-flex; padding: 0.1875rem; border: 1px solid var(--hb-line); border-radius: 999px; }
.hb-view { display: grid; place-items: center; width: 2.125rem; height: 2.125rem; border: 0; border-radius: 999px; background: none; color: var(--hb-muted); cursor: pointer; }
.hb-view:hover { color: var(--hb-navy); }
.hb-view[aria-pressed="true"] { background: var(--hb-navy); color: #fff; }
.hb-filters { display: none; align-items: center; gap: 0.375rem; min-height: 2.5rem; padding: 0 0.875rem; border: 1px solid var(--hb-line); border-radius: 999px; background: #fff; font: inherit; font-size: 0.875rem; font-weight: 700; color: var(--hb-navy); cursor: pointer; }
.hb-badge-n { display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; padding: 0 0.375rem; border-radius: 999px; background: var(--hb-pink); font-size: 0.75rem; font-weight: 800; color: var(--hb-navy); }

/* phones: the tabs on their own row, then the search, «التصفية» (a bottom sheet) and the view */
@media (max-width: 47.99rem) {
  .hb-tabs { width: 100%; }
  .hb-tab { flex: 1; padding-inline: 0.5rem; }
  .hb-search { flex: 1 1 auto; min-width: 0; }
  .hb-search:focus-within { flex-basis: auto; }
  .hb-chips, .hb-end > .hb-chip-wrap { display: none; }
  .hb-filters { display: inline-flex; order: 3; }
  .hb-end { order: 4; margin-inline-start: 0; }
}

/* ── the count and the chosen filters ── */
.hb-status { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; min-height: 2rem; }
.hb-count { margin: 0; font-size: 0.875rem; font-weight: 800; color: var(--hb-navy); }
.hb-active { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; }
.hb-tag { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 2rem; padding: 0 0.75rem; border: 0; border-radius: 999px; background: var(--hb-sky-soft); font: inherit; font-size: 0.8125rem; font-weight: 700; color: var(--hb-navy); cursor: pointer; }
.hb-tag span { font-size: 1.0625rem; line-height: 1; opacity: 0.6; }
.hb-tag:hover span { opacity: 1; }

/* ── the courses: 4 a row on a large screen, 3, then 2 (phones too) ── */
.hb-results { display: flex; flex-direction: column; gap: 1rem; }
.hb-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
@media (min-width: 22.5rem) { .hb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 48rem) { .hb-grid { gap: 1rem; } }
@media (min-width: 64rem) { .hb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 80rem) { .hb-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.hb-js .hb-card[data-later] { display: none; }
.hb-card { min-width: 0; }
.hb-in { position: relative; display: flex; flex-direction: column; height: 100%; overflow: hidden; border: 1px solid var(--hb-line); border-radius: 1rem; background: #fff; box-shadow: 0 4px 6px -1px rgb(30 31 77 / 0.08), 0 2px 4px -2px rgb(30 31 77 / 0.06); transition: box-shadow 0.2s, transform 0.2s; }
.hb-in:hover { box-shadow: 0 14px 26px -14px rgb(30 31 77 / 0.32); transform: translateY(-2px); }
.hb-in:focus-within { outline: 2px solid var(--hb-navy); outline-offset: 2px; }
.hb-thumb { position: relative; display: block; flex: none; aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(90deg, #eef0f8 25%, #f8f9fc 37%, #eef0f8 63%); background-size: 400% 100%; animation: hb-shimmer 1.4s ease infinite; }
.hb-thumb.is-white { background-color: #fff; }
.hb-badge { position: absolute; bottom: 0.5rem; inset-inline-start: 0.5rem; max-width: calc(100% - 1rem); overflow: hidden; padding: 0.1875rem 0.5rem; border-radius: 999px; background: rgb(36 37 92 / 0.86); font-size: 0.6875rem; font-weight: 700; line-height: 1.6; color: #fff; white-space: nowrap; text-overflow: ellipsis; }
.hb-body { display: flex; flex: 1; flex-direction: column; gap: 0.25rem; min-width: 0; padding: 0.625rem 0.75rem 0.75rem; }
.hb-title { display: -webkit-box; overflow: hidden; margin: 0; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 0.9375rem; font-weight: 800; line-height: 1.55; color: var(--hb-navy); }
.hb-title a { color: inherit; text-decoration: none; outline: none; }
.hb-title a::after { content: ""; position: absolute; inset: 0; }
.hb-teacher { margin: 0; overflow: hidden; font-size: 0.8125rem; color: var(--hb-muted); white-space: nowrap; text-overflow: ellipsis; }
.hb-meta { display: flex; flex-wrap: wrap; gap: 0.125rem 0.5rem; margin: 0.125rem 0 0; font-size: 0.75rem; color: var(--hb-muted); }
.hb-meta span + span::before { content: "·"; margin-inline-end: 0.5rem; }
.hb-meta:empty { display: none; }
.hb-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: auto; padding-top: 0.5rem; }
.hb-price { font-size: 1rem; font-weight: 800; color: var(--hb-navy); }
.hb-price.is-contact { font-size: 0.8125rem; font-weight: 700; color: var(--hb-muted); }
.hb-add { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; min-height: 2.25rem; padding: 0 0.75rem; border: 1px solid rgb(36 37 92 / 0.3); border-radius: 0.625rem; font-size: 0.8125rem; font-weight: 800; color: var(--hb-navy); text-decoration: none; white-space: nowrap; transition: background-color 0.15s, color 0.15s, border-color 0.15s; }
.hb-add:hover { border-color: var(--hb-navy); background: var(--hb-navy); color: #fff; }
@media (max-width: 29.99rem) {
  .hb-body { padding: 0.5rem 0.625rem 0.625rem; }
  .hb-title { font-size: 0.875rem; }
  .hb-add { flex: 1 1 100%; }
}

/* the list: one compact row a course, to scan many */
.hb-grid[data-view="list"] { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
.hb-grid[data-view="list"] .hb-in { flex-direction: row; align-items: stretch; }
.hb-grid[data-view="list"] .hb-in:hover { transform: none; }
.hb-grid[data-view="list"] .hb-thumb { width: 7.5rem; aspect-ratio: auto; min-height: 4.25rem; }
.hb-grid[data-view="list"] .hb-badge { display: none; }
.hb-grid[data-view="list"] .hb-body { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.125rem 1rem; padding: 0.5rem 0.875rem; }
.hb-grid[data-view="list"] .hb-title { flex: 1 1 16rem; -webkit-line-clamp: 1; }
.hb-grid[data-view="list"] .hb-teacher { flex: 0 1 11rem; }
.hb-grid[data-view="list"] .hb-meta { flex: 0 1 15rem; margin: 0; }
.hb-grid[data-view="list"] .hb-foot { flex: 0 0 auto; margin-top: 0; padding-top: 0; }
@media (max-width: 47.99rem) {
  .hb-grid[data-view="list"] .hb-thumb { width: 5.5rem; }
  .hb-grid[data-view="list"] .hb-body { flex-direction: column; align-items: stretch; gap: 0.125rem; }
  .hb-grid[data-view="list"] .hb-title, .hb-grid[data-view="list"] .hb-teacher, .hb-grid[data-view="list"] .hb-meta { flex: none; }
  .hb-grid[data-view="list"] .hb-add { flex: none; }
}

/* ── loading: grey cards until the script has applied a shared choice ── */
.hb-skel { display: none; }
.hb-pending .hb-grid[data-hb-grid], .hb-pending .hb-more { display: none !important; }
.hb-pending .hb-skel { display: grid; }
.hb-skel li { display: flex; flex-direction: column; gap: 0.5rem; overflow: hidden; padding-bottom: 0.875rem; border: 1px solid var(--hb-line); border-radius: 1rem; }
.hb-sk { display: block; height: 0.875rem; margin-inline: 0.75rem; border-radius: 0.375rem; background: linear-gradient(90deg, #eef0f8 25%, #f8f9fc 37%, #eef0f8 63%); background-size: 400% 100%; animation: hb-shimmer 1.4s ease infinite; }
.hb-sk-thumb { height: auto; margin: 0 0 0.25rem; border-radius: 0; aspect-ratio: 16 / 9; }
.hb-sk.is-short { width: 45%; }
@keyframes hb-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ── nothing matches, and more ── */
.hb-empty { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 3rem 1rem; border: 1px dashed var(--hb-line); border-radius: 1rem; text-align: center; }
.hb-empty-icon { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 1rem; background: var(--hb-sky-soft); color: var(--hb-sky-deep); }
.hb-empty-title { margin: 0.25rem 0 0; font-size: 1.0625rem; font-weight: 800; color: var(--hb-navy); }
.hb-empty-text { margin: 0 0 0.5rem; font-size: 0.875rem; color: var(--hb-muted); }
.hb-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0 1.25rem; border: 0; border-radius: 999px; background: var(--hb-navy); font: inherit; font-size: 0.9375rem; font-weight: 800; color: #fff; cursor: pointer; }
.hb-btn:hover { background: var(--hb-ink); }
.hb-more { align-self: center; min-height: 2.75rem; margin-top: 0.25rem; padding: 0 1.5rem; border: 1px solid var(--hb-line); border-radius: 999px; background: #fff; font: inherit; font-size: 0.9375rem; font-weight: 800; color: var(--hb-navy); cursor: pointer; }
.hb-more:hover { border-color: var(--hb-navy); }

/* ── phones: the filters and the order in a bottom sheet ── */
.hb-sheet { position: fixed; inset: 0; z-index: 100; }
.hb-sheet-back { position: absolute; inset: 0; background: rgb(30 31 77 / 0.5); }
.hb-sheet-box { position: absolute; inset-inline: 0; bottom: 0; display: flex; flex-direction: column; max-height: 85dvh; padding-bottom: env(safe-area-inset-bottom, 0px); border-radius: 1.25rem 1.25rem 0 0; background: #fff; box-shadow: 0 -10px 40px rgb(30 31 77 / 0.25); animation: hb-up 0.22s ease; }
.hb-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 1rem 1.25rem 0.75rem; border-bottom: 1px solid var(--hb-line); }
.hb-sheet-head h2 { margin: 0; font-size: 1.0625rem; font-weight: 800; color: var(--hb-navy); }
.hb-x { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border: 0; border-radius: 50%; background: var(--hb-soft); font-size: 1.375rem; line-height: 1; color: var(--hb-navy); cursor: pointer; }
.hb-sheet-body { flex: 1; overflow-y: auto; padding: 0.75rem 1rem; overscroll-behavior: contain; }
.hb-sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 1.25rem; border-top: 1px solid var(--hb-line); }
.hb-sheet-foot .hb-btn { flex: 1; }
@keyframes hb-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  .hb-thumb, .hb-sk { animation: none; }
  .hb-in, .hb-search, .hb-chip svg { transition: none; }
  .hb-in:hover { transform: none; }
  .hb-sheet-box { animation: none; }
}


/* v105 (2026-11-12, the owner: «في صفحة الدورات يظهر نص مع رقم دورة احذفه لاستغلال المساحة — حسّن هذه الصفحات على
   الموبايل: بطاقة الدورة تظهر طويلة والفلترة غير جميلة — احذف المساحة الصغيرة فوق بار الفلترة») */
.hb { --hb-cart: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Ccircle cx=%279%27 cy=%2720%27 r=%271.4%27/%3E%3Ccircle cx=%2718%27 cy=%2720%27 r=%271.4%27/%3E%3Cpath d=%27M2.5 3.5h2.6l2.3 11a2 2 0 0 0 2 1.6h7.8a2 2 0 0 0 2-1.5l1.6-7.1H6.1%27/%3E%3C/svg%3E"); --hb-check: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272.4%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27m5 12.5 4.5 4.5L19 7.5%27/%3E%3C/svg%3E"); margin-top: -1.5rem; }
/* the count: for screen readers only (it still says how many after each choice); the row shows the chosen filters only */
.hb-count { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hb-status { min-height: 0; }
.hb-status:not(:has(.hb-tag)) { margin-top: -0.75rem; }

/* phones: the toolbar from edge to edge in two rows (the sections; the search and «التصفية», the order being in its sheet);
   shorter cards: the details on one line, the price and a cart button side by side */
@media (max-width: 47.99rem) {
  .hb-bar { margin-inline: -1rem; padding: 0.625rem 1rem; border-bottom: 1px solid var(--hb-line); }
  .hb-end { display: none; }
  .hb-body { gap: 0.125rem; padding: 0.5rem 0.625rem 0.625rem; }
  .hb-title { font-size: 0.875rem; line-height: 1.5; }
  .hb-meta { flex-wrap: nowrap; overflow: hidden; white-space: nowrap; }
  .hb-meta span:nth-child(n+3) { display: none; }
  .hb-foot { flex-wrap: nowrap; gap: 0.375rem; padding-top: 0.375rem; }
  .hb-price { font-size: 0.9375rem; }
  .hb-add { flex: none; width: 2.25rem; min-height: 2.25rem; padding: 0; font-size: 0; }
  .hb-add::before { content: ""; width: 1.125rem; height: 1.125rem; background: currentColor; -webkit-mask: var(--hb-cart) center / contain no-repeat; mask: var(--hb-cart) center / contain no-repeat; }
  .hb-add[data-added], .hb-add[aria-busy="true"] { border-color: var(--hb-navy); background: var(--hb-navy); color: #fff; }
  .hb-add[data-added]::before, .hb-add[aria-busy="true"]::before { -webkit-mask-image: var(--hb-check); mask-image: var(--hb-check); }
  .hb-add[data-hm-open] { width: auto; padding: 0 0.625rem; font-size: 0.75rem; }
  .hb-add[data-hm-open]::before { display: none; }
}

@media (min-width: 40rem) and (max-width: 47.99rem) {
  .hb-bar { margin-inline: -1.5rem; padding-inline: 1.5rem; }
}

/* v168 (the owner, 2026-11-18: «المجال باهت · السعر جدا صغير»): the price larger, white at night.
   v168b («اسم المجال ضعه في البطاقة ليس في الصورة»): the field is a line over the title, in the brand's blue */
.hb-field { margin: 0; overflow: hidden; font-size: 0.75rem; font-weight: 800; line-height: 1.6; color: #146C8C; white-space: nowrap; text-overflow: ellipsis; }
html.hm-night .hb-body .hb-field { color: #8FD6F0; }
.hb-grid[data-view="list"] .hb-field { flex: 0 1 10rem; }
.hb-foot .hb-price { font-size: 1.25rem; line-height: 1.3; }
.hb-foot .hb-price.is-contact { font-size: 0.8125rem; }
html.hm-night .hb-foot .hb-price { color: #fff; }
html.hm-night .hb-foot .hb-price.is-contact { color: #afb1c0; }
@media (max-width: 47.99rem) {
  .hb-foot .hb-price { font-size: 1.125rem; }
  .hb-foot .hb-price.is-contact { font-size: 0.75rem; }
}
