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

.lp-expandable-content .lp-expandable-content {
  margin-bottom: 0.5em;
  margin-top: -0.5em;
}

.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.5rem 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 #939393;
  /*border: 1px solid var(--ak-smultron-25);*/
  border-radius: 4px;
  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-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 {
  align-items: center;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: flex;
  font-size: inherit;
}

.sv-edit-mode .lp-expandable-content > *:nth-child(odd),
.lp-expandable-content__wrap .lp-expandable-content__toggler {
  /*background-color: transparent;*/
  background-color: var(--ak-smultron-25);
  box-sizing: border-box;
  font-weight: 400;
  text-align: left;
  transition: background-color 0.3s ease;
  width: 100%;
}

.sv-edit-mode .lp-expandable-content > *:nth-child(odd) .subheading,
.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 {
  color: inherit;
  font-family: stolzl-medium,'open sans',arial,helvetica,sans-serif;
  font-size: 1.8rem;
  font-weight: inherit;
  margin-bottom: 0 !important;
}

.lp-expandable-content__toggler > span {
  flex-grow: 1;
}

.lp-expandable-content__toggler > .lp-toggler-icon {
  color: #03310f;
  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;
  /*background: var(--ak-smultron-25);*/
}

.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: #dae6e0;*/
  background-color: var(--ak-smultron-75);
  color: inherit;
  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: #dae6e0;*/
  background-color: var(--ak-smultron-75);  
}

/*.lp-expandable-content__wrap:has(.lp-expandable-content__toggler.lp-expandable-content--is-open),
.lp-expandable-content__wrap:has(.lp-expandable-content__toggler[aria-expanded='true']) {
  border: 1px solid var(--ak-smultron-75);  
}*/