/* ==========================================================================
   Layout: boxed page, header, mobile drawer, footer, section grid
   ========================================================================== */

/* ---- Boxed page --------------------------------------------------------- */

.page {
  position: relative;
  max-width: var(--page-max);
  margin: 0 auto;
  background-color: var(--color-bg);
  box-shadow: 0 0 15px rgb(0 0 0 / 0.06);
}

.site-main {
  position: relative;
  z-index: 0;
  padding-top: 30px;
  background-color: var(--color-bg);
}

/* ---- Header ------------------------------------------------------------- */

.site-header {
  position: relative;
  min-height: var(--header-height);
  background-color: var(--color-bg);
}

.site-header__bar {
  position: absolute;
  top: 61px;
  left: 0;
  z-index: 30;
  width: 100%;
  border-bottom: 1px solid transparent;
}

.site-header__container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 12px;
}

.site-header__inner {
  position: relative;
  display: flex;
  justify-content: space-between;
  background-color: var(--color-surface);
}

.site-logo {
  display: block;
  height: 60px;
  margin: 0 30px 0 20px;
  padding: 15px 0;
  box-sizing: content-box;
  line-height: 60px;
}
.site-logo img {
  width: auto;
  max-height: 100%;
  vertical-align: middle;
}

/* Desktop navigation */
.site-nav {
  display: none;
}
.site-nav__list {
  display: flex;
}
.site-nav__link {
  display: block;
  padding: 15px 0;
  font-family: var(--font-nav);
  font-size: var(--fs-nav);
  font-weight: 500;
  line-height: 60px;
  color: var(--color-nav);
}
.site-nav__link span {
  display: block;
  padding: 0 20px;
  border-right: 1px solid rgb(0 0 0 / 0.05);
  line-height: 60px;
  white-space: nowrap;
}
.site-nav__item:last-child .site-nav__link span {
  border: 0;
}
.site-nav__link:hover,
.site-nav__link[aria-current="page"] {
  color: var(--color-nav-active);
}

/* Hamburger (shown below 1240px) */
.menu-toggle {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  top: 50%;
  right: 15px;
  width: 34px;
  height: 34px;
  margin-top: -17px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--color-link);
  font-size: 22px;
  cursor: pointer;
}

@media (min-width: 1240px) {
  .site-nav { display: block; }
  .menu-toggle { display: none; }

  /* Sticky bar after scrolling past the header */
  .site-header__bar.is-sticky {
    position: fixed;
    top: 0;
    z-index: 701;
    height: 61px;
    background-color: var(--color-surface);
    opacity: 0.97;
    box-shadow: 0 2px 5px 0 rgb(0 0 0 / 0.1);
    animation: header-slide-in 0.3s ease;
  }
  .is-sticky .site-header__inner {
    background: none;
  }
  .is-sticky .site-logo {
    height: 50px;
    padding: 5px 0;
    line-height: 50px;
  }
  .is-sticky .site-logo img {
    max-height: 35px;
  }
  .is-sticky .site-nav__link,
  .is-sticky .site-nav__link span {
    line-height: 30px;
  }
}

@keyframes header-slide-in {
  from { top: -60px; }
  to   { top: 0; }
}

@media (max-width: 767px) {
  .site-header__bar {
    position: static;
    background-color: var(--color-surface);
  }
  .site-header__container {
    max-width: 100%;
    padding: 0;
  }
  .site-header__inner {
    background: none;
  }
  .site-logo {
    width: calc(100% - 100px);
    margin: 10px 50px;
    padding: 0;
    text-align: center;
  }
  .menu-toggle {
    top: 40px;
    right: 10px;
  }
}

/* ---- Mobile drawer ------------------------------------------------------ */

body {
  position: relative;
  left: 0;
  transition: left 0.3s ease;
}
body.drawer-open {
  left: -125px;
}

.drawer {
  position: fixed;
  top: 0;
  right: -250px;
  z-index: 100000;
  width: 250px;
  max-width: 100%;
  height: 100%;
  overflow: auto;
  border-bottom: 60px solid var(--color-surface-drawer);
  background-color: var(--color-surface-drawer);
  transition: right 0.3s ease;
}
.drawer.is-open {
  right: 0;
}

.drawer__close-row {
  height: 60px;
}
.drawer__close {
  float: right;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 13px 13px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-drawer-link);
  font-size: 22px;
  cursor: pointer;
}

.drawer__nav {
  margin: 20px 0;
}
.drawer__item {
  border-top: 1px solid rgb(255 255 255 / 0.03);
}
.drawer__item:last-child {
  border-bottom: 1px solid rgb(255 255 255 / 0.03);
}
.drawer__link {
  display: block;
  margin-right: 50px;
  padding: 11px 5px 10px 20px;
  font-family: var(--font-nav);
  font-size: var(--fs-nav);
  font-weight: 500;
  line-height: 19px;
  color: var(--color-drawer-link);
}
.drawer__link:hover,
.drawer__link[aria-current="page"] {
  color: var(--color-drawer-link-active);
}

.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9002;
  width: 100%;
  height: 120%;
  background: var(--color-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

@media (min-width: 1240px) {
  .drawer,
  .drawer-overlay {
    display: none;
  }
}

/* ---- Footer ------------------------------------------------------------- */

.site-footer {
  position: relative;
  border-top: 1px solid var(--color-hairline);
  background-color: var(--color-surface-footer);
  color: var(--color-text-footer);
  text-align: center;
}

.site-footer__container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 30px calc(var(--section-pad-x) + 12px) 45px;
}

.back-to-top {
  width: 42px;
  height: 42px;
  margin: -10px 0 10px;
  padding: 0;
  font-size: 20px;
  vertical-align: top;
}

@media (min-width: 960px) {
  .back-to-top {
    margin-top: -9px;
  }
}
.back-to-top .icon {
  color: var(--color-icon-muted);
}

/* ---- Section grid -------------------------------------------------------
   A section holds rows of columns; every content block inside a column
   gets the same side gutter and bottom gap. */

.section {
  position: relative;
  padding-left: var(--section-pad-x);
  padding-right: var(--section-pad-x);
}

/* Standard pages keep content within the container width;
   the home page sections span the whole boxed page. */
.section--contained {
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
}

.col-1-2 { width: 50%; }
.col-1-3 { width: 33.333%; }
.col-2-3 { width: 66.666%; }
.col-center { margin-left: 25%; }

.block {
  display: flow-root; /* keep child margins inside the block */
  margin: 0 var(--gutter) var(--block-gap);
}

.text-center {
  text-align: center;
}

@media (max-width: 767px) {
  .col-1-2,
  .col-1-3,
  .col-2-3 {
    width: 100%;
  }
  .col-center {
    margin-left: 0;
  }
}

.button-block {
  text-align: center;
}
.button-block .btn {
  vertical-align: middle;
}
