/*
=========================================================
Expandable Content
=========================================================
 * Contains styling for the Expandable Content jQuery plugin.
 *
 * Copyright Limepark AB, https://limepark.se/licensvillkor
=========================================================*/

.lp-expandable-content {
  margin: 3rem 0;
}

.sv-edit-mode .lp-expandable-content > *:nth-child(odd),
.lp-expandable-content__wrap .lp-expandable-content__toggler,
.sv-edit-mode .lp-expandable-content > *:nth-child(even),
.lp-expandable-content__content {
  padding: 1.6rem 2rem;
}

/* Modulavstånd i innehållsytor (ej textmoduler) */
.lp-expandable-content__content > .sv-portlet {
  margin-bottom: 3rem;
}

/*
---------------------------------------------------------
WRAP
--------------------------------------------------------- */

.sv-edit-mode .lp-expandable-content > *:nth-child(odd),
.sv-edit-mode .lp-expandable-content > *:nth-child(even),
.lp-expandable-content__wrap {
  border: 1px solid var(--lp-border-color);
  border-radius: var(--lp-button-border-radius);
}

.sv-edit-mode .lp-expandable-content > *:nth-child(odd),
.lp-expandable-content__wrap {
  background-color: #fff;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.sv-edit-mode .lp-expandable-content > *:nth-child(odd) {
  border-bottom: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.sv-edit-mode .lp-expandable-content > *:nth-child(even) {
  border-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}


/*
---------------------------------------------------------
QUESTION/BUTTON
--------------------------------------------------------- */

.lp-expandable-content__wrap .lp-expandable-content__toggler {
  border: 0;
  cursor: pointer;
}

.sv-edit-mode .lp-expandable-content > *:nth-child(odd),
.lp-expandable-content__wrap .lp-expandable-content__toggler {
  background-color: var(--lp-color-1);
  color: var(--lp-color-1-text);
  box-sizing: border-box;
  font-weight: 600;
  text-align: left;
  width: 100%;
  transition: var(--lp-transition-default);
}

.lp-expandable-content__wrap .lp-expandable-content__toggler {
  align-items: center;
  display: -moz-flex;
  display: -ms-flex;
  display: -o-flex;
  display: flex;
}

.sv-edit-mode .lp-expandable-content > *:nth-child(odd) .subheading,
.sv-edit-mode .lp-expandable-content > *:nth-child(odd) .heading3,
.sv-edit-mode .lp-expandable-content > *:nth-child(odd) .heading4,
.sv-edit-mode .lp-expandable-content > *:nth-child(odd) .normal,
.lp-expandable-content__toggler .subheading,
.lp-expandable-content__toggler .normal,
.lp-expandable-content__toggler .heading3,
.lp-expandable-content__toggler .heading4 {
  color: var(--lp-color-1-text);
  font-size: 1.8rem;
  margin-bottom: 0 !important;
  font-weight: 600;
}

.lp-expandable-content__toggler > .sv-text-portlet {
  flex-grow: 1;
}

.lp-expandable-content__toggler > .lp-toggler-icon {
  color: #fff;
  font-size: 1em;
  margin-left: 2rem;

  flex-shrink: 0;
  order: 1;
  pointer-events: none;
}


/*
---------------------------------------------------------
ANSWER
--------------------------------------------------------- */

.sv-edit-mode .lp-expandable-content > *:nth-child(even),
.lp-expandable-content__content {
  background: transparent;
  padding-top: 0;
}

.lp-expandable-content__content .sv-portlet {
  margin: 0 0 3rem;
}

/* Ingen marginal under sista modulen */

.lp-expandable-content__content > .sv-text-portlet-content:last-child p.normal:last-child,
.lp-expandable-content__content .sv-portlet:last-child {
  margin-bottom: 0;
}

.lp-expandable-content__content > *:first-child {
   border-top: 1px solid var(--lp-border-color);
   padding-top: var(--lp-spacing-x-small);
}

/*
---------------------------------------------------------
STATES
--------------------------------------------------------- */

.lp-expandable-content__wrap .lp-expandable-content__toggler:hover,
.lp-expandable-content__wrap .lp-expandable-content__toggler:focus {
  text-decoration: underline;
}

/* Closed/Opened */
.lp-expandable-content__toggler[aria-expanded='true'] {
   background-color: #fff;
   color: var(--lp-font-color);
}

.lp-expandable-content__toggler[aria-expanded='true'] .subheading,
.lp-expandable-content__toggler[aria-expanded='true'] .normal,
.lp-expandable-content__toggler[aria-expanded='true'] .heading2,
.lp-expandable-content__toggler[aria-expanded='true'] .heading3,
.lp-expandable-content__toggler[aria-expanded='true'] .heading4 
.lp-expandable-content__toggler[aria-expanded='true'] .lp-icon,
.lp-expandable-content__toggler[aria-expanded='true'] .lp-toggler-icon {
   color: var(--lp-font-color);
}

.lp-expandable-content__toggler[aria-expanded='false'] .lp-toggler-icon--close {
  display: none;
}

.lp-expandable-content__toggler[aria-expanded='true'] .lp-toggler-icon--open {
  display: none;
}

/* Aktiv */

.lp-expandable-content__wrap .lp-expandable-content__toggler {
  position: relative;
  z-index: 1;
}

.lp-expandable-content__wrap .lp-expandable-content__toggler.lp-expandable-content--is-open:after,
.lp-expandable-content__wrap .lp-expandable-content__toggler[aria-expanded='true']:after,
.lp-expandable-content__wrap .lp-expandable-content__toggler:hover:after,
.lp-expandable-content__wrap .lp-expandable-content__toggler:focus:after {
  opacity: 0.1;
}
