//  Copyright (c) 2012-2013, Jungwacht Blauring Schweiz. This file is part of
//  hitobito and licensed under the Affero General Public License version 3
//  or later. See the COPYING file at the top-level directory or at
//  https://github.com/hitobito/hitobito.

/* Typo */
// -------------------------
h1,
h2 {
  font-family: $heading-font-family;
  margin-top: 0;
}

h1,
.h1 {
  font-size: 1.5em;
  font-weight: 700;
  line-height: 1.25em;
}

h2,
.h2 {
  font-size: 1.4em;
  font-weight: 300;
}

h3,
.h3 {
  font-size: 1.25em;
}

h4,
.h4 {
  font-size: 1.2em;
}

h5,
.h5 {
  font-size: 1.1em;
  margin: 10px 0 0 0;
}

.content-header {
  margin-bottom: 24px;
  @include responsive(mediaTablet) {
    margin-bottom: $v-space;
  }
  h1 {
    margin-bottom: 0px;
  }
}

p:last-child {
  margin-bottom: 0;
}

.muted {
  color: $gray;
}

td p,
address {
  margin: 0;
}

.alert ul {
  margin: 0 0 0 25px;
}

.btn-toolbar .dropdown,
.btn-toolbar .link {
  font-size: 14px;
  vertical-align: middle;
}

.btn-group + .link {
  margin-left: $v-space;
}

h1 .btn,
h2 .btn,
h3 .btn,
h4 .btn {
  font-weight: normal;
  font-family: $font-family-base;
}

// Definition list
dl {
  margin-top: 0;
}

dd {
  overflow-wrap: anywhere;
}

.dl-horizontal {
  dd {
    white-space: wrap !important;

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

    // display empty multiline fields correctly with whitespace
    .multiline::after {
      content: "\00a0";
    }
  }

  @include responsive(mediaTablet) {
    dd {
      margin-bottom: 0;
    }
  }

  &:last-child {
    border-bottom: 1px solid $border-color;
    margin-bottom: $v-space;
  }

  dt {
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .labeled-grid {
    margin-bottom: 0.5rem;
    grid-template-columns: 1fr 2fr;
    grid-column-gap: 15px;

    &:last-child {
      margin-bottom: 0;
    }
  }
}
.dl-borderless,
.dl-borderless:last-child {
  border: 0;
}

.well .dl-horizontal {
  &:first-child {
    border-top: none;
    padding-top: 0;
  }

  &:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }
}

.dl-vertical {
  display: grid;

  dt {
    text-align: left !important;
  }

  dd {
    margin-bottom: calc($v-space / 4);
    margin-left: 16px;
  }
}

.labeled-grid {
  margin-bottom: 0.25rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-column-gap: 5px;

  dd {
    margin-bottom: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media screen and (max-width: 768px) {
  .dl-horizontal {
    grid-template-columns: 1fr;
  }
}

select[class*="span"] {
  min-height: 30px;
  height: 30px;
  *margin-top: 4px;
  line-height: 30px;
}

legend {
  font-size: 1.2em;
  line-height: 180%;

  small {
    font-size: 85%;
    margin-left: 10px;
  }
}

.nowrap {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.anchor {
  color: inherit;
  text-decoration: none;
}

.animated-highlight {
  -webkit-animation: highlight 2.5s;
  animation: highlight 2.5s;
}
