/* SPA header: keep "Explore Learning Tools" beside the logo on React pages.
   Flex order is used so hydration cannot move the button back. Visual rules match fixes/parent-pages.css. */

.header-inner {
  justify-content: flex-start;
}

.header-inner > .brand {
  order: 1;
}

.header-inner > .header-cta:not(.drawer-cta) {
  order: 2;
  display: inline-flex !important;
  align-items: center;
  margin-left: 0 !important;
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Static parent pages have no arrow on this button. */
.header-inner > .header-cta:not(.drawer-cta) svg {
  display: none;
}

.header-inner > .desktop-nav {
  order: 3;
}

.header-inner > .header-auth {
  order: 4;
  margin-left: auto;
  flex: 0 0 auto;
}

.header-inner > .menu-button {
  order: 5;
  flex: 0 0 auto;
}

.header-cta .cta-short { display: none; }
.header-cta .cta-long { display: inline; }

@media (max-width: 1100px) {
  .header-inner > .header-cta:not(.drawer-cta) {
    padding: 10px 14px !important;
    font-size: 14px !important;
    min-height: 44px;
  }
}

@media (max-width: 900px) {
  .header-cta .cta-long { display: none; }
  .header-cta .cta-short { display: inline; }
  .header-inner > .header-cta:not(.drawer-cta) {
    padding: 8px 14px !important;
    font-size: 14px !important;
    min-height: 44px;
    box-shadow: 0 3px #b4482a;
  }
  /* React markup has no .cta-short span; paint the same short label immediately. */
  .header-inner > .header-cta:not(.drawer-cta):not(:has(.cta-short)) {
    font-size: 0 !important;
    gap: 0;
  }
  .header-inner > .header-cta:not(.drawer-cta):not(:has(.cta-short))::before {
    content: "Learning Tools";
    font-size: 14px;
    font-weight: 900;
    letter-spacing: normal;
    line-height: 1.2;
  }
}

@media (max-width: 799px) {
  .header-inner > .brand {
    flex: 0 0 auto !important;
    min-width: auto !important;
    max-width: none !important;
    overflow: visible;
  }
  .header-inner > .header-auth {
    display: none !important;
  }
  .header-inner > .header-cta:not(.drawer-cta) {
    min-height: 44px;
    min-width: 44px;
  }
  .header-inner > .menu-button {
    margin-left: auto;
    display: inline-flex !important;
  }
}

@media (max-width: 479px) {
  .header-inner {
    gap: 8px;
    padding-inline: 10px;
  }
  .header-inner > .header-cta:not(.drawer-cta) {
    padding: 6px 10px !important;
    font-size: 13px !important;
  }
  .header-inner > .header-cta:not(.drawer-cta):not(:has(.cta-short))::before {
    font-size: 13px;
  }
}

@media (max-width: 360px) {
  .header-inner {
    gap: 6px;
    padding-inline: 8px;
  }
  .header-inner > .header-cta:not(.drawer-cta) {
    padding: 6px 8px !important;
    font-size: 12.5px !important;
  }
  .header-inner > .header-cta:not(.drawer-cta):not(:has(.cta-short))::before {
    font-size: 12.5px;
  }
}

/* Some React pages (e.g. /premium/) add wider header padding; keep the menu button on screen on phones. */
@media (max-width: 479px) {
  html body .site-header .header-inner { gap: 8px !important; padding-left: 10px !important; padding-right: 10px !important; }
  html body .site-header .header-inner > .brand { min-width: 0 !important; flex: 0 1 auto !important; }
  html body .site-header .header-inner > .menu-button { flex: 0 0 auto; }
}
@media (max-width: 360px) {
  html body .site-header .header-inner { gap: 6px !important; padding-left: 8px !important; padding-right: 8px !important; }
}
