/* assets/css/header.css */

/* ──────────────────────────────────────────────
   GLOBAL & RESET
   ────────────────────────────────────────────── */

html,
body {
  overflow-x: hidden;
}

body {
  background: var(--surface);
  font-family: var(--font-main);
  color: var(--on-surface);
  font-size: 16px;
  line-height: 24px;
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
}

.container {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--margin-mobile);
  padding-right: var(--margin-mobile);
  width: 100%;
}

@media (min-width: 768px) {
  .container {
    padding-left: var(--margin-desktop);
    padding-right: var(--margin-desktop);
  }
}

/* ──────────────────────────────────────────────
   TYPOGRAPHY HELPERS
   ────────────────────────────────────────────── */
.text-headline-xl {
  font-size: 40px;
  line-height: 48px;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.text-headline-xl-mobile {
  font-size: 32px;
  line-height: 40px;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.text-headline-lg {
  font-size: 32px;
  line-height: 40px;
  font-weight: 600;
}

.text-headline-md {
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
}

.text-body-lg {
  font-size: 18px;
  line-height: 28px;
  font-weight: 400;
}

.text-body-md {
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
}

.text-label-md {
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.01em;
  font-weight: 500;
}

.text-button {
  font-size: 16px;
  line-height: 20px;
  letter-spacing: 0.02em;
  font-weight: 600;
}

/* ──────────────────────────────────────────────
   ICON FONT
   ────────────────────────────────────────────── */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
}

.course-card-footer .btn-icon .material-symbols-outlined {
  color: #fff !important;
}

.course-card-footer .btn-icon:hover .material-symbols-outlined {
  color: #fff !important;
}


/* ================================================
   TOP BAR
   ================================================ */
.top-bar {
  background: var(--primary-container);
  color: var(--on-primary);
  height: 36px;
  overflow: hidden;
  position: relative;
  z-index: 51;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.top-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--margin-mobile);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ── Ticker ── */
.top-bar-ticker {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  height: 100%;
}

.ticker-label {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--secondary-container);
  color: var(--on-secondary-fixed);
  padding: 0 10px;
  border-radius: 5px;
  height: 24px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: 10px;
  line-height: 1;
}

.ticker-label .material-symbols-outlined {
  font-size: 12px;
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 20;
}

/* Hide the label text, keep only icon, on narrowest screens */
.ticker-label span:not(.material-symbols-outlined) {
  display: none;
}

.ticker-track-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 36px;
  display: flex;
  align-items: center;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 4%,
    black 96%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 4%,
    black 96%,
    transparent 100%
  );
}

.ticker-track {
  display: flex;
  align-items: center;
  list-style: none;
  white-space: nowrap;
  animation: ticker-scroll 24s linear infinite;
  will-change: transform;
}

.ticker-track-wrap > ul:last-child {
  animation: ticker-scroll 24s linear infinite;
}

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  padding: 0 20px 0 0;
}

.ticker-item::after {
  content: '·';
  margin-left: 20px;
  opacity: 0.3;
  font-size: 16px;
  line-height: 1;
}

.ticker-item:last-child::after {
  display: none;
}

.ticker-item .material-symbols-outlined {
  font-size: 11px;
  color: var(--secondary-container);
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 20;
  flex-shrink: 0;
}

/* ── Social icons ── */
.top-bar-social {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

/* Hide ALL social icons by default (mobile-first) */
.tb-social-link {
  display: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius);
  color: rgba(255,255,255,0.55);
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.tb-social-link svg {
  width: 12px;
  height: 12px;
}

.tb-social-link:hover {
  color: var(--secondary-container);
  background: rgba(255,255,255,0.08);
}

.tb-whatsapp:hover {
  color: #25d366;
}

/* ════════════════════════════════════
   BREAKPOINTS — mobile-first, narrow → wide
   ════════════════════════════════════ */

/* ── 360px — absolute minimum ── */
@media (min-width: 360px) {
  .top-bar {
    height: 34px;
  }

  .ticker-track-wrap {
    height: 34px;
  }

  .ticker-label {
    height: 22px;
    padding: 0 8px;
    font-size: 9px;
    margin-right: 8px;
  }

  .ticker-item {
    font-size: 10px;
    padding: 0 18px 0 0;
    gap: 4px;
  }

  .ticker-item::after {
    margin-left: 18px;
  }
}

/* ── 370px ── */
@media (min-width: 370px) {
  .top-bar {
    height: 34px;
  }

  .ticker-label {
    height: 22px;
    padding: 0 9px;
    font-size: 9px;
    margin-right: 10px;
    gap: 4px;
  }

  .ticker-item {
    font-size: 10.5px;
  }
}

/* ── 390px — most iPhones ── */
@media (min-width: 390px) {
  .top-bar {
    height: 34px;
  }

  .ticker-label {
    height: 23px;
    padding: 0 10px;
    font-size: 9.5px;
    margin-right: 10px;
    gap: 4px;
  }

  .ticker-label span:not(.material-symbols-outlined) {
    display: none; /* still too narrow for label text */
  }

  .ticker-item {
    font-size: 11px;
    padding: 0 20px 0 0;
  }

  .ticker-item::after {
    margin-left: 20px;
  }

  /* Show WhatsApp only */
  .tb-whatsapp {
    display: flex;
  }
}

/* ── 410px ── */
@media (min-width: 410px) {
  .ticker-label {
    height: 23px;
    padding: 0 10px;
    font-size: 10px;
  }

  .ticker-item {
    font-size: 11px;
  }

  /* Show WhatsApp + Facebook */
  .tb-whatsapp,
  .top-bar-social .tb-social-link:nth-child(2) {
    display: flex;
  }
}

/* ── 430px — larger Android flagships ── */
@media (min-width: 430px) {
  .top-bar {
    height: 35px;
  }

  .ticker-track-wrap {
    height: 35px;
  }

  .ticker-label {
    height: 24px;
    padding: 0 11px;
    font-size: 10px;
    margin-right: 12px;
  }

  .ticker-item {
    font-size: 11.5px;
    padding: 0 22px 0 0;
    gap: 5px;
  }

  .ticker-item::after {
    margin-left: 22px;
  }

  /* Show WhatsApp + Facebook + Instagram */
  .tb-whatsapp,
  .top-bar-social .tb-social-link:nth-child(2),
  .top-bar-social .tb-social-link:nth-child(3) {
    display: flex;
  }
}

/* ── 768px — tablet portrait ── */
@media (min-width: 768px) {
  .top-bar {
    height: 36px;
  }

  .top-bar-inner {
    padding: 0 var(--margin-desktop);
    gap: 16px;
  }

  .ticker-track-wrap {
    height: 36px;
  }

  .ticker-label {
    height: 26px;
    padding: 0 14px;
    font-size: 11px;
    margin-right: 14px;
    gap: 5px;
    /* Restore text label on tablet+ */
  }

  .ticker-label span:not(.material-symbols-outlined) {
    display: inline;
  }

  .ticker-label .material-symbols-outlined {
    font-size: 13px;
  }

  .ticker-item {
    font-size: 12px;
    padding: 0 28px 0 0;
    gap: 6px;
  }

  .ticker-item::after {
    margin-left: 28px;
    font-size: 17px;
  }

  .ticker-item .material-symbols-outlined {
    font-size: 12px;
  }

  /* Show all social icons */
  .tb-social-link {
    display: flex;
    width: 27px;
    height: 27px;
  }

  .tb-social-link svg {
    width: 13px;
    height: 13px;
  }

  .top-bar-social {
    gap: 1px;
  }
}

/* ── 1024px — tablet landscape ── */
@media (min-width: 1024px) {
  .top-bar {
    height: 36px;
  }

  .ticker-label {
    height: 26px;
    padding: 0 16px;
    font-size: 11px;
    margin-right: 16px;
  }

  .ticker-item {
    font-size: 12.5px;
    padding: 0 32px 0 0;
  }

  .ticker-item::after {
    margin-left: 32px;
    font-size: 18px;
  }

  .tb-social-link {
    width: 28px;
    height: 28px;
  }

  .tb-social-link svg {
    width: 14px;
    height: 14px;
  }

  .top-bar-social {
    gap: 2px;
  }
}

/* ── 1280px — desktop ── */
@media (min-width: 1280px) {
  .ticker-item {
    font-size: 13px;
  }
}


/* ================================================
   SECTION: HEADER & NAVIGATION
   ================================================ */
header {
  background: rgba(248, 249, 250, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(197, 198, 208, 0.3);
  transition: box-shadow 0.2s;
}

header.scrolled {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.custom-logo-link {
  width: 150px;
}

.custom-logo-link img {
  object-fit: cover;
  width: 100%;
  height: auto;
}

#site-header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--margin-mobile);
}

@media (min-width: 768px) {
  #site-header nav {
    padding: 0 var(--margin-desktop);
  }
}

@media screen and (max-width: 480px) {
  .custom-logo-link img {
    width: 80%;
  }
}

.logo {
  font-size: 24px;
  line-height: 32px;
  font-weight: 700;
  color: var(--primary-container);
  text-decoration: none;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 32px;
  list-style: none;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--on-surface-variant);
  transition: color 0.2s;
  padding-bottom: 4px;
}

.nav-links a:hover {
  color: var(--primary-container);
}

.nav-links a.active {
  color: var(--primary-container);
  font-weight: 700;
  border-bottom: 2px solid var(--secondary-container);
}

.btn-primary {
  background: var(--primary-container);
  color: var(--on-primary);
  padding: 10px 24px;
  border-radius: var(--radius-lg);
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 24, 72, 0.2);
  transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover {
  background: var(--on-primary-fixed-variant);
}

.btn-primary:active {
  transform: scale(0.95);
}

/* Header Media Queries */
@media (min-width: 370px) {
  #site-header nav {
    height: 64px;
  }

  .logo {
    font-size: 18px;
  }

  .btn-primary {
    font-size: 13px;
    padding: 8px 14px;
  }
}

@media (min-width: 430px) {
  #site-header nav {
    height: 72px;
  }

  .logo {
    font-size: 20px;
  }

  .btn-primary {
    font-size: 14px;
    padding: 10px 18px;
  }
}

@media (min-width: 480px) {
  #site-header nav {
    height: 76px;
  }

  .logo {
    font-size: 22px;
  }

  .btn-primary {
    font-size: 15px;
    padding: 10px 22px;
  }
}

@media (min-width: 768px) {
  #site-header nav {
    height: 80px;
    padding: 0 var(--margin-desktop);
  }

  .logo {
    font-size: 24px;
  }

  .nav-links {
    display: flex;
  }

  .btn-primary {
    font-size: 16px;
    padding: 10px 24px;
  }
}


/* ================================================
   HAMBURGER BUTTON
   ================================================ */

/* Hidden on desktop */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-lg);
  flex-shrink: 0;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.hamburger:hover {
  background: rgba(0, 24, 72, 0.06);
}

.hamburger:focus-visible {
  outline: 2px solid var(--primary-container);
  outline-offset: 2px;
}

/* The three bars */
.ham-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--primary-container);
  border-radius: 2px;
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1),
              opacity   0.2s ease,
              width     0.3s ease;
  transform-origin: center;
}

/* Active state — bars become ✕ */
.hamburger.is-active .ham-bar--top {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.is-active .ham-bar--mid {
  opacity: 0;
  width: 0;
}

.hamburger.is-active .ham-bar--bot {
  transform: translateY(-7px) rotate(-45deg);
}

/* Show only below 768px */
@media (max-width: 767px) {
  .hamburger {
    display: flex;
  }
}

/* ================================================
   MOBILE MENU DRAWER
   ================================================ */

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  visibility: hidden;
}

.mobile-menu.is-open {
  pointer-events: auto;
  visibility: visible;
}

/* Backdrop */
.mobile-menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 24, 72, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu.is-open .mobile-menu-backdrop {
  opacity: 1;
}

/* Drawer panel — slides in from the right */
.mobile-menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 88vw);
  background: var(--surface-container-lowest);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.23, 1, 0.32, 1);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: -8px 0 40px rgba(0, 24, 72, 0.18);
}

.mobile-menu.is-open .mobile-menu-panel {
  transform: translateX(0);
}

/* Prevent body scroll when menu is open */
body.menu-open {
  overflow: hidden;
}

/* ── Drawer header ── */
.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(197, 198, 208, 0.4);
  flex-shrink: 0;
  background: #fff;
}

.mobile-menu-header .custom-logo-link {
  width: 120px;
}

/* .mobile-menu-header .custom-logo-link img {
  filter: brightness(0) invert(1); 
} */

.mobile-menu-header .logo {
  color: var(--on-primary);
  font-size: 18px;
}

/* Close button inside drawer (pure CSS cross) */
.mobile-menu-close {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  background: var(--primary-container);
  border: 1px solid var(--primary-container);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.2s;
  position: relative;
}

.mobile-menu-close:hover {
  background: rgba(255,255,255,0.2);
}

.mobile-menu-close:focus-visible {
  outline: 2px solid var(--secondary-container);
  outline-offset: 2px;
}

/* Reuse .ham-bar for the X inside close button */
.mobile-menu-close .ham-bar {
  background: var(--on-primary);
  width: 16px;
  position: absolute;
}

.mobile-menu-close .ham-bar--top {
  transform: rotate(45deg);
}

.mobile-menu-close .ham-bar--bot {
  transform: rotate(-45deg);
}

/* ── Nav links inside drawer ── */
.mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  flex: 1;
}

.mobile-nav-links li {
  border-bottom: 1px solid rgba(197, 198, 208, 0.2);
}

.mobile-nav-links li:last-child {
  border-bottom: none;
}

.mobile-nav-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  font-size: 15px;
  font-weight: 600;
  color: var(--on-surface);
  text-decoration: none;
  transition: background 0.15s, color 0.15s, padding-left 0.2s;
}

.mobile-nav-links a::after {
  content: '›';
  font-size: 20px;
  color: var(--on-surface-variant);
  opacity: 0.4;
  transition: transform 0.2s, opacity 0.2s;
}

.mobile-nav-links a:hover,
.mobile-nav-links a:focus {
  background: rgba(0, 24, 72, 0.04);
  color: var(--primary-container);
  padding-left: 28px;
}

.mobile-nav-links a:hover::after,
.mobile-nav-links a:focus::after {
  opacity: 0.8;
  transform: translateX(3px);
}

.mobile-nav-links a.active {
  color: var(--primary-container);
  font-weight: 700;
  border-left: 3px solid var(--secondary-container);
  padding-left: 21px;
}

/* ── CTA block inside drawer ── */
.mobile-menu-cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 24px;
  border-top: 1px solid rgba(197, 198, 208, 0.3);
  flex-shrink: 0;
}

.mobile-apply-btn {
  display: block;
  text-align: center;
  padding: 14px 24px;
  font-size: 15px;
  border-radius: var(--radius-lg);
  width: 100%;
}

.mobile-whatsapp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: #25d366;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: background 0.2s;
}

.mobile-whatsapp-btn:hover {
  background: #1ebe5d;
}

/* ── Social strip inside drawer ── */
.mobile-menu-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 24px 24px;
  flex-shrink: 0;
}

.mobile-menu-social .tb-social-link {
  display: flex;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(197, 198, 208, 0.5);
  color: var(--on-surface-variant);
}

.mobile-menu-social .tb-social-link svg {
  width: 16px;
  height: 16px;
}

.mobile-menu-social .tb-social-link:hover {
  background: var(--primary-container);
  color: var(--on-primary);
  border-color: var(--primary-container);
}

/* ── Hide drawer entirely on desktop ── */
@media (min-width: 768px) {
  .mobile-menu {
    display: none;
  }
}

@media screen and (max-width: 768px){
  .desktop-cta {
    padding: 6px 16px;
    font-size: 14px;
  }
}