/**
** BODYBOX
** Used on any div.
**
** EXAMPLE:
** <LayoutItem layout="left">
**  <div className="c-bodybox">En tekstboks som flyter til venstre.</div>
** </LayoutItem>
**
** Attribute modifier used to display info on author etc. in license view
**/

.c-bodybox {
  padding: $spacing * 1.5;
  margin-top: $spacing--large;
  margin-bottom: $spacing--large;
  border-style: solid;
  border-color: $brand-color--tertiary;
  border-width: 1px;
  overflow: hidden;

  &--attribute {
    padding: $spacing--small $spacing;
    display: inline-block;
    clear: both;
    font-style: italic;
  }

  &--translation {
    padding: 0 $spacing--large $spacing--small $spacing;
  }

  &--contains-table {
    @include mq($from: desktop) {
      @include grids-expand(4,6,2);
      padding-left: 16.667%;
      padding-right: 16.667%;
    }
  }
}

/* Hacks for complex content fetched inside bodybox */
.c-bodybox > ul:not([class]),
.c-bodybox :not(li) > ul:not([class]) {
  @include mq(desktop) {
    margin-left: $spacing;
  }
}

.c-bodybox > ol:not([class]),
.c-bodybox :not(li) > ol:not([class]),
.c-bodybox .ol-list--roman {
  @include mq(desktop) {
    margin-left: $spacing--large;
  }
}

.c-bodybox {
  .c-figure {
    width: 100% !important;
    left: auto !important;
    padding: 0;

    &.u-float-right, &.u-float-small-right {
      width: 50% !important;
      margin-right: 0;
    }

    &.u-float-left, &.u-float-small-left {
      width: 50% !important;
      margin-left: 0;
    }
  }
}

.c-bodybox > *:first-child {
  margin-top: 0;
}

.c-bodybox > *:last-child {
  margin-bottom: 0;
}
