/**
 * Quess Post Filter — post-filter.css  v1.0
 * Contains: sidebar, search, category tabs, year dropdown,
 *           tag pills, results grid, featured/regular post cards,
 *           load-more, mobile responsive, layout wrappers.
 */

/* ══════════════════════════════════════════════════════
   LAYOUT WRAPPERS (widget output)
══════════════════════════════════════════════════════ */
.qpf-full-layout {
    display: grid;
    gap: 40px;
}
.qpf-layout-sidebar-left  { grid-template-columns: 260px 1fr; }
.qpf-layout-sidebar-right { grid-template-columns: 1fr 260px; }
.qpf-layout-stacked       { grid-template-columns: 1fr; }

@media (max-width: 1024px) {
    .qpf-layout-sidebar-left,
    .qpf-layout-sidebar-right { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════ */
.post-filter-sidebar { background: #fff; padding: 0; }

.filter-section        { margin-bottom: 0; }
.filter-section-title  {
    font-size: 1.25vw; font-weight: 600; color: #0095DA;
    margin-bottom: 15px; line-height: 30px;
}

/* ── Search ── */
.filter-search {
    position: relative; margin-bottom: 30px; width: 100%;
}
.filter-search-input {
    width: 100% !important; padding: 16px 24px !important;
    border-bottom: 1px solid #9B9C9C !important;
    border-radius: 8px !important; font-size: 1.15vw !important;
    transition: border-color 0.3s !important;
    border: none !important; letter-spacing: -0.72px;
    box-shadow: none !important;
}
.filter-search-input:focus { outline: none; border-color: #0095DA; }
.filter-search-input::placeholder { color: #999; }
.search-icon {
    position: absolute; right: 0; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    font-size: 18px; color: #666; box-shadow: none;
}
.search-icon:hover { background-color: transparent; }
input#post-search { border-bottom: 1px solid #9B9C9C !important; box-shadow: none; }

/* ── Category tabs ── */
.filter-category-tabs { margin-bottom: 60px; }
.category-tabs {
    list-style: none; padding: 0 !important; margin: 0 !important;
    display: flex; flex-direction: column;
}
.category-tabs li { margin: 0; }
.category-tab {
    display: block; padding: 8px 15px; text-decoration: none;
    border-left: 1px solid rgba(35,169,205,0.2);
    transition: all 0.3s; color: #363939;
    font-size: 1.12vw; font-weight: 400;
    letter-spacing: -0.64px;
}
.category-tab:hover { color: #363939; }
.category-tab.active {
    border-left: 3px solid #0095DA; color: #363939;
    font-size: 1.12vw; font-weight: 600;
    line-height: 15px; letter-spacing: -0.64px;
}
.category-tab, .category-tab:focus, .category-tab:active {
    outline: none; box-shadow: none; text-decoration: none !important;
}

/* ── Year dropdown ── */
.filter-year { margin-bottom: 30px; }
.year-dropdown { position: relative; }
.year-dropdown-toggle {
    width: 68%; padding: 16px 20px;
    background: #363939 !important; color: #fff;
    border: none; border-radius: 8px; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    font-size: 1.15vw; font-weight: 500; transition: background-color 0.3s;
}
.year-dropdown-toggle:hover { background: #3d3d3d; }
.year-dropdown-toggle.open .dropdown-arrow { transform: rotate(180deg); }
.dropdown-arrow { font-size: 12px; transition: transform 0.3s; }
.dropdown-arrow img { width: 80%; }
.year-dropdown-menu {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border: 1px solid #e0e0e0;
    border-radius: 8px; margin-top: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100; max-height: 300px; overflow-y: auto;
    width: 68%; margin: 0 !important; padding: 0 !important;
}
.year-dropdown-menu li { list-style: none; }
.year-dropdown-menu a {
    display: block; padding: 10px 15px; color: #666;
    text-decoration: none !important; font-size: 1.12vw;
    transition: background-color 0.3s;
}
.year-dropdown-menu a:hover { background-color: #f5f5f5; color: #333; }

/* ── Tags ── */
.tags-list {
    list-style: none; padding: 0 !important; margin: 0 !important;
}
.tags-list .tag-link,
.tags-list .tag-link:focus,
.tags-list .tag-link:active {
    outline: none !important; box-shadow: none;
    text-decoration: none !important;
}
.tag-link {
    display: block; padding: 12px 15px; text-decoration: none;
    border-left: 1px solid rgba(35,169,205,0.2);
    transition: all 0.3s; color: #363939;
    font-size: 1.12vw; font-weight: 400; letter-spacing: -0.64px;
}
.tag-link.active {
    border-left: 3px solid #0095DA; color: #363939;
    font-size: 1.12vw; font-weight: 600;
    line-height: 10px; letter-spacing: -0.64px;
}

/* ══════════════════════════════════════════════════════
   RESULTS GRID
══════════════════════════════════════════════════════ */
.post-filter-results { min-height: 400px; }

.posts-grid {
    display: grid; grid-template-columns: repeat(2,1fr);
    gap: 30px; transition: opacity 0.3s;
}
.posts-grid.is-reports { grid-template-columns: 1fr; }

/* ══════════════════════════════════════════════════════
   FEATURED POST
══════════════════════════════════════════════════════ */
.post-item-featured { grid-column: 1 / -1; }
.post-reports.post-item-featured { grid-column: 1; }

.featured-content-wrapper {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 30px; align-items: center;
    background: #fff; border-radius: 8px; overflow: hidden;
}
.featured-thumbnail {
    position: relative; overflow: hidden; height: 100%;
}
.featured-thumbnail img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.3s; border-radius: 16px;
}
.featured-content { padding: 40px; }
.post-featured-badge {
    display: inline-block; letter-spacing: -0.56px;
    color: #686A6A; font-size: 1.12vw; font-weight: 600; margin-bottom: 15px;
}
.post-item-featured .post-title {
    margin: 0 0 10px; font-size: 1.8vw; line-height: 1.3;
}
.post-item-featured .post-title a {
    color: #333; text-decoration: none; transition: color 0.3s;
}
.post-item-featured .post-title a:hover { color: #0095DA; }

/* Featured meta row */
.post-item-featured .post-meta-row {
    display: flex; align-items: center; justify-content: space-between;
}
.post-item-featured .post-meta {
    display: flex; align-items: center; gap: 12px; margin-bottom: 0;
}
.post-item-featured .post-read-more {
    opacity: 0; transform: translateX(-8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: inline-flex; align-items: center; gap: 8px;
    color: #000; text-decoration: none !important;
    font-size: 1.15vw; font-weight: 600;
    position: absolute; bottom: 0;
}
.post-item-featured:hover .post-read-more { opacity: 1; transform: translateX(0); }

/* ══════════════════════════════════════════════════════
   REGULAR POST CARD
══════════════════════════════════════════════════════ */
.post-item:not(.post-item-featured) {
    position: relative; background: #fff; border-radius: 8px;
    overflow: visible; transition: transform 0.4s cubic-bezier(0.4,0,0.2,1),
        box-shadow 0.4s cubic-bezier(0.4,0,0.2,1),
        border-color 0.4s cubic-bezier(0.4,0,0.2,1);
    border: 2px solid transparent;
}
.post-item:not(.post-item-featured) > * { overflow: hidden; }

/* Partial border default */
.post-item:not(.post-item-featured)::before {
    content: ''; position: absolute; right: -2px; bottom: 0;
    width: 0; height: 60%;
    background: linear-gradient(to top, rgba(35,169,205,0.6), transparent);
    border-bottom-right-radius: 8px;
    transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
}
.post-item:not(.post-item-featured)::after {
    content: ''; position: absolute; bottom: 0; right: 0;
    width: 60%; height: 60%;
    border-right: 2px solid rgba(0,0,0,0.11);
    border-bottom: 1px solid rgba(0,0,0,0.11);
    box-sizing: border-box; border-bottom-right-radius: 8px;
}
/* Hover full gradient border */
.post-item:not(.post-item-featured):hover {
    border: 1px solid transparent;
    background: linear-gradient(#fff,#fff) padding-box,
        linear-gradient(167deg, #0095DA 18.67%, #013356 72.89%) border-box;
}

/* Thumbnail */
.post-thumbnail {
    position: relative; overflow: hidden; aspect-ratio: 16/9;
}
.post-thumbnail img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
    border-radius: 8px 8px 0 0;
}

/* Content */
.post-content { padding: 25px; }
.post-title {
    margin: 0 0 15px; font-size: 1.25vw; line-height: normal;
    letter-spacing: -0.96px; font-weight: 600;
}
h3.post-title { width: 85%; }
.post-title a { color: #000; text-decoration: none !important; transition: color 0.3s; }
.post-title a:hover { color: #0095DA; }

.post-meta {
    display: flex; align-items: center; gap: 15px; margin-bottom: 0;
}
.post-date {
    color: #686A6A; font-size: 1.12vw; font-weight: 600;
    letter-spacing: -0.64px;
}
.post-date::before {
    content: "•"; margin-right: 15px;
    color: #5E5E5E; opacity: 0.6;
}
.post-category {
    color: #000; font-size: 16px; font-weight: 600; letter-spacing: -0.64px;
}
.post-tags {
    color: #000; font-size: 1.12vw; font-weight: 600; letter-spacing: -0.64px;
}
.post-meta-row {
    display: flex; align-items: center; justify-content: space-between;
}
.post-read-more {
    opacity: 0; transform: translateX(-8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: inline-flex; align-items: center; gap: 8px;
    color: #000; text-decoration: none;
    font-size: 18px; font-weight: 600; letter-spacing: -0.72px;
}
.post-read-more img { width: 18px; height: auto; }
.post-item:hover .post-read-more { opacity: 1; transform: translateX(0); }

/* ══════════════════════════════════════════════════════
   REPORTS LAYOUT
══════════════════════════════════════════════════════ */
.post-reports .featured-content-wrapper {
    display: flex; gap: 32px; align-items: start;
}
.post-reports .featured-thumbnail {
    min-height: 15vw; width: 38%; border-radius: 8px;
}
.post-reports .featured-thumbnail img {
    min-height: 15vw; border-radius: 8px;
}
.post-reports .featured-content {
    padding: 0 32px 0 0; display: flex; flex-direction: column;
    height: -webkit-fill-available; width: 60%; position: relative;
}
.post-reports .post-title {
    font-size: 1.6vw; line-height: 1.3; margin-bottom: 12px; font-weight: 700;
}
.post-reports .post-excerpt {
    margin-bottom: 20px; font-size: 1.15vw; line-height: 133.33%; color: #666;
}
.post-reports .post-meta-row {
    margin-top: auto; position: absolute; bottom: 0; width: 100%;
}
.post-reports .post-featured-badge { display: none; }
.post-reports.post-item-featured .post-read-more {
    opacity: 0; transform: translateX(-8px);
    transition: opacity 0.3s ease, transform 0.3s ease; position: relative;
}
.post-reports.post-item-featured:hover .post-read-more { opacity: 1; transform: translateX(0); }

/* ══════════════════════════════════════════════════════
   CASE STUDIES LAYOUT
══════════════════════════════════════════════════════ */
#post-results[data-category="case-studies"] .posts-grid,
#post-results[data-category="casestudy"] .posts-grid {
    display: grid; grid-template-columns: repeat(2,1fr); gap: 50px;
}
#post-results[data-category="case-studies"]
.posts-grid > .post-item:first-child .featured-content-wrapper,
#post-results[data-category="casestudy"]
.posts-grid > .post-item:first-child .featured-content-wrapper {
    display: flex; flex-direction: column; gap: 0;
}
#post-results[data-category="case-studies"]
.posts-grid > .post-item:first-child .featured-thumbnail {
    width: 100%; height: 50vh; position: relative;
}
#post-results[data-category="case-studies"]
.posts-grid > .post-item:first-child .featured-thumbnail img {
    width: 100%; height: 100%; object-fit: cover;
}
#post-results[data-category="case-studies"]
.posts-grid > .post-item:first-child .post-featured-badge {
    position: absolute; top: 16px; left: 16px; z-index: 2;
    background: #fff; padding: 6px 12px; border-radius: 6px;
    font-size: 14px; font-weight: 600;
}
#post-results[data-category="case-studies"]
.posts-grid > .post-item:first-child .featured-content {
    padding: 24px 0 0; width: 100%; display: flex; flex-direction: column;
}
#post-results[data-category="case-studies"] .post-item.post-casestudy,
#post-results[data-category="casestudy"] .post-item.post-casestudy {
    display: flex; flex-direction: column; height: 100%; border-color: transparent;
}
#post-results[data-category="case-studies"] .post-thumbnail {
    width: 100%; height: 220px; overflow: hidden; border-radius: 8px;
}
#post-results[data-category="case-studies"] .post-thumbnail img {
    width: 100%; height: 100%; object-fit: cover;
}
#post-results[data-category="case-studies"] .post-content {
    padding: 25px 0; display: flex; flex-direction: column; flex-grow: 1;
}
#post-results[data-category="case-studies"] .post-meta-row {
    display: flex; justify-content: space-between;
    align-items: center; margin-top: auto;
}

/* Blogs featured */
#post-results[data-category="blogs"]
.posts-grid > .post-item:first-child .featured-thumbnail { height: 23vw; }
#post-results[data-category="blogs"]
.posts-grid > .post-item:first-child .featured-content {
    padding: 0 20px; position: relative; height: 15vw;
}

/* ══════════════════════════════════════════════════════
   LOAD MORE
══════════════════════════════════════════════════════ */
.load-more-wrapper { margin-top: 50px; text-align: center; }
.load-more-btn {
    padding: 16px 24px; background: #363939; color: #fff;
    border: none; border-radius: 8px; font-size: 18px;
    font-weight: 600; cursor: pointer; transition: all 0.3s;
    letter-spacing: -0.72px;
}
.load-more-btn:hover:not(:disabled) {
    background: #007ab8; transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,149,218,0.4);
}
.load-more-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════
   NO RESULTS
══════════════════════════════════════════════════════ */
.no-posts-found { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: #999; }
.no-posts-found p { font-size: 16px; }

/* ══════════════════════════════════════════════════════
   RESPONSIVE — desktop breakpoints
══════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .posts-grid { grid-template-columns: 1fr; }
    .featured-content-wrapper { grid-template-columns: 1fr; gap: 0; }
    .featured-thumbnail { min-height: 250px; }
    .featured-content { padding: 30px; }
    .post-item-featured .post-title { font-size: 24px; }
    .post-reports .featured-content-wrapper { flex-direction: column; }
    .post-reports .featured-thumbnail { width: 100%; min-height: 280px; }
    .post-reports .featured-thumbnail img { border-radius: 12px 12px 0 0; }
    .post-reports .featured-content { padding: 24px; width: 100%; }
}
@media (max-width: 768px) {
    .category-tabs { flex-direction: column; }
    .category-tab  { font-size: 14px; padding: 10px 12px; }
    .featured-content { padding: 25px; }
    .post-item-featured .post-title { font-size: 20px; }
/*     .post-filter-sidebar { margin-bottom: 30px; } */
    .filter-section-title { font-size: 16px; }
    .post-reports .post-title { font-size: 20px; }
    .post-reports .post-excerpt { font-size: 14px; }
	.filter-year {
    margin-bottom: 0px;
}
}

/* ══════════════════════════════════════════════════════
   MOBILE SIDEBAR
══════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* Hide desktop-only elements */
    .post-filter-sidebar .filter-category-tabs,
    .post-filter-sidebar .filter-tags .filter-section-title { display: none !important; }
    .post-filter-sidebar .year-dropdown-toggle,
    .post-filter-sidebar .year-dropdown-menu { display: none !important; }
    .search-icon { display: none !important; }
    .post-filter-sidebar .filter-search { display: none !important; }

    .post-filter-sidebar { background: #f5f7f8; padding: 0; }

    /* Category dropdown */
    .mobile-category-dropdown {
        display: block !important; background: #EBF6FC; padding: 0; margin-bottom: 0;
    }
    .mobile-category-toggle {
        width: 100%; background: transparent; border: none;
        padding: 18px 20px; display: flex; justify-content: space-between;
        align-items: center; cursor: pointer; font-size: 18px;
        font-weight: 600; color: #0095DA; letter-spacing: -0.5px; box-shadow: none;
    }
    .mobile-category-toggle:hover,
    .mobile-category-toggle:focus { background: transparent !important; box-shadow: none !important; outline: none; }
    .mobile-dropdown-arrow { transition: transform 0.3s; display: flex; align-items: center; }
    .mobile-dropdown-arrow svg { width: 20px; height: 20px; stroke: #0095DA; fill: none; }
    .mobile-category-toggle.open .mobile-dropdown-arrow { transform: rotate(180deg); }
    .mobile-category-menu {
        display: none; background: #fff; border-top: 1px solid #e0e0e0;
        box-shadow: 0 6px 16px rgba(0,0,0,0.12);
        position: absolute; left: 0; right: 0; z-index: 999;
    }
    .mobile-category-menu.open { display: block; }
    .mobile-category-menu a {
        display: block; padding: 18px 24px; font-size: 16px; font-weight: 500;
        color: #363939; text-decoration: none !important;
        border-bottom: 1px solid rgba(0,0,0,0.06); transition: background 0.2s;
    }
    .mobile-category-menu a:last-child { border-bottom: none; }
    .mobile-category-menu a.active { color: #0095DA; font-weight: 600; }

    /* Year nav bar */
    .mobile-year-nav {
        display: flex !important; align-items: center; justify-content: space-between;
        padding: 16px 20px; background: #fff;
        border-bottom: 1px solid #e8e8e8; margin-bottom: 0;
    }
    .mobile-year-nav .year-prev,
    .mobile-year-nav .year-next {
        background: none; border: none; cursor: pointer; padding: 4px 8px;
        color: #888; font-size: 16px; display: flex; align-items: center; box-shadow: none;
    }
    .mobile-year-nav .year-prev:hover,
    .mobile-year-nav .year-next:hover { background: transparent !important; color: #0095DA; }
    .mobile-year-nav .year-prev svg,
    .mobile-year-nav .year-next svg { width: 16px; height: 16px; stroke: #888; fill: none; }
    .year-label {
        font-size: 15px; font-weight: 500; color: #363939;
        letter-spacing: -0.3px; flex: 1; text-align: center;
    }
    .year-search-btn {
        background: none; border: none; cursor: pointer;
        padding: 4px 8px; display: flex; align-items: center; box-shadow: none;
    }
    .year-search-btn:hover { background: transparent !important; }
    .year-search-btn svg { width: 20px; height: 20px; stroke: #666; fill: none; }

    /* Slide-in search bar */
    .mobile-search-bar {
        display: none; padding: 12px 16px; background: #fff;
        border-bottom: 1px solid #e8e8e8;
    }
    .mobile-search-bar.open { display: flex; align-items: center; gap: 8px; }
    .mobile-search-bar .filter-search-input {
        flex: 1; padding: 10px 14px !important;
        border: 1px solid #E0E0E0 !important; border-radius: 8px !important;
        font-size: 14px !important; background: #f9f9f9;
        box-shadow: none !important; border-bottom: 1px solid #e0e0e0 !important;
    }
    .mobile-search-close {
        background: none; border: none; cursor: pointer;
        padding: 4px; color: #999; box-shadow: none; flex-shrink: 0;
    }
    .mobile-search-close svg { width: 18px; height: 18px; stroke: #999; fill: none; }

    /* Tag pills */
    .post-filter-sidebar .filter-tags {
        display: block !important; padding: 14px 16px 4px; background: #fff;
    }
    .post-filter-sidebar .tags-list {
        display: flex !important; flex-direction: row !important;
        flex-wrap: nowrap !important; overflow-x: auto !important;
        gap: 10px !important; padding-bottom: 10px !important;
        -ms-overflow-style: none; scrollbar-width: none;
    }
    .post-filter-sidebar .tags-list::-webkit-scrollbar { display: none; }
    .post-filter-sidebar .tags-list li { flex-shrink: 0; }
    .post-filter-sidebar .tag-link {
        display: inline-block !important; padding: 8px 18px !important;
        border: 1.5px solid #E0E0E0 !important;
        border-left: 1.5px solid #E0E0E0 !important;
        border-radius: 100px !important; font-size: 13px !important;
        font-weight: 500 !important; color: #363939 !important;
        white-space: nowrap; background: #fff;
        line-height: normal !important; letter-spacing: -0.3px;
        transition: all 0.2s ease;
    }
    .post-filter-sidebar .tag-link.active {
        background: #EBF6FC !important; border-color: #0095DA !important;
        color: #0095DA !important; font-weight: 600 !important;
        border-left: 1.5px solid #0095DA !important;
    }

    /* Results on mobile */
    #post-results .posts-grid.is-grid { grid-template-columns: repeat(1,1fr); }
    #post-results h3.post-title a { font-size: 1.4rem; }
    #post-results .post-meta span.post-tags,
    #post-results .post-meta span.post-date,
    #post-results span.post-featured-badge { font-size: 1rem; }
    #post-results h3.post-title { width: 100%; }
    #post-results .post-content { padding: 15px; }
    #post-results .post-item.post-blogs:hover { border: unset; background: unset; transition: unset; }
    #post-results .post-item-featured:hover .post-read-more { display: none; }
    #post-results .post-item:not(.post-item-featured):hover .post-read-more { display: none; }
}

/* Desktop: hide mobile-only elements */
@media (min-width: 769px) {
    .mobile-category-dropdown,
    .mobile-year-nav,
    .mobile-search-bar { display: none !important; }
}
