/* Shared application header contract for Next.js and generated Antora pages. */
:root {
  --app-docs-blue: #1e73be;
  --app-docs-blue-bright: #3b95df;
  --app-docs-navy: #071a2c;
  --app-docs-navy-soft: #0e3659;
  --app-docs-focus: #8bc9ff;
  --app-shell-header-height: 64px;
}

.app-shell-header {
  position: sticky;
  z-index: 50;
  top: 0;
  display: block;
  width: 100%;
  height: var(--app-shell-header-height);
  color: #fff;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.app-shell-header.app-shell-header-fixed {
  position: fixed;
  right: 0;
  left: 0;
}

.app-shell-navbar {
  position: relative;
  isolation: isolate;
  display: flex;
  width: 100%;
  height: var(--app-shell-header-height);
  min-height: var(--app-shell-header-height);
  align-items: stretch;
  border-bottom: 1px solid rgb(139 201 255 / 30%);
  background:
    radial-gradient(circle at 72% -140%, rgb(89 176 244 / 75%), transparent 48%),
    linear-gradient(118deg, var(--app-docs-navy) 0%, #0b2c4b 52%, #145f9d 100%);
  box-shadow: 0 8px 28px rgb(7 26 44 / 22%);
}

.app-shell-navbar::before,
.app-shell-navbar::after {
  position: absolute;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.app-shell-navbar::before {
  inset: 0;
  background: linear-gradient(90deg, rgb(255 255 255 / 5%), transparent 38%);
}

.app-shell-navbar::after {
  top: -80px;
  right: 160px;
  width: 256px;
  height: 224px;
  background: url("/brand/raciocinios-icon.png") center / contain no-repeat;
  opacity: 0.075;
  transform: rotate(8deg);
}

.app-shell-brand-region {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  padding-left: clamp(12px, 2vw, 24px);
}

.app-shell-navbar .app-shell-brand-region .app-shell-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 0;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
}

.app-shell-navbar .app-shell-brand-region .app-shell-brand * {
  padding: 0;
}

.app-shell-brand:focus-visible,
.app-shell-menu-toggle:focus-visible,
.app-shell-action:focus-visible {
  outline: 3px solid var(--app-docs-focus);
  outline-offset: 2px;
}

.app-shell-brand-mark {
  display: block;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
}

.app-shell-brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.app-shell-brand-copy,
.app-shell-brand-title {
  display: block;
  min-width: 0;
}

.app-shell-brand-copy {
  line-height: 1.05;
}

.app-shell-brand-title {
  overflow: hidden;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell-brand-tagline {
  display: block;
  margin-top: 4px;
  color: rgb(255 255 255 / 68%);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.app-shell-menu {
  display: flex;
  min-width: 0;
  margin-left: auto;
}

.app-shell-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: clamp(12px, 2vw, 24px);
}

.app-shell-action {
  display: inline-flex;
  box-sizing: border-box;
  height: 38px;
  min-width: 0;
  max-width: 100%;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 999px;
  background: rgb(255 255 255 / 9%);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  hyphens: none;
  text-decoration: none;
  white-space: nowrap;
  word-break: normal;
  overflow: hidden;
  overflow-wrap: normal;
  backdrop-filter: blur(10px);
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.app-shell-action > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell-search-action {
  width: 148px;
}

.app-shell-library-action,
.app-shell-profile-action {
  width: 124px;
}

.app-shell-admin-action {
  width: 158px;
}

.app-shell-access-action {
  width: auto;
  min-width: 112px;
  max-width: 210px;
}

.app-shell-navbar .app-shell-actions .app-shell-access-action {
  border-color: rgb(255 255 255 / 82%);
  background: #fff;
  box-shadow: 0 7px 20px rgb(0 0 0 / 14%);
  color: #124f80;
}

.app-shell-access-label {
  max-width: 160px;
}

.app-shell-actions[data-auth-state="loading"] .app-shell-action[hidden] {
  display: inline-flex !important;
  visibility: hidden;
}

.app-shell-action[hidden] {
  display: none !important;
}

.app-shell-action.is-current,
.app-shell-action[aria-current="page"] {
  border-color: rgb(139 201 255 / 62%);
  background: rgb(255 255 255 / 18%);
  box-shadow:
    inset 0 -2px #8bc9ff,
    0 5px 16px rgb(0 0 0 / 9%);
  color: #fff;
}

.app-shell-navbar .app-shell-actions .app-shell-action:hover,
.app-shell-navbar .app-shell-actions .app-shell-action:focus-visible {
  border-color: rgb(255 255 255 / 48%);
  background: rgb(255 255 255 / 16%);
  color: #fff;
  text-decoration: none;
}

.app-shell-navbar .app-shell-actions .app-shell-access-action:hover,
.app-shell-navbar .app-shell-actions .app-shell-access-action:focus-visible {
  border-color: #fff;
  background: #f4faff;
  box-shadow: 0 9px 24px rgb(0 0 0 / 20%);
  color: #0b3c63;
}

.app-shell-navbar .app-shell-actions .app-shell-action:hover {
  transform: translateY(-1px);
}

.app-shell-search-action kbd {
  flex: 0 0 auto;
  padding: 4px 6px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 5px;
  background: rgb(0 0 0 / 15%);
  box-shadow: none;
  color: rgb(255 255 255 / 72%);
  font: inherit;
  font-size: 10px;
  font-weight: 650;
}

.app-shell-icon {
  display: block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: currentcolor;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.25;
}

.app-shell-menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  min-width: 42px;
  align-self: center;
  align-items: center;
  justify-content: center;
  margin: 0 12px 0 auto;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 12px;
  background: rgb(255 255 255 / 8%);
  color: #fff;
}

.app-shell-menu-toggle span {
  position: absolute;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentcolor;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.app-shell-menu-toggle span + span {
  margin-top: 0;
}

.app-shell-menu-toggle span:first-child {
  transform: translateY(-6px);
}

.app-shell-menu-toggle span:last-child {
  transform: translateY(6px);
}

.app-shell-menu-toggle.is-active span:first-child {
  transform: rotate(45deg);
}

.app-shell-menu-toggle.is-active span:nth-child(2) {
  opacity: 0;
}

.app-shell-menu-toggle.is-active span:last-child {
  transform: rotate(-45deg);
}

@media screen and (max-width: 1199px) {
  html.is-clipped--navbar {
    overflow-y: hidden;
  }

  .app-shell-navbar::after {
    top: -56px;
    right: 14%;
    width: 192px;
    height: 176px;
    opacity: 0.055;
  }

  .app-shell-brand-region {
    height: var(--app-shell-header-height);
    padding-right: 8px;
  }

  .app-shell-navbar .app-shell-menu-toggle {
    display: flex;
  }

  .app-shell-menu {
    position: absolute;
    top: var(--app-shell-header-height);
    right: 0;
    left: 0;
    display: block;
    max-height: calc(100vh - var(--app-shell-header-height));
    margin-left: 0;
    overflow-y: auto;
    border-top: 1px solid rgb(139 201 255 / 24%);
    border-bottom: 1px solid rgb(7 26 44 / 55%);
    background:
      radial-gradient(circle at 88% 0%, rgb(59 149 223 / 34%), transparent 42%),
      linear-gradient(135deg, #071a2c 0%, #0c3457 100%);
    box-shadow: 0 14px 28px rgb(7 26 44 / 32%);
    color: #fff;
  }

  .app-shell-menu:not(.is-active) {
    display: none;
  }

  .app-shell-actions {
    display: grid;
    width: min(760px, 100%);
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 0 auto;
    padding: 13px;
  }

  .app-shell-actions[data-auth-state="loading"] .app-shell-action[hidden],
  .app-shell-action[hidden] {
    display: none !important;
  }

  .app-shell-action,
  .app-shell-search-action,
  .app-shell-library-action,
  .app-shell-admin-action,
  .app-shell-profile-action,
  .app-shell-access-action {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 44px;
  }
}

@media screen and (max-width: 760px) {
  .app-shell-brand-tagline {
    display: none;
  }
}

@media screen and (max-width: 480px) {
  .app-shell-brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .app-shell-brand-title {
    font-size: 16px;
  }

  .app-shell-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-shell-action,
  .app-shell-menu-toggle span {
    transition: none;
  }
}
