/**
  * Datahub subsite
  */

.subsite-datahub {
  --border-color-secondary: @darkCerulean;
  --text-color-secondary: @blue-4;

  .search-action {
    background-color: @blue-4;
  }

  #search-box {
    background: @blue-4 !important;
  }

  .eea.banner {
    background: @blue-4;

    .gradient {
      background: none;
    }
  }

  .main-menu {
    .item.active {
      a {
        border-bottom: 4px solid @darkCerulean;
        color: @darkCerulean;
      }
    }

    .item {
      a {
        color: @darkCerulean;

        &:hover {
          border-bottom: 4px solid @darkCerulean;
        }
      }
    }
  }
}

/**
    * Datahub search
    */

.view-datahub-item {
  .item.tabs-title {
    margin-top: 2em;
    margin-bottom: 0.3em;
    font-size: 24px;
  }

  .datasets-tab {
    margin-bottom: 2.5em;

    .ui.tab {
      padding-top: 0;
    }

    .ui.vertical.menu {
      width: 100%;
      height: 100%;

      .item {
        padding: 1rem 60px 1rem 0 !important;
        border-right-width: 0.2rem !important;
        text-align: right;
      }
    }

    .ui.grid > [class*='four wide'].column {
      width: 20% !important;
    }

    .ui.grid > [class*='twelve wide'].column {
      width: 80% !important;
    }
  }
}

.datahub-view {
  .searchapp-datahub {
    /* Search box */
    .sui-search-box {
      .search-input .terms-box input {
        border-color: @darkCerulean;

        &:focus {
          border-bottom: 3px solid @blue-3;
          outline: none !important;

          &:focus + .terms-box-left {
            border-bottom: 3px solid @blue-3;
          }
        }
      }

      .terms-box-left {
        border-color: @darkCerulean;

        .search-icon svg {
          fill: @darkCerulean !important;
        }
      }

      .input-controls .clear-button {
        border-color: @darkCerulean !important;
      }

      .input-controls i.close.icon {
        color: @darkCerulean !important;

        &:before,
        &:after {
          background-color: @darkCerulean !important;
        }
      }
    }

    /* Tabs */
    .ui.secondary.pointing.menu {
      a.item {
        color: @blue-grey-5;

        &.active,
        &:active {
          border-color: @darkCerulean;
          color: @darkCerulean;
        }
      }
    }

    /* Filters */
    .above-results .sorting .inline.dropdown > span,
    .dropdown-facets-list .ui.button.sui-button:hover,
    .ui.basic.button.sui-button,
    .ui.basic.button.sui-button:active {
      color: @darkCerulean !important;
    }

    /* Pagination */
    .search-body-footer {
      .ui.button.pagination-item {
        &.active,
        &:hover {
          color: @darkCerulean !important;
        }

        &:after {
          border-color: @darkCerulean;
        }
      }
    }
  }
}

/**
    * Datahub item view
    */
.view-datahub-item {
  color: @blue-grey-5;

  .title.accordion-title.filter {
    background-color: #efefef !important;
  }

  .eea.banner {
    background: @blue-4;

    .gradient {
      background: none;
    }

    .subtitle > a {
      color: inherit;
    }
  }

  .search-action {
    background-color: @blue-4;
  }

  .prod-id {
    cursor: pointer;

    i.icon {
      position: relative;
      top: 1px;
      margin: 0;
      font-size: 1.2em;
      vertical-align: bottom;
    }
  }

  #search-box {
    background: @blue-4 !important;
  }

  .dataset-view {
    .dataset-container:not(:first-of-type) {
      padding-top: 2.5em;
      border-top: 1px solid @lighterGray;
    }
  }

  .ui.secondary.vertical.pointing.menu .active.item {
    border-color: @darkCerulean;
    color: @darkCerulean;
  }

  .dataset-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    margin-bottom: 2.5em;
  }

  .eea.callout {
    border-color: @darkCerulean;
    margin-bottom: 3em;
    color: @blue-grey-5;
  }

  .ui.accordion {
    .active.title {
      background-color: @mediumWhite;
      color: @deepBlue;
    }

    .list .item {
      > .content {
        display: flex;
        align-items: center;

        .item-protocol {
          margin-left: 0.3em;
        }

        .icon {
          margin-right: 0.3em;
        }

        .item-link {
          margin: 0 0.3em;
        }
      }

      .item-description {
        display: -webkit-box;
        overflow: hidden;
        margin-top: 0.7em;
        -webkit-box-orient: vertical;
        font-size: 80%;
        -webkit-line-clamp: 3;
      }
    }
  }

  .info-wrapper {
    padding: 2em;
    margin: 3em 0;
    background-color: @grey-1;
    color: @lightBlack;
    font-size: 18px;

    .info-content {
      width: 100%;
      max-width: 900px;
      margin: 0 auto;
    }

    .info-title {
      margin-bottom: 1.3em;
      font-weight: 700;
    }
  }

  .geotags {
    margin: 0.5em 0;
    columns: 5;
    font-size: 15px;
    list-style-type: none;

    span {
      display: block;
    }
  }

  .related-wrapper {
    margin: 2em 0;

    .ui.cards {
      .ui.card {
        .content {
          min-height: 148px;
          background-color: @deepBlue;

          .description {
            color: @white;
            font-size: 16px;
          }
        }

        &:hover {
          border: none;
          box-shadow: none;
        }
      }
    }

    h2 {
      color: @darkMidnightBlue;
    }
  }

  .tag-item {
    display: inline-block;
    padding: 2px 5px;
    border-radius: 0.5em;
    margin: 5px;
    background: @whiteGray;
    color: @black;
    font-size: 12px;
    line-height: 2;
    word-break: keep-all;
  }

  .section-wrapper {
    margin: 2em 0;
  }

  .metadata-section {
    break-inside: avoid-column;
  }

  .metadata-list {
    column-count: 2;
    column-gap: 2em;
  }

  .formats {
    margin-left: 1em;

    svg {
      position: relative;
      top: 2px;
    }
  }

  .dataset-content {
    display: flex;
    justify-content: space-between;
    font-size: 14px;

    > div {
      margin-bottom: 2em;
    }
  }

  .dataset-pdf {
    .d-link {
      margin: 0;
    }
  }

  .d-link {
    display: flex;
    align-items: center;
    margin: 0.5em 0;
    font-weight: 500;

    i {
      margin-right: 5px;
    }

    a {
      color: inherit;
    }
  }

  .ui.label.archived-item {
    border-radius: 0.25em;
    margin-right: 0.5em;
    background-color: @brightYellow;
  }
}

.ui.button.see-more {
  padding: 0 !important;
  border: none;
  margin: 0;
  margin-left: 10px;
  background: none;
  color: @linkColor;
  font-size: inherit;
  font-weight: normal;

  &:hover,
  &:active,
  &:focus {
    background: none;
    color: @linkColor;
    opacity: 0.8;
  }

  &.open:after {
    content: '\25B2';
  }

  &.close:after {
    content: '\25BC';
  }
}

.dh-label {
  display: inline-block;
  padding: 0.3em 0.6em;
  border-radius: 0.25em;
  margin-top: -3px;
  margin-right: 7px;
  color: @deepBlue;
  font-size: 65%;
  line-height: 1;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;

  &:not(.inverted) {
    background-color: @mediumGray;
  }

  &.inverted {
    box-shadow: 0px 0px 0px 1px @deepBlue inset;
  }
}

.more-like-this {
  .header span {
    .elipsisOverflow(2);
  }

  .card-description {
    .elipsisOverflow(7);
  }
}

.dataset-item {
  display: flex;
  align-items: center;
  justify-content: space-between;

  span {
    font-weight: 500;
  }
}

// .temporal-coverage {
//   display: flex;
//   align-items: center;
//   margin: 2em 0;

//   .time-range {
//     position: relative;
//     display: flex;
//     align-items: center;
//     padding: 0.5em 1em;
//     background-color: @primaryColor;
//     color: white;
//     font-size: 23px;
//     font-weight: 700;

//     span {
//       margin: 0 10px;
//       line-height: 19px;
//     }

//     &:before,
//     &:after {
//       position: absolute;
//       top: -6px;
//       width: 6px;
//       height: 125%;
//       background-color: @primaryColor;
//       content: ' ';
//     }

//     &:before {
//       left: 0;
//     }

//     &:after {
//       right: 0;
//     }
//   }

//   .side-year {
//     display: flex;
//     align-items: center;
//     padding: 0.2em 1.3em;
//     background-color: #d2d9de;
//     color: white;
//     font-size: 19px;
//     font-weight: 500;
//   }
// }

// .dataset-header {
//   margin-bottom: 3em;

//   h1 {
//     color: @blue-grey-5;
//   }

//   .dataset-header-bottom {
//     color: @blue-grey-5;
//     font-size: 14px;
//     font-weight: 700;

//     .header-data:not(:last-child) {
//       position: relative;
//       display: inline-block;
//       padding-right: 1.5em;

//       &:after {
//         position: absolute;
//         top: 3px;
//         right: 10px;
//         height: 70%;
//         border-left: 2px solid @blue-grey-5;
//         content: ' ';
//       }
//     }
//   }
// }
