@font-face {
  font-family: "IRANSansX";
  src: url("../fonts/iran/iransansxv.woff") format("woff");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}


:root {
  /* Typography */
  --ct-font-sans: "IRANSansX", Tahoma, Arial, sans-serif;
  --ct-font-latin: Inter, Arial, sans-serif;

  /* Brand palette - single source of truth */
  --ct-primary: #23b6ff;
  --ct-primary-hover: #14e0a5;
  --ct-primary-strong: #006eaa;
  --ct-primary-ink: #031820;
  --ct-primary-soft: #e8f7ff;
  --ct-primary-border: #9edfff;

  /* Neutral palette */
  --ct-ink: #14212a;
  --ct-ink-soft: #263741;
  --ct-muted: #66737b;
  --ct-subtle: #84939c;
  --ct-bg: #ffffff;
  --ct-surface: #ffffff;
  --ct-surface-soft: #eef3f6;
  --ct-surface-tint: #fafcfd;
  --ct-border: #dde7ec;
  --ct-border-soft: #edf3f6;
  --ct-dark: #0a233d;
  --ct-dark-deep: #050a10;
  --ct-dark-soft: #102a43;
  --ct-on-dark: #f3f7fb;

  /* State colors */
  --ct-success: #027a48;
  --ct-success-soft: #ecfdf3;
  --ct-success-border: #abefc6;
  --ct-danger: #b42318;
  --ct-danger-soft: #fff4f2;
  --ct-danger-border: #fecdca;
  --ct-warning: #ff7a00;
  --ct-warning-ink: #9a3412;
  --ct-warning-soft: #fff7ed;
  --ct-info: #0868d7;
  --ct-info-soft: #f4f8ff;

  /* RGB channels used only for controlled opacity */
  --ct-rgb-primary: 35 182 255;
  --ct-rgb-gradient-end: 20 224 165;
  --ct-rgb-ink: 20 33 42;
  --ct-rgb-white: 255 255 255;
  --ct-rgb-surface: 255 255 255;
  --ct-rgb-grid: 116 134 158;
  --ct-rgb-dark: 5 10 16;

  /* Shared elevation */
  --ct-shadow-xs: 0 8px 20px rgb(var(--ct-rgb-ink) / .04);
  --ct-shadow-sm: 0 9px 24px rgb(var(--ct-rgb-ink) / .055);
  --ct-shadow-md: 0 14px 38px rgb(var(--ct-rgb-ink) / .08);
  --ct-shadow-lg: 0 24px 50px rgb(var(--ct-rgb-ink) / .16);
  --ct-shadow-primary: 0 10px 22px rgb(var(--ct-rgb-primary) / .2);

  /* Backwards-compatible aliases used by existing pages */
  --ct-green: var(--ct-primary);
  --ct-green-strong: var(--ct-primary-hover);
  --ct-green-soft: var(--ct-primary-soft);
  --ct-orange: var(--ct-warning);
  --ct-shadow: var(--ct-shadow-md);

  font-family: var(--ct-font-sans);
  color: var(--ct-ink);
  background: var(--ct-bg);
  color-scheme: light;
}

html[data-theme="dark"] {
  --ct-primary: #23b6ff;
  --ct-primary-hover: #14e0a5;
  --ct-primary-strong: #7dd5ff;
  --ct-primary-ink: #031820;
  --ct-primary-soft: #0b3048;
  --ct-primary-border: #245b79;

  --ct-ink: #f3f7fb;
  --ct-ink-soft: #d8e4ee;
  --ct-muted: #a7b7c8;
  --ct-subtle: #8094a8;
  --ct-bg: #050a10;
  --ct-surface: #0a233d;
  --ct-surface-soft: #102a43;
  --ct-surface-tint: #181531;
  --ct-border: #29435d;
  --ct-border-soft: #203a53;
  --ct-dark: #050a10;
  --ct-dark-deep: #050a10;
  --ct-dark-soft: #0a233d;
  --ct-on-dark: #f3f7fb;

  --ct-success: #5ee6a8;
  --ct-success-soft: #10271f;
  --ct-success-border: #24543f;
  --ct-danger: #ff8b83;
  --ct-danger-soft: #2b1718;
  --ct-danger-border: #603033;
  --ct-warning: #ff9a3d;
  --ct-warning-ink: #ffd1a3;
  --ct-warning-soft: #2b1b0f;
  --ct-info: #77b7ff;
  --ct-info-soft: #14253a;

  --ct-rgb-surface: 10 35 61;

  --ct-shadow-xs: 0 8px 20px rgb(0 0 0 / .18);
  --ct-shadow-sm: 0 9px 24px rgb(0 0 0 / .22);
  --ct-shadow-md: 0 14px 38px rgb(0 0 0 / .28);
  --ct-shadow-lg: 0 24px 50px rgb(0 0 0 / .36);
  --ct-shadow-primary: 0 10px 22px rgb(var(--ct-rgb-primary) / .13);

  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  direction: rtl;
  font-family: var(--ct-font-sans);
  margin: 0;
  text-align: right;
  color: var(--ct-ink);
  background: var(--ct-bg);
  transition: color .24s ease, background-color .24s ease;
}

#main-content {
  flex: 1 0 auto;
}

.site-download-fab {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 900;
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 9px;
  border: 1px solid rgb(255 255 255 / .2);
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, #0487d1, #23b6ff 54%, #14d8a2);
  box-shadow: 0 16px 36px rgb(3 24 32 / .28), 0 3px 10px rgb(35 182 255 / .24);
  text-decoration: none;
  direction: rtl;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.site-download-fab:hover,
.site-download-fab:focus-visible {
  color: #fff;
  transform: translateY(-3px);
  filter: brightness(1.05);
  box-shadow: 0 20px 42px rgb(3 24 32 / .32), 0 5px 14px rgb(35 182 255 / .30);
}
.site-download-fab:focus-visible { outline: 3px solid var(--ct-primary-border); outline-offset: 3px; }
.site-download-fab__icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #06314a;
  background: rgb(255 255 255 / .94);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .6);
  font-size: 1rem;
}
.site-download-fab__copy { display: grid; gap: 1px; line-height: 1.25; }
.site-download-fab__copy strong { font-size: .78rem; font-weight: 850; white-space: nowrap; }
.site-download-fab__copy small { color: rgb(255 255 255 / .85); font-size: .61rem; font-weight: 600; white-space: nowrap; }
@media (max-width: 620px) {
  .site-download-fab { right: 13px; bottom: max(15px, env(safe-area-inset-bottom)); min-height: 50px; padding: 6px; border-radius: 16px; }
  .site-download-fab__icon { width: 38px; height: 38px; border-radius: 11px; }
  .site-download-fab__copy { display: none; }
}
img { max-width: 100%; }
a { color: inherit; }
button, input, textarea, select { font: inherit; font-family: var(--ct-font-sans); }
input, textarea, select, .card, .site-footer, .site-header { transition-property: background-color, border-color, color; transition-duration: .24s; transition-timing-function: ease; }

.skip-link { position: fixed; right: 1rem; top: -100px; z-index: 9999; background: var(--ct-surface); color: var(--ct-ink); padding: 10px 14px; border-radius: 8px; box-shadow: var(--ct-shadow); }
.skip-link:focus { top: 1rem; }
.container { width: min(1180px, calc(100% - 36px)); margin: 0 auto; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 1000; background: rgb(var(--ct-rgb-surface) / .96); border-bottom: 1px solid var(--ct-border-soft); backdrop-filter: blur(16px); transition: background-color .24s ease, border-color .24s ease; }
.nav-wrap { min-height: 72px; display: grid; grid-template-columns: auto 1fr minmax(220px, 300px) auto auto; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ct-ink); text-decoration: none; white-space: nowrap; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; color: var(--ct-primary); flex: 0 0 auto; }
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-mark-dot { fill: var(--ct-ink); transition: fill .24s ease; }
.brand-logo { display: block; width: auto; object-fit: contain; }
.brand-logo--horizontal { height: 48px; max-width: 190px; }
.brand-copy { display: flex; flex-direction: column; direction: ltr; text-align: left; line-height: 1; }
.brand-copy strong { font-family: var(--ct-font-latin); font-size: 1.06rem; letter-spacing: -.035em; }
.brand-copy small { margin-top: 5px; color: var(--ct-muted); font-size: .57rem; letter-spacing: .02em; }
#main-nav { display: flex; align-items: center; justify-content: center; gap: 25px; min-width: 0; }
#main-nav a { position: relative; color: var(--ct-ink-soft); text-decoration: none; font-size: .91rem; font-weight: 700; padding: 25px 0 23px; transition: color .18s ease; }
#main-nav a:hover, #main-nav a.is-active { color: var(--ct-primary-strong); }
#main-nav a.is-active::after { content: ""; position: absolute; right: 0; left: 0; bottom: 15px; height: 2px; border-radius: 99px; background: var(--ct-primary); }
.nav-cart-count {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 99px;
  color: #07130d;
  background: var(--ct-primary);
  font-size: .65rem;
  font-weight: 900;
  line-height: 1;
}
.nav-mobile-link { display: none; }
.header-search { min-width: 0; height: 40px; display: flex; align-items: center; gap: 8px; direction: rtl; padding: 0 12px; border: 1px solid var(--ct-border); background: var(--ct-surface-soft); border-radius: 10px; }
.header-search svg,
.header-search > i,
.header-search-submit {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: var(--ct-ink-soft);
  fill: none;
  stroke: var(--ct-ink-soft);
  stroke-width: 1.8;
  flex: 0 0 auto;
  font-size: 0.92rem;
}
.header-search-submit {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}
.header-search-submit:hover,
.header-search-submit:focus-visible {
  color: var(--ct-primary-strong);
}
.header-search-submit i { pointer-events: none; }
.header-search input { border: 0; outline: 0; background: transparent; padding: 0; width: 100%; height: auto; font-size: .78rem; color: var(--ct-ink-soft); box-shadow: none; }
.header-search input::placeholder { color: var(--ct-subtle); }
.header-auth { display: flex; align-items: center; gap: 7px; direction: rtl; }
.header-auth a { min-width: 62px; height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 12px; text-decoration: none; border-radius: 9px; font-size: .82rem; font-weight: 750; white-space: nowrap; transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.header-auth a:hover { transform: translateY(-1px); }
.header-auth i { font-size: .8rem; }
.header-auth a.header-cart {
  position: relative;
  width: 38px;
  min-width: 38px;
  padding: 0;
  color: var(--ct-ink-soft);
  border: 1px solid var(--ct-border);
  background: var(--ct-surface);
}
.header-auth a.header-cart:hover,
.header-auth a.header-cart.is-active {
  color: var(--ct-primary-strong);
  border-color: var(--ct-primary-border);
  background: var(--ct-primary-soft);
}
.header-auth a.header-cart i { font-size: .92rem; }
.header-cart-count {
  position: absolute;
  top: -6px;
  left: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ct-surface);
  border-radius: 99px;
  color: #07130d;
  background: var(--ct-primary);
  font-size: .61rem;
  font-weight: 900;
  line-height: 1;
}
.header-login { color: var(--ct-ink-soft); border: 1px solid transparent; background: transparent; }
.header-login:hover { color: var(--ct-primary-strong); border-color: var(--ct-primary-border); background: var(--ct-primary-soft); }
.header-register { min-width: 84px !important; color: var(--ct-primary-ink); background: var(--ct-primary); border: 1px solid var(--ct-primary); box-shadow: 0 5px 14px rgb(var(--ct-rgb-primary) / .16); }
.header-register:hover { background: var(--ct-primary-hover); border-color: var(--ct-primary-hover); box-shadow: 0 7px 18px rgb(var(--ct-rgb-primary) / .2); }
.header-logout { color: var(--ct-muted); border: 1px solid var(--ct-border); background: var(--ct-surface); }
.header-logout:hover { color: var(--ct-danger); border-color: var(--ct-danger-border); background: var(--ct-danger-soft); }
.theme-toggle {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  padding: 0;
  border: 1px solid var(--ct-border);
  border-radius: 10px;
  color: var(--ct-ink-soft);
  background: var(--ct-surface);
  cursor: pointer;
  line-height: 1;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .18s ease;
}
.theme-toggle:hover { color: var(--ct-primary-strong); border-color: var(--ct-primary-border); background: var(--ct-primary-soft); transform: translateY(-1px); }
.theme-toggle:active { transform: scale(.96); }
.theme-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.theme-toggle .theme-icon-sun { display: none; }
.theme-toggle .theme-icon-moon { display: block; }
html[data-theme="dark"] .theme-toggle .theme-icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .theme-icon-moon { display: none; }
.nav-toggle { display: none; width: 44px; height: 44px; padding: 9px; border: 1px solid var(--ct-border); border-radius: 10px; background: var(--ct-surface); color: var(--ct-ink); }
.nav-toggle span { display: block; height: 2px; margin: 4px 0; background: currentColor; border-radius: 99px; }

html[data-theme="light"] .nav-toggle {
  color: #174922;
  border-color: #b8d5a9;
  background: #f4faef;
  box-shadow: 0 3px 10px rgb(23 73 34 / .08);
}

html[data-theme="light"] .nav-toggle:hover,
html[data-theme="light"] .nav-toggle:focus-visible,
html[data-theme="light"] .nav-toggle[aria-expanded="true"] {
  color: #123a1b;
  border-color: var(--ct-primary);
  background: var(--ct-primary);
}

/* Shared buttons / forms */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 10px 18px; border-radius: 9px; background: var(--ct-primary); color: var(--ct-primary-ink); text-decoration: none; border: 0; cursor: pointer; font-weight: 800; }
.button:hover { background: var(--ct-primary-hover); }
.button:disabled { cursor: wait; opacity: .65; }
.button-small { min-height: 36px; padding: 7px 12px; }
.section { padding: 48px 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.card { background: var(--ct-surface); border: 1px solid var(--ct-border); border-radius: 14px; padding: 20px; box-shadow: var(--ct-shadow-xs); transition: background-color .24s ease, border-color .24s ease, color .24s ease; }
.card h3 { margin-top: 0; }
.muted { color: var(--ct-muted); }
.form-card { max-width: 620px; margin: 48px auto; }

.otp-resend {
  margin-top: 12px;
}

.otp-resend__status {
  margin: 0 0 8px;
  font-size: .9rem;
}

.otp-resend__status span {
  color: var(--ct-primary-strong);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

label { display: block; margin: 14px 0 6px; font-weight: 700; }

input,
textarea,
select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--ct-border);
  border-radius: 8px;
  outline: 0;
  color: var(--ct-ink);
  background: var(--ct-surface);
  background-clip: padding-box;
  box-shadow: none;
  caret-color: var(--ct-primary-strong);
  transition:
    background-color .18s ease,
    border-color .18s ease,
    color .18s ease,
    box-shadow .18s ease;
}

/* Remove Safari's inset field styling without changing native controls such as
   checkboxes, file inputs, date pickers, or submit buttons. */
input:not([type]),
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="text"],
input[type="url"],
textarea {
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--ct-primary-strong);
  outline: 0;
  box-shadow: 0 0 0 3px rgb(var(--ct-rgb-primary) / .14);
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgb(var(--ct-rgb-primary) / .35);
  outline-offset: 2px;
}
.errorlist { color: var(--ct-danger); padding-right: 18px; }
.messages { padding-top: 14px; }
.message { background: var(--ct-success-soft); color: var(--ct-success); border: 1px solid var(--ct-success-border); padding: 12px 16px; border-radius: 10px; }
.course-price { font-weight: 800; color: var(--ct-primary-strong); }
.media-player { display: block; width: 100%; max-height: 540px; border-radius: 10px; background: var(--ct-ink); }
audio { width: 100%; }
.notice { padding: 24px; border-radius: 10px; background: var(--ct-warning-soft); color: var(--ct-warning-ink); }
.dashboard-stats strong, .dashboard-stats span { display: block; }
.dashboard-stats strong { font-size: 2rem; color: var(--ct-primary-strong); }
.dashboard-stats span { margin-top: 6px; color: var(--ct-muted); }
.recent-row { display: flex; justify-content: space-between; gap: 12px; margin: 10px 0; }
.complete-form { margin-top: 20px; }
.course-thumbnail { display: block; width: 100%; max-height: 360px; object-fit: cover; border-radius: 14px; margin-bottom: 20px; }
.notice-small { display: inline-block; padding: 8px 12px; color: var(--ct-primary-strong); background: var(--ct-primary-soft); border-radius: 8px; }
.review { margin: 10px 0; }
.review p { margin-bottom: 0; }
.breadcrumbs { margin-bottom: 18px; font-size: .9rem; color: var(--ct-muted); }
.breadcrumbs a { color: var(--ct-primary-strong); }
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 28px; }

/* Footer */
.site-footer { margin-top: 64px; padding: 38px 0 18px; color: var(--ct-muted); border-top: 1px solid var(--ct-border); background: var(--ct-surface); transition: background-color .24s ease, border-color .24s ease, color .24s ease; }
.footer-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: start; }
.footer-brand p { max-width: 560px; line-height: 2; margin: 18px 0 0; font-size: .9rem; }
.brand-footer .brand-mark { width: 42px; height: 42px; }
.brand-footer .brand-logo--horizontal { height: 62px; max-width: 250px; }
.footer-links { display: grid; grid-template-columns: repeat(3, minmax(90px, 1fr)); gap: 14px 20px; padding-top: 6px; }
.footer-links a, .footer-bottom a { text-decoration: none; color: var(--ct-muted); font-size: .85rem; }
.footer-links a:hover, .footer-bottom a:hover { color: var(--ct-primary-strong); }
.footer-bottom { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--ct-border-soft); display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: .78rem; }

@media (max-width: 1080px) {
  .nav-wrap { grid-template-columns: auto 1fr auto auto; gap: 12px; }
  .header-search { display: none; }
  #main-nav { gap: 18px; }
}

@media (max-width: 820px) {
  .container { width: min(100% - 28px, 1180px); }
  .nav-wrap { min-height: 66px; grid-template-columns: minmax(0, 1fr) 44px 44px; position: relative; gap: 9px; }
  .nav-toggle { display: block; grid-column: 3; grid-row: 1; }
  .theme-toggle { grid-column: 2; grid-row: 1; }
  .brand { min-width: 0; grid-column: 1; grid-row: 1; justify-self: start; }
  .brand-copy { min-width: 0; }
  .brand-copy small { display: none; }
  #main-nav { display: none; position: absolute; top: calc(100% + 1px); right: 0; left: 0; padding: 12px 14px 16px; background: var(--ct-surface); border: 1px solid var(--ct-border); border-top: 0; border-radius: 0 0 14px 14px; box-shadow: 0 18px 36px rgb(var(--ct-rgb-ink) / .12); flex-direction: column; align-items: stretch; gap: 0; }
  #main-nav.is-open { display: flex; }
  #main-nav a { padding: 11px 8px; border-bottom: 1px solid var(--ct-border-soft); }
  #main-nav a:last-child { border-bottom: 0; }
  #main-nav a.is-active::after { display: none; }
  .nav-mobile-link { display: block; }
  #main-nav .nav-mobile-cart {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .nav-mobile-cart > span { display: inline-flex; align-items: center; gap: 7px; }
  .header-auth { display: none; }
  .filters { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-links { grid-template-columns: repeat(2, 1fr); }
}

@media (hover: none) and (pointer: coarse) {
  .theme-toggle:hover {
    transform: none;
  }
}

@media (max-width: 520px) {
  .brand-mark { width: 34px; height: 34px; }
  .brand-logo--horizontal { height: 42px; max-width: 154px; }
  .brand-copy strong { font-size: .96rem; }
  .footer-bottom { align-items: flex-start; flex-direction: column; }
}

/* Keep only the real desktop navigation items on one vertical axis.
   Mobile-only links must stay hidden on desktop. */
@media (min-width: 821px) {
  #main-nav {
    height: 72px;
    white-space: nowrap;
  }

  #main-nav > a:not(.nav-mobile-link),
  .nav-dropdown-summary {
    height: 72px;
    min-height: 72px;
    padding-top: 0;
    padding-bottom: 0;
    display: inline-flex;
    align-items: center;
    line-height: 1.5;
  }

  #main-nav > a:not(.nav-mobile-link) {
    justify-content: center;
  }

  #main-nav > .nav-mobile-link {
    display: none !important;
  }

  .nav-dropdown {
    height: 72px;
    align-self: center;
  }

  .nav-dropdown-summary-label {
    line-height: inherit;
  }
}

/* Main navigation: course-type dropdown. */
.nav-dropdown {
  position: relative;
  min-width: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
}

.nav-dropdown-summary {
  position: relative;
  min-height: 72px;
  padding: 0;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--ct-ink-soft);
  font-family: var(--ct-font-sans);
  font-size: .91rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: color .18s ease;
}

.nav-dropdown-summary-label {
  position: relative;
  display: inline-block;
  line-height: 1.5;
}

.nav-dropdown-summary > svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s ease;
}

.nav-dropdown:hover > .nav-dropdown-summary,
.nav-dropdown:focus-within > .nav-dropdown-summary,
.nav-dropdown.is-open > .nav-dropdown-summary,
.nav-dropdown.is-active > .nav-dropdown-summary {
  color: var(--ct-primary-strong);
}

/* The active line is exactly the text width — no inset on either side. */
.nav-dropdown.is-active .nav-dropdown-summary-label::after {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  bottom: -10px;
  height: 2px;
  border-radius: 99px;
  background: var(--ct-primary);
}

.nav-dropdown:hover > .nav-dropdown-summary > svg,
.nav-dropdown:focus-within > .nav-dropdown-summary > svg,
.nav-dropdown.is-open > .nav-dropdown-summary > svg {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% - 8px);
  right: 50%;
  z-index: 1100;
  min-width: 176px;
  padding: 7px;
  border: 1px solid var(--ct-border);
  border-radius: 12px;
  background: var(--ct-surface);
  box-shadow: var(--ct-shadow-md);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(50%, -6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}

/* Invisible bridge keeps the hover state while the pointer moves into the menu. */
.nav-dropdown-menu::before {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  top: -12px;
  height: 12px;
}

/* Desktop opens on hover; focus-within also keeps it keyboard-accessible. */
.nav-dropdown:hover > .nav-dropdown-menu,
.nav-dropdown:focus-within > .nav-dropdown-menu,
.nav-dropdown.is-open > .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(50%, 0);
}

#main-nav .nav-dropdown-menu a {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  border-radius: 8px;
  color: var(--ct-ink-soft);
  font-family: var(--ct-font-sans);
  font-size: .8rem;
  font-weight: 750;
  line-height: 1.7;
  white-space: nowrap;
}

#main-nav .nav-dropdown-menu a::after {
  display: none !important;
}

#main-nav .nav-dropdown-menu a:hover,
#main-nav .nav-dropdown-menu a:focus-visible,
#main-nav .nav-dropdown-menu a.is-current {
  color: var(--ct-primary-strong);
  background: var(--ct-primary-soft);
}

@media (max-width: 820px) {
  #main-nav {
    max-height: calc(100dvh - 74px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .nav-dropdown {
    width: 100%;
    align-self: auto;
    display: block;
    border-bottom: 1px solid var(--ct-border-soft);
  }

  .nav-dropdown-summary {
    width: 100%;
    min-height: 0;
    padding: 11px 8px;
    justify-content: space-between;
    color: var(--ct-ink-soft);
    font-size: .82rem;
    line-height: 1.5;
    text-align: right;
  }

  .nav-dropdown-summary-label {
    line-height: 1.5;
  }

  .nav-dropdown.is-active .nav-dropdown-summary-label::after {
    display: none;
  }

  /* Hover must not force a submenu open on touch/mobile layouts. */
  .nav-dropdown:hover > .nav-dropdown-menu,
  .nav-dropdown:focus-within > .nav-dropdown-menu {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: none;
  }

  .nav-dropdown-menu {
    position: static;
    width: 100%;
    min-width: 0;
    max-height: 0;
    margin: 0;
    padding: 0 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    overflow: hidden;
    transform: none;
    transition: max-height .22s ease, opacity .18s ease, padding .22s ease;
  }

  .nav-dropdown-menu::before {
    display: none;
  }

  .nav-dropdown.is-open > .nav-dropdown-menu {
    max-height: 180px;
    padding-top: 2px;
    padding-bottom: 9px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  #main-nav .nav-dropdown-menu a {
    width: 100%;
    min-height: 38px;
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    justify-content: flex-start;
    font-size: .79rem;
  }

  #main-nav .nav-dropdown-menu a + a {
    margin-top: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-dropdown-summary > svg,
  .nav-dropdown-menu {
    transition: none !important;
  }
}


/* 2026-09-19: exact vertical alignment for all primary navigation items.
   Every desktop item now uses the same anchor + label structure. */
@media (min-width: 821px) {
  #main-nav {
    height: 72px;
    align-items: stretch;
  }

  #main-nav > .nav-root-link,
  #main-nav > .nav-dropdown {
    height: 72px;
    min-height: 72px;
    margin: 0;
    align-self: stretch;
  }

  #main-nav > .nav-root-link,
  #main-nav > .nav-dropdown > .nav-root-link {
    position: relative;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ct-ink-soft);
    font-family: var(--ct-font-sans);
    font-size: .91rem;
    font-weight: 700;
    line-height: 1 !important;
    text-decoration: none;
    vertical-align: middle;
  }

  #main-nav .nav-root-label {
    position: relative;
    height: 72px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1 !important;
    white-space: nowrap;
  }

  /* Disable the legacy underline attached to the anchor itself. */
  #main-nav > .nav-root-link.is-active::after {
    display: none !important;
  }

  /* One identical underline implementation for normal links and Courses. */
  #main-nav > .nav-root-link.is-active .nav-root-label::after,
  #main-nav > .nav-dropdown.is-active > .nav-root-link .nav-root-label::after {
    content: "";
    position: absolute;
    right: 0;
    left: 0;
    bottom: 11px;
    height: 2px;
    border-radius: 99px;
    background: var(--ct-primary);
  }

  #main-nav > .nav-dropdown > .nav-dropdown-summary {
    min-height: 72px;
    height: 72px;
    gap: 6px;
    line-height: 1 !important;
  }

  #main-nav > .nav-dropdown > .nav-dropdown-summary > svg {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    margin: 0;
    align-self: center;
  }
}

@media (max-width: 820px) {
  #main-nav > .nav-root-link,
  #main-nav > .nav-dropdown > .nav-root-link {
    width: 100%;
    min-height: 0;
    height: auto;
    padding: 11px 8px !important;
    display: flex;
    align-items: center;
    line-height: 1.5 !important;
  }

  #main-nav .nav-root-label {
    height: auto;
    display: inline;
    line-height: inherit !important;
  }

  #main-nav > .nav-dropdown > .nav-dropdown-summary {
    justify-content: space-between;
  }

  #main-nav .nav-root-label::after {
    display: none !important;
  }
}
