/* ==========================================================================
   LEC IELTS — universal site header (partials/site_header.php)
   Namespaced `lec-hdr-*` / `lec-drawer-*` and sized in px so the forked inner
   pages' own CSS (bare `header`, `nav`, `a`, `button`, html font-size …)
   can't distort it. Brand: red #e31e24, black #0d0d0d. No yellow.
   ========================================================================== */

.lec-hdr,
.lec-hdr-topbar,
.lec-drawer,
.lec-drawer-scrim,
.lec-hdr-skip {
  --lh-red: #e31e24;
  --lh-red-dark: #b9151a;
  --lh-black: #0d0d0d;
  --lh-white: #ffffff;
  --lh-grey: #4a4a4a;
  --lh-soft: #f6f6f6;
  --lh-radius: 10px;
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
}

.lec-hdr *,
.lec-hdr-topbar *,
.lec-drawer * {
  box-sizing: border-box;
}

:where(.lec-hdr, .lec-drawer) ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.lec-hdr a,
.lec-hdr-topbar a,
.lec-drawer a {
  text-decoration: none;
}

/* :where() keeps the reset at class-level specificity so .lec-*-link wins */
:where(.lec-hdr, .lec-drawer) button {
  font: inherit;
  margin: 0;
  cursor: pointer;
}

.lec-hdr-ico {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lec-hdr-wrap {
  width: min(100% - 32px, 1240px);
  margin: 0 auto;
}

.lec-hdr-anchor {
  display: block;
  height: 0;
}

/* --- Skip link --------------------------------------------------------- */
.lec-hdr-skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 3000;
  padding: 10px 16px;
  color: var(--lh-white);
  background: var(--lh-black);
  border-radius: var(--lh-radius);
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
}

.lec-hdr-skip:focus {
  top: 12px;
}

/* --- Top bar ----------------------------------------------------------- */
.lec-hdr-topbar {
  color: var(--lh-white);
  background: var(--lh-red);
  border-bottom: 2px solid var(--lh-black);
  font-size: 13px;
  font-weight: 700;
}

.lec-hdr-topbar-inner,
.lec-hdr-topbar-group {
  display: flex;
  align-items: center;
  gap: 8px 24px;
  flex-wrap: wrap;
}

.lec-hdr-topbar-inner {
  justify-content: space-between;
  min-height: 40px;
  padding: 6px 0;
}

.lec-hdr-topbar a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--lh-white) !important;
  opacity: 0.95;
  transition: opacity 150ms ease;
}

.lec-hdr-topbar a:hover {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lec-hdr-topbar .lec-hdr-ico {
  width: 15px;
  height: 15px;
}

/* --- Main bar ---------------------------------------------------------- */
.lec-hdr {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 2px solid var(--lh-black);
  transition: box-shadow 200ms ease;
}

@supports (backdrop-filter: blur(1px)) {
  .lec-hdr {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: saturate(1.4) blur(14px);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
  }
}

.lec-hdr.is-scrolled {
  box-shadow: 0 6px 0 rgba(13, 13, 13, 0.06), 0 10px 30px rgba(13, 13, 13, 0.08);
}

.lec-hdr-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 78px;
}

.lec-hdr-brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.lec-hdr-brand img {
  display: block;
  width: auto;
  height: 48px;
  max-width: none;
}

/* Nav links */
.lec-hdr-nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
}

.lec-hdr-menu {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2px;
}

.lec-hdr-link {
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  line-height: 1.2;
  text-transform: none;
  letter-spacing: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 44px;
  padding: 0 12px;
  color: var(--lh-black) !important;
  background: none;
  border: 0;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  transition: color 150ms ease, background-color 150ms ease;
}

.lec-hdr-link::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 3px;
  background: var(--lh-red);
  border-radius: 3px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms ease;
}

.lec-hdr-link:hover,
.lec-hdr-dd.is-open > .lec-hdr-link {
  color: var(--lh-red) !important;
  background: rgba(227, 30, 36, 0.06);
}

.lec-hdr-link:hover::after,
.lec-hdr-link.is-current::after,
.lec-hdr-dd.is-current > .lec-hdr-link::after,
.lec-hdr-dd.is-open > .lec-hdr-link::after {
  transform: scaleX(1);
}

.lec-hdr-link:focus-visible,
.lec-hdr-btn:focus-visible,
.lec-hdr-burger:focus-visible,
.lec-hdr-dd-panel a:focus-visible,
.lec-drawer a:focus-visible,
.lec-drawer button:focus-visible {
  outline: 3px solid var(--lh-red);
  outline-offset: 2px;
}

.lec-hdr-dd-btn .lec-hdr-ico {
  width: 16px;
  height: 16px;
  transition: transform 200ms ease;
}

.lec-hdr-dd.is-open > .lec-hdr-dd-btn .lec-hdr-ico {
  transform: rotate(180deg);
}

/* Dropdowns */
.lec-hdr-dd {
  position: relative;
}

.lec-hdr-dd-panel {
  position: absolute;
  top: 100%;
  left: 50%;
  z-index: 10;
  width: 320px;
  padding-top: 14px; /* hover bridge between button and panel */
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 0s linear 160ms;
}

.lec-hdr-dd.is-open > .lec-hdr-dd-panel {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition: opacity 160ms ease, transform 160ms ease, visibility 0s;
}

.lec-hdr-dd-panel ul {
  position: relative;
  margin: 0;
  list-style: none;
  display: grid;
  gap: 2px;
  padding: 8px;
  background: var(--lh-white);
  border: 2px solid var(--lh-black);
  border-radius: 14px;
  box-shadow: 6px 6px 0 var(--lh-black);
}

.lec-hdr-dd-panel ul::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 14px;
  height: 14px;
  background: var(--lh-white);
  border-top: 2px solid var(--lh-black);
  border-left: 2px solid var(--lh-black);
  transform: translateX(-50%) rotate(45deg);
}

.lec-hdr-dd-panel a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  color: var(--lh-black) !important;
  border-radius: 10px;
  transition: background-color 150ms ease;
}

.lec-hdr-dd-panel a:hover {
  background: var(--lh-soft);
}

.lec-hdr-dd-ico {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  color: var(--lh-red);
  background: rgba(227, 30, 36, 0.08);
  border: 2px solid transparent;
  border-radius: 10px;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.lec-hdr-dd-panel a:hover .lec-hdr-dd-ico {
  color: var(--lh-white);
  background: var(--lh-red);
  border-color: var(--lh-black);
}

.lec-hdr-dd-text {
  display: grid;
  gap: 2px;
}

.lec-hdr-dd-text strong {
  font-size: 15px;
  font-weight: 800;
}

.lec-hdr-dd-text small {
  color: var(--lh-grey);
  font-size: 13px;
  font-weight: 500;
}

/* Buttons */
.lec-hdr-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.lec-hdr-btn {
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  line-height: 1.2;
  text-transform: none;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px;
  border: 2px solid var(--lh-black);
  border-radius: var(--lh-radius);
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.lec-hdr-btn:hover {
  transform: translate(-2px, -2px);
}

.lec-hdr-btn:active {
  transform: translate(0, 0);
}

.lec-hdr-btn-red {
  color: var(--lh-white) !important;
  background: var(--lh-red);
  box-shadow: 4px 4px 0 var(--lh-black);
}

.lec-hdr-btn-red:hover {
  box-shadow: 6px 6px 0 var(--lh-black);
}

.lec-hdr-btn-red.is-current {
  background: var(--lh-red-dark);
}

.lec-hdr-btn-dark {
  color: var(--lh-white) !important;
  background: var(--lh-black);
  box-shadow: 4px 4px 0 var(--lh-red);
}

.lec-hdr-btn-dark:hover {
  box-shadow: 6px 6px 0 var(--lh-red);
}

.lec-hdr-btn:active {
  box-shadow: 1px 1px 0 var(--lh-black);
}

.lec-hdr-burger {
  display: none;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  color: var(--lh-black);
  background: var(--lh-white);
  border: 2px solid var(--lh-black);
  border-radius: var(--lh-radius);
  box-shadow: 3px 3px 0 var(--lh-black);
}

.lec-hdr-burger .lec-hdr-ico {
  width: 22px;
  height: 22px;
}

/* --- Mobile drawer ----------------------------------------------------- */
.lec-drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 1990;
  background: rgba(13, 13, 13, 0.5);
  opacity: 0;
  transition: opacity 220ms ease;
}

.lec-drawer-scrim.is-open {
  opacity: 1;
}

.lec-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  width: min(380px, 88vw);
  background: var(--lh-white);
  border-left: 2px solid var(--lh-black);
  box-shadow: -10px 0 40px rgba(13, 13, 13, 0.2);
  transform: translateX(105%);
  visibility: hidden;
  transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 280ms;
}

.lec-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
}

.lec-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 2px solid var(--lh-black);
}

.lec-drawer-head img {
  display: block;
  height: 40px;
  width: auto;
}

.lec-drawer-close {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--lh-white);
  background: var(--lh-red);
  border: 2px solid var(--lh-black);
  border-radius: var(--lh-radius);
  box-shadow: 3px 3px 0 var(--lh-black);
}

.lec-drawer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 12px;
}

.lec-drawer-link {
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  line-height: 1.2;
  text-transform: none;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  color: var(--lh-black) !important;
  background: none;
  border: 0;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 800;
  text-align: left;
}

.lec-drawer-link:hover,
.lec-drawer-link.is-current {
  color: var(--lh-red) !important;
  background: rgba(227, 30, 36, 0.06);
}

.lec-drawer-link.is-current {
  box-shadow: inset 4px 0 0 var(--lh-red);
}

.lec-drawer-link .lec-hdr-ico {
  transition: transform 200ms ease;
}

.lec-drawer-group.is-open > .lec-drawer-link {
  color: var(--lh-red) !important;
}

.lec-drawer-group.is-open > .lec-drawer-link .lec-hdr-ico {
  transform: rotate(180deg);
}

.lec-drawer-sub {
  display: none;
  padding: 2px 0 8px;
}

.lec-drawer-group.is-open > .lec-drawer-sub {
  display: grid;
  animation: lecDrawerSubIn 200ms ease;
}

@keyframes lecDrawerSubIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.lec-drawer-sub a {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0 2px 14px;
  padding: 8px 10px;
  color: var(--lh-black) !important;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
}

.lec-drawer-sub a:hover {
  background: var(--lh-soft);
}

.lec-drawer-sub .lec-hdr-dd-ico {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
}

.lec-drawer-foot {
  display: grid;
  gap: 12px;
  padding: 16px 18px 20px;
  border-top: 2px solid var(--lh-black);
  background: var(--lh-soft);
}

.lec-drawer-foot .lec-hdr-btn {
  width: 100%;
  height: 50px;
}

.lec-drawer-contact {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
  font-size: 14px;
  font-weight: 700;
}

.lec-drawer-contact a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--lh-grey) !important;
}

.lec-drawer-contact .lec-hdr-ico {
  width: 16px;
  height: 16px;
  color: var(--lh-red);
}

html.lec-drawer-lock,
html.lec-drawer-lock body {
  overflow: hidden;
}

/* --- Responsive -------------------------------------------------------- */
@media (max-width: 1180px) {
  .lec-hdr-link {
    padding: 0 9px;
    font-size: 14px;
  }

  .lec-hdr-link::after {
    left: 9px;
    right: 9px;
  }

  .lec-hdr-btn {
    padding: 0 14px;
    font-size: 14px;
  }
}

@media (max-width: 1080px) {
  .lec-hdr-nav {
    display: none;
  }

  .lec-hdr-bar {
    justify-content: space-between;
  }

  .lec-hdr-burger {
    display: grid;
  }
}

@media (max-width: 768px) {
  .lec-hdr-topbar {
    display: none;
  }

  .lec-hdr-bar {
    min-height: 68px;
  }

  .lec-hdr-brand img {
    height: 42px;
  }

  .lec-hdr-actions .lec-hdr-btn-dark {
    display: none;
  }
}

@media (max-width: 480px) {
  .lec-hdr-actions {
    gap: 10px;
  }

  .lec-hdr-actions .lec-hdr-btn-red {
    height: 42px;
    padding: 0 12px;
    font-size: 13px;
    box-shadow: 3px 3px 0 var(--lh-black);
  }

  .lec-hdr-actions .lec-hdr-btn-red .lec-hdr-ico {
    display: none;
  }

  .lec-hdr-burger {
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 340px) {
  .lec-hdr-actions .lec-hdr-btn-red {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lec-hdr *,
  .lec-drawer,
  .lec-drawer *,
  .lec-drawer-scrim {
    transition: none !important;
  }
}

@media print {
  .lec-hdr-topbar,
  .lec-hdr,
  .lec-drawer,
  .lec-drawer-scrim {
    display: none !important;
  }
}
