/* Documentation licensed under CC BY 4.0 */
/* License available at https://creativecommons.org/licenses/by/4.0/ */

/* Basic element styles */

/* TODO - consider * { box-sizing: border-box; } */

#_toc {
  display: none;
}

a {
  text-decoration: none;
}

ul {
  list-style: disc outside;
}

body {
  color: #212121;
  font: 400 16px/24px Roboto,sans-serif;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* The header */

header {
  background-color: #009688;
  box-shadow: 0 0 4px rgba(0,0,0,.14), 0 4px 8px rgba(0,0,0,.28);
  overflow: hidden;
  padding-top: 84px;
  position: static;
  top: 0;
  width: 100%;
  z-index: 10005;
}

header h1 {
  color: white;
  display: inline-block;
  font: 34px/56px Roboto,sans-serif;
  letter-spacing: -.01em;
  margin: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 0 24px;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: top;
  margin-left: 25px;
}

header h1 a {
  color: white;
}

header a.closurelogo {
  left: 12px;
  pointer-events: none;
  position: absolute;
  top: 13px;
  transition: left .2s, top .2s;
}

header a.closurelogo div {
  height: 150px;
  width: 150px;
  transition: height .2s, opacity .2s, width .2s;
}

/* Horizontal nav buttons in the header */

header nav {
  font-size: 13pt;
  height: 48px;
  overflow-y: hidden;
  padding: 0 24px 0 0;
  transition: margin-left .2s;
  width: 100%;
}

header nav .closurelogo {
  display: none;
  float: left;
  height: 20px;
  width: 20px;
}

header ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

header li {
  display: inline-block;
  margin: 0;
  padding: 0;
}

header li a.active {
  border-bottom-color: white;
  color: white;
}

header li a {
  border-bottom: 2px solid transparent;
  border-top: 2px solid transparent;
  color: rgba(255, 255, 255, .7);
  display: inline-block;
  font: 500 14px/44px Roboto,sans-serif;
  margin: 0;
  outline: 0;
  padding: 0 24px;
  text-transform: uppercase;
  transition: color .2s;
}

header li a:hover {
  color: white;
}

/* Main div */

header+div {
  margin-top: 24px;
  padding: 0 24px;
}

header+div nav.side {
  position: absolute;
  top: 212px;
}

header+div nav.toc.float {
  position: absolute;
  right: 24px;
  top: 212px;
}

/* Adjustments for header folding */

.scrolled header {
  position: fixed;
  top: -140px;
}

.scrolled header nav {
  margin-left: 64px;
}

.scrolled header a.closurelogo {
  left: 18px;
  pointer-events: auto;
  position: absolute;
  top: 147px;
  padding: 0 12px;
}

.scrolled header a.closurelogo div {
  height: 32px;
  width: 32px;
}

.scrolled header a.closurelogo:hover div {
  opacity: 0.8;
}

.scrolled header+div {
  margin-top: 212px; /* 24 + 188 total height height */
}

.scrolled header+div nav.side {
  position: fixed;
  top: 72px;
}

.scrolled header+div nav.toc.float {
  position: fixed;
  right: 24px;
  top: 72px;
}

/* Vertical navs (side and toc) */

nav.vertical ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

nav.vertical li {
  line-height: 16px;
  margin: 8px 0 0;
}

nav.vertical li.heading {
  font-weight: 500;
}

nav.vertical li+li.heading {
  margin-top: 20px;
}

nav.vertical a.active {
  color: #03a9f4;
}

nav.vertical a:hover {
  color: #03a9f4;
}

nav.vertical a {
  color: #212121;
}

/* Side nav */

nav.side {
  background: #f7f7f7;
  float: left;
  font-size: 13px;
  padding: 16px 12px 16px 16px;
  width: 228px;
}

/* TOCs */

nav.toc {
  border-left: 4px solid #009688;
  font-size: 13px;
  padding-left: 12px;
}

nav.toc.float {
  float: right;
  width: 160px;
}

nav.toc.inline {
  display: none;
  margin: 20px 0 24px;
}

/* Main article */

article {
  margin-left: 296px;
  margin-right: 188px;
}

article h1 {
  color: #757575;
  font: 400 34px/40px Roboto,sans-serif;
  letter-spacing: -.01em;
  margin: 24px 0 20px;
}

article h2 {
  border-bottom: 1px solid #ebebeb;
  font: 400 24px/32px Roboto,sans-serif;
  letter-spacing: -.01em;
  margin: 40px 0 20px;
  padding-bottom: 3px;
}

article nav+h2 {
  margin-top: 24px;
}

/* Footer buttons */

footer {
  bottom: 0;
  display: block;
  height: 48px;
  left: 0;
  position: fixed;
  right: 0;
  transition: bottom .2s;
  z-index: 10005;
}

.down footer {
  bottom: -200px;
}

footer>a {
  bottom: 32px;
  display: none; /* overridden when there's an href */
  position: absolute;
}

footer>a[href] {
  display: block;
}

footer>a>div {
  background: #db4437;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,.37);
  height: 36px;
  position: relative;
  transition: box-shadow .2s;
  width: 36px;
}

footer>a:hover>div {
  box-shadow: 0 2px 2px rgba(0,0,0,0.2),0 6px 10px rgba(0,0,0,.3);
}

footer>a>div>div:first-child {
  color:transparent;
  height: 24px;
  left: 6px;
  position: absolute;
  top: 6px;
  width: 24px;
}

footer>a>div>div:nth-child(2) {
  align-items: center;
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(0,0,0,.37);
  display: flex;
  flex-direction: column;
  font-size: 11px;
  left: 50%;
  opacity: 0;
  position: absolute;
  text-align: center;
  top: 100%;
  transition: opacity .2s;
  white-space: nowrap;
  width: 0;
}

footer>a:hover>div>div:nth-child(2) {
  opacity: 1;
  transition: opacity .2s .2s;
}

footer>a>div>div:nth-child(2)>div {
  background: rgba(0,0,0,.7);
  border-radius: 3px;
  color: white;
  line-height: 16px;
  padding: 0 5px;
  position: relative;
  top: 8px;
}

/* Edit button (specifically) */

footer>a.edit>div>div:first-child {
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24" fill="#FFFFFF"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
}
footer>a.edit {
  right: 32px;
}

/* Closure logo */
.closurelogo div {
  background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewPort="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg"><defs><clipPath id="c"><rect x="0" y="0" width="100" height="25"/><rect x="0" y="75" width="100" height="25" /><rect x="0" y="0" width="25" height="100" /><rect x="75" y="0" width="25" height="100" /></clipPath></defs><g clip-path="url(#c)"><circle cx="25" cy="25" r="20" stroke="none" fill="white" /><circle cx="75" cy="25" r="20" stroke="none" fill="white" /><circle cx="25" cy="75" r="20" stroke="none" fill="white" /><circle cx="75" cy="75" r="20" stroke="none" fill="white" /></g></svg>');
  background-size: cover;
  display: inline-block;
  opacity: 0.3;
}

/* Reactive adjustments for smaller screens */

@media(max-width: 1200px) {
  nav.toc.float {
    display: none;
  }
  nav.toc.inline {
    display: block;
  }
  article {
    margin-right: 0;
  }
}

@media(max-width: 720px) {
  nav.side {
    display: none; /* TODO(sdh): collapse w/ roll-out instead of hide */
  }
  article {
    margin-left: 0;
  }
}
