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

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

.sv-edit-mode .lp-expandable-content > *:nth-child(odd),
.lp-expandable-content .lp-expandable-content__toggler {
  padding: 14px 20px;
}

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

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

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

.sv-edit-mode .lp-expandable-content > *:nth-child(odd),
.sv-edit-mode .lp-expandable-content > *:nth-child(even),
.lp-expandable-content__wrap {
  border-radius: 7px;
  overflow: hidden;
}

.sv-edit-mode .lp-expandable-content > *:nth-child(odd),
.lp-expandable-content__wrap {
  margin-top: 1.5rem;
}

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

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


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

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

.sv-edit-mode .lp-expandable-content > *:nth-child(odd),
.lp-expandable-content .lp-expandable-content__toggler {
  background-color: rgba(196,46,53,.1);
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  display: -webkit-flex;
  display: -moz-flex;
  display: -ms-flex;
  display: -o-flex;
  display: flex;
  font-weight: 700;
  text-align: left;
  width: 100%;
  margin-bottom: 0;
}

.lp-expandable-content .lp-expandable-content__toggler {
  cursor: pointer;
  position: relative;
  isolation: isolate;
  transition: all ease 0.2s;
}

.sv-edit-mode .lp-expandable-content > *:nth-child(odd) .font-heading-2,
.sv-edit-mode .lp-expandable-content > *:nth-child(odd) .font-heading-3,
.sv-edit-mode .lp-expandable-content > *:nth-child(odd) .font-normal,
.lp-expandable-content__toggler .font-heading-2,
.lp-expandable-content__toggler .font-heading-3,
.lp-expandable-content__toggler .font-normal {
  margin-top: 0;
  margin-bottom: 0 !important;
  line-height: 1.5;
  font-weight: 400;
  font-size: 19px;
  transition: all ease 0.2s;
}

.lp-expandable-content__toggler > .sv-text-portlet {
  -webkit-box-flex: 1;
  -ms-flex-positive: 1;
  flex-grow: 1;
  margin: 0;
}

.lp-expandable-content__toggler > .lp-toggler-icon {
  width: 40px;
  height: 40px;
  -ms-flex-negative: 0;
  flex-shrink: 0;
  -webkit-box-ordinal-group: 2;
  -ms-flex-order: 1;
  order: 1;
  margin-left: 2rem;
  pointer-events: none;
  background-color: #c42e35;
  fill: #fff;
  border-radius: 5px;
  padding: 10px;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  transition: all ease 0.2s;
}


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

.sv-edit-mode .lp-expandable-content > *:nth-child(even),
.lp-expandable-content__content {
  background: rgba(196,46,53,.1);
  margin: 0;
}

/* Distance between portlets in content. */
.lp-expandable-content__content > .sv-portlet {
  margin-bottom: 3rem;
}

/* Collapse bottom margin for last paragraph in content.  */
.lp-expandable-content__content > .sv-text-portlet-content:last-child p:last-child,
.lp-expandable-content__content .sv-portlet:last-child {
  margin-bottom: 0;
}

.sv-edit-mode .lp-expandable-content>*:nth-child(even) > .sv-text-portlet-content:nth-child(2) > *:first-child, 
.lp-expandable-content__content > .sv-text-portlet-content:nth-child(2) > *:first-child {
   margin-top: 0;
}


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

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

/* Closed/Opened */

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

.lp-expandable-content__toggler[aria-expanded='true'] .font-heading-2,
.lp-expandable-content__toggler[aria-expanded='true'] .font-heading-3,
.lp-expandable-content__toggler[aria-expanded='true'] .font-normal {
   color: #fff;
}

.lp-expandable-content__toggler[aria-expanded='true'] .lp-toggler-icon {
   background-color: #fff;
   fill: #c42e35;
}

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