/*
  Hoja de estilos exclusiva para la cabecera REMCB.
  Sustituye la hoja anterior por esta: no modifica footer, columnas,
  artículos, comités, indexaciones ni el contenido de las páginas.
*/

.remcb-brand-header {
  width: 100%;
  color: #fff;
  background: linear-gradient(110deg, #00577b 0%, #006083 50%, #005276 100%);
  border-bottom: 1px solid rgba(255, 255, 255, .55);
}

.remcb-brand-header,
.remcb-brand-header * {
  box-sizing: border-box;
}

.remcb-brand-header__utility {
  min-height: 44px;
  background: #004866;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.remcb-brand-header__utility-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 72px);
}

.remcb-brand-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  width: 100%;
  min-height: 166px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 72px);
}

.remcb-language,
.remcb-login {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: transparent;
  font-size: 14px;
  line-height: 1;
}

.remcb-language {
  gap: 7px;
  padding: 0 14px 0 0;
  border-right: 1px solid rgba(255, 255, 255, .7);
}

.remcb-language::after {
  content: "▾";
  margin-left: -22px;
  margin-right: 5px;
  font-size: 11px;
  pointer-events: none;
}

.remcb-language select {
  min-height: 32px;
  padding: 0 28px 0 4px;
  border: 0;
  color: #fff;
  background: transparent;
  font: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.remcb-language select option {
  color: #173d50;
  background: #fff;
}

.remcb-login {
  padding: 0;
  text-decoration: none;
  font-weight: 700;
}

.remcb-user-control,
.remcb-user-slot {
  display: flex;
  align-items: center;
  min-height: 34px;
}

.remcb-user-control {
  gap: 7px;
}

/* En la cabecera se muestra solo el acceso. OJS seguirá ofreciendo el
   registro desde su página de inicio de sesión. */
.remcb-user-slot #navigationUser a[href*="/user/register"] {
  display: none !important;
}

.remcb-tool-icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.remcb-user-slot #navigationUser {
  position: static !important;
  display: flex !important;
  align-items: center;
  float: none !important;
  min-height: 34px;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none;
}

.remcb-user-slot #navigationUser > li {
  position: relative;
  display: block;
  margin: 0;
}

.remcb-user-slot #navigationUser > li > a {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 !important;
  border: 0;
  border-radius: 0;
  color: #fff !important;
  background: transparent !important;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.remcb-user-slot #navigationUser > li > a:hover,
.remcb-user-slot #navigationUser > li > a:focus,
.remcb-user-slot #navigationUser > .open > a {
  color: #fff !important;
  background: transparent !important;
  text-decoration: underline;
}

.remcb-user-slot #navigationUser .dropdown-menu {
  right: 0;
  left: auto;
  z-index: 1100;
}

.remcb-user-slot #navigationUser .dropdown-menu a {
  color: #284c83 !important;
}

.remcb-login:hover,
.remcb-login:focus,
.remcb-language:focus-within {
  color: #fff;
  background: transparent;
  text-decoration: underline;
}

.remcb-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.remcb-brand-header__journal,
.remcb-brand-header__puce {
  display: block;
  flex: 0 1 auto;
  line-height: 0;
}

.remcb-brand-header__journal img {
  display: block;
  width: clamp(310px, 35vw, 500px);
  height: auto;
  max-height: 164px;
  object-fit: contain;
  object-position: left center;
}

.remcb-brand-header__puce img {
  display: block;
  width: clamp(275px, 28vw, 430px);
  height: auto;
  max-height: 132px;
  object-fit: contain;
  object-position: right center;
}

/* Solo conserva el azul y el contraste del menú de OJS. */
header .container-fluid {
  background-color: #005278 !important;
}

/* Oculta el título textual que OJS inserta a la izquierda del menú.
   No afecta los logotipos de la cabecera personalizada. */
header.navbar .navbar-header > a.navbar-brand,
header.navbar a.navbar-brand:not(.remcb-brand-header__journal) {
  display: none !important;
}

.navbar-default .nav > li > a,
.navbar-default .navbar-nav > li > a {
  color: #fff !important;
  font-weight: 700;
}

/* Amplía únicamente el contenedor principal de OJS; no alcanza al footer. */
.pkp_structure_content {
  box-sizing: border-box;
  width: 100% !important;
  max-width: none !important;
}

.dropdown-toggle:hover,
.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus {
  background-color: rgba(255, 255, 255, .18) !important;
}

@media (max-width: 767px) {
  .remcb-brand-header__utility,
  .remcb-brand-header__utility-inner,
  .remcb-brand-header__inner {
    min-height: auto;
  }

  .remcb-brand-header__utility-inner {
    flex-wrap: wrap;
    padding: 8px 20px;
  }

  .remcb-brand-header__inner {
    flex-direction: column;
    align-items: center;
    gap: 22px;
    padding: 24px 20px;
  }

  .remcb-brand-header__journal img {
    width: min(100%, 430px);
    max-height: none;
  }

  .remcb-brand-header__puce img {
    width: min(86%, 330px);
    max-height: none;
  }
}

@media (max-width: 420px) {
  .remcb-brand-header__utility-inner {
    justify-content: center;
  }

  .remcb-language,
  .remcb-login,
  .remcb-user-slot #navigationUser > li > a {
    font-size: 13px;
  }
}

/* -------------------------------------------------------------------------
   Cabecera RFJ — se añade al final para sustituir solo la cabecera heredada.
   ------------------------------------------------------------------------- */
.rfj-brand-header,
.rfj-brand-header * { box-sizing: border-box; }

.rfj-brand-header {
  width: 100%;
  color: #224e98;
  background: #fff;
  border-bottom: 4px solid #998f67;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.rfj-brand-header__utility {
  min-height: 42px;
  color: #fff;
  background: #224e98;
}

.rfj-brand-header__utility-inner,
.rfj-brand-header__inner {
  display: flex;
  width: 100%;
  padding-right: clamp(18px, 4vw, 64px);
  padding-left: clamp(18px, 4vw, 64px);
}

.rfj-brand-header__utility-inner {
  min-height: 42px;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.rfj-language,
.rfj-login {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  color: rgba(255, 255, 255, .96);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.rfj-language { gap: 7px; padding-right: 14px; border-right: 1px solid rgba(255,255,255,.38); }
.rfj-language::after { content: "▾"; margin-right: 5px; margin-left: -22px; font-size: 11px; pointer-events: none; }
.rfj-language select { min-height: 32px; padding: 0 28px 0 4px; border: 0; color: inherit; background: transparent; font: inherit; cursor: pointer; appearance: none; -webkit-appearance: none; }
.rfj-language select option { color: #224e98; background: #fff; }
.rfj-login:hover, .rfj-login:focus, .rfj-language:focus-within { color: #fff; text-decoration: underline; }
.rfj-tool-icon { flex: 0 0 18px; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rfj-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.rfj-login[hidden] { display: none !important; }

/* El menú de cuenta nativo de OJS se traslada a esta franja con JavaScript. */
.rfj-brand-header #navigationUser.rfj-user-navigation {
  display: flex;
  float: none !important;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rfj-brand-header #navigationUser.rfj-user-navigation > li { float: none; margin: 0; }
.rfj-brand-header #navigationUser.rfj-user-navigation > li > a {
  display: block;
  padding: 6px 8px;
  color: rgba(255,255,255,.96);
  font-size: 14px;
  font-weight: 650;
  line-height: 18px;
  text-decoration: none;
}
.rfj-brand-header #navigationUser.rfj-user-navigation > li > a:hover,
.rfj-brand-header #navigationUser.rfj-user-navigation > li > a:focus { color: #fff; text-decoration: underline; }
.rfj-brand-header #navigationUser.rfj-user-navigation .dropdown-menu { right: 0; left: auto; }

.rfj-brand-header__inner {
  position: relative;
  min-height: 150px;
  align-items: center;
  justify-content: flex-start;
}

.rfj-brand-header__journal { display: block; line-height: 0; }
.rfj-brand-header__journal img { display: block; width: clamp(270px, 31vw, 480px); height: auto; }

.rfj-brand-header__puce {
  position: absolute;
  left: 50%;
  display: block;
  line-height: 0;
  transform: translateX(-50%);
}
.rfj-brand-header__puce img { display: block; width: clamp(115px, 12vw, 180px); height: auto; }
.rfj-brand-header__puce:hover, .rfj-brand-header__puce:focus { opacity: .82; }

.rfj-brand-header__metadata {
  position: absolute;
  right: clamp(18px, 4vw, 64px);
  bottom: 28px;
  margin: 0;
  color: #224e98;
  font-size: clamp(13px, 1.2vw, 16px);
  font-weight: 700;
  line-height: 1.35;
  text-align: right;
}
.rfj-brand-header__metadata p { margin: 0; }
.rfj-brand-header__metadata span { font-weight: 400; }

/* Conserva el menú existente, ahora con el azul institucional de RFJ. */
header .container-fluid { background-color: #224e98 !important; }
#headerNavigationContainer,
#headerNavigationContainer .navbar,
#headerNavigationContainer .container { width: 100%; max-width: none; }
#headerNavigationContainer .navbar { min-height: 0; margin-bottom: 0; border-radius: 0; }
#headerNavigationContainer .container {
  padding-right: clamp(18px, 4vw, 64px);
  padding-left: clamp(18px, 4vw, 64px);
}
#headerNavigationContainer #nav-menu { padding-right: 0; padding-left: 0; }
#headerNavigationContainer #main-navigation { margin-left: 0; }
#headerNavigationContainer .navbar-form { margin-right: 0; }

@media (max-width: 767px) {
  .rfj-brand-header__utility-inner { justify-content: center; }
  .rfj-brand-header #navigationUser.rfj-user-navigation { gap: 0; }
  .rfj-brand-header #navigationUser.rfj-user-navigation > li > a { padding: 6px; font-size: 12px; }
  .rfj-brand-header__inner { min-height: auto; justify-content: center; padding-top: 22px; padding-bottom: 22px; }
  .rfj-brand-header__journal img { width: min(78vw, 390px); }
  .rfj-brand-header__puce,
  .rfj-brand-header__metadata { display: none; }
}

/* Evita que los íconos de correo del pie hereden tamaños excesivos. */
footer img[src*="email.svg"],
.pkp_structure_footer img[src*="email.svg"] {
  display: inline-block !important;
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  vertical-align: middle;
}
