/* Hamburger menu: used by every page, including the home page. */

.navbar-toggler {
  border: 0;
  color: var(--color-acento);
}

.navbar-toggler-icon {
  --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23fff' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* menu */
.dropdown-menu {
  --bs-dropdown-min-width: 266px;
  --bs-dropdown-padding-y: 0;
  --bs-dropdown-border-width: 0;
  --bs-dropdown-border-radius: 0;
  --bs-dropdown-link-color: var(--color-acento);
  --bs-dropdown-link-hover-color: #fff;
  --bs-dropdown-link-hover-bg: var(--color-acento);
  --bs-dropdown-link-active-color: #fff;
  --bs-dropdown-link-active-bg: var(--color-acento);
  --bs-dropdown-item-padding-x: 1.9rem;
  font-family: var(--font-sans);
  font-size-adjust: var(--font-size-adjust);
  font-size: 18.75px;
  line-height: 38px;
  box-shadow: 6px 6px 8px rgba(0, 0, 0, .35);
}

.dropdown-item {
  padding-block: 0;
}

.sub-menu .dropdown-item {
  font-size: 14px;
  line-height: 20px;
  padding: 8px 1.9rem 8px 3.4rem;
  white-space: normal;
}

/* menu is anchored to the header's top-right corner, whatever the header's size */
.topbar .dropdown { position: static; }

.topbar .dropdown-menu {
  position: absolute !important;
  inset: 0 0 auto auto !important;
  width: 266px;
  transform: none !important;
  margin: 0 !important;
}

/* menu hover: .menu-hl (moved by site.js) is a band in the palette's dark colour behind the item */
.dropdown-menu { background: #fff; }

.dropdown-menu .dropdown-item {
  position: relative;
  z-index: 1;
  background: transparent;
  transition: color .2s .05s;
}

.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
  background: transparent;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}

.menu-hl {
  position: absolute;
  left: 0;
  width: 100%;
  top: 0;
  height: 0;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  background: var(--color-banda);
  transition: top .3s cubic-bezier(.2, .7, .2, 1), height .3s cubic-bezier(.2, .7, .2, 1), opacity .2s;
}

.menu-hl.on { opacity: 1; }

.menu-hl.snap { transition: opacity .2s; }

/* menu selected: left border on the menu's edge, no background */
.dropdown-menu .dropdown-item.active {
  background: transparent;
  color: var(--color-acento);
  border-left: 4px solid var(--color-acento);
  padding-left: calc(1.9rem - 4px);
}

.sub-menu .dropdown-item.active { padding-left: calc(3.4rem - 4px); }

.dropdown-menu .dropdown-item.active:hover { color: #fff; }

/* Search (includes/buscador.html): the magnifier sits left of the hamburger and slides a translucent
   field open to its left; results show in an overlay as you type. */
.buscador { display: flex; align-items: center; margin: 0; }

/* the field and the menu stay above the overlay, which sits inside the same header */
.buscador, .buscador ~ .site-menu { position: relative; z-index: 1025; }

.buscador-boton {
  padding: .25rem .5rem;
  border: 0;
  background: none;
  color: #fff;
  line-height: 0;
}

.buscador-campo {
  width: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  font-family: var(--font-mono);
  font-size: var(--fs-texto);
  line-height: 30px;
  opacity: 0;
  outline: 0;
  transition: width .3s cubic-bezier(.2, .7, .2, 1), padding .3s, opacity .2s, border-color .3s;
}

.buscador-campo::placeholder { color: rgba(255, 255, 255, .7); }

.buscador.abierto .buscador-campo {
  width: min(260px, 50vw);
  padding: 0 .6em;
  border-bottom-color: #fff;
  opacity: 1;
}

.buscador-capa {
  position: fixed;
  inset: 0;
  z-index: 1020; /* below the sticky header (1030), above the page */
  padding: 120px 16px 40px;
  overflow-y: auto;
  background: rgba(20, 20, 20, .82);
  backdrop-filter: blur(6px);
}

.buscador-resultados { max-width: 640px; margin: 0 auto; color: #fff; font-family: var(--font-mono); }

.buscador-lista { list-style: none; margin: 0; padding: 0; }

.buscador-lista a {
  display: block;
  margin-inline: -.6em;      /* the plate reaches past the text, as a row */
  padding: 10px .6em;
  border-bottom: 1px solid rgba(255, 255, 255, .25);
  color: #fff;
  font-size: var(--fs-texto);
  font-weight: 700;
  text-decoration: none;
}

/* over the dark overlay a dark plate reads better than a dark ink: the item keeps white type */
.buscador-lista a:hover,
.buscador-lista a:focus-visible {
  background: rgba(0, 0, 0, .55);
  color: #fff;
}

.buscador-lista small { display: block; font-size: var(--fs-chico); font-weight: 400; opacity: .7; }

.buscador-vacio { font-size: var(--fs-texto); }

/* on the home page the search and menu sit above the overlay */
.home-menu { z-index: 1030; }

@media (min-width: 992px) {
  .buscador-boton { transition: transform .3s; }

  .topbar.scrolled .buscador-boton { transform: scale(.5); transform-origin: right center; }
}
