/*
WikiBookIndex - Styling for Widget WikiBookIndex
See detailed documentation in Dev/mediawiki
*/

/* ---------- */
/* 1. General */

.wiki-book-index {
  display: flex;
  gap: 3px;
  width: fit-content;
}

.wiki-book-index > .info,
.wiki-book-index > a {
  padding: .3em .7em .35em;
  color: #333 !important;
  background: #eee;
}

.wiki-book-index > a > span.text {
  display: none;
}

.wiki-book-index > a:hover {
  background: #d8d8d8;
}

.wiki-book-index > .info,
.wiki-book-index > .info > span {
  display: none;
}

.wiki-book-index > a:hover ~ .info {
  display: inline-block;
}

.wiki-book-index > a.prev:hover ~ .info > .prev,
.wiki-book-index > a.index:hover ~ .info > .index,
.wiki-book-index > a.next:hover ~ .info > .next {
  display: inline-block;
}

/* --------------------------- */
/* 2. Variants (for-parameter) */

/* for=firstheading */

.wiki-book-index.wbi-for-firstheading {
  float: right;
  margin: .15em -.3em -.1em .6em;
  font-size: .9em;
}

.wiki-book-index.wbi-for-firstheading > a {
  padding: 0 .3em .1em;
  margin-top: -.1em;
}

.wiki-book-index.wbi-for-firstheading > .info {
  position: absolute;
  right: 8px;
  top: 62px;
  width: max-content;
  max-width: 100%;
  z-index: 10;
  border: 1px solid #ccc;
}

/* for=footer */

.wiki-book-index.wbi-for-footer {
  font-size: 18px;
  width: 100%;
  margin-top: 50px;
}

.wiki-book-index.wbi-for-footer > a {
  flex-grow: 1;
  background-color: #fafafa;
  text-align: center;
  text-decoration: none;
}

.wiki-book-index.wbi-for-footer > a:hover {
  background: #e2e2e2;
}

.wiki-book-index.wbi-for-footer > a > i {
  font-size: 22px;
  position: relative;
  top: 4px;
  float: left;
}

.wiki-book-index.wbi-for-footer > a.next > i {
  float: right;
}

.wiki-book-index.wbi-for-footer > a > span.text {
  display: inline;
}

.wiki-book-index.wbi-for-footer > .info {
  display: none !important;
}
