/*
 * Sahamin LMS Theme — main stylesheet (mobile first).
 *
 * Brand colours (--c-primary, --c-accent, --c-secondary and their derived shades) are printed
 * inline from the Customizer: Appearance → Customize → Sahamin Theme Options → Brand Colours.
 * The values below are fallbacks only.
 *
 * Breakpoints: 600px (large phone / small tablet), 960px (desktop), 1180px (wide).
 */

/* ---------- Fonts (self-hosted, Latin subset — covers Somali and English) ---------- */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/poppins-400.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/poppins-600.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/poppins-700.woff2') format('woff2'); }

/* ---------- Tokens ---------- */
:root {
  --c-primary: #114181;
  --c-primary-rgb: 17, 65, 129;
  --c-primary-dark: #0d3161;
  --c-primary-soft: #eef2f8;
  --c-on-primary: #ffffff;
  --c-accent: #eaa249;
  --c-accent-rgb: 234, 162, 73;
  --c-accent-dark: #c78a3e;
  --c-accent-soft: #fcf1e4;
  --c-accent-text: #694921;
  --c-on-accent: #10233f;
  --c-secondary: #26b1d4;
  --c-secondary-soft: #e0f4f9;
  --c-secondary-text: #13596a;

  --c-text: #10233f;
  --c-muted: #55657a;
  --c-border: #e2e7ef;
  --c-bg: #ffffff;
  --c-bg-alt: #f6f8fb;
  --c-success: #0b7a4b;
  --c-success-soft: #e3f4ec;

  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 24px rgba(var(--c-primary-rgb), 0.08);
  --shadow-hover: 0 16px 32px rgba(var(--c-primary-rgb), 0.16);
  --container: 1180px;
  --gutter: 16px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg);
  text-rendering: optimizeSpeed;
}
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 700; color: var(--c-text); }
h1, h2, h3, h4, p, a, li, dt, dd, span { overflow-wrap: break-word; hyphens: auto; }
/* Very long single words (common in Somali compounds) may break only when they cannot fit;
   "anywhere" also lets flex/grid items shrink, which prevents sideways scrolling. */
h1, h2, h3, .cat-name, .chip, .course-title, .breadcrumbs li, .category-band h1, .partner-item, .stat-card dt { overflow-wrap: anywhere; }
.chip > span, .breadcrumbs li > * { min-width: 0; }
p { margin: 0 0 1em; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg, video { max-width: 100%; height: auto; display: block; }
ul[role="list"] { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--c-secondary); outline-offset: 2px; }

.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.container-narrow { max-width: calc(760px + 2 * var(--gutter)); }
.section { padding: 48px 0; }
.site-main > .section:nth-of-type(even) { background: var(--c-bg-alt); }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  clip: auto; width: auto; height: auto; margin: 0; z-index: 10000;
  top: 8px; left: 8px; padding: 12px 18px; background: #fff; color: var(--c-primary);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
}

/* Makes a whole card clickable through its main link. */
.stretched-link::after { content: ''; position: absolute; inset: 0; z-index: 1; }

/* ---------- Section heading ---------- */
.section-heading { text-align: center; max-width: 720px; margin: 0 auto 28px; }
.section-heading h2 { font-size: clamp(1.5rem, 1.1rem + 2vw, 2.25rem); margin-bottom: 8px; }
.section-subtitle { color: var(--c-muted); margin: 0; }
.section-cta { text-align: center; margin-top: 28px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border: 2px solid transparent; border-radius: var(--radius-sm);
  font: 600 1rem/1.3 var(--font); text-align: center; text-decoration: none; cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--c-primary); color: var(--c-on-primary); }
.btn-primary:hover { background: var(--c-primary-dark); color: var(--c-on-primary); }
.btn-accent { background: var(--c-accent); color: var(--c-on-accent); }
.btn-accent:hover { background: var(--c-accent-dark); color: var(--c-on-accent); }
.btn-ghost { background: transparent; color: var(--c-on-primary); border-color: rgba(255, 255, 255, .6); }
.btn-ghost:hover { background: rgba(255, 255, 255, .12); color: var(--c-on-primary); }
.btn-ghost-dark { background: transparent; color: var(--c-primary); border-color: var(--c-primary); }
.btn-ghost-dark:hover { background: var(--c-primary-soft); }
.btn-small { min-height: 40px; padding: 8px 16px; font-size: .95rem; }
.btn-large { min-height: 52px; padding: 12px 26px; font-size: 1.05rem; }

/* ---------- Badges & cards ---------- */
.badge {
  display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; letter-spacing: .02em; line-height: 1.4;
}
.badge-free { background: var(--c-success-soft); color: var(--c-success); }
.badge-paid { background: var(--c-accent-soft); color: var(--c-accent-text); }
.card {
  position: relative; background: #fff; border: 1px solid var(--c-border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1000; background: #fff;
  border-bottom: 1px solid var(--c-border);
}
.admin-bar .site-header { top: 46px; }
.header-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; min-height: 64px; }
.site-branding { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; color: var(--c-text); text-decoration: none; }
.site-branding:hover { text-decoration: none; }
.site-logo { width: 44px; height: 44px; object-fit: contain; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-title { font-weight: 700; font-size: 1.1rem; line-height: 1.15; color: var(--c-primary); letter-spacing: .02em; }
.brand-tagline { font-size: .75rem; color: var(--c-muted); line-height: 1.25; }

.menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--radius-sm);
  background: var(--c-primary-soft); color: var(--c-primary); cursor: pointer;
}
.menu-toggle-bars, .menu-toggle-bars::before, .menu-toggle-bars::after {
  display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.menu-toggle-bars { position: relative; }
.menu-toggle-bars::before, .menu-toggle-bars::after { content: ''; position: absolute; left: 0; }
.menu-toggle-bars::before { top: -6px; }
.menu-toggle-bars::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

.main-navigation { display: none; width: 100%; padding: 8px 0 16px; }
.main-navigation.is-open { display: block; }
.main-navigation ul { list-style: none; margin: 0; padding: 0; }
.main-navigation li { border-bottom: 1px solid var(--c-border); }
.main-navigation ul a { display: block; padding: 12px 4px; color: var(--c-text); font-weight: 600; }
.main-navigation .current-menu-item > a, .main-navigation .current_page_item > a { color: var(--c-primary); }
.main-navigation .sub-menu { padding-left: 16px; }
.main-navigation .sub-menu li { border-bottom: 0; }
.main-navigation .sub-menu a { font-weight: 400; padding: 8px 4px; }
.header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-top: 16px; }
.header-actions .btn { flex: 1 1 auto; }
.header-link { color: var(--c-text); font-weight: 600; padding: 8px 4px; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--c-primary-dark) 0%, var(--c-primary) 100%);
  color: var(--c-on-primary);
  padding: 36px 0 0;
  overflow: hidden;
}
.hero-inner { display: grid; gap: 28px; }
.hero-text { min-width: 0; }
.hero-title { color: var(--c-on-primary); font-size: clamp(1.75rem, 1.2rem + 3vw, 3.1rem); line-height: 1.15; margin-bottom: 14px; }
.hero-subtitle { font-size: clamp(1rem, .95rem + .4vw, 1.25rem); opacity: .9; margin-bottom: 24px; max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-actions .btn { flex: 1 1 200px; }
.hero-media { margin: 0 calc(-1 * var(--gutter)); }
.hero-image { width: 100%; aspect-ratio: 1000 / 633; object-fit: cover; }

/* Legacy banner layout */
.hero--banner { padding: 0; background: var(--c-primary); }
.hero-banner-text { padding: 28px 0 24px; }
.hero-banner-text .hero-title { margin-bottom: 8px; }
.hero-banner-text .hero-subtitle { margin-bottom: 0; }
.hero-banner { position: relative; line-height: 0; }
.hero-banner-image { width: 100%; }
.hero-banner-hotspot {
  position: absolute; display: block; z-index: 2; border-radius: 8px;
  left: var(--hero-cta-mobile-left, 2.85%); top: var(--hero-cta-mobile-top, 68.85%);
  width: var(--hero-cta-mobile-width, 26%); height: var(--hero-cta-mobile-height, 15%);
}
.hero-banner-hotspot:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* ---------- Hero course slider ---------- */
.hero--slider { position: relative; padding: 0; background: var(--c-primary-dark); color: var(--c-on-primary); }
.hs-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: 100%;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.hs-track::-webkit-scrollbar { display: none; }
.hs-track:focus-visible { outline: 3px solid var(--c-accent); outline-offset: -3px; }
.hs-slide { position: relative; display: flex; flex-direction: column; min-width: 0; scroll-snap-align: start; }
.hs-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--c-primary); }
.hs-media img { width: 100%; height: 100%; object-fit: cover; }
.hs-placeholder {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
  background:
    radial-gradient(circle at 80% 20%, rgba(var(--c-accent-rgb), .5) 0, rgba(var(--c-accent-rgb), 0) 45%),
    linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dark) 55%, var(--c-secondary) 140%);
}
.hs-placeholder .placeholder-logo { width: 88px; height: 88px; padding: 10px; }
.hs-overlay { flex: 1; padding: 20px 0 76px; background: var(--c-primary-dark); }
.hs-content { max-width: 600px; min-width: 0; }
.hs-eyebrow { margin: 0 0 6px; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--c-accent); }
.hs-title { margin: 0 0 12px; font-size: clamp(1.4rem, 1rem + 2.4vw, 2.6rem); line-height: 1.15; overflow-wrap: anywhere; }
.hs-title a {
  color: var(--c-on-primary);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hs-title a:hover { text-decoration: underline; text-underline-offset: 4px; }
.hs-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 12px; padding: 0; list-style: none; font-size: .9rem; opacity: .92; }
.hs-level { padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, .16); font-weight: 600; }
.hs-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 18px; font-size: 1.15rem; font-weight: 700; }
.hs-price del { opacity: .7; font-weight: 400; font-size: .95rem; }
.hs-price ins { text-decoration: none; color: var(--c-accent); }
.hs-price .price-free { color: #7ee2b8; }
.hs-price .price-enrolled { color: var(--c-on-primary); }
.hs-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hs-actions .btn { flex: 1 1 180px; }
.hs-controls {
  position: absolute; left: 0; right: 0; bottom: 16px; z-index: 3;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.hs-controls[hidden] { display: none; }
.hs-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .5);
  background: rgba(0, 0, 0, .25); color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.hs-btn:hover { background: rgba(0, 0, 0, .45); }
.hs-pause { font-size: .8rem; }
.hs-dots { display: flex; gap: 2px; }
.hs-dot {
  /* 32px tap target around a small visible dot */
  width: 32px; height: 32px; padding: 0; border: 0; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.hs-dot::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .45); transition: width .2s ease, background-color .2s ease; }
.hs-dot[aria-current="true"]::before { width: 24px; border-radius: 6px; background: var(--c-accent); }

/* ---------- Category slider ---------- */
.cat-slider { position: relative; }
.cat-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: 72%; gap: 12px;
  margin: 0; padding: 4px 2px 10px; list-style: none;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.cat-track:focus-visible { outline: 3px solid var(--c-secondary); outline-offset: 4px; border-radius: var(--radius); }
.cat-slider.is-static .cat-track { justify-content: center; }
.cat-slide { scroll-snap-align: start; min-width: 0; display: flex; }
.cat-card {
  display: flex; flex-direction: column; width: 100%; overflow: hidden;
  background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius);
  color: var(--c-text); text-decoration: none; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.cat-card:hover { text-decoration: none; border-color: var(--c-secondary); box-shadow: var(--shadow); transform: translateY(-2px); }
.cat-media { display: block; aspect-ratio: 16 / 10; background: var(--c-secondary-soft); overflow: hidden; }
.cat-media img { width: 100%; height: 100%; object-fit: cover; }
.cat-media--empty {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-secondary) 120%);
  color: var(--c-on-primary); font-size: 2.4rem; font-weight: 700;
}
.cat-body { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 14px; min-width: 0; }
.cat-name {
  font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.cat-count { font-size: .85rem; color: var(--c-muted); }
.slider-controls { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
.slider-controls[hidden] { display: none; }
.slider-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--c-border); background: #fff;
  color: var(--c-primary); font-size: 1.6rem; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.slider-btn:hover:not(:disabled) { border-color: var(--c-primary); background: var(--c-primary-soft); }
.slider-btn:disabled { opacity: .35; cursor: default; }
.admin-notice { margin: 16px 0; padding: 12px 16px; border-left: 4px solid var(--c-accent); background: var(--c-accent-soft); border-radius: var(--radius-sm); }

/* ---------- Course card (one design everywhere) ---------- */
.course-grid { display: grid; grid-template-columns: 1fr; gap: 18px; list-style: none; margin: 0; padding: 0; }
.course-grid > li { display: flex; }
.course-card {
  position: relative; display: flex; flex-direction: column; width: 100%; height: 100%;
  background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .25s ease, box-shadow .25s ease;
}
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.course-card:focus-within { outline: 3px solid var(--c-secondary); outline-offset: 2px; }
.course-thumb { position: relative; aspect-ratio: 16 / 9; background: var(--c-primary-soft); overflow: hidden; }
.course-thumb img { width: 100%; height: 100%; object-fit: cover; }
.course-thumb-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 100%; color: var(--c-on-primary);
  background:
    radial-gradient(circle at 85% 15%, rgba(var(--c-accent-rgb), .55) 0, rgba(var(--c-accent-rgb), 0) 40%),
    linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dark) 55%, var(--c-secondary) 130%);
}
.placeholder-logo { width: 56px; height: 56px; border-radius: 50%; background: #fff; padding: 6px; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.placeholder-logo .site-logo { width: 100%; height: 100%; }
.placeholder-name { font-weight: 700; letter-spacing: .12em; font-size: .8rem; text-transform: uppercase; opacity: .9; }
.course-thumb .badge { position: absolute; top: 12px; left: 12px; z-index: 2; box-shadow: 0 2px 6px rgba(0, 0, 0, .12); }
.badge-level { background: #fff; color: var(--c-primary); }
.course-body { display: flex; flex-direction: column; flex: 1; padding: 16px; min-width: 0; }
.course-title { font-size: 1.05rem; line-height: 1.35; margin: 0 0 10px; }
.course-title a {
  color: var(--c-text);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.course-title a:hover { color: var(--c-primary); text-decoration: none; }
.course-facts { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 14px; padding: 0; list-style: none; font-size: .85rem; color: var(--c-muted); }
.course-facts li { display: inline-flex; align-items: center; gap: 6px; }
.course-facts svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.course-footer {
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--c-border);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
}
.course-price { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-weight: 700; color: var(--c-text); line-height: 1.3; }
.course-price del { color: var(--c-muted); font-weight: 400; font-size: .85rem; }
.course-price ins { text-decoration: none; color: var(--c-primary); }
.price-free { color: var(--c-success); }
.price-enrolled { color: var(--c-secondary-text); font-size: .9rem; }
/* The button sits above the card-wide title link. */
.course-action { position: relative; z-index: 2; }

/* Tutor LMS lists (course archive, shortcode, widget) use Tutor's grid; make the card fill each cell. */
.tutor-course-list > .course-card { height: 100%; }
.course-archive-breadcrumbs { padding-top: 20px; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 0 16px; padding: 0; list-style: none; font-size: .875rem; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.breadcrumbs li + li::before { content: '›'; opacity: .6; padding-right: 2px; }
.breadcrumbs a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.breadcrumbs [aria-current] { font-weight: 600; }

/* ---------- Course category page ---------- */
.category-band {
  padding: 20px 0 32px; color: var(--c-on-primary);
  background: linear-gradient(135deg, var(--c-primary-dark) 0%, var(--c-primary) 100%);
}
.category-band .breadcrumbs { color: rgba(255, 255, 255, .85); }
.category-band-inner { display: flex; align-items: flex-start; gap: 16px; }
.category-band-media {
  flex: 0 0 72px; width: 72px; height: 72px; border-radius: 18px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: #fff; color: var(--c-primary); font-size: 2rem; font-weight: 700;
}
.category-band-media img { width: 100%; height: 100%; object-fit: cover; }
.category-band-text { min-width: 0; }
.category-band h1 { color: var(--c-on-primary); font-size: clamp(1.5rem, 1.1rem + 2vw, 2.4rem); margin-bottom: 6px; }
.category-band-desc { opacity: .9; max-width: 46em; }
.category-band-desc p { margin: 0 0 8px; }
.category-band-count {
  display: inline-block; margin: 4px 0 0; padding: 4px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .14); font-size: .875rem; font-weight: 600;
}

.filter-chips { margin-bottom: 24px; }
.filter-chips ul, .filter-chips-list {
  display: flex; gap: 8px; margin: 0; padding: 0 0 4px; list-style: none;
  overflow-x: auto; scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.filter-chips-list { flex-wrap: wrap; justify-content: center; overflow: visible; margin-bottom: 24px; }
.filter-chips-list li { max-width: 100%; }
.filter-chips-list .chip { white-space: normal; text-align: left; max-width: 100%; }
.filter-chips .chip { max-width: 80vw; overflow: hidden; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 16px; white-space: nowrap;
  border: 1px solid var(--c-border); border-radius: 999px; background: #fff;
  color: var(--c-text); font-weight: 600; font-size: .9rem;
}
.chip:hover { border-color: var(--c-primary); color: var(--c-primary); text-decoration: none; }
.chip.is-active { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-on-primary); }
.chip-count { font-size: .75rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--c-primary-soft); color: var(--c-primary); }
.chip.is-active .chip-count { background: rgba(255, 255, 255, .2); color: var(--c-on-primary); }

.level-group + .level-group { margin-top: 36px; }
.level-heading { display: flex; align-items: center; gap: 12px; font-size: 1.25rem; margin-bottom: 16px; }
.level-heading::after { content: ''; flex: 1; height: 2px; background: var(--c-border); border-radius: 2px; }

.empty-state { max-width: 640px; margin: 0 auto; text-align: center; padding: 24px 0; }
.empty-state svg { margin: 0 auto 16px; fill: none; stroke: var(--c-secondary); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.empty-state > p { color: var(--c-muted); font-size: 1.05rem; }
.empty-state-title { font-size: 1.1rem; margin-top: 28px; }

/* ---------- Ratings (shown only for courses with reviews) ---------- */
.course-rating { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: .85rem; color: var(--c-muted); }
.rating-value { font-weight: 700; color: var(--c-text); }
.stars { --rating: 0; display: inline-block; font-size: .95rem; line-height: 1; letter-spacing: 1px; }
.stars::before {
  content: '★★★★★';
  background: linear-gradient(90deg, var(--c-accent) calc(var(--rating) * 20%), #cfd6e1 calc(var(--rating) * 20%));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Features ---------- */
.feature-grid { display: grid; grid-template-columns: 1fr; gap: 28px; list-style: none; margin: 0 auto; }
.feature-card { text-align: center; padding: 0 8px; }
.feature-visual {
  display: flex; align-items: center; justify-content: center;
  width: 160px; height: 104px; margin: 0 auto 14px; border-radius: 999px;
  background: radial-gradient(circle, rgba(var(--c-primary-rgb), .1), rgba(var(--c-primary-rgb), .02));
}
.feature-visual img { max-height: 80px; width: auto; object-fit: contain; }
.feature-card h3 { font-size: 1.15rem; }
.feature-card p { color: var(--c-muted); margin: 0; }

/* ---------- Payment methods ---------- */
.partner-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.partner-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  font-weight: 600; color: var(--c-text);
}
.partner-grid > li { display: flex; }
.partner-item { width: 100%; }
a.partner-item { text-decoration: none; transition: border-color .2s ease, box-shadow .2s ease; }
a.partner-item:hover { border-color: var(--c-primary); box-shadow: var(--shadow); }
.partner-logo { width: 48px; height: 48px; object-fit: contain; border-radius: 10px; flex-shrink: 0; }

/* ---------- Statistics ---------- */
.stat-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 0; }
.stat-card {
  display: flex; flex-direction: column-reverse; align-items: center; text-align: center;
  padding: 22px 16px; background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius);
}
.stat-card dd { margin: 0 0 4px; font-size: clamp(1.8rem, 1.4rem + 2vw, 2.6rem); font-weight: 700; line-height: 1.1; color: var(--c-primary); }
.stat-card dt { color: var(--c-muted); font-weight: 600; }

/* ---------- Certificate & enrollment ---------- */
.two-col-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.certificate-preview { position: relative; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--c-border); }
.certificate-preview img { width: 100%; aspect-ratio: 570 / 377; object-fit: cover; }
.certificate-stamp {
  position: absolute; top: 12px; right: 12px; padding: 6px 14px; border-radius: 999px;
  font-size: .75rem; font-weight: 700; letter-spacing: .08em; box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}
.certificate-stamp-paid { background: var(--c-accent); color: var(--c-on-accent); }
.certificate-stamp-free { background: var(--c-primary); color: var(--c-on-primary); }
.certificate-card h3 { margin: 16px 0 6px; font-size: 1.15rem; }
.certificate-card p, .enrollment-card p { color: var(--c-muted); }
.certificate-card p { margin: 0; }
.enrollment-card { display: flex; flex-direction: column; align-items: flex-start; }
.enrollment-card .badge { margin-bottom: 12px; }
.enrollment-card h3 { font-size: 1.25rem; }
.enrollment-card .btn { margin-top: auto; }
.workflow-note {
  margin-top: 20px; padding: 16px 20px; border-left: 4px solid var(--c-secondary);
  background: var(--c-secondary-soft); border-radius: var(--radius-sm);
}
.workflow-note p { margin: 0; color: var(--c-text); }
.workflow-note-title { font-weight: 700; margin-bottom: 4px !important; }

/* ---------- Call to action ---------- */
.cta-box {
  text-align: center; padding: 32px 20px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
  color: var(--c-on-primary);
}
.cta-box h2 { color: var(--c-on-primary); font-size: clamp(1.4rem, 1.1rem + 1.6vw, 2rem); }
.cta-box p { opacity: .9; max-width: 36em; margin: 0 auto 20px; }
.cta-form { max-width: 560px; margin: 0 auto; text-align: left; }
.cta-label { display: block; font-weight: 600; margin-bottom: 6px; }
.cta-form-row { display: flex; flex-direction: column; gap: 10px; }
.cta-form input {
  min-height: 52px; padding: 0 16px; border: 0; border-radius: var(--radius-sm);
  font: inherit; color: var(--c-text); background: #fff; width: 100%;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--c-primary-dark); color: rgba(255, 255, 255, .85); padding-top: 44px; border-top: 4px solid var(--c-accent); }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 28px; padding-bottom: 28px; }
.footer-logo-line { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.footer-logo-line .site-logo { width: 52px; height: 52px; background: #fff; border-radius: 50%; padding: 4px; }
.footer-site-name { margin: 0; font-size: 1.2rem; font-weight: 700; color: #fff; }
.footer-tagline { margin: 0; font-size: .85rem; opacity: .75; }
.footer-heading { font-size: 1.05rem; color: #fff; margin-bottom: 10px; }
.footer-contact p { margin: 0 0 6px; }
.footer-contact span { opacity: .75; }
.social-links { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.social-links a {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; transition: background-color .2s ease;
}
.social-links a:hover { background: var(--c-accent); color: var(--c-on-accent); }
.social-links svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.footer-bottom {
  display: flex; flex-direction: column; gap: 12px; text-align: center;
  border-top: 1px solid rgba(255, 255, 255, .15); padding: 18px var(--gutter) 24px;
}
.footer-navigation .menu { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; list-style: none; margin: 0; padding: 0; }
.footer-navigation a { display: inline-block; padding: 6px 0; }
.copyright { margin: 0; font-size: .9rem; }

/* ---------- Blog & pages ---------- */
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem); }
.archive-description { color: var(--c-muted); }
.post-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.post-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.post-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.post-body { padding: 18px; }
.post-title { font-size: 1.15rem; }
.post-title a { color: var(--c-text); }
.entry-meta { font-size: .85rem; color: var(--c-muted); margin-bottom: 8px; }
.entry-summary p:last-child { margin: 0; }
.entry-thumb { margin-bottom: 24px; border-radius: var(--radius); overflow: hidden; }
.entry-content { font-size: 1.05rem; }
.entry-content > * { max-width: 100%; }
.entry-content img, .entry-content iframe { max-width: 100%; height: auto; }
.entry-content h2 { margin-top: 1.6em; }
.entry-content table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.entry-content th, .entry-content td { border: 1px solid var(--c-border); padding: 8px 10px; text-align: left; }
.alignwide, .alignfull { max-width: 100%; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 28px; }
.nav-links .page-numbers {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 12px;
  border: 1px solid var(--c-border); border-radius: var(--radius-sm); color: var(--c-text);
}
.nav-links .page-numbers.current { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-on-primary); }
.post-navigation .nav-links { justify-content: space-between; }
.comments-area { margin-top: 32px; }
.comment-list { padding-left: 20px; }
.error-404 { text-align: center; }
.error-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 20px; }

/* ---------- Forms ---------- */
input[type="text"], input[type="email"], input[type="url"], input[type="search"], input[type="password"], input[type="tel"], textarea, select {
  width: 100%; min-height: 44px; padding: 10px 14px; font: inherit; color: var(--c-text);
  background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-sm);
}
textarea { min-height: 120px; }
.search-form { display: flex; gap: 8px; max-width: 480px; margin: 0 auto; }
.search-form label { flex: 1; }
.search-submit, input[type="submit"] {
  min-height: 44px; padding: 10px 18px; border: 0; border-radius: var(--radius-sm);
  background: var(--c-primary); color: var(--c-on-primary); font: 600 1rem var(--font); cursor: pointer;
}

/* ---------- Widgets ---------- */
.widget { margin-bottom: 28px; }
.widget-title { font-size: 1.1rem; }

/* ---------- "How to pay" box (paid course pages) ---------- */
.sahamin-pay {
  margin-top: 20px; padding: 16px; border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  background: var(--c-bg-alt); font-family: var(--font); font-size: .95rem; text-align: left;
}
.sahamin-pay p { margin: 0 0 8px; }
.sahamin-pay-title { font-weight: 700; font-size: 1.05rem; color: var(--c-primary); }
.pay-account-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pay-account-actions .btn { flex: 1 1 140px; }
.pay-choice { margin: 0 0 8px; padding: 0; border: 0; min-width: 0; }
.pay-choice legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.pay-choice label {
  display: flex; align-items: center; gap: 10px; min-height: 44px; margin-bottom: 6px; padding: 8px 12px;
  border: 2px solid var(--c-border); border-radius: var(--radius-sm); background: #fff; cursor: pointer; font-weight: 600;
}
.pay-choice label:has(input:checked) { border-color: var(--c-primary); background: var(--c-primary-soft); }
.pay-choice input { width: 18px; height: 18px; accent-color: var(--c-primary); }
.pay-choose-hint { display: none; color: var(--c-muted); font-size: .875rem; }
.sahamin-pay.is-js:not(.has-choice) .pay-choose-hint { display: block; }
.pay-panel { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--c-border); }
.sahamin-pay.is-js .pay-panel { display: none; }
.sahamin-pay.is-js .pay-panel.is-active { display: block; }
.sahamin-pay.is-js .pay-panel-title { display: none; } /* the chosen radio already says which */
.pay-panel-title { font-weight: 700; }
.pay-amount strong { font-size: 1.15rem; color: var(--c-primary); }
.pay-methods { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 8px; }
.pay-method { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-sm); }
.pay-logo { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; flex-shrink: 0; }
.pay-method-body { min-width: 0; }
.pay-method-body p { margin: 0 0 2px; overflow-wrap: anywhere; }
.pay-method-name { font-weight: 700; }
.pay-k { color: var(--c-muted); }
.pay-number-value { font-weight: 700; letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.pay-copy {
  margin-left: 6px; padding: 2px 10px; min-height: 28px; border: 1px solid var(--c-primary); border-radius: 999px;
  background: #fff; color: var(--c-primary); font: 600 .8rem var(--font); cursor: pointer;
}
.pay-note, .pay-instructions, .pay-after { color: var(--c-muted); font-size: .875rem; }
.pay-receipt { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--c-border); }
.pay-receipt .pay-after { margin: 0 0 10px !important; color: var(--c-text); }
.pay-receipt-buttons { display: flex; flex-direction: column; gap: 8px; }
.pay-receipt-buttons .btn { width: 100%; justify-content: center; color: #fff; text-decoration: none; }
.pay-receipt-buttons svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
/* App colours, darkened so white text meets WCAG AA contrast. */
.pay-whatsapp { background: #128049; }
.pay-whatsapp:hover { background: #0d6639; color: #fff; }
.pay-telegram { background: #1a73a8; }
.pay-telegram:hover { background: #145c87; color: #fff; }
.pay-receipt-buttons .btn-ghost-dark { color: var(--c-primary); }

/* ---------- Tutor LMS ---------- */
/* Colours are passed to Tutor through --tutor-color-primary (see inc/customizer.php). */
.tutor-wrap, .tutor-course-details-page, .tutor-dashboard { font-family: var(--font); }
/* Long Somali category/course names inside Tutor's own templates must wrap, not push the page sideways. */
.tutor-meta, .tutor-meta > div, .tutor-course-details-title, .tutor-course-name, .tutor-breadcrumb { min-width: 0; overflow-wrap: anywhere; }

/* ===================================================================== */
/* >= 600px                                                              */
/* ===================================================================== */
@media (min-width: 600px) {
  :root { --gutter: 24px; }
  .section { padding: 64px 0; }
  .course-grid, .partner-grid, .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-track { grid-auto-columns: calc((100% - 2 * 16px) / 3); gap: 16px; }
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .cta-box { padding: 44px 32px; }
  .cta-form-row { flex-direction: row; }
  .cta-form input { flex: 1; }
  .stat-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 760px; margin: 0 auto; }
  .stat-grid-1 { grid-template-columns: minmax(0, 360px); justify-content: center; }
  .hero-actions .btn { flex: 0 0 auto; }
}

@media (min-width: 783px) {
  .admin-bar .site-header { top: 32px; }
}

/* ===================================================================== */
/* >= 960px                                                              */
/* ===================================================================== */
@media (min-width: 960px) {
  .header-wrap { flex-wrap: nowrap; min-height: 76px; }
  .site-branding { flex: 0 0 auto; }
  .site-logo { width: 52px; height: 52px; }
  .brand-title { font-size: 1.25rem; }
  .menu-toggle { display: none; }

  .main-navigation { display: flex !important; align-items: center; justify-content: flex-end; gap: 24px; width: auto; padding: 0; flex: 1 1 auto; min-width: 0; }
  .main-navigation > ul { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 22px; }
  .main-navigation li { border: 0; position: relative; }
  .main-navigation ul a { padding: 8px 0; font-size: .95rem; }
  .main-navigation .sub-menu {
    position: absolute; top: 100%; left: -16px; min-width: 220px; padding: 8px 0; z-index: 10;
    background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-sm); box-shadow: var(--shadow);
    visibility: hidden; opacity: 0; transform: translateY(6px); transition: opacity .15s ease, transform .15s ease, visibility .15s;
  }
  .main-navigation li:hover > .sub-menu, .main-navigation li:focus-within > .sub-menu { visibility: visible; opacity: 1; transform: none; }
  .main-navigation .sub-menu a { padding: 8px 16px; }
  .header-actions { flex-wrap: nowrap; padding: 0; flex-shrink: 0; }
  .header-actions .btn { flex: 0 0 auto; }

  .hero { padding: 0; }
  .hero-inner { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: 32px; min-height: 440px; }
  .hero-text { padding: 56px 0; }
  .hero-media { margin: 0; align-self: stretch; display: flex; align-items: center; }
  .hero-image {
    border-radius: var(--radius);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18%);
    mask-image: linear-gradient(90deg, transparent 0, #000 18%);
  }

  .hs-slide { min-height: 480px; }
  .hs-media { position: absolute; inset: 0; aspect-ratio: auto; }
  .hs-overlay {
    position: relative; z-index: 1; display: flex; align-items: center; padding: 56px 0 88px;
    background: linear-gradient(90deg, rgba(var(--c-primary-rgb), .96) 0%, rgba(var(--c-primary-rgb), .82) 40%, rgba(var(--c-primary-rgb), .15) 75%, rgba(var(--c-primary-rgb), 0) 100%);
  }
  .hs-overlay > .container { width: 100%; }
  .hs-actions .btn { flex: 0 0 auto; }
  .hs-controls { bottom: 24px; }

  .hero-banner-hotspot {
    left: var(--hero-cta-left, 2.85%); top: var(--hero-cta-top, 68.85%);
    width: var(--hero-cta-width, 18.55%); height: var(--hero-cta-height, 14.8%); border-radius: 14px;
  }

  .cat-track { grid-auto-columns: calc((100% - 3 * 16px) / 4); }
  .course-grid, .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .partner-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .two-col-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .category-band { padding: 24px 0 44px; }
  .category-band-inner { align-items: center; gap: 24px; }
  .category-band-media { flex-basis: 96px; width: 96px; height: 96px; }
  .card { padding: 24px; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
  .footer-bottom { flex-direction: row; justify-content: space-between; text-align: left; }
  .footer-navigation .menu { justify-content: flex-start; }
}

@media (min-width: 1180px) {
  .course-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
