/**
 * Description: Layouts and styles for all post-related elements, including posts grid, posts slider, filter and pagination.
 */

/**
 * Table of Contents:
 *
 * 1.0 - Post Title & Meta
 *    
 * 2.0 - Filter
 * 
 * 3.0 - Pagination
 *    3.1 - Multi-pages
 *    3.2 - Load More
 *
 * 4.0 - Grid Layout
 *
 * 5.0 - Post Grid
 * 
 * 6.0 - Post Slider
 * 
 * 7.0 - Media Queries
 */


/* ==========================================================================
   1.0 Post Title & Meta
   ========================================================================== */

.loft-section .post {
    padding: 0;
    border: none;
}

.loft-section.post-section a,
.no-touch .loft-section.post-section a:hover,
.loft-section.post-section a:focus {
    text-decoration: none;
}

.loft-section .post-title {
    font-size: 24px;
    word-wrap: break-word;
}

.loft-section .loft-slider .post-title {
    font-size: 30px;
    color: inherit;
}

.loft-section.post-section .post-meta {
    text-transform: capitalize;
}

.loft-section.post-section .post-meta > * {
    display: inline-block !important;
}

.loft-section.post-section .post-meta time {
    display: inline;
}

.loft-section.post-section .post-meta > *:after {
    content: " / ";
    opacity: 0.3;
}

.loft-section.post-section .post-meta > *:last-child:after {
    content: "";
}

.loft-section.post-section .post-meta > *:before {
    display: none;
}

.loft-section.post-section.post-grid .post-meta {
    font-size: 12px;
}

.loft-section.post-section .post-excerpt {
    margin-top: 24px;
}

.loft-section.post-section.post-slider .post-meta > * {
    color: inherit;
}


/* ==========================================================================
   2.0 Filter
   ========================================================================== */

.loft-section .filter {
    position: relative;
    z-index: 98;
    display: block;
    width: 100%;
}

.loft-section.grid-list.with-space .filter {
    margin-bottom: -10px;
}

.loft-section .filter span {
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.loft-section .filter ul {
    position: absolute;
    top: 49px;
    display: none;
    width: 100%;
    max-height: 60vh;
    margin: 0;
    background: none;
    overflow: auto;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    text-align: center;
    list-style: none;
}

.loft-section .filter ul li {
    position: relative;
    display: block;
    width: auto;
    border-top: 1px solid #EEE;
    color: inherit !important;
    text-align: center;
}

.loft-section .filter ul li.active {
    display: none;
}

.loft-section .filter ul li:only-child {
    display: block;
}

.loft-section .filter ul li a {
    display: block;
    padding: 15px 30px;
    white-space: nowrap;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    outline-offset: -4px;
    transition: 0.5s;
}

.loft-section .filter .current-filter + ul {
    background: #F5F5F5;
    padding: 0 20px;
}

.loft-section .filter .current-filter + ul li a {
    opacity: 1;
}

.no-touch .loft-section .filter ul li a:hover {
    background: #FFF;
}

.loft-section .filter .current-filter {
    display: block;
    width: 100%;
    padding: 0 20px;
}

.loft-section .filter .current-filter span {
    display: block;
    height: 50px;
    line-height: 50px;
}

.loft-section .filter-title {
    text-align: center;
}

.loft-section .filter .current-filter .arrow {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 9;
    display: block;
    width: 50px;
    height: 50px;
    background: none;
    border: none;
    color: inherit;
    text-align: center;
    cursor: pointer;
}


/* ==========================================================================
   3.0 Pagination
   ========================================================================== */

/* 3.1 Multi-pages
   ========================================================================== */

.loftbuilder-pagination {
    position: relative;
    width: 100%;
    margin-right: 0;
    margin-left: 0;
    clear: both;
}

.loftbuilder-pagination ul {
    padding: 40px 0;
}

.grid-list.with-space .loftbuilder-pagination ul {
    padding: 30px 0 40px;
}

.loftbuilder-pagination ul.page-numbers {
    margin: 0;
    list-style: none;
    text-align: center;
}

.loftbuilder-pagination ul.page-numbers li {
    display: inline;
    margin: 0;
    line-height: 1;
}

.loftbuilder-pagination ul.page-numbers li .page-numbers {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 1px solid;
    box-sizing: content-box;
    line-height: 30px;
    text-align: center;
    opacity: 0.5;
}

.no-touch .loftbuilder-pagination ul.page-numbers li .page-numbers {
    font-size: 12px;
}

.loftbuilder-pagination ul.page-numbers li .page-numbers.current {
    opacity: 0.7;
}

.no-touch .loftbuilder-pagination ul.page-numbers li a.page-numbers:hover,
.loftbuilder-pagination ul.page-numbers li a.page-numbers:focus {
    color: inherit;
    opacity: 1;
}

/* 3.2 Load More
   ========================================================================== */

.loft-section .load-more {
    clear: both;
    padding-top: 10px;
}

.loft-section .grid-list.with-space .load-more {
    padding-top: 0;
}

.loft-section .load-more,
.loft-section .load-more a,
.loft-section .loading-spin,
.loft-section .load-more span {
    display: block;
    width: 100%;
    text-align: center;
}

.loft-section .loading-spin {
    height: 84px;
}

.loft-section.grid-list .loading-spin {
    height: 74px;
}

.loft-section .load-more a,
.loft-section .load-more span {
    line-height: 24px;
    padding: 20px 0 30px;
}

.no-touch .loft-section .load-more a:hover,
.loft-section .load-more a:focus {
    color: inherit;
}

.loft-section .load-more.loading a {
    display: none;
}

.loft-section .load-more .loading-spin {
    padding-top: 16px;
    display: none;
}

.loft-section .load-more.loading .loading-spin {
    display: block;
}

.loft-section .loading-spin circle {
    stroke-dasharray: 252;
    stroke-dashoffset: 25;
    stroke-width: 4;
    fill: none;
    stroke: currentColor;
}

.loft-section .loading-spin svg {
    -webkit-animation: loadingSpin 1s linear infinite;
    animation: loadingSpin 1s linear infinite;
}

@-webkit-keyframes loadingSpin {
    to {
        -webkit-transform: rotate(360deg);
    }
}

@keyframes loadingSpin {
    to {
        transform: rotate(360deg);
    }
}


/* ==========================================================================
   4.0 Grid Layout
   ========================================================================== */

.loft-section.grid-list .post {
    position: relative;
    float: left;
    z-index: 9;
    display: block;
    width: 100%;
    margin: 0;
}

.loft-section.grid-list.with-space .post {
    width: calc(100% - 20px);
    margin: 10px;
}

#loftbuilder-page-content .post-grid .post .container {
    position: static;
    padding: 0;
}


/* ==========================================================================
   5.0 Post Grid
   ========================================================================== */

.loft-section.post-grid .post-title {
    margin-bottom: 0;
}

.loft-section.post-grid .post-meta {
    margin-top: 12px;
}

.loft-section.post-grid .post .featured-img img {
    display: block;
    width: 100%;
}

.loft-section.post-grid .post .featured-img a:hover img,
.loft-section.post-grid .post .featured-img a:focus img {
    opacity: 0.8;
}

.loft-section.post-grid .post .post-content {
    position: relative;
    z-index: 9;
    width: 100%;
    padding: 36px 20px;
    -webkit-box-sizing: border-box;
    -ms-box-sizing: border-box;
    box-sizing: border-box;
}

.no-touch .loft-section.post-grid .post .post-content a:hover,
.loft-section.post-grid .post .post-content a:focus {
    color: inherit;
}

/**
 * Sticky Post
 */

.loft-section.post-section .sticky-post {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 9;
    display: inline-block;
    padding: 5px 10px;
    background: #000;
    color: #FFF;
    overflow: hidden;
    pointer-events: none;
    font-size: 10px;
}


/* ==========================================================================
   6.0 Post Slider
   ========================================================================== */

.loft-section.post-slider .post .featured-img {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    display: none;
    opacity: 0;
}

.loft-section.post-slider .loft-slider .post {
    width: 100%;
    height: 100%;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    background-position: center !important;
    background-color: #222;
    margin: 0;
}

.loft-section.post-slider.fullscreen .post {
    height: 400px;
    min-height: 100vh;
}

.loft-section.post-slider .post a.post-link {
    background: rgba(0, 0, 0, 0.3);
    color: #FFF;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.1);
}


/* ==========================================================================
   7.0 Media Queries
   ========================================================================== */

@media screen and (min-width : 641px) {
    .loft-section.loft-slider .post-title {
        font-size: 36px;
    }
    
    .loft-section.post-grid .post .post-content {
        padding-right: 30px;
        padding-left: 30px;
    }
    
    .loft-section.post-grid:not(.layout-column-one) > .container {
        display: -webkit-box;
        display: -webkit-flex;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-orient: horizontal;
        -webkit-box-direction: normal;
        -webkit-flex-direction: row;
        -ms-flex-direction: row;
        flex-direction: row;
        -webkit-flex-flow: row wrap;
        -ms-flex-flow: row wrap;
        flex-flow: row wrap;
        -webkit-align-items: stretch;
        align-items: stretch;
    }
    
    .loft-section.grid-list .post {
        float: left;
    }
    
    .loft-section.grid-list:not(.layout-column-one) .post {
        width: 50%;
    }
    
    .loft-section.grid-list.with-space:not(.layout-column-one) .post {
        width: calc(50% - 20px);
    }
    
    .loft-section.post-grid.layout-column-two:not(.with-space) .post:nth-of-type(2n+3):last-of-type {
        z-index: 1;
    }
    
    .grid-list.with-space .loftbuilder-pagination ul {
        padding: 40px 0;
    }
    
    .loft-section.grid-list.with-space .load-more {
        padding-top: 10px;
    }
}


@media screen and (min-width : 768px) {
	.loft-section.grid-list.with-space .filter {
		margin-bottom: 0;
	}
}


@media screen and (min-width : 641px) and (max-width : 1024px) {
    .loft-section.post-grid.layout-column-three:not(.with-space) .post:nth-of-type(2n+3):last-of-type,
    .loft-section.post-grid.layout-column-four:not(.with-space) .post:nth-of-type(2n+3):last-of-type {
        z-index: 1;
    }
}


@media screen and (min-width : 1025px) {
    .loft-section.grid-list .filter {
        padding: 18px 0;
    }
    
    .loft-section.grid-list.with-space .filter {
        padding: 8px 0;
    }
    
    .loft-section .filter ul {
        position: relative;
        top: 0;
        display: block;
        box-shadow: none;
    }
    
    .loft-section .filter.align-default ul {
        text-align: left;
    }
    
    .loft-section:not(.fullwidth) .filter.align-default ul li:first-child a {
        padding-left: 0;
    }
    
    .loft-section.with-space .filter.align-default ul li:first-child a {
        padding-left: 10px;
    }
    
    .loft-section .filter.align-reverse ul {
        text-align: right;
    }
    
    .loft-section:not(.fullwidth) .filter.align-reverse ul li:last-child a {
        padding-right: 0;
    }
    
    .loft-section.with-space .filter.align-reverse ul li:last-child a {
        padding-right: 10px;
    }
    
    .loft-section .filter ul li,
    .loft-section .filter ul li.active {
        display: inline-block;
        border: none;
    }
    
    .loft-section .filter ul li a {
        opacity: 0.5;
    }
    
    .no-touch .loft-section .filter ul li a:hover {
        background: none;
    }
    
    .loft-section .filter ul li.active a,
    .no-touch .loft-section .filter ul li a:hover,
    .loft-section .filter ul li a:focus {
        opacity: 1;
        color: inherit;
    }
    
    .loft-section.grid-list.layout-column-three .post {
        width: 33.33%;
    }
    
    .loft-section.grid-list.layout-column-three.with-space .post {
        width: calc(33.33% - 20px);
    }
    
    .loft-section.grid-list.layout-column-four .post {
        width: 25%;
    }
    
    .loft-section.grid-list.layout-column-four.with-space .post {
        width: calc(25% - 20px);
    }
    
    .loft-section.post-grid.layout-column-three:not(.with-space) .post:nth-of-type(3n+4):nth-last-of-type(-n+2),
    .loft-section.post-grid.layout-column-four:not(.with-space) .post:nth-of-type(4n+5):nth-last-of-type(-n+3),
    .loft-section.post-grid.layout-column-three:not(.with-space) .post:nth-of-type(3n+4):nth-last-of-type(-n+2) ~ .post,
    .loft-section.post-grid.layout-column-four:not(.with-space) .post:nth-of-type(4n+5):nth-last-of-type(-n+3) ~ .post {
        z-index: 1;
    }
}