/*
=========================================================
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.2rem 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-expandable-wrap-border-color);
  border-radius: var(--lp-expandable-border-radius);
}

.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-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;
  border-radius: var(--lp-expandable-border-radius);
  cursor: pointer;
}

.sv-edit-mode .lp-expandable-content > *:nth-child(odd),
.lp-expandable-content__wrap .lp-expandable-content__toggler {
  background-color: var(--lp-expandable-toggler-background-color);
  box-sizing: border-box;
  font-weight: 700;
  text-align: left;
  width: 100%;
}

.lp-expandable-content__wrap .lp-expandable-content__toggler,
.sv-edit-mode .lp-expandable-content > *:nth-child(odd) {
  align-items: center;
  display: -moz-flex;
  display: -ms-flex;
  display: -o-flex;
  display: flex;

  justify-content: space-between;
}

.lp-expandable-content__wrap .lp-expandable-content__toggler {
  color: inherit;
  font-size: inherit;
  font-weight: 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__wrap > .sv-text-portlet:first-child .subheading,
.lp-expandable-content__wrap > .sv-text-portlet:first-child .normal,
.lp-expandable-content__wrap > .sv-text-portlet:first-child .heading3,
.lp-expandable-content__wrap > .sv-text-portlet:first-child .heading4 {
  color: inherit;
  font-size: 1.8rem;
  font-weight: 300;
  margin-bottom: 0 !important;
}

.lp-expandable-content__toggler > span {
  flex-grow: 1;
}

.lp-expandable-content__toggler > .lp-toggler-icon {
  font-size: 1em;
  margin-left: 2rem;

  flex-shrink: 0;
  order: 1;
  pointer-events: none;
}

.lp-expandable-content__wrap > .sv-text-portlet:first-child .normal {
  max-width: initial;
}


/*
---------------------------------------------------------
ANSWER
--------------------------------------------------------- */

.sv-edit-mode .lp-expandable-content > *:nth-child(even),
.lp-expandable-content__content {
  background: var(--lp-expandable-content-background-color);
  border-radius: 0 0 var(--lp-expandable-border-radius) var(--lp-expandable-border-radius);
}

.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-text-portlet:last-child > .sv-text-portlet-content > p.normal:last-child,
.lp-expandable-content__content .sv-portlet:last-child,
.sv-edit-mode .lp-expandable-content > *:nth-child(even) > .sv-portlet:last-child,
.sv-edit-mode .lp-expandable-content > *:nth-child(even) > .sv-text-portlet:last-child .sv-text-portlet-content > p.normal:last-child,
.sv-edit-mode .lp-expandable-content > *:nth-child(even) > .sv-text-portlet-content > p.normal:last-child {
  margin-bottom: 0;
}

/*
---------------------------------------------------------
STATES
--------------------------------------------------------- */

.lp-expandable-content__wrap .lp-expandable-content__toggler:hover,
.lp-expandable-content__wrap .lp-expandable-content__toggler:focus {
  background-color: var(--lp-expandable-toggler-background-color-hover);
  color: inherit;
}

.lp-expandable-content__wrap .lp-expandable-content__toggler:hover,
.lp-expandable-content__wrap .lp-expandable-content__toggler:focus {
  text-decoration: underline;
}

.lp-expandable-content__wrap .lp-expandable-content__toggler:hover .subheading,
.lp-expandable-content__wrap .lp-expandable-content__toggler:hover .normal,
.lp-expandable-content__wrap .lp-expandable-content__toggler:hover .heading3,
.lp-expandable-content__wrap .lp-expandable-content__toggler:hover .heading4,
.lp-expandable-content__wrap .lp-expandable-content__toggler:focus .subheading,
.lp-expandable-content__wrap .lp-expandable-content__toggler:focus .normal,
.lp-expandable-content__wrap .lp-expandable-content__toggler:focus .heading3,
.lp-expandable-content__wrap .lp-expandable-content__toggler:focus .heading4 {
  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'] .lp-toggler-icon--open {
  display: none;
}

/* Aktiv */ 

.lp-expandable-content__wrap .lp-expandable-content__toggler.lp-expandable-content--is-open,
.lp-expandable-content__wrap .lp-expandable-content__toggler[aria-expanded='true'] {
  background-color: var(--lp-expandable-toggler-background-color-active);
  border-radius: var(--lp-expandable-border-radius) var(--lp-expandable-border-radius) 0 0;
}

.lp-expandable-content__wrap .lp-expandable-content__toggler > div:not(.sv-text-portlet) {
  align-items: center;
  display: flex;
  width: 100%;

  justify-content: space-between;
}


.lp-search-facet .lp-expandable-content__wrap .lp-search-facet__name {
  margin: 0;
}

.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__wrap > .sv-text-portlet:first-child .subheading,
.lp-expandable-content__wrap > .sv-text-portlet:first-child span,
.lp-expandable-content__wrap > .sv-text-portlet:first-child .normal,
.lp-expandable-content__wrap > .sv-text-portlet:first-child .heading3,
.lp-expandable-content__wrap > .sv-text-portlet:first-child .heading4 {
  margin: 0;
}
