/* Global site header: base rules + modifier blocks for sample / portal / sticky / cta / badge */

:root {
  --public-max: 1200px;
  --public-gutter: clamp(1rem, 4vw, 2rem);
  --public-header-h: 56px;
  --site-header-height: 56px;
}

/* Base header rules (moved from public-audiences.css) ----------------------- */
.public-header {
  --ph-bg: var(--brand-navy);
  --ph-fg: var(--brand-offwhite);
  --ph-border-bottom: transparent;
  --ph-height: var(--site-header-height, var(--public-header-h, 56px));
  --ph-cta-bg: var(--brand-orange);
  --ph-cta-fg: #FFFFFF;
  --ph-cta-hover: #C95C0A;
  --ph-badge-bg: rgba(var(--brand-cyan-rgb, 0, 182, 214), 0.18);
  --ph-badge-fg: var(--brand-offwhite);
  --ph-badge-border: rgba(var(--brand-cyan-rgb, 0, 182, 214), 0.55);
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ph-bg);
  color: var(--ph-fg);
  border-bottom: var(--ph-border-bottom);
}

.public-header__inner {
  display: flex;
  min-height: var(--ph-height);
  max-width: var(--public-max);
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin: 0 auto;
  padding: 0 var(--public-gutter);
}

.public-brand {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

.public-brand img {
  width: auto;
  height: 40px;
  display: block;
}

.public-menu-button {
  display: none;
  min-width: 88px;
  min-height: 44px;
  padding: 0 1rem;
  color: var(--ph-fg, var(--brand-offwhite));
  background: transparent;
  border: 2px solid var(--ph-fg, var(--brand-offwhite));
  border-radius: var(--radius-control, 2px);
  font: 700 1rem var(--font-heading);
  cursor: pointer;
}

.public-nav__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.public-nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--ph-fg, var(--brand-offwhite));
  font-weight: 700;
  text-decoration: none;
  text-underline-offset: 6px;
}

.public-nav a:hover {
  text-decoration: underline;
}

.public-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 3px;
}

.public-nav__sign-in {
  margin-left: 0.5rem;
  padding-left: 1.5rem;
  border-left: 1px solid rgba(var(--brand-offwhite-rgb, 248, 249, 250), 0.35);
}

.public-nav__sign-in a {
  font-weight: 400;
  text-decoration: underline;
}

.public-nav__form {
  margin: 0;
}

.public-nav__button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0;
  color: var(--ph-fg, var(--brand-offwhite));
  background: none;
  border: 0;
  font: inherit;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 6px;
  cursor: pointer;
}

/* Resources: a button that opens a short list (includes/public/site-shell.php). Without JavaScript the list shows. */
.public-nav__group {
  position: relative;
}

.public-nav__toggle {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: var(--space-2);
  padding: 0;
  color: var(--ph-fg, var(--brand-offwhite));
  background: none;
  border: 0;
  font: inherit;
  font-weight: 700;
  text-underline-offset: 6px;
  cursor: pointer;
}

.public-nav__toggle:hover {
  text-decoration: underline;
}

.public-nav__group--current > .public-nav__toggle {
  text-decoration: underline;
  text-decoration-thickness: 3px;
}

.public-nav__caret {
  width: 0.5em;
  height: 0.5em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-0.15em) rotate(45deg);
}

.public-nav__toggle[aria-expanded="true"] .public-nav__caret {
  transform: translateY(0.15em) rotate(-135deg);
}

.public-nav__submenu,
.public-nav__documents {
  margin: 0;
  padding: 0;
  list-style: none;
}

.has-js .public-nav__toggle[aria-expanded="false"] + .public-nav__submenu {
  display: none;
}

.public-nav__sublabel {
  display: block;
  padding-top: var(--space-2);
  color: var(--ph-fg, var(--brand-offwhite));
  font-size: var(--fs-sm);
  opacity: 0.8;
}

@media (min-width: 900px) {
  .has-js .public-nav__submenu {
    position: absolute;
    z-index: 60;
    top: 100%;
    left: calc(-1 * var(--space-4));
    min-width: 14rem;
    padding: var(--space-2) var(--space-4);
    background: var(--ph-bg);
    border: 1px solid rgba(var(--brand-offwhite-rgb, 248, 249, 250), 0.35);
    border-radius: var(--radius-control, 2px);
  }
  .public-nav__submenu a {
    width: 100%;
    white-space: nowrap;
  }
}

/* Narrow desktops: the five links and Sign In stay on one line. */
@media (min-width: 900px) and (max-width: 1099px) {
  .public-nav__list {
    column-gap: var(--space-4);
  }
  .public-nav__sign-in {
    margin-left: 0;
    padding-left: var(--space-4);
  }
}

/* Skip link (accessibility landmark) */
.public-skip-link {
  position: absolute;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 12px 16px;
  color: var(--brand-offwhite);
  background: var(--brand-navy);
  transform: translateY(-160%);
}

.public-skip-link:focus {
  transform: translateY(0);
}

@media (min-width: 900px) {
  .public-header {
    position: static;
  }
}

@media (max-width: 899px) {
  .has-js .public-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .has-js .public-nav {
    display: none;
  }
  .has-js .menu-open .public-nav {
    position: fixed;
    inset: var(--ph-height) 0 0;
    display: block;
    overflow-y: auto;
    padding: 0.5rem var(--public-gutter) 2rem;
    background: var(--ph-bg);
  }
  .has-js .public-nav__list {
    flex-direction: column;
    align-items: stretch;
  }
  .has-js .public-nav__list a,
  .has-js .public-nav__list .public-nav__button,
  .has-js .public-nav__list .public-nav__toggle {
    width: 100%;
    min-height: 56px;
    font-size: 1.125rem;
    border-bottom: 1px solid rgba(var(--brand-offwhite-rgb, 248, 249, 250), 0.2);
  }
  .has-js .public-nav__toggle {
    justify-content: space-between;
  }
  .has-js .public-nav__submenu a {
    padding-left: var(--space-4);
  }
  .has-js .public-nav__sublabel {
    padding-left: var(--space-4);
  }
  .has-js .public-nav__sign-in {
    margin: 0;
    padding: 0;
    border: 0;
  }
  .public-header__inner {
    min-height: var(--ph-height);
  }
}

/* Modifier: variant sample ------------------------------------------------- */
.public-header--sample {
  --ph-bg: var(--brand-navy);
  --ph-fg: var(--brand-offwhite);
  --ph-border-bottom: 2px solid var(--brand-cyan);
  --ph-badge-bg: rgba(var(--brand-cyan-rgb, 0, 182, 214), 0.22);
  --ph-badge-border: var(--brand-cyan);
  --ph-badge-fg: #FFFFFF;
}

/* Modifier: variant portal ------------------------------------------------- */
.public-header--portal {
  --ph-bg: var(--brand-navy);
  --ph-fg: var(--brand-offwhite);
  --ph-border-bottom: 2px solid var(--brand-teal);
  --ph-badge-bg: rgba(var(--brand-teal-rgb, 0, 151, 130), 0.22);
  --ph-badge-border: var(--brand-teal);
  --ph-badge-fg: var(--brand-offwhite);
}

/* Modifier: variant default ------------------------------------------------ */
.public-header--default {
  /* Inherits base .public-header properties */
}

/* Modifier: variant internal ----------------------------------------------- */
.public-header--internal,
.internal-global-header {
  position: sticky;
  top: 0;
  z-index: 50;
  color: #fff;
  background: rgba(27, 55, 101, .98);
  border-bottom: 1px solid #13274b;
  box-shadow: 0 3px 12px rgba(15, 33, 66, .18);
}

@media (min-width: 900px) {
  .public-header.public-header--internal,
  .public-header.internal-global-header {
    position: sticky;
    top: 0;
    z-index: 50;
  }
}

.public-header--internal .public-header__inner,
.internal-global-header__inner {
  width: min(100% - 32px, 1240px);
  max-width: 1240px;
  margin: 0 auto;
  padding: 0;
  display: block;
}

.internal-global-header__topline {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.internal-global-header__identity,
.internal-global-header__account {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.internal-global-header__brand-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}

.internal-global-header__logo {
  display: block;
  width: auto;
  height: 40px;
  object-fit: contain;
}

.internal-global-header__initiative,
.internal-global-header__context {
  overflow: hidden;
  color: #d3deeb;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .045em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.internal-global-header__initiative {
  padding-left: 12px;
  border-left: 1px solid #456080;
}

.internal-global-header__context {
  color: #fff;
  font-weight: 750;
}

.internal-global-header__account {
  flex: 0 0 auto;
}

.internal-global-header__user {
  color: #e6edf5;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.internal-global-header__account form {
  margin: 0;
}

.internal-global-header__account button {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid #456080;
  border-radius: 7px;
  color: #e6edf5;
  background: #13274b;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.internal-global-header__account button:hover {
  background: #0f2142;
}

.internal-global-header__navigation {
  min-height: 43px;
  display: flex;
  align-items: stretch;
  gap: 7px;
  overflow-x: auto;
  border-top: 1px solid rgba(211, 222, 235, .16);
}

.internal-global-header nav.internal-global-header__navigation,
.public-header--internal nav.internal-global-header__navigation {
  max-width: none;
  margin: 0;
  padding: 0;
  justify-content: flex-start;
}

.internal-global-header__navigation a {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border-bottom: 3px solid transparent;
  color: #d3deeb;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.internal-global-header__navigation a:hover,
.internal-global-header__navigation a:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, .08);
}

.internal-global-header__navigation a[aria-current="page"] {
  border-bottom-color: #e46b0f;
  color: #fff;
}

.internal-global-header a:focus-visible,
.internal-global-header button:focus-visible,
.public-header--internal a:focus-visible,
.public-header--internal button:focus-visible {
  outline: 3px solid #e46b0f;
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .public-header--internal .public-header__inner,
  .internal-global-header__inner {
    width: calc(100% - 24px);
  }
  .internal-global-header__initiative {
    display: none;
  }
  .internal-global-header__topline {
    min-height: 54px;
    gap: 8px;
  }
  .internal-global-header__identity,
  .internal-global-header__account {
    gap: 8px;
  }
  .internal-global-header__user {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .internal-global-header__navigation a {
    padding: 0 9px;
    font-size: 11px;
  }
}

@media print {
  body.student-success .internal-global-header,
  body.counsel .internal-global-header,
  body.student-success .public-header--internal,
  body.counsel .public-header--internal {
    display: none;
  }
}

/* Modifier: sticky --------------------------------------------------------- */
.public-header--sticky {
  position: sticky;
  top: 0;
  z-index: 50;
}

@media (min-width: 900px) {
  .public-header.public-header--sticky {
    position: sticky;
    top: 0;
    z-index: 50;
  }
}

/* Modifier: CTA button inside navigation ------------------------------------ */
.public-header__cta {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  color: var(--ph-cta-fg, #FFFFFF);
  background: var(--ph-cta-bg, var(--brand-orange));
  border: 2px solid transparent;
  border-radius: var(--radius-control, 2px);
  font: 700 0.95rem/1.2 var(--font-heading);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}

.public-header__cta:hover {
  background: var(--ph-cta-hover, #C95C0A);
  color: var(--ph-cta-fg, #FFFFFF);
  text-decoration: none;
  transform: translateY(-1px);
}

.public-header__cta:active {
  transform: none;
}

.public-header__cta:focus-visible {
  outline: 3px solid var(--brand-orange);
  outline-offset: 3px;
}

@media (max-width: 899px) {
  .has-js .public-nav__list .public-header__cta {
    width: 100%;
    min-height: 52px;
    margin-top: 0.5rem;
    justify-content: center;
    border-bottom: 0;
  }
}

/* Modifier: badge ----------------------------------------------------------- */
.public-header__badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.2rem 0.65rem;
  color: var(--ph-badge-fg, var(--brand-offwhite));
  background: var(--ph-badge-bg, rgba(var(--brand-cyan-rgb, 0, 182, 214), 0.18));
  border: 1px solid var(--ph-badge-border, rgba(var(--brand-cyan-rgb, 0, 182, 214), 0.55));
  border-radius: 999px;
  font: 700 0.8125rem/1 var(--font-heading);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .public-header__cta {
    transition: none;
    transform: none;
  }
}
