/* ==========================================================================
   PromptWeb Academy — Premium Header / Navigation
   Pure CSS3. No frameworks. Fluid, clamp()-based, mobile-first.
   Drop-in replacement for the header block only — does not touch
   the rest of style.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. HEADER-SCOPED TOKENS
   Reuses the brand's existing colors (--primary, --accent, --navy, etc. are
   already defined in style.css). These extra tokens are header-only and
   won't collide with anything else on the site.
   -------------------------------------------------------------------------- */
:root{
  --hdr-h-desktop: 78px;
  --hdr-h-tablet:  72px;
  --hdr-h-mobile:  64px;

  --hdr-logo-desktop: 52px;
  --hdr-logo-tablet:  46px;
  --hdr-logo-mobile:  42px;

  --hdr-container: 1280px;
  --hdr-bg:        rgba(255, 255, 255, 0.90);
  --hdr-border:    rgba(0, 0, 0, 0.06);
  --hdr-ease:      cubic-bezier(.4, 0, .2, 1);
}

/* --------------------------------------------------------------------------
   1. HEADER SHELL
   -------------------------------------------------------------------------- */
.site-header{
  position: sticky;              /* sticks to top and stays visible on scroll */
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;

  background: var(--hdr-bg);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--hdr-border);

  transition: box-shadow .3s var(--hdr-ease), background .3s var(--hdr-ease);
}

/* Soft shadow only appears once the page has been scrolled (toggled by header.js) */
.site-header.is-scrolled{
  box-shadow: 0 8px 30px rgba(8, 27, 58, 0.08);
}

.nav-inner{
  width: 100%;
  max-width: var(--hdr-container);
  margin: 0 auto;
  padding-inline: clamp(1rem, 3vw, 2.5rem);

  height: var(--hdr-h-desktop);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(.75rem, 2vw, 2rem);
}

@media (max-width: 992px){
  .nav-inner{ height: var(--hdr-h-tablet); }
}
@media (max-width: 768px){
  .nav-inner{ height: var(--hdr-h-mobile); }
}

/* --------------------------------------------------------------------------
   2. LEFT — BRAND / LOGO
   Always stays left, never resizes incorrectly (fixed heights, auto width).
   -------------------------------------------------------------------------- */
.brand{
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-shrink: 0;                /* logo never gets squeezed by the menu */
}

.brand-logo{
  height: var(--hdr-logo-desktop);
  width: auto;
  max-width: none;
  display: block;
}
@media (max-width: 992px){
  .brand-logo{ height: var(--hdr-logo-tablet); }
}
@media (max-width: 768px){
  .brand-logo{ height: var(--hdr-logo-mobile); }
}

.brand-text{ display: flex; flex-direction: column; line-height: 1.15; }
.brand-name{
  font-family: var(--font-display, 'Poppins', sans-serif);
  font-weight: 700;
  font-size: clamp(.92rem, 1.4vw, 1.05rem);
  color: var(--navy, #081B3A);
  white-space: nowrap;
}
.brand-tag{
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .06em;
  color: var(--accent, #FF7A00);
}
@media (max-width: 480px){
  .brand-tag{ display: none; }   /* keep the mark tight on very small screens */
}

/* --------------------------------------------------------------------------
   3. CENTER — DESKTOP MENU
   -------------------------------------------------------------------------- */
.main-nav{ flex: 1; display: flex; justify-content: center; min-width: 0; }

.nav-links{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1.25rem, 2.4vw, 2.25rem);   /* equal spacing, fluid */
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a{
  position: relative;
  padding: .4rem .1rem;
  font-family: var(--font-display, 'Poppins', sans-serif);
  font-weight: 500;
  font-size: .95rem;
  color: var(--text, #1E293B);
  text-decoration: none;
  white-space: nowrap;
  transition: color .25s var(--hdr-ease);
}

/* Blue underline hover animation, grows from the left */
.nav-links a::after{
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient-brand, linear-gradient(120deg, #2563EB, #FF7A00));
  transition: width .3s var(--hdr-ease);
}

.nav-links a:hover{ color: var(--primary, #2563EB); }
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after{ width: 100%; }

/* Current page highlight */
.nav-links a[aria-current="page"]{
  color: var(--primary, #2563EB);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   4. RIGHT — CTA + HAMBURGER
   -------------------------------------------------------------------------- */
.nav-actions{ display: flex; align-items: center; gap: clamp(.75rem, 2vw, 1.25rem); flex-shrink: 0; }

.btn-cta{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  padding: .75rem clamp(1.1rem, 2vw, 1.6rem);
  border-radius: 50px;
  font-family: var(--font-display, 'Poppins', sans-serif);
  font-weight: 600;
  font-size: .92rem;
  color: #fff;
  text-decoration: none;
  background: var(--gradient-brand, linear-gradient(120deg, #2563EB 0%, #FF7A00 100%));
  box-shadow: 0 10px 24px rgba(255, 122, 0, .25);
  transition: transform .3s var(--hdr-ease), box-shadow .3s var(--hdr-ease);
}
.btn-cta:hover{
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(255, 122, 0, .35);
}
.btn-cta:active{ transform: translateY(0); }

@media (max-width: 640px){
  .nav-actions > .btn-cta{ display: none; }   /* CTA moves into the mobile slide menu */
}

/* Hamburger button (hidden on desktop) */
.nav-toggle{
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  background: none;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  z-index: 1002;
}
.nav-toggle:hover{ background: rgba(37, 99, 235, .06); }
.nav-toggle span{
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--navy, #081B3A);
  transition: transform .3s var(--hdr-ease), opacity .3s var(--hdr-ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2){ opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   5. RESPONSIVE SWITCH — DESKTOP MENU <-> HAMBURGER
   -------------------------------------------------------------------------- */
@media (max-width: 940px){
  .main-nav{ display: none; }   /* hide the desktop menu */
  .nav-toggle{ display: flex; }
}

/* --------------------------------------------------------------------------
   6. MOBILE FULL-SCREEN SLIDE MENU
   -------------------------------------------------------------------------- */
.mobile-overlay{
  position: fixed;
  inset: 0;
  background: rgba(8, 27, 58, .45);
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s var(--hdr-ease), visibility .35s var(--hdr-ease);
  z-index: 999;
}
.mobile-overlay.is-open{ opacity: 1; visibility: visible; }

.mobile-menu{
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(88vw, 380px);
  max-width: 100%;
  background: #fff;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  padding: clamp(1.25rem, 4vw, 1.75rem);
  overflow-y: auto;

  transform: translateX(100%);       /* slides in from the right */
  transition: transform .35s var(--hdr-ease);
  box-shadow: -20px 0 60px rgba(8, 27, 58, .18);
}
.mobile-menu.is-open{ transform: translateX(0); }

.mobile-menu-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.mobile-menu-top .brand-logo{ height: 38px; }

.mobile-close{
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border, #E2E8F0);
  background: var(--bg-light, #F8FAFC);
  font-size: 1.4rem;
  line-height: 1;
  color: var(--navy, #081B3A);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .25s var(--hdr-ease), transform .25s var(--hdr-ease);
}
.mobile-close:hover{ background: var(--border, #E2E8F0); transform: rotate(90deg); }

.mobile-links{
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.mobile-links li{ border-bottom: 1px solid var(--border, #E2E8F0); }
.mobile-links li:last-child{ border-bottom: none; }
.mobile-links a{
  display: block;
  padding: 1.05rem .25rem;         /* large, touch-friendly hit area */
  font-family: var(--font-display, 'Poppins', sans-serif);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--navy, #081B3A);
  text-decoration: none;
  transition: color .25s var(--hdr-ease), padding-left .25s var(--hdr-ease);
}
.mobile-links a:hover,
.mobile-links a:focus-visible{ color: var(--primary, #2563EB); padding-left: .5rem; }
.mobile-links a[aria-current="page"]{ color: var(--primary, #2563EB); }

.mobile-menu .btn-cta{
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.mobile-social{
  display: flex;
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.mobile-social a{
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border, #E2E8F0);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy, #081B3A);
  transition: background .25s var(--hdr-ease), color .25s var(--hdr-ease), transform .25s var(--hdr-ease);
}
.mobile-social a:hover{
  background: var(--gradient-brand, linear-gradient(120deg, #2563EB, #FF7A00));
  color: #fff;
  border-color: transparent;
  transform: translateY(-3px);
}
.mobile-social svg{ width: 18px; height: 18px; fill: currentColor; }

.mobile-contact{
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border, #E2E8F0);
  font-size: .9rem;
}
.mobile-contact a{
  color: var(--text-muted, #5b6b83);
  text-decoration: none;
  transition: color .25s var(--hdr-ease);
}
.mobile-contact a:hover{ color: var(--primary, #2563EB); }

/* Lock page scroll while the mobile menu is open (class toggled by header.js) */
body.menu-open{ overflow: hidden; }

/* --------------------------------------------------------------------------
   7. ACCESSIBILITY
   -------------------------------------------------------------------------- */
.nav-links a:focus-visible,
.mobile-links a:focus-visible,
.btn-cta:focus-visible,
.nav-toggle:focus-visible,
.mobile-close:focus-visible,
.mobile-social a:focus-visible{
  outline: 3px solid var(--accent, #FF7A00);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce){
  .site-header, .nav-toggle span, .mobile-menu, .mobile-overlay,
  .nav-links a::after, .btn-cta, .mobile-close, .mobile-social a{
    transition-duration: .001ms !important;
  }
}

/* --------------------------------------------------------------------------
   8. SAFETY NET — NO OVERFLOW, NO FIXED WIDTHS
   -------------------------------------------------------------------------- */
.site-header, .nav-inner, .main-nav, .nav-links, .nav-actions{ max-width: 100%; }
