/*
=========================================================
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 {
  padding: 1.2rem 2rem;
}

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

.sv-edit-mode .lp-expandable-content .sv-image-portlet {
  margin-bottom: 3rem;
}

/* 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-color-3);
  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: 2.5rem;
  overflow: hidden;
}

.sv-edit-mode .lp-expandable-content > *:nth-child(even) {
  margin-bottom: 1.5rem;
}

.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) {
  background-color: var(--lp-color-3);
}

.lp-expandable-content__wrap .lp-expandable-content__toggler {
  background-color: transparent;
}

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

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

.lp-expandable-content__wrap .lp-expandable-content__toggler {
  color: inherit;
}

.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-font-color);
  font-size: var(--lp-font-size-2);
  margin-bottom: 0 !important;
}

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

.lp-expandable-content__toggler > .lp-toggler-icon {
  color: var(--env-collapse-icon-color);
  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;
}

.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;
}

/*
---------------------------------------------------------
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='false'] .lp-toggler-icon--close {
  display: none;
}

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

.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:after {
  background-color: var(--lp-color-1);
  bottom: 0;
  content: '';
  display: block;
  left: 0;
  opacity: 0;
  position: absolute;
  right: 0;
  top: 0;
  transition: var(--lp-transition-default);
  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;
}
