/*
=========================================================
Expandable Content
=========================================================
 * Contains styling for the Expandable Content jQuery plugin.
 *
 * Copyright Limepark AB, https://limepark.se/licensvillkor
=========================================================*/

.lp-expandable-content {
  margin: 1rem 0 !important;
}

/* Modulavstånd i innehållsytor (ej textmoduler) */
.lp-expandable-content__content > .sv-portlet,
.sv-edit-mode .lp-expandable-content > *:nth-child(even) > .sv-portlet {
  margin-bottom: var(--lp-spacing);
}

/*
---------------------------------------------------------
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 rgba(5, 46, 236, 0.4);
  border-radius: var(--lp-button-border-radius);
}

.sv-edit-mode .lp-expandable-content > *:nth-child(odd),
.lp-expandable-content__wrap {
  background-color: transparent;
  margin-bottom: 1rem;
  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;
  margin-bottom: var(--lp-spacing-x-small);
}


/*
---------------------------------------------------------
QUESTION/BUTTON
--------------------------------------------------------- */

.lp-expandable-content__wrap .lp-expandable-content__toggler {
  align-items: center;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: flex;
  font-size: inherit;
  position: relative;
  z-index: 1;

  isolation: isolate;
}

.sv-edit-mode .lp-expandable-content > *:nth-child(odd),
.lp-expandable-content__wrap .lp-expandable-content__toggler {
  background-color: transparent;
  box-sizing: border-box;
  font-weight: 700;
  margin-bottom: 0;
  padding: var(--lp-spacing-x-small) var(--lp-spacing-x-small);
  text-align: left;
  width: 100%;
}

.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 .rubrikx3,
.lp-expandable-content__wrap > .sv-text-portlet:first-child .heading4 {
  color: var(--lp-color-blue--contrast);
  font-size: var(--lp-font-size-medium);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0 !important;
  margin-top: 0 !important;
  text-transform: uppercase;
}

.lp-expandable-content__toggler > span {
  flex-grow: 1;
}

.lp-expandable-content__toggler > .lp-toggler-icon {
  color: var(--lp-color-blue--contrast);
  font-size: 1.15em;
  margin-left: 1.5em;

  flex-shrink: 0;
  order: 1;
  pointer-events: none;
}

/*
---------------------------------------------------------
ANSWER
--------------------------------------------------------- */

.sv-edit-mode .lp-expandable-content > *:nth-child(even),
.lp-expandable-content__content {
  background-color: transparent;
  padding: var(--lp-spacing-small);
}

.lp-expandable-content__content .sv-portlet {
  margin: 0 0 var(--lp-spacing);
}

/* 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 {
  text-decoration: underline;
  transition: var(--lp-transition-default);

  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

/* 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 */
