/* ISO Metrik shared public header normalization — 2.4.14.
   Keeps the theme header consistent across normal public pages and signed-out portal/sign-in pages. */
.header-utility,
.header-utility-inner,
.shell.header-inner,
.header-utility-nav,
.desktop-nav,
.desktop-nav-list,
.header-actions,
.brand {
  box-sizing: border-box;
}

.header-utility-inner {
  width: min(1480px, calc(100% - 48px));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;
}

.header-utility-inner > a.header-utility-link {
  flex: 0 0 auto;
  white-space: nowrap;
}

.header-utility-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: clamp(12px, 1.35vw, 24px);
  min-width: 0;
  white-space: nowrap;
}

.header-utility-nav > a,
.header-utility-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  white-space: nowrap;
  line-height: 1.2;
}

.header-utility-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

/* Keep each group inside the available header width after the portal links
   are added. A shorter container must grow vertically instead of overlapping. */
.site-header .header-utility-inner {
  flex-wrap: wrap;
  row-gap: 4px;
}

.site-header .header-utility-contact,
.site-header .header-utility-nav {
  flex-wrap: wrap;
  max-width: 100%;
}

.site-header .header-utility-nav {
  margin-left: auto;
}

/* The theme's final mobile layer sets grid columns but relies on its earlier
   display:grid rule. Restore that layout after the shared desktop flex rule. */
@media (max-width: 1024px) {
  .site-header .header-utility-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
    padding-block: 5px;
  }

  .site-header .header-utility-contact,
  .site-header .header-utility-nav {
    display: flex;
    width: 100%;
    justify-content: center;
    gap: 4px 14px;
    margin: 0;
  }

  .site-header .header-utility-nav > a,
  .site-header .header-utility-link {
    max-width: 100%;
    white-space: normal;
  }
}

@media (min-width: 1181px) {
  .shell.header-inner {
    width: min(1480px, calc(100% - 48px));
    margin-inline: auto;
    display: grid !important;
    grid-template-columns: minmax(185px, 220px) minmax(0, 1fr) max-content;
    align-items: center;
    column-gap: clamp(16px, 1.7vw, 30px);
    min-width: 0;
  }

  .shell.header-inner > .brand {
    grid-column: 1;
    min-width: 0;
    width: 100%;
    max-width: 220px;
    margin: 0 !important;
    position: static !important;
    transform: none !important;
  }

  .shell.header-inner > .brand a,
  .shell.header-inner > .brand img {
    display: block;
    width: 100%;
    max-width: 220px;
    height: auto;
  }

  .shell.header-inner > .desktop-nav {
    grid-column: 2;
    min-width: 0;
    width: 100%;
    margin: 0 !important;
  }

  .desktop-nav-list,
  .desktop-nav ul {
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap !important;
    gap: clamp(8px, 0.9vw, 16px);
    margin: 0 !important;
    padding: 0 !important;
    min-width: 0;
    white-space: nowrap;
  }

  .desktop-nav a {
    white-space: nowrap;
    font-size: clamp(11px, 0.82vw, 14px);
    line-height: 1.2;
  }

  .shell.header-inner > .header-actions {
    grid-column: 3;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    margin: 0 !important;
  }

  .header-actions .nav-cta {
    white-space: nowrap;
    flex: 0 0 auto;
  }
}

@media (min-width: 1181px) and (max-width: 1320px) {
  .header-utility-inner,
  .shell.header-inner {
    width: min(100% - 32px, 1480px);
  }
  .header-utility-nav { gap: 10px; }
  .header-utility-link { font-size: 12px; }
  .shell.header-inner { grid-template-columns: minmax(170px, 190px) minmax(0, 1fr) max-content; column-gap: 12px; }
  .desktop-nav-list, .desktop-nav ul { gap: 7px; }
  .desktop-nav a { font-size: 11px; }
  .header-actions .nav-cta { padding-left: 14px; padding-right: 14px; font-size: 12px; }
}

/* Preserve the normal desktop arrangement, but let a constrained header
   grow rather than letting its navigation spill over the logo or button. */
@media (min-width: 1025px) {
  .site-header {
    container-name: iso-public-header;
    container-type: inline-size;
  }

  .site-header .header-inner {
    height: auto;
    min-height: 70px;
  }

  .site-header .desktop-nav-list {
    flex-wrap: wrap !important;
  }

  @container iso-public-header (max-width: 1000px) {
    .site-header .header-inner {
      grid-template-columns: 180px minmax(0, 1fr) !important;
      padding-block: 12px;
    }

    .site-header .header-inner > .brand {
      grid-column: 1;
      grid-row: 1;
    }

    .site-header .header-inner > .header-actions {
      grid-column: 2;
      grid-row: 1;
    }

    .site-header .header-inner > .desktop-nav {
      grid-column: 1 / -1;
      grid-row: 2;
    }

    .site-header .desktop-nav-list a {
      padding-block: 10px;
    }

    .site-header .desktop-nav-list a::after {
      bottom: 3px;
    }
  }
}
