/* =========================================
   HEADER: identidad corporativa y navegación
========================================= */

header[role="banner"].site-header {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  background-color: #fff;
}

/* Contenedor del grid */
.site-header__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  grid-template-rows: auto;
  align-items: stretch;
  column-gap: 24px;

  width: calc(100% - 40px);
  max-width: 1200px;
  margin-inline: auto;
  padding: 0 0 10px;
  box-sizing: border-box;
  min-width: 0;
}

/* Tablet */
@media (max-width: 900px) {  
  header[role="banner"].site-header {
    margin: 0;
  }

  .site-header__inner {
    width: 100%;
    max-width: none;
    column-gap: 1px;
  }
}

/* Pantallas muy grandes */
@media (min-width: 1441px) {
  .site-header__inner {
    max-width: 1320px;
  }
}

/* =========================================
   Columna izquierda: logotipo
========================================= */

.site-header__brand {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  min-width: 0;
  margin: 0;
}

.site-header__brand a {
  display: block;
  max-width: 100%;
  line-height: 0;
  transform-origin: left top;
  transition: transform 220ms ease;
}

/* Efecto al pasar el ratón */
@media (hover: hover) and (pointer: fine) {
  .site-header__brand a:hover {
    transform: scale(1.025);
  }
}

/* Accesibilidad: respetar la preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  .site-header__brand a {
    transition: none;
  }
}

.site-header__brand img {
  display: block;
  width: 100%;
  max-width: 550px;
  height: auto;
}

/* =========================================
   Columna derecha
========================================= */

.site-header__right {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  min-width: 0;
  padding: 12px 0 4px;
}

/* Texto corporativo */

.site-header__corporate {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  min-width: 0;
  margin: 1.8em 0.5em 0 0.5em;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  color: #222;
  text-align: right;
}

.site-header__corporate strong {
  font-weight: var(--font-weight-bold);
}

.site-header__corporate span {
  display: block;
  margin-top: 4px;
  font-size: 0.9rem;
  font-weight: var(--font-weight-regular);
  color: #555;
}

/* =========================================
   Redes sociales y menú hamburguesa
========================================= */

.site-header__tools {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  width: 100%;
  min-width: 0;
  margin-top: 12px;
}

/* Contenedor de redes */

.site-header__tools .social-links {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* Enlaces sociales */

.site-header__tools .social-links__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  padding: 0;
  box-sizing: border-box;
  color: var(--color-empleate);
  background: transparent;
  text-decoration: none;
  border: 0;
  border-radius: 50%;
}

.site-header__tools .social-links__link svg {
  width: 23px;
  height: 23px;
  fill: currentColor;
  display: block;
}

/* Interacción y accesibilidad */

.site-header__tools .social-links__link:hover {
  opacity: 0.75;
}

.site-header__tools .social-links__link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Hamburguesa: conservamos su funcionamiento actual */

.site-header__tools .menu-toggle {
  flex-shrink: 0;
  margin: 0;
}

/* =========================================
   Responsive: tablet y móvil
========================================= */

@media (max-width: 768px) {
  header[role="banner"].site-header {
    padding-right: 0;
    padding-left: 0;
  }

  .site-header__right {
    padding-top: 8px;
    padding-bottom: 4px;
  }

  .site-header__corporate {
    font-size: 0.85rem;
  }

  .site-header__corporate span {
    font-size: 0.75rem;
  }

  .site-header__tools {
    gap: 6px;
    margin-top: 10px;
  }

  .site-header__tools .social-links {
    gap: 6px;
  }
}

/* =========================================
   Responsive: móviles estrechos
========================================= */

@media (max-width: 420px) {
  header[role="banner"].site-header {
    column-gap: 8px;
    padding-right: 0px;
    padding-left: 0px;
  }

  .site-header__right {
    padding-top: 6px;
  }

  .site-header__corporate {
    font-size: 0.75rem;
  }

  .site-header__corporate span {
    font-size: 0.68rem;
  }

  .site-header__tools {
    gap: 4px;
    margin-top: 8px;
  }

  .site-header__tools .social-links {
    gap: 3px;
  }

  .site-header__tools .social-links__link svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    display: block;
  }
}


/* =========================================
   MÓVIL: logo arriba y contenido debajo
========================================= */

@media (max-width: 600px) {

  /* Grid de una sola columna */
  .site-header__inner {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 0;
    row-gap: 0;
  }

  /* Primera fila: logotipo */
  .site-header__brand {
    grid-column: 1;
    grid-row: 1;
    justify-content: flex-start;
    align-items: flex-start;
    min-width: 0;
  }

  .site-header__brand a {
    width: 100%;
  }

  .site-header__brand img {
    display: block;
    width: 100%;
    max-width: 550px;
    height: auto;
  }

  /* Segunda fila: texto y herramientas */
  .site-header__right {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    padding: 8px 0 4px;
    align-items: stretch;
  }

  /* Texto corporativo centrado */
  .site-header__corporate {
    align-items: center;
    text-align: center;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    font-size: 0.85rem;
  }

  .site-header__corporate span {
    font-size: 0.75rem;
  }

  /* Redes sociales y hamburguesa en una línea */
  .site-header__tools {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    width: 100%;
    margin-top: 10px;
  }

  .site-header__tools .social-links {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 6px;
  }
}

/* =========================================
   MÓVIL ESTRECHO
========================================= */

@media (max-width: 420px) {

  .site-header__right {
    padding-top: 6px;
  }

  .site-header__corporate {
    font-size: 0.75rem;
  }

  .site-header__corporate span {
    font-size: 0.68rem;
  }

  .site-header__tools {
    gap: 4px;
    margin-top: 8px;
  }

  .site-header__tools .social-links {
    gap: 3px;
  }

  .site-header__tools .social-links__link {
    width: 36px;
    height: 22px;
    fill: currentColor;
    display: block;
  }

  .site-header__tools .social-links__link svg {
    width: 26px;
    height: 26px;
  }
}
