/* VINX INTERNAL HEADER LAYOUT START */

/*
   Desktop:
   Brand | Theme + Language | Navigation

   Landing excluded.
   Existing theme colors and behavior unchanged.
*/

.site-header:not(.site-header-home)
.header-actions > .theme-toggle {
  position: static !important;
  inset: auto !important;
  transform: none !important;
  align-self: center !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
}

.site-header:not(.site-header-home)
.header-actions > .lang-switch {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
}

@media (min-width: 1281px) {

  .site-header:not(.site-header-home) {
    display: grid !important;

    grid-template-columns:
      max-content
      minmax(0, 1fr)
      max-content;

    grid-template-rows: auto;

    align-items: center !important;

    column-gap: clamp(
      1rem,
      2vw,
      2.5rem
    );

    min-height: 64px !important;
    height: auto !important;

    padding:
      0
      var(--pad, 1.5rem) !important;

    box-sizing: border-box;
  }

  .site-header:not(.site-header-home)
  > .header-main {
    display: contents !important;
  }

  .site-header:not(.site-header-home)
  > .header-main > .brand {
    grid-column: 1;
    grid-row: 1;

    justify-self: start;
    align-self: center;

    flex: none !important;

    width: auto !important;
    min-width: 0 !important;

    margin: 0 !important;
    padding: 0 !important;

    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  .site-header:not(.site-header-home)
  > .header-main > .header-actions {
    grid-column: 2;
    grid-row: 1;

    display: flex !important;

    justify-self: stretch;
    justify-content: center !important;

    align-items: center !important;

    flex-direction: row !important;
    flex-wrap: nowrap !important;

    gap: clamp(
      .8rem,
      1.5vw,
      1.5rem
    ) !important;

    min-width: 0;
    width: 100%;

    margin: 0 !important;
    padding: 0 !important;
  }

  .site-header:not(.site-header-home)
  > .context-nav {
    grid-column: 3;
    grid-row: 1;

    display: flex !important;

    justify-self: end;
    justify-content: flex-end !important;
    align-items: center !important;

    flex-direction: row !important;
    flex-wrap: nowrap !important;

    gap: clamp(
      .7rem,
      1.3vw,
      1.6rem
    ) !important;

    position: static !important;
    inset: auto !important;
    transform: none !important;

    width: auto !important;
    height: auto !important;

    min-height: 0 !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;

    white-space: nowrap !important;
    box-sizing: border-box;
  }

  .site-header:not(.site-header-home)
  > .header-main
  .nav-toggle {
    display: none !important;
  }
}

/*
   Narrow screens:
   Keep the brand and controls on the first row.
   Navigation opens through the existing MENU toggle.
*/

@media (max-width: 1280px) {

  .site-header:not(.site-header-home) {
    display: block !important;

    height: auto !important;
    min-height: 0 !important;

    padding: 0 !important;
  }

  .site-header:not(.site-header-home)
  > .header-main {
    display: flex !important;

    flex-direction: row !important;
    flex-wrap: nowrap !important;

    align-items: center !important;
    justify-content: space-between !important;

    width: 100% !important;
    min-height: 50px !important;

    padding:
      0
      var(--pad, 1.5rem) !important;

    box-sizing: border-box;
  }

  .site-header:not(.site-header-home)
  > .header-main > .brand {
    flex: 1 1 auto !important;

    min-width: 0 !important;

    margin-right: auto !important;

    white-space: nowrap !important;

    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .site-header:not(.site-header-home)
  > .header-main > .header-actions {
    display: flex !important;

    flex: 0 0 auto !important;

    flex-direction: row !important;
    flex-wrap: nowrap !important;

    align-items: center !important;
    justify-content: flex-end !important;

    gap: clamp(
      .35rem,
      1.5vw,
      .8rem
    ) !important;

    margin: 0 !important;
    padding: 0 !important;
  }

  .site-header:not(.site-header-home)
  > .header-main
  .nav-toggle {
    display: inline-flex !important;
    align-items: center !important;

    flex: 0 0 auto !important;
  }

  .site-header:not(.site-header-home)
  > .context-nav {
    display: none !important;

    position: static !important;
    transform: none !important;

    width: 100% !important;

    margin: 0 !important;

    padding:
      1rem
      var(--pad, 1.5rem) !important;

    box-sizing: border-box;
  }

  .site-header:not(.site-header-home)
  > .context-nav.open {
    display: flex !important;

    flex-direction: column !important;
    align-items: flex-start !important;

    gap: 1rem !important;
  }
}

/* VINX INTERNAL HEADER LAYOUT END */
