/* ht, MasaKudamatsu, for some of this CSS */
/* setting the color palette */
html {
    --dark-gray: rgb(90, 90, 90);
    --light-gray: rgb(148, 148, 148);
    --focus-blue: rgb(69, 159, 189);
}

.branding {
  font-family: 'Noto Sans', Verdana, sans-serif;
  color: var(--light-gray); 
}

.searchbox {
  --target-size: 48px; /* https://web.dev/accessible-tap-targets/ */
  --box-height: var(--target-size);
  --border-radius: calc(var(--box-height) / 2);
  --border-width: 2px;
  --icon-size: calc(var(--box-height) * 3/4 );
  --side-margin: calc(var(--border-radius) / 2);
  --icon-vertical-margin: calc( ( var(--box-height) - var(--icon-size) ) / 2 );
}

/* shaping the box */
.searchbox {
  height: var(--box-height);
  max-width: 561px; /* to follow the search box of google.com */
}
.searchbox input[type="search"] {
  border: var(--border-width) solid var(--dark-gray);
  border-radius: var(--border-radius);
  height: 100%;
  width: 100%;
}

/* Styling each component */
.searchbox svg {
  fill: var(--dark-gray);
  height: var(--icon-size);
  width: var(--icon-size);
}
.searchbox input[type="search"] {
  -webkit-appearance: none; /* to prevent Safari from ignoring font-size */
  color: var(--dark-gray); 
  font-family: 'Noto Sans', Verdana, sans-serif;
  font-size: 1rem;
}
.searchbox input[type="search"]::placeholder {
  color: var(--light-gray);
  opacity: 1; /* to override the default of Firefox */
}

  /* positioning inner elements */
.searchbox {
  position: relative;
}
.searchbox svg {
  position: absolute;
  left: var(--side-margin);
  top: var(--icon-vertical-margin);
  bottom: var(--icon-vertical-margin);
}
.searchbox input[type="search"] {
  padding-left: calc( var(--side-margin) + var(--icon-size) + 4px);
  padding-right: var(--side-margin);
}
input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none; /* Remove the left padding inside the box for Safari; see https://github.com/filipelinhares/ress/blob/master/ress.css */
}


/* Ensuring that tapping the icon focuses the search box */
.searchbox svg {
  z-index: -1;
}
.searchbox input[type="search"] {
  background: transparent;
}

/* Styling focus state */
.searchbox input[type="search"]:focus {
  border-color: var(--focus-blue);
  box-shadow: 0px 0px 5px var(--focus-blue);
  outline: 1px solid transparent; /* fallback for forced color modes; see https://www.sarasoueidan.com/blog/focus-indicators/#tips-for-styling-focus-indicators */
  /* it also removes the default focus ring imposed by browsers */
}

/* Custom-style the delete button that appears once the user enters text (Chrome and Safari only); see https://css-tricks.com/webkit-html5-search-inputs/#aa-styling-search-graphical-widgets */
.searchbox input[type="search"]::-webkit-search-cancel-button {
  /* Remove default */
  -webkit-appearance: none;
  /* Now your own custom styles */
  background-image: url("data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='rgb(148, 148, 148)' %3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z' /%3E%3C/svg%3E%0A");
  height: calc(var(--box-height) / 2);
  width: calc(var(--box-height) / 2);
}

input[type="search"] {
  -webkit-tap-highlight-color: transparent; /* Otherwise, tapping will show a flash of grey background on iOS Safari; see https://twitter.com/masa_kudamatsu/status/1429387005658468356 */
}


/* Positioning the search box */
body .searchbox {
  width: 90%;
  margin: 0 auto;
  top: 60px;
}

.results {
  width: 90%;
  margin: 0 auto;
  font-family: 'Noto Sans', Verdana, sans-serif;
}

.result {
  margin-top: 0.5em;
}
.result-anchor {
  text-decoration: none;
}
.result-title {
}
.result-url {
  margin-top: 1pt;
  font-size: 0.8em;
  font-style: italic;
  opacity: 80%;
}
.result-snippet {
  margin-top: 1pt;
  font-size: 0.8em;
}
.result-deep-links {
  margin-top: 1pt;
  font-size: 0.8em;
}
.result-deep-link-anchor {
  text-decoration: none;
  margin-left: 2em;
  font-style: italic;
}

.related-queries {
  margin-top: 2em;
  font-size: 0.8em;
}
.related-query {
  text-decoration: none;
  margin-left: 2em;
  font-style: italic;
}

.google {
  margin-top: 2em;
  font-size: 0.8em;
}
.google-option {
  text-decoration: none;
  margin-left: 2em;
  font-style: italic;
}


/* HT Zongbin, for the spinning dots, from https://codepen.io/nzbin/pen/GGrXbp */
.dot-spin {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  width: 10px;
  height: 10px;
  border-radius: 5px;
  background-color: transparent;
  color: transparent;
  box-shadow: 0 -18px 0 0 #9880ff, 12.727926px -12.727926px 0 0 #9880ff, 18px 0 0 0 #9880ff, 12.727926px 12.727926px 0 0 rgba(152, 128, 255, 0), 0 18px 0 0 rgba(152, 128, 255, 0), -12.727926px 12.727926px 0 0 rgba(152, 128, 255, 0), -18px 0 0 0 rgba(152, 128, 255, 0), -12.727926px -12.727926px 0 0 rgba(152, 128, 255, 0);
  animation: dot-spin 1.5s infinite linear;
}

@keyframes dot-spin {
  0%, 100% {
    box-shadow: 0 -18px 0 0 #9880ff, 12.727926px -12.727926px 0 0 #9880ff, 18px 0 0 0 #9880ff, 12.727926px 12.727926px 0 -5px rgba(152, 128, 255, 0), 0 18px 0 -5px rgba(152, 128, 255, 0), -12.727926px 12.727926px 0 -5px rgba(152, 128, 255, 0), -18px 0 0 -5px rgba(152, 128, 255, 0), -12.727926px -12.727926px 0 -5px rgba(152, 128, 255, 0);
  }
  12.5% {
    box-shadow: 0 -18px 0 -5px rgba(152, 128, 255, 0), 12.727926px -12.727926px 0 0 #9880ff, 18px 0 0 0 #9880ff, 12.727926px 12.727926px 0 0 #9880ff, 0 18px 0 -5px rgba(152, 128, 255, 0), -12.727926px 12.727926px 0 -5px rgba(152, 128, 255, 0), -18px 0 0 -5px rgba(152, 128, 255, 0), -12.727926px -12.727926px 0 -5px rgba(152, 128, 255, 0);
  }
  25% {
    box-shadow: 0 -18px 0 -5px rgba(152, 128, 255, 0), 12.727926px -12.727926px 0 -5px rgba(152, 128, 255, 0), 18px 0 0 0 #9880ff, 12.727926px 12.727926px 0 0 #9880ff, 0 18px 0 0 #9880ff, -12.727926px 12.727926px 0 -5px rgba(152, 128, 255, 0), -18px 0 0 -5px rgba(152, 128, 255, 0), -12.727926px -12.727926px 0 -5px rgba(152, 128, 255, 0);
  }
  37.5% {
    box-shadow: 0 -18px 0 -5px rgba(152, 128, 255, 0), 12.727926px -12.727926px 0 -5px rgba(152, 128, 255, 0), 18px 0 0 -5px rgba(152, 128, 255, 0), 12.727926px 12.727926px 0 0 #9880ff, 0 18px 0 0 #9880ff, -12.727926px 12.727926px 0 0 #9880ff, -18px 0 0 -5px rgba(152, 128, 255, 0), -12.727926px -12.727926px 0 -5px rgba(152, 128, 255, 0);
  }
  50% {
    box-shadow: 0 -18px 0 -5px rgba(152, 128, 255, 0), 12.727926px -12.727926px 0 -5px rgba(152, 128, 255, 0), 18px 0 0 -5px rgba(152, 128, 255, 0), 12.727926px 12.727926px 0 -5px rgba(152, 128, 255, 0), 0 18px 0 0 #9880ff, -12.727926px 12.727926px 0 0 #9880ff, -18px 0 0 0 #9880ff, -12.727926px -12.727926px 0 -5px rgba(152, 128, 255, 0);
  }
  62.5% {
    box-shadow: 0 -18px 0 -5px rgba(152, 128, 255, 0), 12.727926px -12.727926px 0 -5px rgba(152, 128, 255, 0), 18px 0 0 -5px rgba(152, 128, 255, 0), 12.727926px 12.727926px 0 -5px rgba(152, 128, 255, 0), 0 18px 0 -5px rgba(152, 128, 255, 0), -12.727926px 12.727926px 0 0 #9880ff, -18px 0 0 0 #9880ff, -12.727926px -12.727926px 0 0 #9880ff;
  }
  75% {
    box-shadow: 0 -18px 0 0 #9880ff, 12.727926px -12.727926px 0 -5px rgba(152, 128, 255, 0), 18px 0 0 -5px rgba(152, 128, 255, 0), 12.727926px 12.727926px 0 -5px rgba(152, 128, 255, 0), 0 18px 0 -5px rgba(152, 128, 255, 0), -12.727926px 12.727926px 0 -5px rgba(152, 128, 255, 0), -18px 0 0 0 #9880ff, -12.727926px -12.727926px 0 0 #9880ff;
  }
  87.5% {
    box-shadow: 0 -18px 0 0 #9880ff, 12.727926px -12.727926px 0 0 #9880ff, 18px 0 0 -5px rgba(152, 128, 255, 0), 12.727926px 12.727926px 0 -5px rgba(152, 128, 255, 0), 0 18px 0 -5px rgba(152, 128, 255, 0), -12.727926px 12.727926px 0 -5px rgba(152, 128, 255, 0), -18px 0 0 -5px rgba(152, 128, 255, 0), -12.727926px -12.727926px 0 0 #9880ff;
  }
}

.dot-spin-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 32px 0;
  margin: 0 -5%;
  overflow: hidden;
  visibility: hidden;
}

.footer {
  font-size: 0.6em;
  opacity: 90%;
  margin-top: 8em;
  margin-left: auto;
  margin-right: auto;
  width: 80%;
  font-family: 'Noto Sans', Verdana, sans-serif;
  text-align: center;
}

.footer-item {
  position: relative;
  display: inline-block;
  cursor: pointer;
  margin-left: 4%;
  margin-right: 4%;
  text-align: center;
}

.tooltiptext {
  visibility: hidden;
  width: 25em;
  background-color: whitesmoke;
  color: darkblue;
  border-radius: 6px;
  padding: 1em;
  position: absolute;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.7s;
  text-align: left;
  margin-left: -10em;
  margin-top: -4em;
}

.tooltip:hover .tooltiptext,
.tooltip:focus .tooltiptext {
  visibility: visible;
  opacity: 1;
}
