/* ==========================================================================
   LeadMinds — course archive
   Source design: archive-courses-responsive.html  (all classes prefixed lm-a-)
   Cards come from course-cards.css (.lm-ch .lm-card …)
   ========================================================================== */

.lm-a {
  width: 100%; flex: 0 0 100%; min-width: 0;
  --a-bg: #F8FAFC; --a-dark: #071A1A; --a-ink: #0E2727; --a-muted: #4C6161;
  --a-line: rgba(14, 39, 39, .08); --a-accent: #F37458; --a-accent-ink: #B8441F;
  --a-navy: #0B2E4A; --a-gray-chip: #5A6B6B;
  font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  color: var(--a-ink);
  background: var(--a-bg);
}
.lm-a *, .lm-a *::before, .lm-a *::after { box-sizing: border-box; }
.lm-a a { color: inherit; text-decoration: none; }
.lm-a ul { list-style: none; margin: 0; padding: 0; }
.lm-a img, .lm-a svg { display: block; }

/* ---------- Hero ---------- */
.lm-a-hero { position: relative; background: var(--a-dark); overflow: hidden; }
.lm-a-hero::after { content: ""; position: absolute; inset-inline-start: -40px; bottom: -40px; width: 230px; height: 230px; background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .12), transparent 70%); opacity: .6; }
.lm-a-hero-inner { position: relative; max-width: 1240px; margin: 0 auto; padding: 132px 40px 46px; display: flex; flex-direction: column; gap: 10px; }
.lm-a-crumb { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; color: rgba(255, 255, 255, .72); }
.lm-a-crumb b { color: #fff; font-weight: 600; }
.lm-a-hero h1 { margin: 2px 0 0; padding: 0; font-size: 38px; font-weight: 700; line-height: 1.3; color: #fff; font-family: inherit; }
.lm-a-hero h1::before, .lm-a-hero h1::after { content: none; }
.lm-a-hero p.lm-a-sub { margin: 0; max-width: 52ch; font-size: 16.5px; line-height: 1.7; color: rgba(255, 255, 255, .82); }
.lm-a-search { position: relative; display: flex; align-items: center; max-width: 560px; margin-top: 6px; }
.lm-a-search svg { position: absolute; inset-inline-end: 16px; color: #5B7070; pointer-events: none; }
.lm-a-search input { width: 100%; height: 52px; padding: 0 48px; background: #fff; border: 0; border-radius: 12px; font-size: 15px; color: var(--a-ink); font-family: inherit; }
.lm-a-search input::placeholder { color: #6B8080; }

/* ---------- Category pills ---------- */
.lm-a-cats { background: #fff; border-bottom: 1px solid var(--a-line); }
.lm-a-cats-inner { max-width: 1240px; margin: 0 auto; padding: 16px 40px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.lm-a-cats-inner::-webkit-scrollbar { display: none; }
.lm-a-pill { flex: none; min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; background: var(--a-bg); border: 1px solid var(--a-line); border-radius: 999px; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; color: var(--a-ink); }
.lm-a-pill.is-active { background: var(--a-accent); border-color: var(--a-accent); font-weight: 700; }

/* ---------- Layout ---------- */
.lm-a-layout { max-width: 1240px; margin: 0 auto; padding: 0 40px; display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 32px; align-items: start; }

/* Sidebar */
.lm-a-sidebar { margin-top: 24px; background: #fff; border: 1px solid var(--a-line); border-radius: 16px; overflow: hidden; box-shadow: 0 10px 26px -20px rgba(14, 39, 39, .6); }
.lm-a-sidebar-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--a-line); }
.lm-a-sidebar-head h2 { margin: 0; padding: 0; font-size: 17px; font-weight: 700; font-family: inherit; }
.lm-a-sidebar-head h2::before, .lm-a-sidebar-head h2::after { content: none; }
.lm-a-clear { margin-inline-start: auto; font-size: 13.5px; font-weight: 600; color: var(--a-accent-ink); cursor: pointer; background: none; border: 0; font-family: inherit; }
.lm-a-ghead { min-height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; font-size: 14.5px; font-weight: 700; border-top: 1px solid var(--a-line); cursor: pointer; }
.lm-a-group:first-child .lm-a-ghead { border-top: 0; }
.lm-a-ghead svg { transform: rotate(180deg); flex: none; transition: transform .2s; }
.lm-a-group.is-closed .lm-a-ghead svg { transform: rotate(0deg); }
.lm-a-group.is-closed .lm-a-opts { display: none; }
.lm-a-opt { min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 20px; font-size: 14px; font-weight: 500; cursor: pointer; margin: 0; }
.lm-a-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.lm-a-opt .lm-a-box { width: 18px; height: 18px; flex: none; border: 1.5px solid rgba(14, 39, 39, .3); border-radius: 5px; }
.lm-a-opt input:checked + .lm-a-box { background: var(--a-accent); border-color: var(--a-accent); }
.lm-a-opt input:checked ~ span:not(.lm-a-box) { font-weight: 700; }
.lm-a-opt em { margin-inline-start: auto; font-style: normal; font-size: 12.5px; color: var(--a-muted); }
.lm-a-opts { padding-bottom: 14px; }

/* Result bar */
.lm-a-results { display: flex; align-items: center; gap: 12px; padding: 24px 0 12px; flex-wrap: wrap; }
.lm-a-results p { margin: 0; font-size: 14px; font-weight: 500; color: var(--a-muted); }
.lm-a-results strong { color: var(--a-ink); }
.lm-a-sort { margin-inline-start: auto; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; background: #fff; border: 1px solid var(--a-line); border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; color: var(--a-ink); }

/* Mobile toolbar */
.lm-a-toolbar { display: none; gap: 8px; padding: 14px 0; }
.lm-a-toolbar button { flex: 1; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: #fff; border: 1px solid var(--a-line); border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--a-ink); cursor: pointer; font-family: inherit; }
.lm-a-count { min-width: 20px; height: 20px; display: inline-grid; place-items: center; padding: 0 6px; background: var(--a-accent); border-radius: 999px; font-size: 11.5px; font-weight: 700; }

/* Active filter chips */
.lm-a-chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 0 12px; }
.lm-a-chip-x { min-height: 34px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; background: rgba(243, 116, 88, .12); border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--a-accent-ink); cursor: pointer; }

/* Grid */
.lm-a-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding-top: 14px; }

/* Pagination */
.lm-a-pagination { display: flex; align-items: center; gap: 8px; padding: 32px 0 40px; flex-wrap: wrap; }
.lm-a-page { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; background: #fff; border: 1px solid var(--a-line); border-radius: 10px; font-size: 14.5px; font-weight: 600; cursor: pointer; color: var(--a-ink); }
.lm-a-page.is-active { background: var(--a-accent); border-color: var(--a-accent); font-weight: 700; }

/* CTA banner */
.lm-a-cta-banner { background: var(--a-navy); margin-top: 48px; }
.lm-a-cta-inner { max-width: 1240px; margin: 0 auto; padding: 56px 40px 60px; display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.lm-a-cta-inner h2 { margin: 0 0 6px; padding: 0; font-size: 26px; font-weight: 700; line-height: 1.45; color: #fff; font-family: inherit; }
.lm-a-cta-inner h2::before, .lm-a-cta-inner h2::after { content: none; }
.lm-a-cta-inner p { margin: 0; font-size: 14.5px; line-height: 1.7; color: rgba(255, 255, 255, .78); }
.lm-a-cta-btn { flex: none; min-height: 48px; display: inline-flex; align-items: center; padding: 0 24px; background: var(--a-accent); border: 0; border-radius: 12px; font-size: 15px; font-weight: 700; color: var(--a-ink); cursor: pointer; font-family: inherit; }

/* No results */
.lm-a-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 60px 4px; }
.lm-a-empty .lm-a-bar { width: 56px; height: 3px; border-radius: 2px; background: #FABA3D; }
.lm-a-empty h3 { margin: 10px 0 0; padding: 0; font-size: 19px; font-weight: 700; font-family: inherit; }
.lm-a-empty p { margin: 0 0 10px; max-width: 34ch; font-size: 14.5px; line-height: 1.75; color: var(--a-muted); }
.lm-a-empty .lm-a-clear-btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; padding: 0 24px; background: var(--a-accent); border: 0; border-radius: 12px; font-size: 15px; font-weight: 700; color: var(--a-ink); cursor: pointer; font-family: inherit; }
.lm-a-empty .lm-a-secondary { margin-top: 4px; font-size: 14.5px; font-weight: 700; color: var(--a-navy); }

/* Bottom sheets (mobile filter & sort) */
.lm-a-overlay { display: none; position: fixed; inset: 0; background: rgba(7, 26, 26, .5); z-index: 40; }
.lm-a-overlay.is-open { display: block; }
.lm-a-sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 82%; background: #fff; border-radius: 18px 18px 0 0; box-shadow: 0 -18px 48px rgba(7, 26, 26, .24); display: flex; flex-direction: column; overflow: hidden; z-index: 41; transform: translateY(100%); transition: transform .25s ease; }
.lm-a-sheet.is-open { transform: translateY(0); }
.lm-a-sheet-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--a-line); }
.lm-a-sheet-head h2 { margin: 0; padding: 0; font-size: 17px; font-weight: 700; font-family: inherit; }
.lm-a-close { width: 44px; height: 44px; display: grid; place-items: center; background: var(--a-bg); border: 0; border-radius: 10px; cursor: pointer; margin-inline-start: auto; }
.lm-a-sheet-body { flex: 1; overflow-y: auto; }
.lm-a-sheet-foot { display: flex; gap: 10px; padding: 14px 20px 18px; border-top: 1px solid var(--a-line); }
.lm-a-btn-outline { min-height: 48px; display: inline-flex; align-items: center; padding: 0 20px; border: 1.5px solid var(--a-navy); border-radius: 12px; font-size: 15px; font-weight: 700; color: var(--a-navy); background: #fff; cursor: pointer; font-family: inherit; }
.lm-a-btn-solid { flex: 1; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; background: var(--a-accent); border: 0; border-radius: 12px; font-size: 15px; font-weight: 700; color: var(--a-ink); cursor: pointer; font-family: inherit; }
.lm-a-radio { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid rgba(14, 39, 39, .3); flex: none; }
.lm-a-opt input[type="radio"]:checked + .lm-a-radio { border: 5px solid var(--a-accent); }

/* Sticky mobile action bar */
.lm-a-actionbar { display: none; position: sticky; bottom: var(--lm-stick-bottom, 0px); gap: 10px; padding: 10px 16px; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--a-line); z-index: 20; }
.lm-a-actionbar button { flex: 1; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: #fff; border: 1.5px solid var(--a-navy); border-radius: 12px; font-size: 15px; font-weight: 700; color: var(--a-navy); cursor: pointer; font-family: inherit; }

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
  .lm-a-layout { grid-template-columns: 1fr; }
  .lm-a-sidebar { display: none; }
  .lm-a-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lm-a-toolbar { display: flex; }
  .lm-a-hero-inner, .lm-a-cats-inner, .lm-a-layout { padding-inline: 32px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .lm-a-hero-inner { padding: 112px 20px 30px; }
  .lm-a-hero h1 { font-size: 26px; }
  .lm-a-hero p.lm-a-sub { display: none; }
  .lm-a-cats-inner, .lm-a-layout { padding-inline: 20px; }
  .lm-a-grid { grid-template-columns: 1fr; gap: 18px; }
  .lm-a-results .lm-a-sort { display: none; }
  .lm-a-pagination { display: none; }
  .lm-a-actionbar { display: flex; }
  .lm-a-cta-inner { padding: 40px 20px 44px; flex-direction: column; align-items: flex-start; }
  .lm-a-cta-btn { width: 100%; justify-content: center; }
}

/* ---------- Dark mode ---------- */
[data-theme="dark"] .lm-a {
  width: 100%; flex: 0 0 100%; min-width: 0; background: #0b1220; color: #e2e8f0; }
[data-theme="dark"] .lm-a-cats,
[data-theme="dark"] .lm-a-sidebar,
[data-theme="dark"] .lm-a-sheet { background: #111a2e; border-color: #1f2a44; }
[data-theme="dark"] .lm-a-pill,
[data-theme="dark"] .lm-a-sort,
[data-theme="dark"] .lm-a-toolbar button,
[data-theme="dark"] .lm-a-page { background: #0b1220; border-color: #1f2a44; color: #e2e8f0; }
[data-theme="dark"] .lm-a-pill.is-active,
[data-theme="dark"] .lm-a-page.is-active { background: var(--a-accent); color: #0E2727; }
[data-theme="dark"] .lm-a-results p,
[data-theme="dark"] .lm-a-opt em { color: #94a3b8; }
[data-theme="dark"] .lm-a-search input { background: #0b1220; color: #e2e8f0; }
