/* ==========================================================================
   MentorLab Education — components.css
   Navigation, buttons, reusable UI, cards and interactive elements.
   ========================================================================== */

/* Arrow icon */
.icon-arrow {
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  flex: none;
  background-color: currentColor;
  -webkit-mask: url("../assets/icons/arrow-up-right.svg") center / contain no-repeat;
  mask: url("../assets/icons/arrow-up-right.svg") center / contain no-repeat;
  transition: transform 0.35s var(--ease);
}

.btn:hover .icon-arrow,
.program-link:hover .icon-arrow,
.text-link:hover .icon-arrow,
.footer-consult:hover .icon-arrow {
  transform: translate(3px, -3px);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.95rem 1.45rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  transition:
    background 0.35s var(--ease),
    color 0.35s var(--ease),
    border-color 0.35s var(--ease),
    transform 0.35s var(--ease),
    box-shadow 0.35s var(--ease);
}

.btn--primary {
  background: var(--orange);
  color: var(--ink);
}

.btn--primary:hover {
  background: var(--forest);
  color: var(--paper);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -18px rgba(20, 38, 31, 0.8);
}

.btn--ghost {
  border-color: rgba(30, 58, 47, 0.35);
  color: var(--forest);
  background: transparent;
}

.btn--ghost:hover {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--paper);
  transform: translateY(-2px);
}

.btn--light {
  background: var(--orange);
  color: var(--ink);
}

.btn--light:hover {
  background: var(--forest);
  color: var(--paper);
  transform: translateY(-2px);
}

.btn--small {
  padding: 0.95rem 1.6rem;
  font-size: 0.8rem;
  min-width: 168px;
}

.btn--large {
  padding: 1.05rem 1.9rem;
  font-size: 0.86rem;
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.brand img {
  width: 11rem;
  height: auto;
}

.site-header .brand img {
  width: 9rem;
}

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  padding: 1.4rem 0;
  transition:
    padding 0.45s var(--ease),
    background 0.45s var(--ease),
    box-shadow 0.45s var(--ease),
    backdrop-filter 0.45s var(--ease);
}

.site-header.is-scrolled {
  padding: 0.8rem 0;
  background: rgba(244, 240, 232, 0.88);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 1px 0 var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.desktop-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1.4rem, 2.6vw, 2.6rem);
  flex: 1;
}

.nav-link {
  position: relative;
  padding: 0.35rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease);
}

.nav-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Menu toggle */
.menu-toggle {
  position: relative;
  z-index: 110;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: border-color 0.35s var(--ease), background 0.35s var(--ease);
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.35s var(--ease), background 0.35s var(--ease);
}

.menu-toggle span + span {
  margin-top: 6px;
}

.menu-toggle.is-active span:first-child {
  transform: translateY(3.75px) rotate(45deg);
}

.menu-toggle.is-active span:last-child {
  transform: translateY(-3.75px) rotate(-45deg);
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 7rem var(--gutter) 2rem;
  background: var(--forest);
  color: var(--paper);
  visibility: hidden;
  overflow-y: auto;
  transform: translateY(-100%);
  transition: transform 0.65s var(--ease), visibility 0.65s;
}

.mobile-menu.is-open {
  visibility: visible;
  transform: translateY(0);
}

.mobile-nav a {
  display: block;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line-light);
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 3rem);
  line-height: 1;
  letter-spacing: -0.03em;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.mobile-menu.is-open .mobile-nav a {
  opacity: 1;
  transform: none;
}

.mobile-menu.is-open .mobile-nav a:nth-child(1) { transition-delay: 0.12s; }
.mobile-menu.is-open .mobile-nav a:nth-child(2) { transition-delay: 0.17s; }
.mobile-menu.is-open .mobile-nav a:nth-child(3) { transition-delay: 0.22s; }
.mobile-menu.is-open .mobile-nav a:nth-child(4) { transition-delay: 0.27s; }
.mobile-menu.is-open .mobile-nav a:nth-child(5) { transition-delay: 0.32s; }

.mobile-menu-foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 2rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244, 240, 232, 0.5);
}

/* When the menu is open, header text flips to light */
body.menu-open .site-header {
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

body.menu-open .brand img {
  filter: brightness(0) invert(1);
}

body.menu-open .menu-toggle {
  border-color: var(--line-light);
}

body.menu-open .menu-toggle span {
  background: var(--paper);
}

/* Program cards */
.program-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.2rem;
}

.program-side {
  display: grid;
  gap: 1.2rem;
}

.program-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 250px;
  padding: clamp(1.5rem, 2.5vw, 2.4rem);
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  overflow: hidden;
  transition:
    background 0.5s var(--ease),
    color 0.5s var(--ease),
    border-color 0.5s var(--ease),
    transform 0.5s var(--ease);
}

.program-card:hover {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--paper);
  transform: translateY(-6px);
}

.program-card--featured {
  min-height: 540px;
  background: var(--forest);
  border-color: var(--forest);
  color: var(--paper);
}

.program-card--featured:hover {
  transform: translateY(-6px);
}

.program-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.program-code {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.45s var(--ease);
}

.program-tag {
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--muted);
  transition: color 0.45s var(--ease), border-color 0.45s var(--ease);
}

.program-body h3 {
  margin: 1.8rem 0 0.9rem;
  font-size: clamp(1.7rem, 2.6vw, 2.7rem);
  line-height: 1.02;
}

.program-body p {
  max-width: 44ch;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--ink-soft);
  transition: color 0.45s var(--ease);
}

.program-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.45s var(--ease), border-color 0.45s var(--ease);
}

.program-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--forest);
  transition: color 0.45s var(--ease);
}

/* Card hover colour shifts */
.program-card:hover .program-body p {
  color: rgba(244, 240, 232, 0.72);
}

.program-card:hover .program-code,
.program-card:hover .program-tag,
.program-card:hover .program-foot {
  color: rgba(244, 240, 232, 0.6);
}

.program-card:hover .program-tag,
.program-card:hover .program-foot {
  border-color: var(--line-light);
}

.program-card:hover .program-link {
  color: var(--orange-soft);
}

/* Featured card always light-on-dark */
.program-card--featured .program-code,
.program-card--featured .program-tag,
.program-card--featured .program-foot {
  color: rgba(244, 240, 232, 0.6);
}

.program-card--featured .program-tag,
.program-card--featured .program-foot {
  border-color: var(--line-light);
}

.program-card--featured .program-body p {
  color: rgba(244, 240, 232, 0.72);
}

.program-card--featured .program-link {
  color: var(--orange-soft);
}

/* Watermark code */
.program-card::after {
  content: attr(data-code);
  position: absolute;
  right: -0.05em;
  bottom: -0.3em;
  font-family: var(--font-display);
  font-size: clamp(6rem, 12vw, 11rem);
  line-height: 0.8;
  letter-spacing: -0.05em;
  color: currentColor;
  opacity: 0.045;
  pointer-events: none;
}

/* Pointer glow on featured card */
.pointer-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(
    420px circle at var(--mx, 70%) var(--my, 30%),
    rgba(233, 120, 36, 0.28),
    transparent 65%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease);
}

.pointer-glow-target:hover > .pointer-glow {
  opacity: 1;
}

.program-top,
.program-body,
.program-foot {
  position: relative;
  z-index: 1;
}

/* Responsive navigation */
@media (max-width: 900px) {
  .desktop-nav {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }
}

@media (min-width: 901px) {
  .mobile-menu {
    display: none;
  }
}

@media (max-width: 600px) {
  .header-actions .btn {
    display: none;
  }
}