/**
IMPORT AMOS-LAYOUT VARIABLES and UTILITY
 */
@import (optional) "../../vendor/open20/amos-layout/src/assets/resources/base/less/variables.less";
@import (optional) "../../vendor/open20/amos-layout/src/assets/resources/base/less/utility.less";
/**
IMPORT STYLE-CUSTOM
 */
@import (optional) "../../backend/web/less/style_custom.less";

/**
 DASHBOARD WIDGET GRAPHIC
*/

.latest-documents {
  /*  overflow: hidden;*/
  display: flex;
  flex-direction: row;

  .box-widget-toolbar {
    //display: flex;
    //flex-direction: column;
    height: 170px;
    //text-align: right;
    border-bottom: none;
    border-right: 1px solid @primary-color;
    width: 20%;
    float: left;
    h1 {
      position: relative;
      top: 20%;
      padding: 0;
      @media (min-width: 939px) {
        top: 40%;
      }
    }
  }
  .read-all {
    position: absolute;
    bottom: 10px;
    a {
      padding: 0;
    }
  }
  section {
    width: 80%;
    @media screen and (max-width: 939px) {
      width: 100%;
    }
    .list-items {
      display: flex;
      height: 165px;
      align-items: center;
    }
    .box-widget-title {
      text-align: right;
      position: relative;
      top: 20%;
    }
    .container-icon {
      margin: 0 auto;
    }
    .container-text {
      width: 100% !important; //override amos-layout
      text-align: center;
      border-top: 1px solid @border-color-default;
      margin-bottom: @margin-min;
    }

    .widget-listbox-option {
      width: 33.33%;
      padding: 0 10px;
      height: 150px;
      article {
        display: flex;
        flex-direction: column;
        padding: 5px;
        background-color: #eee;
        height: 150px;
        .container-icon {
          /*text-align: center;
          color: #fff;
          float: left;
          width: 50px;
          height: 50px;
          border-radius:50%;
          color: @primary-color;*/
          .dash {
            font-size: 3em;
            color: @primary-color;
          }
        }
        .footer-listbox {
          position: absolute;
          text-align: center;
          bottom: 5px;
        }
      }
    }
  }
}

@media screen and (max-width: 939px) and (min-width: 320px) {
  .document.grid-item--width2 {
    width: 100%;
    height: 280px;

    .latest-documents {
      flex-direction: column;
      height: 100%;

      .box-widget-toolbar {
        flex-direction: row-reverse;
        border-right: none;
        border-bottom: 1px solid @primary-color;
        height: 35px;
        width: 100%;
        h1 {
          position: relative;
          top: 0;
          padding-left: 0;
        }
      }

      section {
        height: 285px;

        .list-items {
          flex-direction: column;
          height: auto;

          .widget-listbox-option {
            width: 96%;
            margin: 5px 0;
            height: 65px;

            article {
              flex-direction: row;
              justify-content: flex-start;
              height: 100%;
              .container-icon {
                width: 5%;
              }
              .container-text {
                width: 90%;
              }
              @media (max-width: 620px) {
                .container-icon {
                  width: 10%;
                }

                .container-text {
                  width: 80%;
                }
              }
              .container-text {
                border: none;
                text-align: left;
                padding-left: 10px;
                .listbox-date p {
                  margin: 0;
                }
                .box-widget-subtitle {
                  max-width: 80%;
                }
              }
              .footer-listbox {
                position: absolute;
                text-align: right;
                bottom: 0px;
                right: 5px;
              }

            }
          }
        }
      }
      .read-all {
        position: relative;
        bottom: 5px;
      }
    }
  }
}

/**
DOCUMENTI _FORM
 */
.field-documenti-comments_enabled {
  margin-top: 6px;
  .comment-choice {
    margin-top: 5px;
  }
}

/**
DOCUMENTI VIEW
 */
.documents-view {
  .header-widget {
    position: relative;
    margin: @margin-medium 0;
    .post-header .publication-date {
      text-align: right;
    }
    .manage { /* override */
      margin-top: 0;
    }
    .amos-tooltip {
      float: right;
    }
    .reportflag-widget {
      float: right;
      a {
        margin: 0px 12px;
        position: relative;
        bottom: 2px;
      }
    }
  }
  .header {
    background-color: @light-background-color;
    margin-bottom: @margin-default;
    overflow: hidden;
    max-height: 350px;
    display: flex;
    .img-responsive {
      margin: 0 auto;
    }
    .title {
      background-color: rgba(255, 255, 255, 0.8);
      .title-text {
        font-weight: bold;
        margin-top: @margin-medium;
        margin-bottom: @margin-min;
        color: @black-color;
      }
      .subtitle-text {
        margin-top: 0;
        color: @black-color;
        font-style: italic;
        font-size: 1.3em;
      }
    }
  }
  .download-file {
    background-color: @primary-color;
    color: contrast(@primary-color);
    margin-bottom: @margin-default;
    .select2 {
      margin-top: @margin-default;
    }
    > div.action-document {
      margin: @margin-large 0;
      width: 100%;
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
      @media (max-width: 767px) {
        flex-wrap: wrap;
        > div {
          width: 100%;
        }
      }
      > div:first-child {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        width: 70%;
        > div:nth-child(2) {
          width: 80%;
        }
      }
      .dash {
        font-size: 3em;
        background-color: @white-color;
        color: @primary-color;
        border-radius: 50%;
        padding: 10px;
      }
      .filename {
        margin-left: @margin-large;
        font-size: 1.2em;
        position: relative;
        //bottom: 8px;
        font-weight: bold;
        word-wrap: break-word;
      }
      .btn {
        border: none;
        .am-download {
          font-size: 1.3em;
          position: relative;
          top: 1px;
          color: @white-color;
        }
      }
    }
  }
}

/**
DOCUMENTI LIST VIEW
 */

.listview-container.folder {
  width: auto;
  max-width: 50%;
  @media (max-width: 767px) and (min-width: 621px) {
    width: 50%;
    max-width: 50%;
  }
  @media (max-width: 620px) {
    width: 100%;
    max-width: 100%;
  }
  padding: 2px;
  margin: 0;
  position: relative;
  .post-horizontal {
    border: 1px solid @border-color-default;
    background-color: @light-background-color;
    padding: 2px 5px;
    .post-content {
      .post-title {
        //text-align: center;
        .flexbox;
        .flexbox-row;
        align-items: center;
        margin-top: @margin-medium;
        h2 {
          margin-top: @margin-min;
          font-size: 1.25em; /* max chars on 2 row */
        }
        .dash-folder-open {
          font-size: 3em;
          margin-right: @margin-min;
        }
      }
      .badge{ /* override */
        top: 0;
        right: -3px;
      }
    }
    .manage {
      position: absolute;
      right: 10px;
      top: 5px;
      .manage-menu {
        width: auto;
        font-size: 1.3em;
        padding: 0;
      }
    }
  }
}

.listview-container.document {
  margin-top: @margin-default;
}

/**
DOCUMENTI OWL CAROUSEL
 */
@owl-documents-height: 200px;

.document-owl-carousel.owl-carousel {
  margin: @margin-medium 0;
  padding-bottom: @padding-default;
  border-bottom: 1px solid @primary-color;
  .owl-nav > button.owl-prev,
  .owl-nav > button.owl-next,
  .owl-item,
  .owl-item > .owl-item-content,
  .owl-item > .owl-item-content > div { /* override height owl-carousel */
    height: @owl-documents-height;
  }
  .owl-dots{
    display: none;
  }
  .owl-nav > button.owl-prev,
  .owl-nav > button.owl-next { /* override color nav */
    background-color: @primary-color;
  }
  .owl-item-content {
    > div {
      padding-top: @padding-min;
      padding-bottom: @padding-min;
    }
    > div:nth-child(1) {
      background-color: @light-background-color;
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      //align-items: center;
      padding-left: @padding-min;
      .date {
        color: @black-color;
        text-transform: uppercase;
        font-weight: bold;
        font-size: 0.8em;
        line-height: 1em;
      }
      > div {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        margin-left: @margin-default;
        margin-top: 35%;
        @media (max-width: 767px) and (min-width: 451px) {
          margin-top: 15%;
        }
        @media (max-width: 450px) {
          margin-top: 35%;
        }
        a {
          text-decoration: none;
          z-index: 9;
          margin: @margin-medium 0 @margin-default;
          &:first-child {
            background-color: @white-color;
            border: 1px solid @primary-color;
            border-radius: 50%;
            padding: @padding-default;
            &.is-folder {
              padding: 23px 10px 21px 18px;
              position: relative;
              bottom: 5px;
            }
          }
          .dash {
            justify-content: center;
            font-size: 5em;
            z-index: 9;
            &.dash-folder-open {
              font-size: 4em;
            }
            @media (max-width: 450px) {
              font-size: 4em;
              &.dash-folder-open {
                font-size: 3em;
              }
            }
          }
        }
        .download-file {
          margin-top: @margin-min;
          text-transform: uppercase;
          color: @black-color;
          font-weight: bold;
        }
      }
    }
    > div:nth-child(2) {
      background-color: @primary-color;
      padding-left: @padding-default;
      padding-right: @padding-default;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      .post-header {
        margin: 0;
        .creator a,
        .card-prevalent-partnership,
        .card-creator-targets {
          color: @white-color;
        }
        .creator { /* override */
          @media (max-width: 1199px) and (min-width: 320px) {
            max-width: 100%;
          }
        }
      }

      .title {
        color: @white-color;
        margin-left: @margin-min;
        font-size: 1.5em;
        word-wrap: break-word;
        a {
          color: @white-color;
          text-decoration: none;
        }
      }
      .directory {
        color: @white-color;
        margin-left: @margin-min;
        font-size: 1em;
        word-wrap: break-word;
        font-style: italic;
      }
      .read-more {
        text-align: right;
        a {
          color: @white-color;
          > .am {
            margin-left: @margin-min;
            font-size: 1.5em;
            position: relative;
            top: 3px;
          }
        }
      }
    }
    @media (max-width: 420px) {
      display: flex;
      flex-direction: column;
      > div {
        width: 100%;
        &:nth-child(1) {
          height: @owl-documents-height / 4;
          .date {
            float: left;
          }
          > div {
            margin: 0;
            flex-direction: row-reverse;
            position: absolute;
            //right: 5px;
            left: 10px;
            bottom: -152px;
            z-index: 9;
            .download-file {
              margin-top: 0;
              color: @white-color;
            }
            .dash {
              display: none;
              //font-size: 1.5em;
              //padding: @padding-min;
              //margin-left: @margin-min;
              //&.dash-folder-open {
              //  padding: 6px 3px 5px 5px;
              //  font-size: 1em;
              //}
            }
          }
        }
        &:nth-child(2) {
          padding: 5px;
          .post-header {
            .creator {
              font-size: 0.8em;
            }
            .post-header-avatar .container-round-img-sm {
              width: 30px;
              height: 30px;
            }
          }
        }
      }
    }
  }
}

