/**
 * @file
 * Header layout — topbar, branding, main navigation.
 */

.header-v1 {
  position: relative;
  z-index: 999;
  background: #260387;
}

/**
 * Sitewide: the Drupal admin toolbar and its dropdowns/trays must always sit
 * above the site header (which uses z-index 999). Without this, admin-toolbar
 * popups — e.g. the People → Invitations dropdown on /admin/people/ — render
 * behind the purple banner and are clipped.
 */
#toolbar-administration,
#toolbar-bar,
.toolbar-tray,
.toolbar-tray-horizontal,
.toolbar-tray-vertical,
.toolbar-menu,
#toolbar-item-administration-tray,
.contextual,
.contextual-links {
  z-index: 1502;
}

/* Topbar */
.topbar {
  background: #1a025e;
  color: #fff;
  font-size: 13px;
  padding: 6px 0;
}

.topbar a {
  color: #fff;
}

.topbar a:hover {
  color: #82fec8;
}

/* Topbar account menu — inline, right-aligned */
.topbar .container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.topbar nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 16px;
  align-items: center;
}

.topbar nav ul li {
  margin: 0;
  padding: 0;
}

.topbar nav ul li a {
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

/* Header main */
.header-main {
  background: #260387;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 0;
  transition: all 0.3s ease;
}

.header-main-inner {
  position: relative;
}

.header-main-inner a,
.header-main-inner a:link,
.header-main-inner a:visited,
.header-main-inner a.is-active {
  color: #fff !important;
}

.header-main-inner a:hover,
.header-main-inner a:focus {
  color: #82fec8 !important;
}

/* Branding */
.branding {
  display: flex;
  align-items: center;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-branding .site-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.site-branding .site-logo img {
  max-height: 80px;
  width: auto;
  display: block;
}

.site-branding .site-identity {
  display: flex;
  flex-direction: column;
}

.site-branding .site-name {
  font-family: 'Poppins', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #260387;
  text-decoration: none;
  line-height: 1.2;
}

.site-branding .site-name:hover {
  text-decoration: none;
  color: #1a025e;
}

.site-branding .site-slogan {
  font-size: 12px;
  color: #888;
}

/* Header inner — nav container */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}

/**
 * Restore `[hidden]` on Drupal contextual-links popups.
 *
 * The `.main-menu ul { display: flex }` and `.topbar nav ul { display: flex }`
 * rules unintentionally match the `<ul class="contextual-links">` that Drupal
 * injects inside every contextual-region. That `display: flex` beats the
 * browser default `[hidden] { display: none }`, so the admin popups (Configure
 * block / Remove block / Edit menu) would show permanently. Force them hidden
 * when the `hidden` attribute is present; Drupal's JS removes the attribute to
 * open the popup, at which point core's `.contextual.open .contextual-links`
 * rule takes over and reveals it as a block.
 */
ul.contextual-links[hidden] {
  display: none !important;
}

/* Admin contextual links in header — fix visibility on dark background */
.header-v1 .contextual-region {
  position: relative;
}

.header-v1 .contextual {
  background: transparent;
}

.header-v1 .contextual .trigger {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.header-v1 .contextual .trigger:hover {
  background-color: rgba(255, 255, 255, 0.4);
}

.header-v1 .contextual .contextual-links {
  background: #fff;
}

.header-v1 .contextual .contextual-links a {
  color: #333 !important;
}

/* Blocks in header — ensure transparent background */
.header-v1 .block,
.header-v1 nav,
.header-v1 .contextual-region {
  background: transparent;
  color: #fff;
}

/* Prevent admin contextual wrappers from creating dark boxes */
.page-admission-front .header-v1 .block,
.page-admission-front .header-v1 .contextual-region,
.page-admission-front .area-main-menu .block,
.page-admission-front .area-main-menu .contextual-region {
  background: transparent !important;
  border: none;
  box-shadow: none;
}

/* Ensure menu text is visible in header on all pages */
.header-main-inner .block h2,
.header-main-inner .block .block-title {
  color: #fff;
  display: none;
}

/* Remove dashed focus outline on contextual regions in header */
.header-v1 .contextual-region.focus {
  outline: none;
}

/* Ensure all wrappers inside the header nav area are transparent */
.header-v1 .gva-offcanvas-mobile,
.header-v1 .gva-offcanvas-mobile > div,
.header-v1 .area-main-menu {
  background-color: transparent;
}

/* Fix contextual trigger visibility in dark header */
.header-v1 .contextual .trigger {
  border-color: rgba(255, 255, 255, 0.3);
}

/* Contextual links dropdown in header — must stay white and readable */
.header-v1 .contextual .contextual-links,
.header-v1 .contextual .contextual-links li {
  background-color: #fff !important;
}

.header-v1 .contextual .contextual-links a,
.header-v1 .contextual .contextual-links a:link,
.header-v1 .contextual .contextual-links a:visited {
  color: #333 !important;
  background-color: #fff !important;
}

.header-v1 .contextual .contextual-links a:hover {
  color: #000 !important;
  background-color: #f7fcff !important;
}

/* Sticky header — disabled */

/* Hamburger menu button — mobile only */
.menu-bar {
  display: none;
  cursor: pointer;
  padding: 10px;
  float: right;
}

.menu-bar span {
  display: block;
  width: 24px;
  height: 3px;
  background: #e0e0e0;
  margin: 4px 0;
  transition: 0.3s;
  border-radius: 2px;
}

@media (max-width: 991px) {
  .menu-bar {
    display: block;
  }

  .site-branding .site-logo img {
    max-height: 40px;
  }

  .site-branding .site-name {
    font-size: 15px;
  }
}
