/*
 Theme Name:   Newsmatic Child
 Theme URI:    https://fashiondiver.com
 Description:  Child theme for Newsmatic
 Author:       Ali Haider
 Template:     newsmatic
 Version:      1.0.0
*/

/* Front page - shared modern design tokens */
:root {
    --fd-accent: #1b8415;
    --fd-radius: 10px;
    --fd-card-shadow: 0 2px 10px rgba(20, 20, 20, .06);
    --fd-card-shadow-hover: 0 10px 24px rgba(20, 20, 20, .12);
    --fd-border: #eef0ee;
}

/* Remove profile/user icon before author name on all post cards */
.post-meta .byline::before,
.post-meta .byline:before,
.post-meta .author::before,
.post-meta .author:before,
.post-meta .author_name::before,
.post-meta .author_name:before,
.post-meta .byline i,
.post-meta .byline svg,
.post-meta .byline img,
.post-meta .byline .avatar,
.post-element .byline::before,
.post-element .byline:before,
.post-element .author::before,
.post-element .author:before {
    display: none !important;
    content: none !important;
}

/* Front page ad banner - fixed short strip, image is cropped to fit */
.ad-banner-section .ad-banner-wrap {
    width: 100%;
    height: 150px;
    max-height: 150px;
    overflow: hidden;
    text-align: center;
    border-radius: var(--fd-radius);
}
.ad-banner-section .ad-banner-wrap img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}
@media (max-width: 480px) {
    .ad-banner-section .ad-banner-wrap,
    .ad-banner-section .ad-banner-wrap img {
        height: 100px;
        max-height: 100px;
    }
}

/* Front page hero - own layout, independent of parent theme's
   slick-carousel-dependent .main-banner-slider markup */
.fd-hero-section .newsmatic-container {
    padding-top: 20px;
    padding-bottom: 20px;
}
.fd-hero {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 16px;
    align-items: stretch;
}
.fd-hero-main,
.fd-hero-feature {
    height: 100%;
    min-height: 360px;
}
.fd-hero-feature {
    position: relative;
    display: block;
    border-radius: var(--fd-radius);
    overflow: hidden;
    background: #eee;
    box-shadow: var(--fd-card-shadow);
}
.fd-hero-feature-thumb {
    position: absolute;
    inset: 0;
    display: block;
}
.fd-hero-feature-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.fd-hero-feature:hover .fd-hero-feature-thumb img {
    transform: scale(1.04);
}
.fd-hero-feature-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, .8), rgba(0, 0, 0, 0));
    color: #fff;
    z-index: 1;
}
.fd-hero-feature-content .post-title a {
    color: #fff;
}
.fd-hero-feature-content .post-excerpt {
    color: #eee;
    margin-top: 8px;
}
.fd-hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
}
.fd-hero-tile {
    position: relative;
    display: block;
    border-radius: var(--fd-radius);
    overflow: hidden;
    min-height: 172px;
    background: #eee;
    box-shadow: var(--fd-card-shadow);
}
.fd-hero-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.fd-hero-tile:hover img {
    transform: scale(1.06);
}
.fd-hero-tile .post-element-wrap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, .75), rgba(0, 0, 0, 0));
    z-index: 1;
}
.fd-hero-tile .post-title a {
    color: #fff;
    font-size: 14px;
    line-height: 1.3;
}
@media (max-width: 991px) {
    .fd-hero {
        grid-template-columns: 1fr;
    }
    .fd-hero-main,
    .fd-hero-feature {
        min-height: 280px;
    }
}
@media (max-width: 480px) {
    .fd-hero-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    .fd-hero-tile {
        min-height: 200px;
    }
}

/* Front page section top accent border + card look, used across all front-page blocks */
.newsmatic-section .primary-content > div,
.secondary-sidebar .widget,
#full-width-section .row > div,
#bottom-full-width-section .row > div {
    position: relative;
    border-radius: var(--fd-radius);
    box-shadow: var(--fd-card-shadow);
}
.newsmatic-section .primary-content > div:before,
.secondary-sidebar .widget:before,
#full-width-section .row > div:before,
#bottom-full-width-section .row > div:before {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--theme-block-top-border-color, var(--fd-accent));
    margin-top: -3px;
    border-radius: var(--fd-radius) var(--fd-radius) 0 0;
}
.newsmatic-block-title {
    font-weight: 700;
}

/* Post grid cards - lift + shadow on hover, rounded thumbnails */
.news-grid .news-grid-post-wrap article.grid-item {
    transition: transform .25s ease;
}
.news-grid .news-grid-post-wrap article.grid-item .post-thumb-wrap {
    border-radius: var(--fd-radius) var(--fd-radius) 0 0;
    overflow: hidden;
}
.news-grid .news-grid-post-wrap article.grid-item .post-element {
    border-radius: 0 0 var(--fd-radius) var(--fd-radius);
    box-shadow: var(--fd-card-shadow);
}
.news-grid .news-grid-post-wrap article.grid-item:hover {
    transform: translateY(-4px);
}
.news-grid .news-grid-post-wrap article.grid-item:hover .post-element {
    box-shadow: var(--fd-card-shadow-hover);
}
.news-grid .news-grid-post-wrap article.grid-item .post-title a {
    transition: color .2s ease;
}
.news-grid .news-grid-post-wrap article.grid-item .post-title a:hover {
    color: var(--fd-accent);
}

/* Front page "Latest posts" category filter tabs */
.fd-filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}
.fd-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}
.fd-filter-tab {
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #8a8a8a;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    transition: color .2s ease, border-color .2s ease;
}
.fd-filter-tab:hover {
    color: var(--fd-accent);
}
.fd-filter-tab.is-active {
    color: var(--fd-accent);
    border-bottom-color: var(--fd-accent);
}
.news-grid .news-grid-post-wrap.fd-filter-panel {
    display: none;
}
.news-grid .news-grid-post-wrap.fd-filter-panel.is-active {
    display: flex;
}

/* Front page sidebar - hardcoded "Popular" widget, 2x2 image grid */
.fd-popular-posts-widget {
    margin-bottom: 20px;
}
.fd-popular-posts-widget .widget-title {
    margin-bottom: 16px;
}
.fd-popular-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.fd-popular-tile a {
    position: relative;
    display: block;
    border-radius: var(--fd-radius);
    overflow: hidden;
    background: #eee;
}
.fd-popular-tile img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}
.fd-popular-tile a:hover img {
    transform: scale(1.06);
}
.fd-popular-tile .post-categories {
    position: absolute;
    top: 8px;
    left: 8px;
    right: auto;
    bottom: auto;
    margin: 0;
    line-height: 0;
}
.fd-popular-tile .post-categories li {
    margin: 0;
}
.fd-popular-tile .post-categories a {
    background: var(--fd-accent);
    color: #fff;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
}
.fd-popular-tile .post-title {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}
.fd-popular-tile .post-title a:hover {
    color: var(--fd-accent);
}

/* Front page secondary grid (3 latest posts row) - tighter card gap to match hero grid */
#secondary-grid-section .news-grid-post-wrap {
    margin-left: -6px;
    margin-right: -6px;
}
#secondary-grid-section .news-grid-post-wrap article.grid-item {
    padding-left: 6px;
    padding-right: 6px;
}