/*
 * CONV-01E / P-01 — Cabeçalho exclusivo do Portal.
 * Referência homologada: dist/index.html + styles.css +
 * responsive.css + portal-tablet.css @ a90cb888.
 *
 * Esta folha carrega DEPOIS de wp-compat.css e nunca é
 * enfileirada na Assistência ou na T.I.
 */
body.wp-theme-technolife .wp-site-blocks > header.tl-header {
  position: relative;
  z-index: 60;
  height: 108px;
  min-height: 108px;
  padding: 8px 0 0;
  margin-block: 0;
  box-sizing: border-box;
  background: #fff;
  font-family: "Segoe UI", Arial, sans-serif;
}

/* Correção comprovada no snapshot: WordPress adicionava margem de 24px
   entre o template-part de header e o main. Hero inicia sem faixa extra. */
body.wp-theme-technolife .wp-site-blocks > header.tl-header + main {
  margin-block-start: 0;
}

/* A versão estática tem 190px / espaço flexível / 206px e gap de 32px.
   Sobrescreve o layout flex nativo do core sem mudar o Gutenberg global. */
body.wp-theme-technolife .tl-portal-header.wp-block-group.is-layout-flex,
body.wp-theme-technolife .tl-portal-header.wp-block-group {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 206px;
  grid-template-areas: "brand nav phone";
  align-items: center;
  justify-content: initial;
  gap: 32px;
  width: calc(100% - 80px);
  max-width: 1360px;
  min-height: 100px;
  height: 100px;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  box-sizing: border-box;
}

body.wp-theme-technolife .tl-portal-header .tl-brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 160px;
  height: 82px;
  min-width: 0;
}
body.wp-theme-technolife .tl-portal-header .tl-brand img {
  display: block;
  width: 154px;
  max-width: 100%;
  height: auto;
}

body.wp-theme-technolife .tl-portal-header nav.tl-portal-nav {
  grid-area: nav;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-width: 0;
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.5;
  color: #232b50;
}
body.wp-theme-technolife .tl-portal-header .tl-portal-nav
.wp-block-navigation__container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  gap: 48px;
  margin: 0;
  padding: 0;
  list-style: none;
}
body.wp-theme-technolife .tl-portal-header .tl-portal-nav
.wp-block-navigation-item__content {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 100px;
  padding: 0;
  color: #232b50;
  font-size: inherit;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: color 180ms ease;
}
body.wp-theme-technolife .tl-portal-header .tl-portal-nav
.wp-block-navigation-item__content::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 27px;
  height: 2px;
  border-radius: 2px;
  background: #3a4386;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 180ms ease;
}
body.wp-theme-technolife .tl-portal-header .tl-portal-nav
.wp-block-navigation-item__content:hover,
body.wp-theme-technolife .tl-portal-header .tl-portal-nav
.wp-block-navigation-item__content:focus-visible {
  color: #3a4386;
}
body.wp-theme-technolife .tl-portal-header .tl-portal-nav
.wp-block-navigation-item__content:hover::after,
body.wp-theme-technolife .tl-portal-header .tl-portal-nav
.wp-block-navigation-item__content:focus-visible::after {
  transform: scaleX(1);
}

body.wp-theme-technolife .tl-portal-header .tl-header-actions {
  grid-area: phone;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: 0;
  width: 100%;
}
body.wp-theme-technolife .tl-portal-header .tl-header-phone {
  width: 100%;
  margin: 0;
}
body.wp-theme-technolife .tl-portal-header .tl-header-phone
.wp-block-button__link {
  min-height: 50px;
  width: 100%;
  padding: 0 12px;
  border-radius: 7px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 11px;
  box-sizing: border-box;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.3;
  color: #fff;
  background: #3a4386;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(58, 67, 134, .18);
}
body.wp-theme-technolife .tl-portal-header .tl-header-phone
.wp-block-button__link:hover,
body.wp-theme-technolife .tl-portal-header .tl-header-phone
.wp-block-button__link:focus-visible {
  color: #fff;
  background: #252d68;
}
body.wp-theme-technolife .tl-portal-header .tl-portal-nav
.tl-portal-mobile-phone {
  display: none;
}

/* A versão homologada usa duas faixas de navegação entre 768 e 959px. */
@media (min-width: 768px) and (max-width: 959px) {
  body.wp-theme-technolife .wp-site-blocks > header.tl-header {
    height: 148px;
    min-height: 148px;
    padding: 0;
    border-bottom: 1px solid rgba(58, 67, 134, .1);
    box-shadow: 0 8px 28px rgba(25, 34, 76, .06);
  }
  body.wp-theme-technolife .tl-portal-header.wp-block-group.is-layout-flex,
  body.wp-theme-technolife .tl-portal-header.wp-block-group {
    width: calc(100% - 64px);
    max-width: 1080px;
    height: 148px;
    min-height: 148px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 84px 64px;
    grid-template-areas: "brand phone" "nav nav";
    gap: 0 32px;
  }
  body.wp-theme-technolife .tl-portal-header .tl-brand img { width: 146px; }
  body.wp-theme-technolife .tl-portal-header nav.tl-portal-nav {
    align-self: stretch;
    justify-content: flex-start;
    border-top: 1px solid rgba(58, 67, 134, .1);
    font-size: 14px;
  }
  body.wp-theme-technolife .tl-portal-header .tl-portal-nav
  .wp-block-navigation__container {
    justify-content: flex-start;
    gap: clamp(28px, 6vw, 52px);
  }
  body.wp-theme-technolife .tl-portal-header .tl-portal-nav
  .wp-block-navigation-item__content {
    min-height: 63px;
  }
  body.wp-theme-technolife .tl-portal-header .tl-portal-nav
  .wp-block-navigation-item__content::after { bottom: 10px; }
  body.wp-theme-technolife .tl-portal-header .tl-header-phone
  .wp-block-button__link { min-height: 48px; }
}

/* Tablet largo de 960 a 1179px: uma linha como na referência. */
@media (min-width: 960px) and (max-width: 1179px) {
  body.wp-theme-technolife .wp-site-blocks > header.tl-header {
    height: 100px;
    min-height: 100px;
    padding: 0;
  }
  body.wp-theme-technolife .tl-portal-header.wp-block-group.is-layout-flex,
  body.wp-theme-technolife .tl-portal-header.wp-block-group {
    width: calc(100% - 64px);
    max-width: 1080px;
    height: 100px;
    min-height: 100px;
    grid-template-columns: 150px minmax(0, 1fr) 190px;
    gap: 24px;
  }
  body.wp-theme-technolife .tl-portal-header .tl-brand img { width: 146px; }
  body.wp-theme-technolife .tl-portal-header .tl-portal-nav { font-size: 13px; line-height: 1.25; }
  body.wp-theme-technolife .tl-portal-header .tl-portal-nav
  .wp-block-navigation__container {
    gap: clamp(18px, 2.4vw, 34px);
  }
  body.wp-theme-technolife .tl-portal-header .tl-portal-nav
  .wp-block-navigation-item__content {
    min-height: 100px;
    white-space: normal;
    text-align: center;
  }
  body.wp-theme-technolife .tl-portal-header .tl-portal-nav
  .wp-block-navigation-item__content::after { bottom: 21px; }
  body.wp-theme-technolife .tl-portal-header .tl-header-phone
  .wp-block-button__link { padding-inline: 8px; font-size: 13px; gap: 7px; }
}

/* Abaixo de 768px a referência usa logo + menu, com 76px de altura. */
@media (max-width: 767px) {
  body.wp-theme-technolife .wp-site-blocks > header.tl-header {
    height: 76px;
    min-height: 76px;
    padding: 0;
    border-bottom: 1px solid rgba(58, 67, 134, .1);
    box-shadow: 0 8px 28px rgba(25, 34, 76, .06);
  }
  body.wp-theme-technolife .tl-portal-header.wp-block-group.is-layout-flex,
  body.wp-theme-technolife .tl-portal-header.wp-block-group {
    display: grid;
    width: calc(100% - 32px);
    height: 76px;
    min-height: 76px;
    grid-template-columns: minmax(0, 1fr) 48px;
    grid-template-areas: "brand nav";
    gap: 14px;
    padding: 0;
    justify-content: initial;
  }
  body.wp-theme-technolife .tl-portal-header .tl-brand {
    width: 132px;
    height: 68px;
  }
  body.wp-theme-technolife .tl-portal-header .tl-brand img { width: 128px; }
  body.wp-theme-technolife .tl-portal-header .tl-header-actions { display: none; }
  body.wp-theme-technolife .tl-portal-header nav.tl-portal-nav {
    grid-area: nav;
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    margin: 0;
    justify-content: flex-end;
    align-self: center;
    font-size: 15px;
  }
  body.wp-theme-technolife .tl-portal-header .tl-portal-nav
  .wp-block-navigation__responsive-container-open {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(58, 67, 134, .16);
    border-radius: 12px;
    background: #f4f6fb;
    color: #3a4386;
  }
  body.wp-theme-technolife .tl-portal-header .tl-portal-nav
  .wp-block-navigation__responsive-container:not(.is-menu-open) {
    display: none;
  }
  body.wp-theme-technolife .tl-portal-header .tl-portal-nav
  .wp-block-navigation__responsive-container.is-menu-open {
    display: flex;
    z-index: 100000;
    background: #fff;
    color: #232b50;
    padding: 26px;
  }
  body.wp-theme-technolife .tl-portal-header .tl-portal-nav
  .wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation__container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    width: 100%;
  }
  body.wp-theme-technolife .tl-portal-header .tl-portal-nav
  .wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation-item__content {
    display: flex;
    min-height: 50px;
    font-size: 15px;
    padding: 14px 4px;
    white-space: normal;
  }
  body.wp-theme-technolife .tl-portal-header .tl-portal-nav
  .wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation-item + .wp-block-navigation-item {
    border-top: 1px solid rgba(58, 67, 134, .08);
  }
  body.wp-theme-technolife .tl-portal-header .tl-portal-nav
  .wp-block-navigation__responsive-container.is-menu-open
  .tl-portal-mobile-phone {
    display: flex;
    width: 100%;
    margin-top: 10px;
    border: 0;
  }
  body.wp-theme-technolife .tl-portal-header .tl-portal-nav
  .wp-block-navigation__responsive-container.is-menu-open
  .tl-portal-mobile-phone .wp-block-navigation-item__content {
    width: 100%;
    justify-content: center;
    border-radius: 10px;
    background: #3a4386;
    color: #fff;
    font-weight: 750;
  }
  body.wp-theme-technolife .tl-portal-header .tl-portal-nav
  .wp-block-navigation__responsive-container.is-menu-open
  .tl-portal-mobile-phone .wp-block-navigation-item__content::after { display: none; }
}
@media (max-width: 380px) {
  body.wp-theme-technolife .tl-portal-header.wp-block-group.is-layout-flex,
  body.wp-theme-technolife .tl-portal-header.wp-block-group {
    width: calc(100% - 28px);
  }
}
@media (prefers-reduced-motion: reduce) {
  body.wp-theme-technolife .tl-portal-header .tl-portal-nav
  .wp-block-navigation-item__content::after {
    transition: none;
  }
}
