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

File#: _1_accordion
Title: Accordion
Descr: Create stacked sections of content and allow the user to expand/collapse them
Usage: codyhouse.co/license

-------------------------------- */
/* reset */


* {
  font: inherit;
  margin: 0;
  padding: 0;
  border: 0;
}

button,
input,
textarea,
select {
  background-color: transparent;
  border-radius: 0;
  color: inherit;
  line-height: inherit;
  appearance: none;
}

/* variables */
:root {
  /* colors */
  --ak6-color-primary-hsl: 250, 84%, 54%;
  --ak6-color-bg-hsl: 0, 0%, 100%;
  --ak6-color-contrast-high-hsl: 230, 7%, 23%;
  --ak6-color-contrast-higher-hsl: 230, 13%, 9%;
  --ak6-color-contrast-lower-hsl: 240, 4%, 85%;
  --ak6-color-accent-hsl: 342, 89%, 48%;

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

  /* typography */
  --ak6-text-md: 3rem;
  --ak6-text-sm: 0.833rem;

  --ritterNavy: #0f223b;
    /* general */
    --accordion-border-width: 1px;
    /* icon */
    --accordion-icon-size: 20px;
    --accordion-icon-stroke-width: 2px;
}

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

    /* typography */
    --ak6-text-md: 3rem;
    --ak6-text-sm: 1rem;
  }
}


.accordion__item {
  border-style: solid;
  border-color: hsl(var(--ak6-color-contrast-lower-hsl));
  border-bottom-width: var(--accordion-border-width);
}
.accordion__item:first-child {
  border-top-width: var(--accordion-border-width);
}

.accordion__header {
  /* button */
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  cursor: pointer;
}

.accordion__header svg {
  height: var(--accordion-icon-size);
  width: var(--accordion-icon-size);
}

.accordion__header svg .icon__group {
  stroke-width: var(--accordion-icon-stroke-width);
}

.accordion__icon-arrow .icon__group > * {
  -webkit-transform-origin: 10px 14px;
  transform-origin: 10px 14px;
}

.accordion__item--is-open
  > .accordion__header
  > .accordion__icon-arrow
  .icon__group
  > *:first-child {
  -webkit-transform: translateY(-8px) rotate(-90deg);
  transform: translateY(-8px) rotate(-90deg);
}

.accordion__item--is-open
  > .accordion__header
  > .accordion__icon-arrow
  .icon__group
  > *:last-child {
  -webkit-transform: translateY(-8px) rotate(90deg);
  transform: translateY(-8px) rotate(90deg);
}

.accordion__panel {
  display: none;
  will-change: height;
  -webkit-transform: translateZ(0px);
  transform: translateZ(0px);
}

.accordion__item--is-open > .accordion__panel {
  display: block;
}

/* animations */
.accordion[data-animation="on"]
  .accordion__item--is-open
  .accordion__panel
  > * {
  -webkit-animation: accordion-entry-animation 0.4s
    cubic-bezier(0.215, 0.61, 0.355, 1);
  animation: accordion-entry-animation 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.accordion[data-animation="on"] .accordion__icon-arrow .icon__group {
  transition: -webkit-transform 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);
  transition: transform 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);
  transition:
    transform 0.3s cubic-bezier(0.215, 0.61, 0.355, 1),
    -webkit-transform 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.accordion[data-animation="on"] .accordion__icon-arrow .icon__group > * {
  transition:
    stroke-dashoffset 0.3s,
    -webkit-transform 0.3s;
  transition:
    transform 0.3s,
    stroke-dashoffset 0.3s;
  transition:
    transform 0.3s,
    stroke-dashoffset 0.3s,
    -webkit-transform 0.3s;
  transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
}

@-webkit-keyframes accordion-entry-animation {
  from {
    opacity: 0;
    -webkit-transform: translateY(-10px);
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    -webkit-transform: translateY(0px);
    transform: translateY(0px);
  }
}

@keyframes accordion-entry-animation {
  from {
    opacity: 0;
    -webkit-transform: translateY(-10px);
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    -webkit-transform: translateY(0px);
    transform: translateY(0px);
  }
}


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.ak6-padding-x-md {
  padding-left: var(--ak6-space-md);
  padding-right: var(--ak6-space-md);
}

.ak6-padding-top-2xs {
  padding-top: var(--ak6-space-2xs);
}

.ak6-text-md {
  color: var(--ritterNavy);
  font-weight: 700;
  font-size: var(--ak6-text-md);
}

.ak6-padding-y-sm {
  padding-top: var(--ak6-space-sm);
  padding-bottom: var(--ak6-space-sm);
}
