/* Site header. Self-contained (no Tailwind). Theme via [data-theme] on <html>.
   Radius scale: controls 10px, panels 14px, avatar/badge full. Z-index: header 100, overlay 90, drawer 110. */
:root {
  --eh-h: 64px;
  --eh-bg: #ffffff;
  --eh-bg-soft: #f4f4f5;
  --eh-bg-hover: #ececef;
  --eh-border: #e4e4e7;
  --eh-text: #18181b;
  --eh-muted: #52525b;
  --eh-accent: #1d4ed8;
  --eh-accent-hover: #1e40af;
  --eh-accent-ink: #ffffff;
  --eh-accent-soft: #e8efff;
  --eh-shadow: 0 12px 32px -8px rgba(24, 40, 90, .18);
  --eh-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
:root[data-theme="dark"] {
  --eh-bg: #121214;
  --eh-bg-soft: #1c1c20;
  --eh-bg-hover: #26262c;
  --eh-border: #2c2c33;
  --eh-text: #f4f4f5;
  --eh-muted: #a1a1aa;
  --eh-accent: #60a5fa;
  --eh-accent-hover: #93c5fd;
  --eh-accent-ink: #0b1220;
  --eh-accent-soft: #16233d;
  --eh-shadow: 0 16px 40px -8px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

.eh, .eh * , .eh-drawer, .eh-drawer * { box-sizing: border-box; }
.eh, .eh-drawer { font-family: var(--eh-font); color: var(--eh-text); font-size: 15px; line-height: 1.4; }
.eh a, .eh-drawer a { color: inherit; text-decoration: none; }
.eh button, .eh-drawer button, .eh input { font: inherit; color: inherit; }
.eh ul, .eh-drawer ul { list-style: none; margin: 0; padding: 0; }
.eh :focus-visible, .eh-drawer :focus-visible { outline: 2px solid var(--eh-accent); outline-offset: 2px; }

.eh {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--eh-h);
  background: var(--eh-bg);
  border-bottom: 1px solid var(--eh-border);
}
.eh-bar { max-width: 1400px; height: 100%; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 14px; }

.eh-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; font-weight: 700; font-size: 17px; letter-spacing: -.01em; white-space: nowrap; }
.eh-brand img { height: 32px; width: auto; display: block; }

.eh-btn, .eh-icon-btn, .eh-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; background: transparent; cursor: pointer; border-radius: 10px;
  transition: background-color .15s ease, color .15s ease, transform .1s ease;
}
.eh-btn:active, .eh-icon-btn:active { transform: scale(.97); }
.eh-link { padding: 0 12px; height: 40px; font-weight: 600; color: var(--eh-muted); white-space: nowrap; }
.eh-link:hover, .eh-link[aria-current="page"] { color: var(--eh-text); background: var(--eh-bg-soft); }
.eh-icon-btn { width: 40px; height: 40px; font-size: 21px; color: var(--eh-muted); position: relative; }
.eh-icon-btn:hover { background: var(--eh-bg-soft); color: var(--eh-text); }
.eh-btn { height: 40px; padding: 0 16px; font-weight: 600; white-space: nowrap; }
.eh-btn--ghost { border: 1px solid var(--eh-border); }
.eh-btn--ghost:hover { background: var(--eh-bg-soft); }
.eh-btn--primary { background: var(--eh-accent); color: var(--eh-accent-ink) !important; }
.eh-btn--primary:hover { background: var(--eh-accent-hover); }

.eh-badge {
  position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--eh-accent); color: var(--eh-accent-ink);
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

/* search */
.eh-search { flex: 1 1 auto; min-width: 0; max-width: 560px; position: relative; }
.eh-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--eh-muted); pointer-events: none; }
.eh-search input {
  width: 100%; height: 42px; padding: 0 16px 0 42px; border-radius: 10px;
  border: 1px solid var(--eh-border); background: var(--eh-bg-soft); outline: none;
  transition: border-color .15s ease, background-color .15s ease;
}
.eh-search input::placeholder { color: var(--eh-muted); }
.eh-search input:focus { border-color: var(--eh-accent); background: var(--eh-bg); }

.eh-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.eh-nav .eh-btn + .eh-btn { margin-left: 8px; }
.eh-sep { width: 1px; height: 24px; background: var(--eh-border); margin: 0 8px; }

/* dropdown shells */
.eh-pop { position: relative; }
.eh-panel {
  position: absolute; top: calc(100% + 10px); background: var(--eh-bg); border: 1px solid var(--eh-border);
  border-radius: 14px; box-shadow: var(--eh-shadow); z-index: 100;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.eh-pop.is-open > .eh-panel { opacity: 1; visibility: visible; transform: none; }
.eh-pop > .eh-btn[aria-expanded="true"] { background: var(--eh-bg-soft); }
.eh-caret { transition: transform .2s ease; }
[aria-expanded="true"] > .eh-caret { transform: rotate(180deg); }

/* courses mega menu: category rail + card list */
.eh-mega { left: 0; width: 720px; padding: 0; overflow: hidden; }
.eh-mega-body { display: grid; grid-template-columns: 220px 1fr; min-height: 250px; }
.eh-mega-rail { padding: 10px; border-right: 1px solid var(--eh-border); background: var(--eh-bg-soft); }
.eh-rail-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: 0; border-radius: 10px; background: none; cursor: pointer; text-align: left; font-weight: 600; color: var(--eh-muted); }
.eh-rail-btn i { font-size: 19px; }
.eh-rail-arrow { margin-left: auto; opacity: 0; transition: opacity .15s ease; }
.eh-rail-btn:hover, .eh-rail-btn.is-active { background: var(--eh-bg); color: var(--eh-text); }
.eh-rail-btn.is-active { box-shadow: 0 0 0 1px var(--eh-border); }
.eh-rail-btn.is-active .eh-rail-arrow, .eh-rail-btn:hover .eh-rail-arrow { opacity: 1; }
.eh-mega-list { padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.eh-card { display: flex; gap: 14px; padding: 10px; border-radius: 10px; align-items: center; }
.eh-card[hidden], .eh-mega-empty[hidden] { display: none; }
.eh-card:hover { background: var(--eh-bg-soft); }
.eh-card-img { width: 112px; height: 76px; border-radius: 10px; object-fit: cover; flex-shrink: 0; display: block; }
.eh-card-img--jop { display: flex; align-items: center; justify-content: center; background: var(--eh-accent-soft); color: var(--eh-accent); font-size: 32px; }
.eh-card-txt { min-width: 0; text-align: left; }
.eh-card-txt strong { display: block; font-size: 14.5px; line-height: 1.35; }
.eh-card-txt > span { display: block; margin-top: 3px; font-size: 13px; color: var(--eh-muted); line-height: 1.4; }
.eh-card-txt small { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--eh-accent); }
.eh-tag { display: inline-block; width: auto; margin: 0 0 0 8px; padding: 2px 8px; border-radius: 999px; background: var(--eh-accent-soft); color: var(--eh-accent); font-size: 11px; font-weight: 700; line-height: 1.3; vertical-align: 1px; white-space: nowrap; }
.eh-mega-empty { margin: 0; padding: 24px 12px; color: var(--eh-muted); }
.eh-mega-foot { padding: 12px 18px; border-top: 1px solid var(--eh-border); display: flex; justify-content: space-between; align-items: center; color: var(--eh-muted); font-size: 13px; }
.eh-mega-foot a { color: var(--eh-accent); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }

/* menus (user + theme) */
.eh-menu { right: 0; min-width: 240px; padding: 6px; }
.eh-menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--eh-border); margin-bottom: 6px; }
.eh-menu-head strong { display: block; font-size: 14px; }
.eh-menu-head span { display: block; font-size: 12.5px; color: var(--eh-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.eh-menu a, .eh-menu button.eh-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: none; border-radius: 10px; cursor: pointer; text-align: left; color: var(--eh-text); }
.eh-menu a:hover, .eh-menu button.eh-row:hover, .eh-menu button.eh-row[aria-checked="true"] { background: var(--eh-bg-soft); }
.eh-menu i { font-size: 18px; color: var(--eh-muted); }
.eh-menu .eh-check { margin-left: auto; color: var(--eh-accent); visibility: hidden; }
.eh-menu [aria-checked="true"] .eh-check { visibility: visible; }
.eh-menu hr { border: 0; border-top: 1px solid var(--eh-border); margin: 6px 0; }
.eh-avatar { width: 36px; height: 36px; border-radius: 999px; object-fit: cover; display: block; border: 1px solid var(--eh-border); }
.eh-avatar-btn { width: 40px; height: 40px; border-radius: 999px; border: 0; background: none; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* theme icon swap */
.eh-t-dark, .eh-t-light { display: none; }
:root[data-theme="dark"] .eh-t-dark { display: inline-block; }
:root:not([data-theme="dark"]) .eh-t-light { display: inline-block; }

.eh-burger { display: none; }

/* drawer (mobile) */
.eh-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(9, 9, 11, .55); opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s; }
.eh-overlay.is-open { opacity: 1; visibility: visible; }
.eh-drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 110; width: min(88vw, 360px);
  background: var(--eh-bg); border-right: 1px solid var(--eh-border);
  transform: translateX(-100%); transition: transform .26s cubic-bezier(.16, 1, .3, 1);
  display: flex; flex-direction: column; overflow-y: auto;
}
.eh-drawer.is-open { transform: none; }
.eh-drawer-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--eh-border); }
.eh-drawer-body { padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.eh-drawer .eh-search { max-width: none; margin-bottom: 8px; }
.eh-drawer-link { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; font-weight: 600; width: 100%; border: 0; background: none; cursor: pointer; text-align: left; }
.eh-drawer-link:hover { background: var(--eh-bg-soft); }
.eh-drawer-link i { font-size: 20px; color: var(--eh-muted); }
.eh-drawer-sub { display: none; padding: 0 0 6px 8px; }
.eh-drawer-sub.is-open { display: block; }
.eh-drawer-sub a { display: block; padding: 10px 12px; border-radius: 10px; font-size: 14px; color: var(--eh-muted); }
.eh-drawer-sub a:hover { background: var(--eh-bg-soft); color: var(--eh-text); }
.eh-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 10px; background: var(--eh-bg-soft); margin-top: 8px; }
.eh-seg button { height: 36px; border: 0; border-radius: 8px; background: none; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--eh-muted); }
.eh-seg button[aria-pressed="true"] { background: var(--eh-bg); color: var(--eh-text); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.eh-drawer-auth { display: grid; gap: 8px; margin-top: 12px; }
.eh-drawer-auth .eh-btn { width: 100%; height: 44px; }

@media (max-width: 1100px) {
  .eh-hide-md { display: none !important; }
}
@media (max-width: 900px) {
  .eh-desktop { display: none !important; }
  .eh-burger { display: inline-flex; }
  .eh-bar { padding: 0 12px; gap: 6px; }
  .eh-nav { margin-left: auto; }
}
@media (max-width: 420px) {
  .eh-brand span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .eh *, .eh-drawer, .eh-overlay { transition: none !important; }
}

/* search suggestions */
.eh-search input { padding-right: 40px; }
.eh-search input::-webkit-search-cancel-button { display: none; }
.eh-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: var(--eh-muted); font-size: 22px; line-height: 1; cursor: pointer; }
.eh-clear:hover { background: var(--eh-bg-soft); color: var(--eh-text); }
.eh-clear[hidden], .eh-suggest[hidden] { display: none; }
.eh-suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 70; max-height: 70vh; overflow-y: auto; background: var(--eh-bg); border: 1px solid var(--eh-border); border-radius: 12px; box-shadow: var(--eh-shadow); }
.eh-sg-head { margin: 0; padding: 10px 14px 4px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--eh-muted); }
.eh-sg-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; text-decoration: none; color: var(--eh-text); }
.eh-sg-row:hover, .eh-sg-row.is-active, .eh-sg-all:hover, .eh-sg-all.is-active { background: var(--eh-accent-soft); }
.eh-sg-main { min-width: 0; display: grid; gap: 2px; }
.eh-sg-main b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eh-sg-main small { color: var(--eh-muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eh-sg-meta { flex-shrink: 0; display: grid; justify-items: end; gap: 2px; }
.eh-sg-meta em { font-style: normal; font-size: 12px; color: var(--eh-muted); }
.eh-sg-meta b { font-size: 14px; }
.eh-sg-all { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-top: 1px solid var(--eh-border); text-decoration: none; color: var(--eh-accent); font-weight: 700; font-size: 14px; }
.eh-sg-all span { font-weight: 600; font-size: 12px; color: var(--eh-muted); border: 1px solid var(--eh-border); border-radius: 6px; padding: 1px 6px; }
.eh-sg-none { margin: 0; padding: 14px; color: var(--eh-muted); font-size: 14px; }
.eh-sg-none button { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--eh-accent); cursor: pointer; text-decoration: underline; }
.eh-drawer .eh-suggest { position: static; margin-top: 8px; box-shadow: none; max-height: 50vh; }

/* rotating search hint */
.eh-hint { position: absolute; left: 42px; right: 40px; top: 0; bottom: 0; overflow: hidden; pointer-events: none; color: var(--eh-muted); }
.eh-hint[hidden] { display: none; }
.eh-hint-line { position: absolute; inset: 0; display: flex; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: transform .45s ease, opacity .45s ease; }
.eh-hint-line.is-enter { transform: translateY(100%); opacity: 0; }
.eh-hint-line.is-leave { transform: translateY(-100%); opacity: 0; }
@media (prefers-reduced-motion: reduce) { .eh-hint-line { transition: none; } }
