/**
 * StepForth Related Articles Grid + Prev/Next Navigation CSS
 * Replaces Divi Pixel's dipi-related-articles and dipi-post-nav-section
 * 
 * File: /wp-content/themes/SF-DiviBased-2022/css/related-articles.css
 * Version: 1.0.0
 */

/* ============================================================
   PREV / NEXT POST NAVIGATION
   Replicates: .dipi-post-nav-section, .dipi-post-row
   ============================================================ */

.sf-post-nav-section {
    padding: 0;
}

.sf-post-nav-row {
    max-width: 1280px;
    margin: auto;
    padding: 20px 0 !important;
    border-top: 1px solid #f2f2f2;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sf-post-nav-left,
.sf-post-nav-right {
    padding: 10px;
    border-radius: 50px;
    border-width: 0;
    border-style: solid;
    background-color: #f5f5f5;
    transition: 0.6s ease-in-out;
}

.sf-post-nav-left:hover,
.sf-post-nav-right:hover {
    background-color: #140f3c;
}

.sf-post-nav-left a,
.sf-post-nav-right a {
    display: flex;
    align-items: center;
    font-family: 'Rubik', Helvetica, Arial, Lucida, sans-serif;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0;
    color: #2c3d49;
    text-decoration: none;
    transition: 0.5s ease-in-out;
    padding: 0 5px;
}

.sf-post-nav-left:hover a,
.sf-post-nav-right:hover a {
    color: #ffffff;
    transition: 0.3s ease-in-out;
}

.sf-nav-arrow {
    font-size: 20px;
    line-height: 0;
    vertical-align: middle;
}

.sf-nav-arrow-prev {
    padding-right: 5px;
}

.sf-nav-arrow-next {
    padding-left: 5px;
}


/* ============================================================
   RELATED ARTICLES GRID
   Replicates: .dipi-related-articles, .dipi-related-article-column
   ============================================================ */

.sf-related-articles {
    padding: 25px 0;
    max-width: 1280px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0);
    background-size: cover;
    background-repeat: repeat;
    background-position: center center;
}

.sf-related-articles-title {
    text-align: center;
    margin-bottom: 25px;
    font-family: 'Inter', Helvetica, Arial, Lucida, sans-serif;
    font-size: 22px !important;
    color: #2c3d49 !important;
    letter-spacing: 0 !important;
    font-weight: 600 !important;
    transition: 0.5s ease-in-out;
    padding-bottom: 0;
}

/* Row layout */
.sf-related-articles-row {
    display: flex;
    flex: 1 1 auto;
    padding: 1% 0;
}

/* Individual card column */
.sf-related-article-column {
    width: 31.333%;
    margin-right: 3%;
    display: block;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    border-width: 0;
    border-style: solid;
    background: #ffffff;
    transition-duration: 0.6s;
}

.sf-related-article-column:last-child {
    margin-right: 0 !important;
}

.sf-related-article-column:hover {
    transition-duration: 0.6s;
}

/* Content wrapper */
.sf-related-article-content {
    overflow: hidden;
    position: relative;
    height: 100%;
}

.sf-related-article-content a {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

/* Thumbnail wrapper */
.sf-related-article-thumb-wrap {
    overflow: hidden;
}

.sf-related-article-thumb {
    overflow: hidden;
    position: relative;
    transition: 0.6s ease-in-out;
    transform: scale(1);
}

.sf-related-article-column:hover .sf-related-article-thumb {
    transform: scale(1.1);
    transition: 0.6s ease-in-out;
}

/* Image styling */
.sf-related-article-thumb img {
    object-fit: cover;
    transform-origin: center bottom 0;
    display: block;
    position: relative;
    overflow: hidden;
    max-width: 100%;
    width: 100%;
    height: 200px !important;
    min-height: auto;
}

/* Image overlay */
.sf-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: block;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    transition: 0.3s ease-in-out;
}

.sf-related-article-column:hover .sf-image-overlay {
    transition: 0.3s ease-in-out;
}

/* Bottom overlay with gradient - title area */
.sf-related-article-bottom {
    display: flex;
    align-items: center;
    bottom: 0;
    position: absolute;
    width: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0) 0px, rgba(0, 0, 0, 0.6) 100%) rgba(0, 0, 0, 0);
}

/* Title styling */
.sf-related-article-title {
    font-family: 'Inter', Helvetica, Arial, Lucida, sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 20px;
    letter-spacing: 0;
    color: #ffffff;
    text-shadow: 0 4px 10px rgba(7, 15, 27, 0.4);
    padding-left: 15px;
    padding-top: 20px;
    padding-bottom: 15px;
    padding-right: calc(45px);
    transition: 0.6s ease-in-out;
    margin: 0;
}

/* Arrow icon */
.sf-related-article-arrow {
    position: absolute;
    right: 5px;
    bottom: 10px;
    padding: 0 10px;
    opacity: 0;
    transition: 0.6s ease-in-out;
    transform: translateX(-5px);
}

.sf-related-article-column:hover .sf-related-article-arrow {
    opacity: 1;
    transition: 0.6s ease-in-out;
    transform: translateX(0);
}

.sf-readmore-arrow {
    font-size: 20px;
    color: #ffffff;
}


/* ============================================================
   RESPONSIVE STYLES
   ============================================================ */

/* Tablet */
@media (max-width: 980px) {
    .sf-related-articles-row {
        flex-flow: row wrap;
    }

    .sf-related-article-column {
        width: 48%;
        margin-right: 4%;
    }

    .sf-related-article-column:nth-child(2n) {
        margin-right: 0;
    }

    .sf-related-article-column:nth-child(2n+1) {
        clear: both;
    }

    .sf-post-nav-row {
        padding: 20px 5% !important;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .sf-related-articles-row {
        flex-flow: column;
    }

    .sf-related-article-column {
        width: 100%;
        margin-right: 0;
    }

    .sf-post-nav-row {
        padding: 15px 5% !important;
    }

    .sf-related-articles {
        padding: 20px 5%;
    }
}
