:root {
  --mcg-header-blue: #1769e0;
  --mcg-header-blue-dark: #0f56bf;
  --mcg-header-ink: #172338;
  --mcg-header-muted: #718096;
  --mcg-header-line: #dce6f1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(23, 105, 224, .11);
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(248, 251, 255, .95));
  box-shadow: 0 8px 24px rgba(24, 36, 58, .045);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.site-header .header-inner {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
}

.site-header .logo img {
  width: 174px;
  display: block;
}

.site-header .main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  color: #526176;
  font-size: 14px;
  font-weight: 750;
}

.site-header .main-nav > .primary-menu {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-header .main-nav > .primary-menu > .menu-item {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
}

.site-header .main-nav a {
  position: relative;
  padding: 29px 0;
  transition: color .18s ease;
}

.site-header .main-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 21px;
  left: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--mcg-header-blue);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .18s ease;
}

.site-header .main-nav a:hover,
.site-header .main-nav a:focus-visible,
.site-header .main-nav a[aria-current="page"] {
  color: var(--mcg-header-blue);
}

.site-header .main-nav a:hover::after,
.site-header .main-nav a:focus-visible::after,
.site-header .main-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.site-header .header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-header .icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--mcg-header-line);
  border-radius: 50%;
  background: linear-gradient(145deg, #fff, #f4f8fe);
  color: var(--mcg-header-ink);
  box-shadow: 0 7px 18px rgba(31, 73, 126, .075), inset 0 0 0 3px rgba(255, 255, 255, .72);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, color .18s ease, background .18s ease, box-shadow .18s ease;
}

.site-header .icon-button svg {
  display: block;
}

.site-header .icon-button:hover {
  transform: translateY(-1px);
  border-color: #b9d0eb;
  color: var(--mcg-header-blue);
  background: linear-gradient(145deg, #fff, #edf5ff);
  box-shadow: 0 11px 24px rgba(31, 73, 126, .13), inset 0 0 0 3px rgba(255, 255, 255, .78);
}

.site-header .icon-button:active {
  transform: translateY(0) scale(.97);
}

.site-header .search-button[aria-expanded="true"] {
  border-color: var(--mcg-header-blue);
  background: linear-gradient(145deg, var(--mcg-header-blue), var(--mcg-header-blue-dark));
  color: #fff;
  box-shadow: 0 10px 24px rgba(23, 105, 224, .25), inset 0 0 0 3px rgba(255, 255, 255, .14);
}

.site-header .menu-button {
  display: none;
}

/* Keep the mobile navigation above the sticky site header on every template. */
.mobile-panel {
  z-index: 80;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-top: max(23px, env(safe-area-inset-top));
  padding-bottom: max(23px, env(safe-area-inset-bottom));
}

.backdrop {
  z-index: 70;
}

.mobile-panel nav > .primary-menu {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mobile-panel nav > .primary-menu > .menu-item {
  display: block;
  margin: 0;
  padding: 0;
}

.site-footer .footer-menu {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer .footer-menu .menu-item {
  display: block;
  margin: 0;
  padding: 0;
}

.site-footer .footer-menu a {
  min-height: 24px;
  display: flex;
  align-items: center;
  margin: 8px 0;
  color: #c9d5e3;
  text-decoration: none;
}

/* Busca rápida aberta pela lupa do header. */
.search-overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(16px, 9vh, 88px) 20px 24px;
  background: rgba(15, 31, 54, .48);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease;
}

.search-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.live-search {
  width: min(720px, 100%);
  max-height: min(720px, calc(100vh - 32px));
  max-height: min(720px, calc(100dvh - 32px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 24px;
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
  box-shadow: 0 30px 90px rgba(8, 25, 51, .28), 0 4px 14px rgba(21, 55, 96, .12);
  transform: translateY(-10px) scale(.985);
  opacity: 0;
  transition: transform .2s ease, opacity .2s ease;
}

.search-overlay.open .live-search {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.live-search-top {
  min-height: 74px;
  padding: 15px 18px 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid #edf2f7;
}

.live-search-heading {
  min-width: 0;
}

.live-search-label {
  margin: 0;
  color: var(--mcg-header-ink);
  font-size: 15px;
  font-weight: 850;
  letter-spacing: -.01em;
}

.live-search-subtitle {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #7a899c;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.close-search {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #e1eaf4;
  border-radius: 12px;
  background: #f7faff;
  color: #6f8198;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}

.close-search:hover {
  border-color: #c4d8ef;
  background: #edf5ff;
  color: var(--mcg-header-blue);
  transform: rotate(3deg);
}

.live-search-field {
  margin: 18px 22px 0;
  min-height: 60px;
  padding: 0 10px 0 13px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border: 1px solid #cdddf0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 7px 18px rgba(28, 74, 128, .055), inset 0 1px 0 rgba(255, 255, 255, .9);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.live-search-field:focus-within {
  border-color: #82abe1;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(23, 105, 224, .11), 0 9px 22px rgba(28, 74, 128, .08);
}

.live-search-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #edf5ff;
  color: #5c7ea9;
}

.live-search-field input {
  min-width: 0;
  width: 100%;
  height: 58px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--mcg-header-ink);
  font: inherit;
  font-size: 16px;
}

.live-search-field input::placeholder {
  color: #8f9cad;
}

.live-search-field input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.clear-search[hidden] {
  display: none;
}

.clear-search {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: #f1f5fa;
  color: #7b8b9e;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}

.clear-search:hover {
  background: #e5effb;
  color: var(--mcg-header-blue);
}

.live-search-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 500px;
  overflow: auto;
  padding: 0 22px 18px;
  scrollbar-color: #cbd8e8 transparent;
  scrollbar-width: thin;
}

.search-hint {
  min-height: 40px;
  padding: 16px 3px 8px;
  color: #8492a5;
  font-size: var(--text-label, 12px);
  font-weight: 800;
  letter-spacing: .02em;
}

.quick-searches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 4px;
}

.quick-searches button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid #dce6f1;
  border-radius: 999px;
  background: #fff;
  color: #5f7087;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}

.quick-searches button:hover,
.quick-searches button:focus-visible {
  border-color: #a9c8eb;
  background: #f1f7ff;
  color: var(--mcg-header-blue);
  transform: translateY(-1px);
}

.live-results {
  display: grid;
}

.live-result {
  width: 100%;
  min-height: 72px;
  margin-top: 5px;
  padding: 10px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.live-result + .live-result {
  margin-top: 4px;
}

.live-result:hover,
.live-result:focus-visible {
  border-color: #e0ebf8;
  background: #f5f9ff;
  box-shadow: 0 6px 16px rgba(39, 87, 143, .06);
  transform: translateY(-1px);
}

.live-result-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid #dbeaff;
  border-radius: 12px;
  background: #edf5ff;
  color: var(--mcg-header-blue);
}

.live-result small {
  display: block;
  margin-bottom: 3px;
  overflow: hidden;
  color: #7b899b;
  font-size: var(--text-label, 12px);
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-result strong {
  display: block;
  overflow: hidden;
  color: var(--mcg-header-ink);
  font-size: 15px;
  font-weight: 780;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-result-arrow {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #8292a6;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.live-result:hover .live-result-arrow,
.live-result:focus-visible .live-result-arrow {
  background: #e8f2ff;
  color: var(--mcg-header-blue);
  transform: translateX(2px);
}

.live-empty {
  display: none;
  padding: 30px 8px 22px;
  text-align: center;
  color: var(--mcg-header-muted);
  font-size: var(--text-meta, 14px);
}

.view-all {
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  padding: 0 14px 0 16px;
  display: none;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #d6e6fa;
  border-radius: 14px;
  background: #f1f7ff;
  color: var(--mcg-header-blue);
  font-size: var(--text-meta, 14px);
  font-weight: 820;
  text-decoration: none;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.view-all:hover,
.view-all:focus-visible {
  border-color: #b9d2ef;
  background: #e8f2ff;
  color: var(--mcg-header-blue-dark);
}

.view-all > span:last-child {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e3efff;
}

body.mcg-modal-open {
  overflow: hidden;
}

@media (max-width: 1040px) {
  .site-header .main-nav {
    display: none;
  }

  .site-header .menu-button {
    display: grid;
  }
}

@media (max-width: 720px) {
  .site-header .header-inner {
    min-height: 76px;
  }

  .site-header .logo img {
    width: 150px;
  }

  .site-header .search-button {
    display: none;
  }

  .search-overlay {
    align-items: flex-start;
    padding: max(12px, env(safe-area-inset-top)) 10px 10px;
  }

  .live-search {
    max-height: calc(100vh - 22px);
    max-height: calc(100dvh - 22px);
    border-radius: 20px;
  }

  .live-search-top {
    min-height: 68px;
    padding: 13px 13px 12px 17px;
  }

  .live-search-field {
    margin: 14px 13px 0;
  }

  .live-search-body {
    padding: 0 13px 14px;
  }

  .live-result strong {
    white-space: normal;
  }
}

@media (max-width: 460px) {
  .live-search-subtitle {
    display: none;
  }

  .live-search-field {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 9px;
  }

  .live-search-icon {
    width: 30px;
    height: 30px;
  }

  .live-result {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 10px;
    padding-inline: 7px;
  }

  .live-result-icon {
    width: 36px;
    height: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header .icon-button,
  .search-overlay,
  .live-search,
  .close-search,
  .quick-searches button,
  .live-result,
  .live-result-arrow {
    transition-duration: .01ms !important;
  }
}

/* Accessibility baseline shared by every public template. */
:root {
  --blue: #1769d2;
  --blue2: #0f56bf;
  --blue-dark: #0f56bf;
  --blue-strong: #0f56bf;
  --muted: #5f6f85;
  --muted-light: #5f6f85;
  --line-strong: #8995a5;
  --mcg-header-blue: #1769d2;
  --mcg-header-blue-dark: #0f56bf;
  --mcg-header-muted: #5f6f85;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100000;
  padding: 11px 15px;
  border-radius: 9px;
  background: #0f62c9;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  transform: translateY(-180%);
  transition: transform .12s ease;
}

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

#conteudo-principal { scroll-margin-top: 96px; }

.screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body :focus-visible {
  outline: 3px solid #0f62c9 !important;
  outline-offset: 3px !important;
}

footer :focus-visible { outline-color: #fff !important; }

.breadcrumb,
.article-meta,
.card .meta,
.card-meta,
.mcg-sources-count,
.counter,
.privacy-note,
.toc-label,
.clear-link,
.result-topic,
.field-help,
.live-search-subtitle,
.search-hint,
.live-empty,
.live-result small,
.live-result-arrow,
.toc a,
.toc-note {
  color: #5f6f85;
}

input::placeholder,
textarea::placeholder,
.field-control::placeholder,
.live-search-field input::placeholder,
.page-search input::placeholder {
  color: #5f6f85;
  opacity: 1;
}

.field-control,
.live-search-field,
.page-search,
.search { border-color: #8995a5; }

.field-control:hover { border-color: #6f7d90; }

.field-control:focus {
  border-color: #1769d2;
  box-shadow: 0 0 0 3px rgba(23, 105, 210, .2);
}

.field.invalid .field-control {
  border-color: #b94343;
  box-shadow: 0 0 0 3px rgba(185, 67, 67, .18);
}

.site-header .icon-button,
.mobile-panel .icon-button {
  width: 48px;
  height: 48px;
}

.category-pill,
.tag { font-size: var(--text-label, 12px); }

.mcg-table-wrap th,
.mcg-sources-count,
.counter { font-size: var(--text-label, 12px); }

.privacy-note,
.field-help,
.result-topic { font-size: 13px; }

.toc a {
  font-size: var(--text-meta, 14px);
  line-height: 1.5;
}

.toc-note { font-size: var(--text-label, 12px); }

.section-link,
.clear-link {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

.mcg-table-wrap .official-link {
  min-height: 40px;
  padding: 8px 10px;
  font-size: var(--text-meta, 14px);
}

footer a {
  min-height: 24px;
  display: flex;
  align-items: center;
}

/* Composite search fields expose one rounded focus ring on the container. */
.live-search-field:focus-within,
.page-search:focus-within,
.search:focus-within,
.category-search:focus-within {
  border-color: #1769d2;
  box-shadow: 0 0 0 3px #1769d2, 0 9px 22px rgba(28, 74, 128, .08);
}

.live-search-field input:focus-visible,
.page-search input:focus-visible,
.search input:focus-visible,
.category-search input:focus-visible {
  outline: none !important;
}
