// Refactor:
// https://github.com/alphagov/govuk_elements/blob/master/public/sass/elements/_panels.scss

.gv-c-panel {
  @include box-sizing(border-box);
  @include clearfix;

  clear: both;
  border-left-style: solid;
  border-color: $border-colour;

  padding: em(15, 19);
  margin-bottom: em(15, 19);

  &:first-child {
    margin-top: 0;
  }

  &:only-child,
  &:last-child {
    margin-bottom: 0;
  }
}

.gv-c-panel--border-wide {
  border-left-width: 10px;
}

.gv-c-panel--border-narrow {
  border-left-width: 5px;
}

// These should be utility classes
// Panels within form groups
// By default, panels have 15px bottom margin

// Note: This is incredibly fragile, and needs rebuilding.

.form-group {
  .panel-border-narrow {
    float: left;
    width: 100%;
    // Remove the bottom padding as .form-group sets a bottom margin
    padding-bottom: 0;
    // Don't remove the bottom margin for all panels, assume they are often within stacked groups
  }

  // The first panel in a group
  &:first-child {
    margin-top: 10px;
  }

  // The last panel in a group
  &:last-child {
    margin-top: 10px;
    margin-bottom: 0;
  }
}

// For inline panels
.inline .form-group .panel-border-narrow {
  margin-top: 10px;
  margin-bottom: 0;
}
