/* ================================================================
   EST Math Resource Hub — Public Styles
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --erh-accent:      #2563a8;
  --erh-accent-dark: #1a4f8f;
  --erh-accent-bg:   #eff6ff;
  --erh-surface:     #ffffff;
  --erh-bg:          #f8fafc;
  --erh-border:      #e2e8f0;
  --erh-border-soft: #f1f5f9;
  --erh-text:        #0f172a;
  --erh-text-mid:    #334155;
  --erh-text-soft:   #64748b;
  --erh-text-muted:  #94a3b8;
  --erh-green:       #16a34a;
  --erh-green-bg:    #f0fdf4;
  --erh-amber:       #d97706;
  --erh-amber-bg:    #fffbeb;
  --erh-radius:      12px;
  --erh-radius-sm:   8px;
  --erh-shadow:      0 1px 3px rgba(15,23,42,.07), 0 1px 2px rgba(15,23,42,.05);
  --erh-shadow-md:   0 4px 16px rgba(15,23,42,.09), 0 2px 4px rgba(15,23,42,.05);
  --erh-shadow-lg:   0 12px 32px rgba(15,23,42,.12);
  --erh-font:        'Plus Jakarta Sans', system-ui, sans-serif;
  --erh-transition:  all .18s ease;
}

.erh-hub * { box-sizing: border-box; margin: 0; padding: 0; }
.erh-hub { font-family: var(--erh-font); color: var(--erh-text); line-height: 1.6; }
.erh-hub a { text-decoration: none; }

/* ── Hero ─────────────────────────────────────────────────── */
.erh-hero {
  background: linear-gradient(135deg, var(--erh-accent) 0%, #3b82f6 60%, #0ea5e9 100%);
  border-radius: var(--erh-radius);
  padding: 40px 36px;
  color: #fff;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.erh-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.erh-hero-title {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
  position: relative;
  letter-spacing: -.02em;
}
.erh-hero-sub {
  font-size: 14px;
  opacity: .88;
  margin-bottom: 20px;
  position: relative;
}
.erh-hero-chips { display: flex; flex-wrap: wrap; gap: 8px; position: relative; }
.erh-hero-chip {
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 20px;
  padding: 4px 13px;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

/* ── Search bar ───────────────────────────────────────────── */
.erh-searchbar { margin-bottom: 20px; }
.erh-search-inner {
  display: flex;
  align-items: center;
  background: var(--erh-surface);
  border: 2px solid var(--erh-border);
  border-radius: 50px;
  padding: 6px 6px 6px 18px;
  gap: 8px;
  box-shadow: var(--erh-shadow);
  transition: border-color .2s;
}
.erh-search-inner:focus-within { border-color: var(--erh-accent); box-shadow: 0 0 0 4px rgba(37,99,168,.1); }
.erh-search-ico { width: 18px; height: 18px; color: var(--erh-text-muted); flex-shrink: 0; }
.erh-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--erh-font);
  font-size: 15px;
  color: var(--erh-text);
  background: transparent;
  min-width: 0;
}
.erh-search-input::placeholder { color: var(--erh-text-muted); }
.erh-search-btn {
  background: var(--erh-accent);
  color: #fff;
  border: none;
  border-radius: 40px;
  padding: 9px 22px;
  font-family: var(--erh-font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--erh-transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.erh-search-btn:hover { background: var(--erh-accent-dark); }
.erh-clear-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--erh-border);
  background: var(--erh-bg);
  color: var(--erh-text-soft);
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none;
  transition: var(--erh-transition);
}
.erh-clear-btn:hover { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }

/* ── Filters ──────────────────────────────────────────────── */
.erh-filters {
  background: var(--erh-surface);
  border: 1px solid var(--erh-border);
  border-radius: var(--erh-radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--erh-shadow);
}
.erh-filter-row { display: flex; align-items: flex-start; gap: 12px; }
.erh-filter-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--erh-text-soft);
  text-transform: uppercase;
  letter-spacing: .07em;
  white-space: nowrap;
  padding-top: 6px;
  min-width: 56px;
}
.erh-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.erh-pill {
  display: inline-block;
  padding: 5px 13px;
  border: 1.5px solid var(--erh-border);
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--erh-text-mid);
  background: var(--erh-surface);
  cursor: pointer;
  transition: var(--erh-transition);
  white-space: nowrap;
}
.erh-pill:hover { border-color: var(--erh-accent); color: var(--erh-accent); background: var(--erh-accent-bg); }
.erh-pill-active { background: var(--erh-accent); border-color: var(--erh-accent); color: #fff; font-weight: 600; }
.erh-pill-active:hover { background: var(--erh-accent-dark); }

/* Type pill colours */
.erh-pill[href*="erh_type=course"]  { border-color: #bfdbfe; }
.erh-pill[href*="erh_type=video"]   { border-color: #fbcfe8; }
.erh-pill[href*="erh_type=practice"]{ border-color: #fde68a; }
.erh-pill[href*="erh_type=tool"]    { border-color: #ddd6fe; }
.erh-pill[href*="erh_type=pdf"]     { border-color: #fecaca; }

/* ── Results bar ──────────────────────────────────────────── */
.erh-results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--erh-text-soft);
}
.erh-results-count strong { color: var(--erh-text); }
.erh-reset-link { color: var(--erh-accent); font-weight: 500; }
.erh-reset-link:hover { text-decoration: underline; }

/* ── Card grid ────────────────────────────────────────────── */
.erh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

/* ── Card ─────────────────────────────────────────────────── */
.erh-card {
  background: var(--erh-surface);
  border: 1px solid var(--erh-border);
  border-radius: var(--erh-radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--erh-shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  position: relative;
  overflow: hidden;
}
.erh-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--erh-shadow-md);
  border-color: #c7d8f0;
}
.erh-card-featured {
  border-color: #fbbf24;
  border-width: 1.5px;
  background: linear-gradient(145deg, #fffbeb 0%, #fff 50%);
}

.erh-card-ribbon {
  position: absolute;
  top: 14px; right: -8px;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 14px 3px 10px;
  border-radius: 2px 0 0 2px;
  letter-spacing: .04em;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(245,158,11,.4);
}
.erh-card-ribbon::after {
  content: '';
  position: absolute;
  right: 0; top: 100%;
  border: 4px solid #b45309;
  border-right-color: transparent;
  border-bottom-color: transparent;
}

.erh-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.erh-card-icon { font-size: 24px; line-height: 1; }
.erh-card-badges-top { display: flex; gap: 5px; align-items: center; }

.erh-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
}
.erh-badge-lang { background: var(--erh-border-soft); color: var(--erh-text-soft); }

/* Type badge colours */
.erh-badge-course   { background: #dbeafe; color: #1e40af; }
.erh-badge-video    { background: #fce7f3; color: #9d174d; }
.erh-badge-article  { background: #dcfce7; color: #166534; }
.erh-badge-practice { background: #fef3c7; color: #92400e; }
.erh-badge-tool     { background: #ede9fe; color: #5b21b6; }
.erh-badge-pdf      { background: #fee2e2; color: #991b1b; }
.erh-badge-book     { background: #fef9c3; color: #713f12; }
.erh-badge-website  { background: #f0fdf4; color: #166534; }

.erh-card-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--erh-text);
}
.erh-card-title a { color: inherit; }
.erh-card-title a:hover { color: var(--erh-accent); }

.erh-card-desc {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--erh-text-soft);
  flex: 1;
}

.erh-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.erh-meta-source {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--erh-text-muted);
  font-weight: 500;
}
.erh-meta-source svg { width: 12px; height: 12px; flex-shrink: 0; }
.erh-meta-diff { font-size: 11.5px; color: var(--erh-amber); font-weight: 600; }

.erh-card-topic-badge {
  display: inline-block;
  padding: 3px 10px;
  background: var(--erh-accent-bg);
  color: var(--erh-accent);
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  width: fit-content;
}

.erh-card-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.erh-tag {
  padding: 2px 8px;
  background: var(--erh-border-soft);
  border-radius: 6px;
  font-size: 11px;
  color: var(--erh-text-soft);
  transition: var(--erh-transition);
}
.erh-tag:hover { background: var(--erh-accent-bg); color: var(--erh-accent); }

.erh-card-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  background: var(--erh-accent);
  color: #fff;
  border-radius: var(--erh-radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  transition: var(--erh-transition);
  margin-top: auto;
}
.erh-card-cta svg { width: 14px; height: 14px; flex-shrink: 0; }
.erh-card-cta:hover { background: var(--erh-accent-dark); transform: translateY(-1px); }

/* ── Empty state ──────────────────────────────────────────── */
.erh-empty {
  text-align: center;
  padding: 60px 24px;
  background: var(--erh-surface);
  border: 1px solid var(--erh-border);
  border-radius: var(--erh-radius);
}
.erh-empty-icon { font-size: 48px; margin-bottom: 16px; opacity: .6; }
.erh-empty p { color: var(--erh-text-soft); font-size: 15px; }
.erh-empty a { color: var(--erh-accent); font-weight: 600; }

/* ── Pagination ───────────────────────────────────────────── */
.erh-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 32px;
}
.erh-page-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border: 1.5px solid var(--erh-border);
  border-radius: var(--erh-radius-sm);
  font-family: var(--erh-font);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--erh-text-mid);
  background: var(--erh-surface);
  transition: var(--erh-transition);
}
.erh-page-btn:hover { border-color: var(--erh-accent); color: var(--erh-accent); background: var(--erh-accent-bg); }
.erh-page-active { background: var(--erh-accent); border-color: var(--erh-accent); color: #fff; }
.erh-page-active:hover { background: var(--erh-accent-dark); color: #fff; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .erh-hero { padding: 28px 20px; }
  .erh-hero-title { font-size: 20px; }
  .erh-grid { grid-template-columns: 1fr; gap: 14px; }
  .erh-filter-row { flex-direction: column; gap: 6px; }
  .erh-filter-label { padding-top: 0; }
  .erh-card { padding: 18px 16px; }
}
@media (max-width: 480px) {
  .erh-search-btn span { display: none; }
  .erh-hero-chips { gap: 6px; }
  .erh-hero-chip { font-size: 11px; padding: 3px 10px; }
}
