/*
 * site-header: one-row header, full width, sticky.
 * Stays light in dark mode, like the template's brand bar.
 * tcc-header.js reshapes the tccNavigation helper's lists into:
 *   .tcc-hd__list > li.has-panel > button      top-level item that opens a panel
 *   .tcc-hd__panel > .tcc-hd__panel-in         full-width panel
 *     .tcc-hd__main > .tcc-hd__groups          course groups, in columns
 *       li.tcc-hd__group > .tcc-hd__group-title, p, ul, a.tcc-hd__all
 *     .tcc-hd__side                            popular courses and adviser (courses panel only)
 * Below 1080px the menu moves into a drawer (.tcc-hd__drawer).
 */
.tcc-hd {
  --hd-ink: #0f2b50;
  --hd-muted: #3d4a5c;
  --hd-line: #cfdbe8;
  --hd-surface: #f3f7fb;
  --hd-link: #184c8c;
  --hd-accent: #0f8277;
  position: sticky;
  top: 0;
  z-index: 60;
  background: #fff;
  color: var(--hd-ink);
  border-bottom: 1px solid var(--hd-line);
}
.tcc-hd ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tcc-hd li {
  margin: 0;
}
.tcc-hd li.hidden {
  display: none;
}
.tcc-hd a {
  color: inherit;
  text-decoration: none;
}
/* plain buttons: undo Web Awesome's native button style */
.tcc-hd button {
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.tcc-hd__row {
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: 1400px; /* wider than the page content, so the row fits */
  height: 76px;
  margin: 0 auto;
  padding: 0 16px;
}
/* the logo never shrinks; without this the page-wide img max-width squeezes it to nothing */
.tcc-hd__logo {
  flex: none;
}
.tcc-hd__logo img {
  display: block;
  height: 40px;
  width: auto;
  max-width: none;
}

/* top-level menu */
.tcc-hd__list {
  display: flex;
  gap: 4px;
}
.tcc-hd__list > li > :is(a, span, button) {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 76px;
  padding: 0 12px;
  font-weight: 600;
  font-size: .98rem;
  color: var(--hd-ink);
}
.tcc-hd__list > li > :is(a, button):hover,
.tcc-hd__list > li:is(.active, .is-open) > :is(a, span, button) {
  color: var(--hd-link);
}
.tcc-hd__list > li:is(.active, .is-open) > :is(a, span, button)::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--tcc-teal-bright);
}
.tcc-hd__list > li > button wa-icon {
  font-size: .7em;
  transition: rotate .15s;
}
.tcc-hd__list > li.is-open > button wa-icon {
  rotate: 180deg;
}

.tcc-hd__end {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
}
.tcc-hd__phone {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: .95rem;
  color: var(--hd-muted);
  white-space: nowrap;
}
.tcc-hd__phone wa-icon {
  color: var(--hd-accent);
}
.tcc-hd wa-button::part(base) {
  min-height: 44px;
  padding-inline: 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: .95rem;
}
/* the header's buttons stay light-mode blue in dark mode */
.tcc-hd wa-button[variant="brand"]::part(base) {
  background: var(--tcc-blue);
  color: #fff;
  border-color: var(--tcc-blue);
}
.tcc-hd wa-button[variant="brand"]::part(base):hover {
  background: var(--tcc-navy);
}
/* basket with count */
.tcc-hd__basket {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  font-size: 1.2rem;
}
.tcc-hd__basket:hover {
  background: var(--hd-surface);
}
.tcc-hd__count {
  position: absolute;
  top: 3px;
  right: 0;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--tcc-teal-bright);
  color: var(--tcc-navy);
  font-size: .72rem;
  line-height: 19px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
}
.tcc-hd__count.is-new {
  animation: tcc-hd-pop .4s ease-out;
}
@keyframes tcc-hd-pop {
  0% { scale: .4; }
  60% { scale: 1.25; }
  100% { scale: 1; }
}

.tcc-hd .tcc-hd__icon {
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  font-size: 1.2rem;
}

/* drop-down panel */
.tcc-hd__panel {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  max-height: calc(100vh - 77px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  border-bottom: 1px solid var(--hd-line);
  box-shadow: 0 30px 60px rgba(15, 43, 80, .18);
}
.tcc-hd__list > li.is-open > .tcc-hd__panel {
  display: block;
  animation: tcc-hd-drop .18s ease-out;
}
@keyframes tcc-hd-drop {
  from { opacity: 0; translate: 0 -6px; }
  to { opacity: 1; translate: 0 0; }
}
.tcc-hd__panel-in {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 1120px;
  margin: 0 auto;
}
.tcc-hd__panel-in:has(.tcc-hd__side) {
  grid-template-columns: 1fr 300px;
}
.tcc-hd__main {
  padding: 24px 32px 28px 16px;
}

/* search */
.tcc-hd__search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 16px;
  border: 1.5px solid var(--hd-line);
  border-radius: 10px;
  background: var(--hd-surface);
  color: var(--hd-muted);
}
.tcc-hd__search:focus-within {
  border-color: #2f6bb3;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 107, 179, .15);
}
.tcc-hd__search input {
  flex: 1;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--hd-ink);
  font: inherit;
}
/* the search box shows the focus ring instead */
.tcc-hd .tcc-hd__search input:focus-visible {
  outline: 0;
}
.tcc-hd__search kbd {
  padding: 2px 7px;
  border: 1px solid var(--hd-line);
  border-radius: 5px;
  background: #fff;
  color: var(--hd-muted);
  font: 600 .75rem var(--wa-font-family-body);
}
.tcc-hd__results {
  margin-top: 20px;
}
.tcc-hd__results ul {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px 26px;
}
.tcc-hd__results a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  font-weight: 600;
}
.tcc-hd__results a:hover {
  background: var(--hd-surface);
}
.tcc-hd__results small {
  display: block;
  font-size: .78rem;
  font-weight: 400;
  color: var(--hd-muted);
}
.tcc-hd__empty {
  padding: 10px 0;
  color: var(--hd-muted);
}
.tcc-hd__search-wrap.is-searching ~ .tcc-hd__groups {
  display: none;
}

/* course groups */
.tcc-hd__groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 26px;
}
.tcc-hd__search-wrap + .tcc-hd__groups {
  margin-top: 24px;
}
.tcc-hd__group-title {
  display: block;
  font-family: var(--wa-font-family-heading);
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.2;
}
a.tcc-hd__group-title:hover {
  color: var(--hd-link);
}
.tcc-hd__group > p {
  margin: 3px 0 0;
  font-size: .82rem;
  color: var(--hd-muted);
}
.tcc-hd__group > ul {
  margin-top: 8px;
}
.tcc-hd__groups a:not(.tcc-hd__group-title, .tcc-hd__all) {
  display: block;
  padding: 5px 0;
  font-size: .93rem;
}
.tcc-hd__groups a:not(.tcc-hd__group-title):hover {
  color: var(--hd-link);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.tcc-hd__groups li.visible-phone,
.tcc-hd__groups li.is-extra {
  display: none;
}
/* current page: its group heading and its link */
.tcc-hd__group.active > .tcc-hd__group-title {
  color: var(--hd-link);
}
.tcc-hd__groups li.active > a:not(.tcc-hd__group-title, .tcc-hd__all) {
  margin-left: -11px;
  padding-left: 8px;
  border-left: 3px solid var(--tcc-teal-bright);
  color: var(--hd-link);
  font-weight: 700;
}

.tcc-hd .tcc-hd__all {
  display: inline-flex;
  margin-top: 8px;
  font-size: .88rem;
  font-weight: 700;
  color: var(--hd-link);
}

/* side column */
.tcc-hd__side {
  padding: 24px 22px 28px;
  background: var(--hd-surface);
  border-left: 1px solid var(--hd-line);
}
.tcc-hd__side-title {
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--hd-accent);
}
.tcc-hd__popular {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.tcc-hd__popular a {
  display: block;
  padding: 11px 14px;
  background: #fff;
  border: 1px solid var(--hd-line);
  border-radius: 10px;
}
.tcc-hd__popular a:hover {
  border-color: #2f6bb3;
}
.tcc-hd__popular b {
  display: block;
  font-size: .95rem;
}
.tcc-hd__popular small {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
  font-size: .8rem;
  color: var(--hd-muted);
}
.tcc-hd__popular small span {
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--tcc-sage);
  color: var(--tcc-navy);
  font-weight: 700;
  font-size: .7rem;
}
.tcc-hd__adviser {
  margin-top: 16px;
  padding: 14px;
  border-radius: 10px;
  background: var(--tcc-navy);
  color: #fff;
}
.tcc-hd__adviser b {
  display: block;
}
.tcc-hd__adviser p {
  margin-top: 3px;
  font-size: .88rem;
  color: var(--tcc-band-muted);
}
.tcc-hd__adviser a {
  display: inline-flex;
  margin-top: 8px;
  font-weight: 700;
  color: var(--tcc-mint);
}
.tcc-hd .tcc-hd__dates {
  display: inline-flex;
  margin-top: 14px;
  font-weight: 700;
  font-size: .92rem;
  color: var(--hd-link);
}

/* ===== phone and tablet: drawer ===== */
.tcc-hd__drawer {
  --size: min(420px, 100vw);
  color: var(--hd-ink);
}
/* the drawer's content inherits from its dialog part, so set the light colours there */
.tcc-hd__drawer::part(dialog) {
  background: #fff;
  color: var(--hd-ink);
}
.tcc-hd__drawer::part(body) {
  padding: 0;
}
.tcc-hd__drawer::part(footer) {
  padding: 0;
  border-top: 1px solid var(--hd-line);
}
.tcc-hd__drawer-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  height: 60px;
  padding: 0 10px 0 16px;
  background: #fff;
  border-bottom: 1px solid var(--hd-line);
}
.tcc-hd__drawer-head img {
  height: 30px;
}
.tcc-hd .tcc-hd__close {
  display: grid;
  margin-left: auto;
  background: var(--hd-surface);
}
.tcc-hd__drawer-body {
  padding: 14px 16px 0;
}
.tcc-hd__drawer .tcc-hd__search {
  height: 46px;
}
.tcc-hd__drawer .tcc-hd__search kbd {
  display: none;
}
.tcc-hd__drawer .tcc-hd__results ul {
  display: block;
}
.tcc-hd__acc {
  margin-top: 14px;
  border-top: 1px solid var(--hd-line);
}
.tcc-hd__drawer .tcc-hd__search-wrap.is-searching ~ .tcc-hd__acc {
  display: none;
}
.tcc-hd__acc > li {
  border-bottom: 1px solid var(--hd-line);
}
.tcc-hd__acc > li > :is(a, button) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 8px 0;
  text-align: left;
  font-weight: 700;
  font-size: 1.02rem;
}
.tcc-hd__acc > li > button small {
  display: block;
  font-weight: 500;
  font-size: .78rem;
  color: var(--hd-muted);
}
.tcc-hd__acc > li > button wa-icon {
  flex: none;
  font-size: .8rem;
  transition: rotate .15s;
}
.tcc-hd__acc > li > button[aria-expanded="true"] wa-icon {
  rotate: 180deg;
}
.tcc-hd__acc > li > ul {
  padding-bottom: 12px;
}
.tcc-hd__acc > li > ul a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: .95rem;
}
.tcc-hd__acc > li > ul a:hover {
  background: var(--hd-surface);
}
.tcc-hd__acc li.is-extra {
  display: none;
}
/* current page in the drawer */
.tcc-hd__acc > li.active > :is(a, button) {
  color: var(--hd-link);
}
.tcc-hd__acc > li > ul li.active > a {
  background: var(--hd-surface);
  box-shadow: inset 3px 0 0 var(--tcc-teal-bright);
  color: var(--hd-link);
  font-weight: 700;
}
.tcc-hd__acc .tcc-hd__all {
  margin: 0;
  color: var(--hd-link);
}
.tcc-hd__drawer-help {
  margin: 18px 16px 20px;
  padding: 14px;
  border-radius: 12px;
  background: var(--hd-surface);
  font-size: .9rem;
  color: var(--hd-muted);
}
.tcc-hd__drawer-help b {
  color: var(--hd-ink);
}
.tcc-hd__drawer-foot {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 12px 16px 16px;
}
.tcc-hd__call {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1.5px solid var(--hd-line);
  border-radius: 10px;
  color: var(--hd-accent);
  font-size: 1.1rem;
}
.tcc-hd__drawer-foot wa-button::part(base) {
  min-height: 48px;
}

/* The header can never make the page scroll sideways; the rules below keep
   everything in view, this is only a safety net. */
.tcc-hd {
  overflow-x: clip;
}

/* below 1520px the phone link shows as its icon only, leaving room for up to
   eight top-level menu items */
@media (max-width: 1519px) {
  .tcc-hd__phone-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .tcc-hd__phone {
    font-size: 1.2rem;
  }
}

/* small desktops: tighter menu */
@media (min-width: 1080px) and (max-width: 1279px) {
  .tcc-hd__row {
    gap: 14px;
  }
  .tcc-hd__logo img {
    height: 34px;
  }
  .tcc-hd__list > li > :is(a, span, button) {
    padding: 0 8px;
    font-size: .92rem;
  }
  .tcc-hd__list > li:is(.active, .is-open) > :is(a, span, button)::after {
    left: 8px;
    right: 8px;
  }
  .tcc-hd__end {
    gap: 12px;
  }
}

@media (max-width: 1079px) {
  .tcc-hd__row {
    height: 60px;
    gap: 6px;
    padding-right: 10px;
  }
  .tcc-hd__logo img {
    height: 30px;
  }
  .tcc-hd__nav,
  .tcc-hd__phone,
  .tcc-hd__cta {
    display: none;
  }
  .tcc-hd__end {
    gap: 0;
  }
  .tcc-hd .tcc-hd__icon {
    display: grid;
  }
  /* phone order: search, basket, menu */
  .tcc-hd .tcc-hd__icon--search {
    order: -1;
  }
  .tcc-hd .tcc-hd__icon--menu {
    order: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tcc-hd__list > li.is-open > .tcc-hd__panel,
  .tcc-hd__count.is-new {
    animation: none;
  }
}
