/* ==========================================================
   Revista de Derecho Privado (rderechop) 
   ========================================================== */

html.rdp-journal {
  --rdp-color:         #eab818;               /* --rdys-primary */
  --rdp-color-dark:    #1a1a2e;               /* --rdys-dark: fondo del hero sin foto */
  --rdp-hover:         #c99a0e;               /* --rdys-primary-dark */
  --rdp-text-on-color: #1a1a2e;               /* texto sobre el dorado */
  --rdp-hero-text:     #ffffff;               /* texto sobre el hero oscuro */
  --rdp-hero-overlay:  rgba(26, 26, 46, .78);
}

/* ---- 1. Anular el header nativo del portal ---- */
html.rdp-journal .pkp_structure_head > .pkp_head_wrapper > *:not(#rdp-header),
html.rdp-journal .pkp_site_name_wrapper,
html.rdp-journal .pkp_site_nav_menu > *:not(#rdp-nav-slot) {
  display: none !important;
}
html.rdp-journal .pkp_structure_head,
html.rdp-journal .pkp_head_wrapper {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  max-width: none !important;
  width: 100% !important;
}

/* ---- 2. Hero ---- */
#rdp-header { display: none; font-family: "Nunito Sans", Roboto, Arial, sans-serif; }
html.rdp-journal #rdp-header { display: block; width: 100%; }

#rdp-header .rdp-hero {
  position: relative;
  background-color: var(--rdp-color-dark);
  background-image: var(--rdp-hero-image, none);
  background-size: cover;
  background-position: center;
  color: var(--rdp-text-on-color);
}
#rdp-header .rdp-hero::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--rdp-hero-overlay);
}
#rdp-header .rdp-hero-inner {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

/* Fila superior: los dos hipervínculos institucionales */
#rdp-header .rdp-inst {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
#rdp-header .rdp-inst a {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border-radius: 4px;
  padding: 8px 12px;
  line-height: 0;
}
#rdp-header .rdp-inst img { height: 44px; width: auto; display: block; }
#rdp-header .rdp-inst a:focus-visible,
#rdp-header .rdp-actions a:focus-visible,
#rdp-header .rdp-title a:focus-visible {
  outline: 3px solid #fff; outline-offset: 3px;
}

/* Título */
#rdp-header .rdp-title { margin: 0; }
#rdp-header .rdp-title a {
  color: var(--rdp-text-on-color);
  text-decoration: none;
  font-size: clamp(1.7rem, 4.2vw, 2.9rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.01em;
}
#rdp-header .rdp-issn { margin: 6px 0 0; font-size: .9rem; opacity: .9; }

/* ---- 3. Banda de navegación ---- */
#rdp-header .rdp-navband { background: var(--rdp-color); }
#rdp-header .rdp-navband-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: stretch; justify-content: space-between; gap: 16px;
}
#rdp-header #rdp-nav-slot { flex: 1 1 auto; }
html.rdp-journal #rdp-header #navigationPrimary {
  display: flex !important; flex-wrap: wrap; margin: 0; padding: 0; list-style: none;
  background: transparent !important;
}
html.rdp-journal #rdp-header #navigationPrimary > li > a {
  display: block; padding: 14px 16px;
  color: var(--rdp-text-on-color) !important;
  font-weight: 600; text-decoration: none; background: transparent !important;
}
html.rdp-journal #rdp-header #navigationPrimary > li > a:hover,
html.rdp-journal #rdp-header #navigationPrimary > li > a:focus-visible {
  background: rgba(0,0,0,.18) !important;
}
#rdp-header .rdp-actions { display: flex; align-items: center; gap: 8px; }
#rdp-header .rdp-actions a {
  padding: 7px 14px; border-radius: 4px; font-weight: 700; font-size: .9rem;
  text-decoration: none; border: 2px solid #fff; color: #fff;
}
#rdp-header .rdp-actions a.rdp-primary { background: #fff; color: var(--rdp-color); }

/* ---- 4. Mobile ---- */
#rdp-burger {
  display: none; background: none; border: 0; color: #fff;
  font-size: 1.6rem; padding: 10px 0; cursor: pointer;
}
@media (max-width: 820px) {
  #rdp-header .rdp-inst img { height: 34px; }
  #rdp-burger { display: block; }
  #rdp-header .rdp-navband-inner { flex-wrap: wrap; }
  #rdp-header #rdp-nav-slot { display: none; flex-basis: 100%; order: 3; }
  #rdp-header.rdp-open #rdp-nav-slot { display: block; }
  html.rdp-journal #rdp-header #navigationPrimary { flex-direction: column; }
  #rdp-header .rdp-actions { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  #rdp-header * { transition: none !important; }
}
/* Hero: texto claro sobre fondo oscuro */
#rdp-header .rdp-title a,
#rdp-header .rdp-issn { color: var(--rdp-hero-text) !important; }

/* Nav: hover con el dorado oscuro */
html.rdp-journal #rdp-header #navigationPrimary > li > a:hover,
html.rdp-journal #rdp-header #navigationPrimary > li > a:focus-visible {
  background: var(--rdp-hover) !important;
}

/* Botones sobre el dorado: oscuros, no blancos */
#rdp-header .rdp-actions a {
  color: var(--rdp-text-on-color) !important;
  border-color: var(--rdp-text-on-color) !important;
}
#rdp-header .rdp-actions a.rdp-primary {
  background: var(--rdp-text-on-color) !important;
  color: #ffffff !important;
}
#rdp-header .rdp-actions a:focus-visible,
html.rdp-journal #rdp-header #navigationPrimary > li > a:focus-visible {
  outline: 3px solid var(--rdp-text-on-color);
  outline-offset: 2px;
}