/* Self-link styles */
li > a.self-link {
  left: -3.5em;
}
dfn > a.self-link {
  top: auto;
  left: auto;
  opacity: 0;
  width: 1.5em;
  height: 1.5em;
  background: gray;
  color: white;
  font-style: normal;
  transition: opacity .2s, background-color .2s, color .2s;
}
dfn:hover > a.self-link {
  opacity: 1;
}
dfn > a.self-link:hover {
  color: black;
  background-color: #B1C99D;
}
dfn > a.self-link::before {
  content: "#";
}

/* Hide dfn self-links when there's no hover, since they only otherwise show up when you click, and
   in that case they're covered by the dfn.js popup anyway. */
/* TODO: remove `, (hover: on-demand)` when
   https://bugs.chromium.org/p/chromium/issues/detail?id=654861 and
   https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/9308676/ get fixed */
@media (hover: none), (hover: on-demand) {
  dfn > a.self-link {
    display: none;
  }
}

/* Also make sure that they aren't any wider than the right margin, as this otherwise causes
   horizontal scrollbars. (The right margin for small viewports is defined in standard.css.) */
@media (max-width: 767px) {
  dfn > a.self-link {
    width: 0.625em;
  }
}

/* Hide editor visually, but leave it for scraping tools */
.head .editor {
  display: none;
}

/* Floating-but-collapsible annoying warning for snapshots */
details.annoying-warning {
  background-color: #920800;
  background-image: linear-gradient(transparent 40%, rgba(255, 255, 255, 0.2));
  border: solid rgba(0, 0, 0, 0.4);
  border-radius: 3px;
  border-width: 1px 1px 0 1px;
  box-shadow: 0 0 0.5em rgba(0, 0, 0, 0.5);
  color: rgba(255, 255, 255, 0.95);
  opacity: .95;
  position: fixed;
  left: 5%;
  margin: 0 auto;
  right: 5%;
  z-index: 10;
}

details.annoying-warning[open] {
  top: 10%;
  top: calc(5vw + 5vh);
  max-width: 1024px;
  outline: solid 10000px rgba(255, 255, 255, 0.6);
}

details.annoying-warning:not([open]) {
  bottom: 0;
  left: 0;
  right: 0;
  border-radius: 0;
}

details.annoying-warning > summary {
  display: list-item; /* polyfill */
  font-size: 0.875em;
  font-weight: bold;
  letter-spacing: 0.02em;
  padding: 10px 5px;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.85);
  cursor: default;
}

details.annoying-warning > summary::after {
  content: " Expand";
  position: absolute;
  top: 0;
  right: 5px;
  font-size: smaller;
  font-weight: bold;
}

details.annoying-warning[open] > summary::after {
  content: " Collapse";
}

details.annoying-warning p {
  padding: 0 7.5% 1em;
  line-height: 1.4;
  margin: 0;
  text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.85);
}

details.annoying-warning a {
  color: white;
  text-decoration: underline;
}
