/** 
 *------------------------------------------------------------------------------
 * @package       T3 Framework for Joomla!
 *------------------------------------------------------------------------------
 * @copyright     Copyright (C) 2004-2013 JoomlArt.com. All Rights Reserved.
 * @license       GNU General Public License version 2 or later; see LICENSE.txt
 * @authors       JoomlArt, JoomlaBamboo, (contribute to this project at github 
 *                & Google group to become co-author)
 * @Google group: https://groups.google.com/forum/#!forum/t3fw
 * @Link:         http://t3-framework.org 
 *------------------------------------------------------------------------------
 */


// --------------------------------------------------
// MODULE STYLES
// --------------------------------------------------

// 
// GENECRIC MODULE
// --------------------------------------------------
.t3-module {
  background: @t3-module-bg;
  color: @t3-module-color;
  margin-bottom: @line-height-computed;

  // Larger margin on Tablet / Desktop
  @media screen and (min-width: @screen-sm) {
    margin-bottom: @line-height-computed * 2;
  }

  // Module padding
  .module-inner {
    padding: @t3-module-padding;
  }
}

// Module Title
// ------------
.module-title {
  background: @t3-module-title-bg;
  color: @t3-module-title-color;
  font-size: @font-size-large;
  margin: 0 0 (@line-height-computed / 2) 0;
  padding: @t3-module-title-padding;

  // Larger margin on Tablet / Desktop
  @media screen and (min-width: @screen-sm) {
    margin-bottom: @line-height-computed;
  }

}

// Module Content
// --------------
.module-ct {
  background: @t3-module-content-bg;
  color: @t3-module-content-color;
  padding: @t3-module-content-padding;
  .clearfix();
}

// Module List
// -----------
.module-ct,
.module-ct .custom {
  > ul,
  > ol {
    margin-left: 20px;
    padding-left: 0;
  }
  
  > ul.unstyled,
  > ol.unstyled {
    padding-left: 0;
  }

  > ul.nav,
  > ol.nav {
    padding-left: 0;
    margin-left: 0;
  }
}



//
// JOOMLA! MODULES
// --------------------------------------------------

// Menu
// ----
.module_menu {
  .nav {
  }
  
  .nav > li {
  }
  
  .nav > li > a,
  .nav > li > .separator {
    padding: @padding-base-vertical 5px;
    display: block;
  }

  // Hover state
  .nav > li > a:hover {
  }
  
  // Active state
  .nav > li.active > a {
  }
}


// Login Form
// ----------
#login-form {
  
  input[type="text"],
  input[type="password"] {
    width: 100%;
    color: @text-color;
  }
  
  .btn-primary {
  }
  
  ul.unstyled {
    margin-top: @line-height-computed;
    padding-left: 20px;

    >li {
      >a  {
        color: @text-color;

        span {
          color: @text-color;
          font-size: 11px;
        }

        &:hover {
          text-decoration: underline;
        }
      }
    }
  }

  #form-login-username {
  }
  
  #form-login-password {
  }
  
  #form-login-remember {
    label {
      font-weight: normal;
    }
  }
  #modlgn-secretkey {
  }
}


// Advertisement
// -------------
.bannergroup {
}

.banneritem {
  a {
    font-weight: bold;
  }
}

.bannerfooter {
  border-top: 1px solid @t3-border-color;
  font-size: @t3-font-size-smaller;
  padding-top: @t3-global-padding / 2;
  text-align: right;
}


// Categories
// ----------
.categories-module, ul.categories-module,
.category-module, ul.category-module {
  margin: 0;

  li {
    list-style: none;
    padding: (@line-height-computed / 2) 0;
    border-top: 1px solid @t3-border-color;
    // Remove border for first item
    &:first-child {
      border-top: 0;
    }
  }
  
  h4 {
    font-size: @font-size-base;
    font-weight: normal;
    margin: 0;
  }

  //Category
  &.mod-list {
    >li {
      padding: 0;

      +li {
        margin-top: @t3-global-margin / 2;
        padding: 0;
        border: none;
      }

      h4 {

        &:before {
          color: @gray-light;
          content: "\f07c";
          font-family: FontAwesome;
          margin-right: @t3-global-margin / 8;
        }

        a {
          color: @text-color;
          font-weight: 400;

          &:hover,&:focus,&:active {
            border-bottom: 1px solid @hr-border;
          }
        }
      }
    }
  }
}

.owl-categories {
  display: inline-block;
  overflow: hidden;
  padding: 0 168px;
  margin-bottom: -@grid-gutter-width*3;
  margin-top: -@grid-gutter-width;
  width: 100%;

  // Mobile view
  @media (max-width: @screen-sm-max) {
    margin-bottom: 0;
    padding: 0 @grid-gutter-width * 2;
  }

  .owl-carousel {
    .owl-stage-outer {
      padding: @grid-gutter-width 0;
      overflow: visible;
    }
  }

  .category-inner {
    a {
      background-position: center;
      background-repeat: no-repeat;
      background-size: cover;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      height: 672px;
      width: 100%;
      .transition(all 500ms);

      // Mobile view
      @media (max-width: @screen-xs-max) {
        height: 300px;
      }

      &:hover,&:focus,&:active {
        text-decoration: none;
        transform: scale(1.05);
      }
    }

    // Info
    .info {
      background: linear-gradient(to top, @black, transparent);
      color: @white;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      padding: @grid-gutter-width;

      // Title
      .title {
        font-size: @font-size-h3;
        font-weight: 500;
        margin-bottom: @t3-global-margin / 4;
      }

      // NumItems
      .numitems {
        .opacity(0.6);
      }

      // Description
      .desc {
        display: block;
        margin-top: @t3-global-margin / 2;
        text-align: center;
        .opacity(0.6);
      }
    }
  }
}

.grid-categories {
  .category-item {
    height: 0;
    padding-bottom: 100%;
    position: relative;
    margin-bottom: @grid-gutter-width;

    // Mobile view
    @media (max-width: @screen-xs-max) {
      margin-bottom: @grid-gutter-width / 2;
    }

    a {
      background-position: center;
      background-repeat: no-repeat;
      background-size: cover;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      position: absolute;
      height: 100%;
      width: 100%;
      .transition(all 500ms);
    }

    // Info
    .info {
      background: linear-gradient(to top, @black, transparent);
      color: @white;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      padding: @grid-gutter-width;

      // Title
      .title {
        font-size: @font-size-h3;
        font-weight: 500;
        margin-bottom: @t3-global-margin / 4;
      }

      // NumItems
      .numitems {
        .opacity(0.6);
      }

      // Description
      .desc {
        display: block;
        margin-top: @t3-global-margin / 2;
        text-align: center;
        .opacity(0.6);
      }
    }
  }

  .col-sm-8 {
    .category-item {
      padding-bottom: 47%;
    }
  }
}


.category-module {
  &.mod-owl {
    padding: 0 114px;
    overflow: hidden;

    // Mobile view
    @media (max-width: @screen-xs-max) {
      padding: 0 @grid-gutter-width / 2;
    }

    &.container,
    .container > & {
      padding: 0;
    }

    .owl-carousel {
      margin-top: -@grid-gutter-width;

      .owl-stage {
        display: flex;
      }

      .owl-item {
        //display: flex;
        //flex: 1 0 auto;
      }

      .owl-stage-outer {
        padding: @grid-gutter-width 0;
        overflow: visible;
      }
    }
  }

  &.mod-grid {
    .col-lg-4 {
      margin-bottom: @grid-gutter-width;
    }
  }

  // Intro Image
  .intro-image {
    position: relative;

    .item-image {
      float: none !important;

      img {
        width: 100%;
      }

      .carousel-control {
        .ion-ios-arrow-round-back,
        .ion-ios-arrow-round-forward {
          position: absolute;
          top: 50%;
          margin-top: -@grid-gutter-width/2;
          left: 50%;
          margin-left: -@grid-gutter-width/2;
          background: none;
          border-radius: 50%;
          color: @white;
          display: inline-block;
          line-height: @grid-gutter-width;
          height: @grid-gutter-width;
          width: @grid-gutter-width;
        }
      }
    }

    .tag-label {
      background: @brand-success;
      color: @white;
      position: absolute;
      top: 100%;
      left: @grid-gutter-width;
      height: @t3-global-padding;
      font-size: @font-size-h6;
      font-weight: 700;
      line-height: @t3-global-padding;
      text-transform: uppercase;
      padding: 0 @t3-global-padding / 2;
      margin-top: -@t3-global-margin / 2;

      &:before {
        content: "";
        border-width: @t3-global-padding / 2 @t3-global-padding / 2 @t3-global-padding / 2 @t3-global-padding / 4;
        border-style: solid;
        border-color: transparent transparent transparent @brand-success;
        position: absolute;
        left: 100%;
      }

      &.label-rent {
        background: @brand-warning;

        &:before {
          border-color: transparent transparent transparent @brand-warning;
        }
      }

      // Mobile view
      @media (max-width: @screen-sm-max) {
        left: @grid-gutter-width/2;
      }
    }

    .featured-label {
      background: @white;
      color: @gray-lighter;
      position: absolute;
      top: 100%;
      right: @grid-gutter-width;
      height: @grid-gutter-width;
      width: @grid-gutter-width;
      font-size: @font-size-h6;
      font-weight: 700;
      line-height: @grid-gutter-width;
      text-transform: uppercase;
      padding: 0;
      margin-top: -@grid-gutter-width/2;
      border-radius: 50%;
      text-align: center;    
      box-shadow: 0 0 18px rgba(0, 0, 0, 0.1);


      &.featured-label-yes {
        background: @brand-danger;
        color: @white;
      }
    }
  }

  // Info
  .item-inner {
    background: @white;
    border: 1px solid @t3-border-color;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    .transition(box-shadow 500ms);

    &:hover {
      border-color: darken(@t3-border-color, 5%);
      box-shadow: 0 0 18px rgba(0,0,0,0.1);
    }

    .info-detail {
      background: @white;
      padding: @grid-gutter-width;

      // Mobile view
      @media (max-width: @screen-sm-max) {
        padding: @grid-gutter-width/2;
      }
    }

    // Title
    .mod-articles-category-title {
      color: @headings-color;
      display: block;
      font-size: @font-size-h4;
      line-height: @line-height-h4;
      margin-bottom: @t3-global-margin / 2;
    }

    // Meta
    .meta {
      color: @gray-light;
      text-transform: uppercase;
      font-size: @font-size-h6;
      text-transform: uppercase;

      > span {
        display: inline-block;
        margin-right: @t3-global-margin / 2;
        padding: 4px 0;
      }
    }

    // Intro text
    .mod-articles-category-introtext {
      margin-top: @t3-global-margin;
    }

    // Tags
    .mod-articles-category-tags {
      margin-bottom: @t3-global-margin / 2;
    }

    // Custom Field
    .ct-field-row {
      border-top: 1px solid @t3-border-color;
      display: flex;

      > div {
        flex-grow: 1;
        padding: @grid-gutter-width @grid-gutter-width / 2 @grid-gutter-width @grid-gutter-width;
        white-space: nowrap;
        width: 33%;

        // Mobile view
        @media (max-width: @screen-sm-max) {
          padding: @grid-gutter-width / 3;
        }
        
        + div {
          border-left: 1px solid @t3-border-color;
        }

        &.mod-articles-category-writtenby {
          border-left: none;
          text-align: right;
          padding-right: @grid-gutter-width;

          // Mobile view
          @media (max-width: @screen-sm-max) {
            padding-right: @grid-gutter-width / 3;
          }

          .field-label,
          .author-name {
            display: none;
          }

          .author-avatar {
            border-radius: 50%;
            height: @grid-gutter-width;
            width: auto;
            display: inline-block;
          }
        }
      }
    }
  }
}

@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  .category-module .item-inner {
    display: block;
  }
}


// Custom
// ---------
.t3-hero {

  // Map
  .custom {
    .map-container {
      width: 100% !important;
    }
  }
}

// News Feed
// ----------
.feed {
  // Feed Title
  h4 {
    font-weight: bold;
  }
  // Feed list
  .newsfeed,
  ul.newsfeed {
    border-top: 1px solid @hr-border;
    li {}
    .feed-link, 
    h5.feed-link {
      font-size: @font-size-base;
      font-weight: normal;
      margin: 0;
    }
  }

}


// Latest Users 
// ------------
.latestusers,
ul.latestusers {
  margin-left: 0;
  li {
    background: @gray-lighter;
    display: inline-block;
    padding: 5px 10px;
    border-radius: @border-radius-base;
  }
}


// Stats 
// -----
.stats-module {
  dt, dd {
    display: inline-block;
    margin: 0;
  }
  dt {
    font-weight: bold;
    width: 35%;
  }
  dd {
    width: 60%;
  }
}


// Popular Tags
//-------------
.tagspopular {
  ul {
    display: block;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow: hidden;
  }

  ul > li {
    color: @gray;
    display: inline-block;
    margin: 0 5px 5px 0;
  }

  ul > li > a {
    background: @gray-lighter;
    border-radius: 3px;
    color: @gray;
    display: block;
    padding: 2px 5px;
    // Links states
    &:hover,
    &:focus,
    &:active {
      background: @link-hover-color;
      color: @white;
      text-decoration: none;
    }
  }
}



// Similar tags
// ------------
.tagssimilar {
  ul {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  ul > li {
    border-bottom: 1px solid @gray-lighter;
    padding: 8px 0;
  }

  ul > li > a {
    color: @gray;
    // Link states
    &:hover,
    &:focus,
    &:active {
      color: @link-hover-color;
    }
  }
}


// Breadcrums Module
// -----------------
.module-ct > ol.breadcrumb {
  padding: @padding-base-vertical @padding-base-horizontal;
  margin-left: 0;
}

// Masthead
.t3-masthead {
  .ja-masthead {
    background-image: url('@{t3-image-path}/bg-mast-1.jpg');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    padding: @grid-gutter-width * 4 0;
    position: relative;
    text-align: center;

    // Mobile view
    @media (max-width: @screen-xs-max) {
      padding: @grid-gutter-width * 2 0;
    }

    &:before {
      z-index: 5;
      opacity: 0.58;
    }

    .ja-masthead-detail {
      align-items: center;
      margin: 0 auto;
      max-width: 1200px;
      padding: 0;
      display: flex;
      flex-direction: column;

      h3 {
        color: @white;
        font-size: @font-size-h1;
        font-weight: 700;
        margin: 0 auto @t3-global-margin /2;
        line-height: 1.5;

        // Table view
        @media (max-width: @screen-sm-max) {
          font-size: 50px;
          padding: 0 @grid-gutter-width;
        }

        // Mobile view
        @media (max-width: @screen-xs-max) {
          font-size: @font-size-h2;
          padding: 0 @t3-global-padding/2;
        }
      }
    }

    .ja-masthead-description {
      font-size: @font-size-lead;
      opacity: 0.8;
      margin-top: @t3-global-margin;
      padding: 0 @grid-gutter-width * 3;

      // Mobile view
      @media (max-width: @screen-xs-max) {
        font-size: 16px;
      }
    }

    .article-info {
      width: 100%;

      .article-info {
        color: @white;
        float: left;
        font-size: @font-size-lead;
        margin: 0;
        width: 100%;
        opacity: 0.85;
        padding: 0 @t3-global-padding/ 2;

        // Mobile view
        @media (max-width: @screen-xs-max) {
          font-size: 16px;
        }

        a {
          color: @white;

          // Link states
          &:hover, &:focus, &:active {
            text-decoration: underline;
          }
        }
        
        .article-info-term {
          display: none;
        }
        
        dd {
          display: inline-block;
          margin-left: 0;
          white-space: nowrap;
          margin-right: 0;

          strong {
            font-weight: 500;
          }

          .fa {
            display: none;
          }

          +dd {
            &:before {
              content: "-";
              margin-left: 4px;
              margin-right: 2px;
            }
          }
        }

        .tooltip {
          +dd {
            &:before {
              content: "-";
              margin-left: 4px;
              margin-right: 2px;
            }
          }
        }
      }

      ul.btn-group {
        display: flex;
        justify-content: center;
        margin: 0;
        line-height: 36px;
        padding: 0;
        width: 100%;

        >li {
          list-style: none;

          +li {
            margin-left: @t3-global-margin / 6;
          }

          >a {
            background: rgba(0, 0, 0, 0.5);
            font-size: @font-size-h6;
            padding: 2px 8px;
            text-transform: capitalize;
            color: @white;

            &:hover {
              text-decoration: underline;
            }
          }
        }
      }
    }
  }
}

.view-article {
  .ja-masthead {
    &:before {
      background-color: #000;
      content: "";
      display: block;
      height: 100%;
      left: 0;
      opacity: 0.58;
      position: absolute;
      top: 0;
      width: 100%;
      z-index: 5;
    }
  }

  .ja-masthead-detail {
    position: relative;
    z-index: 10;
  }
}

// ACYMAILING
// -----------------
.acym_module {
  position: relative;

  td, tr td {
    border: 0;
  }

  .acyterms {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    position: absolute;
    top: 100%;
    left: 0;
    padding-top: 10px;
    padding-bottom: 10px;

    input[type="checkbox"] {
      margin-right: 6px;
      margin-top: 6px;
      width: 25px;
      padding: 0;
    }

    >a {
      margin: 0 @t3-global-margin / 6;
    }

    // Popup Content
    .fade {
      height: 85vh;

      .modal-body {
        height: 100vh;

        iframe {
          height: 70vh;
        }
      }

      .modal-footer {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        padding: 7px 12px;

        a {
          color: @brand-primary;

          &:hover {
            color: darken(@brand-primary, 10%);
            background: transparent;
          }
        }
      }

      &.in {
        display: block !important;
      }
    }
  }

  .acym_module_form {
    input {
      background: @t3-footer-background;
      border: 1px solid @gray-darker;
      padding: @padding-small-vertical @padding-small-horizontal;
      height: @input-height-small;
      max-width: 100%;

      // Input
      &[type="email"] {
        width: 100%;
        // Mobile view
        @media (min-width: @screen-lg-min) {
          min-width: 345px;
        }
      }

      &[type="checkbox"] {
        width: auto;
        height: auto;
        display: inline;
        margin-top: 0;
        margin-bottom: 0;
      }

      // Button Sub
      &.subbutton {
        background-image: url('@{t3-image-path}/arrow.png');
        background-repeat: no-repeat;
        background-position: center center;
        font-size: 0;
        margin-left: -1px;
        width: @input-height-small;
      }
    }

    .onefield {
      input[type="checkbox"] {
        height: auto;
        display: inline;
      }
    }
  }

  .acyfield_text {
    padding-bottom: 10px;
  }
}

.subscribe-footer {
  // Mobile view
  @media (max-width: @screen-xs-max) {
    clear: both;
    width: 100%;
    padding-bottom: @t3-global-padding;
  }
}

ul.latestnews {
  >li {
    margin-bottom: @t3-global-margin/4;

    a {
      color: @text-color;

      &:hover {
        text-decoration: underline;
      }
    }
  }
}
