/* Hero de la portada (estilo editorial a pantalla ancha). */
.nd-hero {
  --nd-hero-h: 80vh;
  --nd-hh: max(460px, var(--nd-hero-h));
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: var(--nd-hh);
  margin-top: -2rem;
  margin-bottom: 2.5rem;
  overflow: hidden;
  color: #fff;
  background: #101114;
  isolation: isolate;
}
.nd-hero--medium { --nd-hero-h: 60vh; }
.nd-hero--full { --nd-hero-h: calc(100vh - 100px); }

.nd-hero__media,
.nd-hero__shade {
  position: absolute;
  inset: 0;
}
.nd-hero__media { z-index: 0; background: #101114; }
.nd-hero.no-poster .nd-hero__media { background: linear-gradient(135deg, #101114 0%, var(--nd-accent, #03a87c) 130%); }

.nd-hero__poster,
.nd-hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  max-width: none;
}
.nd-hero__video { transition: opacity .5s ease; }
.nd-hero.is-poster .nd-hero__video { opacity: 0; }

.nd-hero__frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100%, calc(var(--nd-hh) * 1.7778));
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 100%;
  border: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s ease;
}
.nd-hero.is-loaded .nd-hero__frame { opacity: 1; }
.nd-hero.is-poster .nd-hero__frame { opacity: 0; }

.nd-hero__shade {
  z-index: 1;
  background:
    linear-gradient(to top, rgba(8, 8, 10, .9) 0%, rgba(8, 8, 10, .55) 34%, rgba(8, 8, 10, .1) 70%, rgba(8, 8, 10, .25) 100%),
    linear-gradient(to right, rgba(8, 8, 10, .55) 0%, rgba(8, 8, 10, 0) 62%);
}

.nd-hero__inner {
  position: relative;
  z-index: 2;
  padding-top: 5rem;
  padding-bottom: 3.5rem;
}
.nd-hero__content { max-width: 720px; }

.nd-hero .nd-hero__kicker,
.nd-hero .nd-hero__kicker:hover {
  display: inline-block;
  margin-bottom: 1rem;
  padding-bottom: .3rem;
  border-bottom: 2px solid var(--nd-accent, #03a87c);
  color: #fff !important;
  font-size: .85rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.nd-hero .nd-hero__title {
  margin: 0 0 1rem;
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(2rem, 4.6vw, 3.9rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.01em;
  color: #fff;
}
.nd-hero .nd-hero__title a,
.nd-hero .nd-hero__title a:hover,
.nd-hero .nd-hero__title a:focus {
  color: #fff !important;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .35);
}
.nd-hero .nd-hero__excerpt {
  max-width: 40rem;
  margin: 0 0 1.75rem;
  font-family: 'Cabin', sans-serif;
  font-size: 1.2rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, .9);
  text-shadow: 0 1px 12px rgba(0, 0, 0, .35);
}
.nd-hero .nd-hero__cta,
.nd-hero .nd-hero__cta:hover,
.nd-hero .nd-hero__cta:focus {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.6rem;
  border: 2px solid #fff;
  border-radius: var(--nd-radius, 12px);
  font-family: 'Cabin', sans-serif;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff !important;
  background: transparent;
  transition: background-color .2s ease, border-color .2s ease;
}
.nd-hero .nd-hero__cta:hover,
.nd-hero .nd-hero__cta:focus-visible {
  background: var(--nd-accent, #03a87c);
  border-color: var(--nd-accent, #03a87c);
}
.nd-hero .nd-hero__cta:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.nd-hero .nd-hero__cta i { font-size: .85em; }

.nd-hero__controls {
  position: absolute;
  z-index: 3;
  right: 1.75rem;
  bottom: 1.75rem;
  display: flex;
  gap: .6rem;
}
.nd-hero .nd-hero__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, .45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  cursor: pointer;
  transition: background-color .2s ease, transform .2s ease;
}
.nd-hero .nd-hero__btn:hover,
.nd-hero .nd-hero__btn:focus-visible { transform: scale(1.06); }
.nd-hero .nd-hero__btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.nd-hero .nd-ico { display: none; }
.nd-hero .nd-hero__playpause .nd-ico--pause { display: block; }
.nd-hero.is-paused .nd-hero__playpause .nd-ico--pause { display: none; }
.nd-hero.is-paused .nd-hero__playpause .nd-ico--play { display: block; }
.nd-hero .nd-hero__sound .nd-ico--muted { display: block; }
.nd-hero .nd-hero__sound[aria-pressed="true"] .nd-ico--muted { display: none; }
.nd-hero .nd-hero__sound[aria-pressed="true"] .nd-ico--loud { display: block; }
.nd-hero.is-failed .nd-hero__controls { display: none; }

@media (max-width: 991.98px) {
  .nd-hero--full { --nd-hero-h: calc(100vh - 50px); }
}
@media (max-width: 767.98px) {
  .nd-hero { --nd-hero-h: 74vh; --nd-hh: max(420px, var(--nd-hero-h)); margin-bottom: 1.5rem; }
  .nd-hero--medium { --nd-hero-h: 56vh; }
  .nd-hero__inner { padding-top: 4.5rem; padding-bottom: 2.25rem; }
  .nd-hero .nd-hero__excerpt {
    font-size: 1.05rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .nd-hero__controls { top: 1rem; right: 1rem; bottom: auto; }
  .nd-hero .nd-hero__btn { width: 42px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .nd-hero__video,
  .nd-hero__frame,
  .nd-hero .nd-hero__btn,
  .nd-hero .nd-hero__cta { transition: none; }
}

/* ---------------------------------------------------------------------------
   Header transparente sobre el hero (escritorio, ≥ 992px)
   --------------------------------------------------------------------------- */
@media (min-width: 992px) {
  body.nd-hero-overlay #content { padding-top: 0; }
  body.nd-hero-overlay .nd-hero { margin-top: 0; }
  body.nd-hero-overlay .nd-hero--full { --nd-hero-h: 100vh; }
  body.admin-bar.nd-hero-overlay .nd-hero--full { --nd-hero-h: calc(100vh - 32px); }

  /* El video/imagen llega hasta el borde superior; el menú flota encima. */
  body.nd-hero-overlay #header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: transparent;
    box-shadow: none;
    z-index: 1000;
    transition: background-color .28s ease, box-shadow .28s ease;
  }
  body.admin-bar.nd-hero-overlay #header { top: 32px; }
  body.nd-hero-overlay #header #main-menu,
  body.nd-hero-overlay #header #main-menu.stick {
    background: transparent;
    box-shadow: none;
  }
  body.nd-hero-overlay:not(.is-header-solid) #header,
  body.dark-mode.nd-hero-overlay:not(.is-header-solid) #header,
  body.dark-mode.nd-hero-overlay:not(.is-header-solid) #header #main-menu {
    background: transparent;
    background-color: transparent;
    box-shadow: none;
  }

  /* Degradado oscuro extra arriba para leer logo y menú. */
  body.nd-hero-overlay .nd-hero__shade {
    background:
      linear-gradient(to bottom, rgba(8, 8, 10, .72) 0%, rgba(8, 8, 10, .35) 16%, rgba(8, 8, 10, .08) 38%, transparent 52%),
      linear-gradient(to top, rgba(8, 8, 10, .9) 0%, rgba(8, 8, 10, .55) 34%, rgba(8, 8, 10, .1) 70%, rgba(8, 8, 10, .2) 100%),
      linear-gradient(to right, rgba(8, 8, 10, .55) 0%, rgba(8, 8, 10, 0) 62%);
  }
  body.nd-hero-overlay .nd-hero__inner { padding-top: 9.5rem; }

  /* Texto e íconos claros sobre el video. */
  body.nd-hero-overlay:not(.is-header-solid) #header .logo,
  body.nd-hero-overlay:not(.is-header-solid) #header .logo a,
  body.nd-hero-overlay:not(.is-header-solid) #header .navbar-brand,
  body.nd-hero-overlay:not(.is-header-solid) #header .navbar-brand a,
  body.nd-hero-overlay:not(.is-header-solid) #header .searh-toggle,
  body.nd-hero-overlay:not(.is-header-solid) #header .dark-light-toggle,
  body.nd-hero-overlay:not(.is-header-solid) #header .social-network a,
  body.nd-hero-overlay:not(.is-header-solid) #header .top-menu a,
  body.nd-hero-overlay:not(.is-header-solid) #header #main-menu .menu-primary > ul > li > a {
    color: #fff !important;
    text-shadow: 0 1px 10px rgba(0, 0, 0, .4);
  }
  body.nd-hero-overlay:not(.is-header-solid) #header .social-network a {
    border-color: rgba(255, 255, 255, .7);
  }
  body.nd-hero-overlay:not(.is-header-solid) #header .top-menu a.btn {
    color: #fff !important;
    border-color: rgba(255, 255, 255, .85);
    background: transparent;
  }
  body.nd-hero-overlay:not(.is-header-solid) #header .top-menu a.btn:hover,
  body.nd-hero-overlay:not(.is-header-solid) #header .searh-toggle:hover,
  body.nd-hero-overlay:not(.is-header-solid) #header .dark-light-toggle:hover,
  body.nd-hero-overlay:not(.is-header-solid) #header #main-menu .menu-primary > ul > li > a:hover {
    color: #fff !important;
    opacity: .85;
  }

  /* Logo de imagen: variante clara o inversión del logo oscuro. */
  body.nd-hero-overlay .nd-logo--light { display: none; }
  body.nd-hero-overlay.nd-has-light-logo:not(.is-header-solid) #header .custom-logo-link:not(.nd-logo--light) { display: none; }
  body.nd-hero-overlay.nd-has-light-logo:not(.is-header-solid) #header .nd-logo--light { display: inline-block; }
  body.nd-hero-overlay:not(.is-header-solid):not(.nd-has-light-logo) #header .custom-logo {
    filter: brightness(0) invert(1);
  }

  /* Buscador abierto: fondo claro para que el campo se lea. */
  body.nd-hero-overlay:not(.is-header-solid) #header .search-form.open-search {
    background: rgba(255, 255, 255, .94);
    border: 0;
    border-radius: 50px;
    padding: 0 .4rem;
  }
  body.nd-hero-overlay:not(.is-header-solid) #header .search-form.open-search .search_field,
  body.nd-hero-overlay:not(.is-header-solid) #header .search-form.open-search .searh-toggle {
    color: #222 !important;
    text-shadow: none;
  }

  /* Submenús: fondo sólido para que no se pierdan sobre el video. */
  body.nd-hero-overlay:not(.is-header-solid) #header #main-menu .menu-primary ul.sub-menu {
    background: #111;
    border: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  }
  body.nd-hero-overlay:not(.is-header-solid) #header #main-menu .menu-primary ul.sub-menu a {
    color: #fff !important;
    text-shadow: none;
  }

  /* Al hacer scroll: header sólido (blanco o modo oscuro). */
  body.nd-hero-overlay.is-header-solid #header {
    background: #fff;
    box-shadow: 0 2px 2px -2px rgba(0, 0, 0, .15);
  }
  body.nd-hero-overlay.is-header-solid #header #main-menu,
  body.nd-hero-overlay.is-header-solid #header #main-menu.stick {
    background: transparent;
  }
  body.dark-mode.nd-hero-overlay.is-header-solid #header,
  body.dark-mode.nd-hero-overlay.is-header-solid #header #main-menu {
    background: #1a1a1a;
    box-shadow: 0 2px 2px -2px rgba(255, 255, 255, .15);
  }
  body.nd-hero-overlay.is-header-solid #header .custom-logo { filter: none; }
  body.nd-hero-overlay.is-header-solid.nd-has-light-logo #header .nd-logo--light { display: none; }
  body.nd-hero-overlay.is-header-solid.nd-has-light-logo #header .custom-logo-link:not(.nd-logo--light) { display: inline-block; }
}

@media (prefers-reduced-motion: reduce) {
  body.nd-hero-overlay #header { transition: none; }
}
