@import "_variables";

// BIG GRID

body {
  height: 100%;
  min-height: 100vh;
  margin: 0;
  display: grid;
  // grid-template-rows: auto 1fr auto;
  grid-template-columns: 1fr min($pale-size, 100%) 1fr;
}
.pale {
  grid-column: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.main-header {
  flex-grow: 0;
  flex-shrink: 0;
}
.main {
  flex-grow: 1;
  flex-shrink: 0;
}
.main-footer {
  flex-grow: 0;
  flex-shrink: 0;
}

// BODY BASICS

body {
  background: var(--page-color);
  color: var(--text-color);
  font-family: $base-font;
  font-size: 1rem;
  line-height: 1.6rem;
}
.pale {
  margin-left: 128px;
  margin-right: 128px;
}
.dexter {
  // left of pale
  background:
    url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEwAAAAICAYAAABTXhlRAAAAc0lEQVRIDWP8DwQMQMDIyAiiGKDcQc8HOxaJQHc/khSYSS15JnSDR/n4QwCUrMApDJay0JVTK2bINR/dPQPNH01hJMYACyzm0VPScOOjhwu6/9DlcfFHUxiukMEhjlGGoYc8IT66uejq0eWHOn80hZEYgwCzIn4EQLgI5wAAAABJRU5ErkJggg==) right top repeat-y, // gradient to left 2x
    url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAIElEQVQIHWP8DwQMQMDIyAiiGJjAJBIBEgargCrEVAEAbIMIAowlqhMAAAAASUVORK5CYII=) right 76px top repeat; // white/black 2x
  }
.sinister {
  // right of pale
  background:
    url(data:image/gif;base64,R0lGODlhTAAIAPABAAAAAP///yH5BAgeAAAALAAAAABMAAgAAAJFBIJpqcexXpyOIgurvls6FoFfw5WZiaXdw7bu24akx8omjOfxeM9izdsBUR0V8XhK2l5Lo7IIRTp11GquGU1at1ztTFUAADs=) left top repeat-y, // gradient to right 2x
    url(data:image/gif;base64,R0lGODlhBAAEAPAAAAAAAP///yH5BAQKAAAALAAAAAAEAAQAAAIGBBKGqAkFADs=) left 76px top repeat; // black/white 2x
}
@media (prefers-color-scheme: dark) {
  .dexter, .sinister {
    background: var(--page-color);
  }
}

// HEADER

.main-header {


  padding-top: 32px;
  font-size: 1rem;
  padding-bottom: 3rem;

  font-variant-numeric: lining-nums proportional-nums;

  .site-title, .breadcrumb {
    display: inline-block;
    bottom: 0;
  }

  .site-title {
    svg * {
      fill: $accent-color;
    }
    // color: $text-color;
    // font-family: $title-font;
    // font-weight: $title-font-weight;
    // text-decoration: none;
    // float: left;
    padding-top: 5px;
    // padding-bottom: 2px;
    // padding-left: 0.5rem;
    // padding-right: 0.5rem;
    // margin-left: -0.5rem;
  }

  a.site-title:hover {
    background-color: $accent-color;
    color: var(--page-color);
    svg * {
      fill: var(--page-color);
    }
  }

  .breadcrumb * {
    border: none;
    // padding-top: 5px;
    // padding-left: 0.5rem;
    // padding-right: 0.5rem;
    margin-left: 1rem;
    display: block;
    float: left;
    // margin-left: 8px;
  }
}

// TODO make a typography file
section, div {
  &.emphasis > P {
    font-size: larger;
  }
}

/// SEARCH WIDGET


.search-form {
  position: relative;
  width: 190px;
  height: 30px;
  input {
    width: 100%;
    border-radius: 15px;
    border: none;
    padding: 0 2px 0 30px;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5;
  }
  button {
    position: absolute;
    top: 2px;
    left: 4px;
    height: 26px;
    width: 26px;
    z-index: 10;
    border: none;
    background: none;
    svg * {
      stroke: $accent-color;
    }
  }
}

/// FOOTER

.main-footer {
  // background-color: $accent-color;
  // color: $page-color;

  padding-top: 16px;
  margin-top: 36px;

  font-variant-numeric: lining-nums proportional-nums;

  // a {
  //   text-decoration: none;
  // }
  // a:hover {
  //   color: $accent-color;
  //   background-color: $page-color;
  //   box-shadow: none;
  // }

  .footer-topnav {
    position: relative;
    width: 100%;
    height: 32px;

    .homelink {
      display: inline-block;
      padding-top: 4px;
      font-weight: $bold-font-weight;
      text-decoration: none;

      svg * {
        fill: $page-color;
      }
      &:hover svg * {
        fill: $accent-color;
      }
    }

    .search-form {
      position: absolute;
      bottom: -4px;
      right: 0;

      &.home {
        right: unset;
        left: 0;
      }
    }
  }

  .sitemap {
    width: 100%;
    clear: both;

    padding-top: 18px;
    padding-bottom: 18px;
    // border-radius: 8px;

    .internal::before {
      content: '/';
      // color: $page-color;
      font-weight: $bold-font-weight;
    }
    // a.internal:hover::before {
    //   color: $accent-color;
    // }

    & > dl {
      width: 50%;
      dt  {
        clear:left;
        float:left;
        min-width: 25%;
        padding-bottom: 8px;
      }
      dd {
        display: none;
        @media ($bp-liminal) {
          display: inherit;
          clear:right;
          padding-bottom: 8px;
        }
      }
    }
    dl.published {
      clear: left;
      float: left;
    }
    dl.personal {
      clear: right;
      float: right;
    }
  }

  .fineprint {
    clear: both;
    padding-top: 18px;

    font-size: small;
    font-style: italic;
  }
}
