/* -------------------------------- 

File#: _1_drawer
Title: Drawer
Descr: A slide-in panel used to display critical content
Usage: codyhouse.co/license

-------------------------------- */

:root {
  /* colors */
  --dp8-color-primary-hsl: 250, 84%, 54%;
  --dp8-color-bg-hsl: 0, 0%, 100%;
  --dp8-color-contrast-high-hsl: 230, 7%, 23%;
  --dp8-color-contrast-higher-hsl: 230, 13%, 9%;
  --dp8-color-contrast-lower-hsl: 240, 4%, 85%;
  --dp8-color-bg-light-hsl: 0, 0%, 100%;
  --dp8-color-bg-lighter-hsl: 0, 0%, 100%;
  --dp8-color-black-hsl: 230, 13%, 9%;
  --dp8-color-bg-dark-hsl: 240, 4%, 95%;
  --dp8-color-white-hsl: 0, 0%, 100%;
  --dp8-color-primary-darker-hsl: 250, 84%, 38%;
  --dp8-color-primary-light-hsl: 250, 84%, 60%;
  --dp8-color-accent-hsl: 342, 89%, 48%;

  /* spacing */
  --dp8-space-xs: 0.5rem;
  --dp8-space-sm: 0.75rem;
  --dp8-space-md: 1.25rem;
  --dp8-space-2xs: 0.375rem;

  /* typography */
  --dp8-text-md: 1.2rem;
  --dp8-text-sm: 0.833rem;
}

@media(min-width: 64rem){
  :root {
    /* spacing */
    --dp8-space-xs: 0.75rem;
    --dp8-space-sm: 1.125rem;
    --dp8-space-md: 2rem;
    --dp8-space-2xs: 0.5625rem;

    /* typography */
    --dp8-text-md: 1.5625rem;
    --dp8-text-sm: 1rem;
  }
}

/* buttons */
.dp8-btn {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-size: 1em;
  white-space: nowrap;
  text-decoration: none;
  background: hsl(var(--dp8-color-bg-dark-hsl));
  color: hsl(var(--dp8-color-contrast-higher-hsl));
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: all 0.2s ease;
  will-change: transform;
  /* padding: var(--dp8-space-2xs) var(--dp8-space-sm); */
  border-radius: 0.25em;
}

.dp8-btn:focus-visible {
  box-shadow: 0px 0px 0px 2px hsl(var(--dp8-color-bg-hsl)), 0px 0px 0px 4px hsla(var(--dp8-color-contrast-higher-hsl), 0.15);
  outline: none;
}

.dp8-btn:active {
  transform: translateY(2px);
}

.dp8-btn--primary {
  background: hsl(var(--dp8-color-primary-hsl));
  color: hsl(var(--dp8-color-white-hsl));
  box-shadow: inset 0px 1px 0px hsla(var(--dp8-color-white-hsl), 0.15), 0px 1px 3px hsla(var(--dp8-color-primary-darker-hsl), 0.25), 0px 2px 6px hsla(var(--dp8-color-primary-darker-hsl), 0.1), 0px 6px 10px -2px hsla(var(--dp8-color-primary-darker-hsl), 0.25);
}

.dp8-btn--primary:focus {
  box-shadow: inset 0px 1px 0px hsla(var(--dp8-color-white-hsl), 0.15), 0px 1px 2px hsla(var(--dp8-color-primary-darker-hsl), 0.25), 0px 1px 4px hsla(var(--dp8-color-primary-darker-hsl), 0.1), 0px 3px 6px -2px hsla(var(--dp8-color-primary-darker-hsl), 0.25), 0px 0px 0px 2px hsl(var(--dp8-color-bg-hsl)), 0px 0px 0px 4px hsl(var(--dp8-color-primary-hsl));
}

/* icons */
.dp8-icon {
  height: var(--dp8-size, 1em);
  width: var(--dp8-size, 1em);
  display: inline-block;
  color: inherit;
  fill: currentColor;
  line-height: 1;
  flex-shrink: 0;
  max-width: initial;
}

.dp8-icon--xs {
  --dp8-size: 16px;
}

/* component */
:root {
  --drawer-width: 400px;
}

.drawer {
  position: fixed;
  z-index: 99999999;
  height: 100%;
  width: 100%;
  max-width: var(--drawer-width);
  top: 0;
  right: 0;
  visibility: hidden;
  transition: visibility 0s 0.3s;
}
.drawer:focus {
  outline: none;
}

.drawer--is-visible {
  visibility: visible;
  transition: none;
}

.drawer--open-left {
  right: auto;
  left: 0;
}

.drawer__content {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  right: 0;
  -webkit-transform: translateX(100%);
          transform: translateX(100%);
  transition: -webkit-transform 0.3s;
  transition: transform 0.3s;
  transition: transform 0.3s, -webkit-transform 0.3s;
  transition-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1);
}
.drawer--open-left .drawer__content {
  -webkit-transform: translateX(-100%);
          transform: translateX(-100%);
}
.drawer--is-visible .drawer__content {
  -webkit-transform: translateX(0);
          transform: translateX(0);
}

.drawer__body {
  height: 100%;
  overflow: auto;
  -ms-scroll-chaining: none;
      overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.drawer__close-btn {
  --dp8-size: 32px;
  width: var(--dp8-size);
  height: var(--dp8-size);
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  background-color: hsla(var(--dp8-color-bg-light-hsl), 0.95);
  box-shadow: inset 0 0 0.5px 1px hsla(0, 0%, 100%, 0.075), 0 0.3px 0.4px rgba(0, 0, 0, 0.025),0 0.9px 1.5px rgba(0, 0, 0, 0.05), 0 3.5px 6px rgba(0, 0, 0, 0.1);
  transition: 0.2s;
}
.drawer__close-btn:hover {
  background-color: hsl(var(--dp8-color-bg-lighter-hsl));
  box-shadow: inset 0 0 0.5px 1px hsla(0, 0%, 100%, 0.075), 0 0.9px 1.5px rgba(0, 0, 0, 0.03),0 3.1px 5.5px rgba(0, 0, 0, 0.08),0 14px 25px rgba(0, 0, 0, 0.12);
}
.drawer__close-btn .drawer__icon {
  display: block;
  color: hsl(var(--dp8-color-contrast-high-hsl));
}

.drawer--modal {
  max-width: none;
  background-color: hsla(var(--dp8-color-black-hsl), 0);
  transition: background-color 0.3s, visibility 0s 0.3s;
}
.drawer--modal.drawer--is-visible {
  background-color: hsla(var(--dp8-color-black-hsl), 0.75);
  transition: background-color 0.3s;
}
.drawer--modal.drawer--open-left .drawer__content {
  right: auto;
  left: 0;
}
.drawer--modal .drawer__content {
  max-width: var(--drawer-width);
}

/* utility classes */
.dp8-margin-xs {
  margin: var(--dp8-space-xs);
}

.dp8-z-index-10 {
  z-index: 10;
}

.dp8-right-0 {
  right: 0;
}

.dp8-top-0 {
  top: 0;
}

.dp8-position-fixed {
  position: fixed;
}

.dp8-text-component :where(h1, h2, h3, h4) {
  line-height: var(--dp8-heading-line-height, 1.2);
  margin-top: calc(var(--dp8-space-md) * var(--dp8-space-multiplier, 1));
  margin-bottom: calc(var(--dp8-space-sm) * var(--dp8-space-multiplier, 1));
}

.dp8-text-component :where(p, blockquote, ul li, ol li) {
  line-height: var(--dp8-body-line-height, 1.4);
}

.dp8-text-component :where(ul, ol, p, blockquote, .dp8-text-component__block) {
  margin-bottom: calc(var(--dp8-space-sm) * var(--dp8-space-multiplier, 1));
}

.dp8-text-component :where(ul, ol) {
  padding-left: 1.25em;
}

.dp8-text-component ul :where(ul, ol), .dp8-text-component ol :where(ul, ol) {
  padding-left: 1em;
  margin-bottom: 0;
}

.dp8-text-component ul {
  list-style-type: disc;
}

.dp8-text-component ol {
  list-style-type: decimal;
}

.dp8-text-component img {
  display: block;
  margin: 0 auto;
}

.dp8-text-component figcaption {
  margin-top: calc(var(--dp8-space-xs) * var(--dp8-space-multiplier, 1));
  font-size: var(--dp8-text-sm);
  text-align: center;}

.dp8-text-component em {
  font-style: italic;
}

.dp8-text-component strong {
  font-weight: bold;
}

.dp8-text-component s {
  text-decoration: line-through;
}

.dp8-text-component u {
  text-decoration: underline;
}

.dp8-text-component mark {
  background-color: hsla(var(--dp8-color-accent-hsl), 0.2);
  color: inherit;
}

.dp8-text-component blockquote {
  padding-left: 1em;
  border-left: 4px solid hsl(var(--dp8-color-contrast-lower-hsl));
  font-style: italic;
}

.dp8-text-component hr {
  margin: calc(var(--dp8-space-md) * var(--dp8-space-multiplier, 1)) auto;
  background: hsl(var(--dp8-color-contrast-lower-hsl));
  height: 1px;
}

.dp8-text-component > *:first-child {
  margin-top: 0;
}

.dp8-text-component > *:last-child {
  margin-bottom: 0;
}

.dp8-text-component.dp8-line-height-xs {
  --dp8-heading-line-height: 1;
  --dp8-body-line-height: 1.1;
}

.dp8-text-component.dp8-line-height-sm {
  --dp8-heading-line-height: 1.1;
  --dp8-body-line-height: 1.2;
}

.dp8-text-component.dp8-line-height-md {
  --dp8-heading-line-height: 1.15;
  --dp8-body-line-height: 1.4;
}

.dp8-text-component.dp8-line-height-lg {
  --dp8-heading-line-height: 1.22;
  --dp8-body-line-height: 1.58;
}

.dp8-text-component.dp8-line-height-xl {
  --dp8-heading-line-height: 1.3;
  --dp8-body-line-height: 1.72;
}

.dp8-padding-md {
  padding: var(--dp8-space-md);
}

.dp8-shadow-md {
  box-shadow:0 0.9px 1.5px rgba(0, 0, 0, 0.03),0 3.1px 5.5px rgba(0, 0, 0, 0.08),0 14px 25px rgba(0, 0, 0, 0.12);
}

:where(.dp8-inner-glow) {
  position: relative;
}

.dp8-inner-glow::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0.5px 1px hsla(0, 0%, 100%, 0.075);
}

.dp8-bg-light {
  --dp8-bg-o: 1;
  background-color: hsla(var(--dp8-color-bg-light-hsl), var(--dp8-bg-o, 1));
}

.dp8-text-md {
  font-size: var(--dp8-text-md);
}

.dp8-padding-sm {
  padding: var(--dp8-space-sm);
}

.dp8-text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dp8-padding-y-xs {
  padding-top: var(--dp8-space-xs);
  padding-bottom: var(--dp8-space-xs);
}

.dp8-padding-x-sm {
  padding-left: var(--dp8-space-sm);
  padding-right: var(--dp8-space-sm);
}

.dp8-border-bottom {
  --dp8-border-o: 1;
  border-bottom: var(--dp8-border-width, 1px) var(--dp8-border-style, solid) hsla(var(--dp8-color-contrast-lower-hsl), var(--dp8-border-o, 1));
}

.dp8-flex-shrink-0 {
  flex-shrink: 0;
}

.dp8-justify-between {
  justify-content: space-between;
}

.dp8-items-center {
  align-items: center;
}

.dp8-flex {
  display: flex;
}

.dp8-flex-column {
  flex-direction: column;
}

.dp8-border-contrast-lower {
  --dp8-border-o: 1;
  border-color: hsla(var(--dp8-color-contrast-lower-hsl), var(--dp8-border-o, 1));
}