/* ============================================================
   Blog Listing Page (/blogs)
   ============================================================ */

/* Respect reduced-motion preference: kill all custom motion, keep instant state changes */
@media (prefers-reduced-motion: reduce) {
    .category_pills .pill,
    .blog_card,
    .blog_card .thumb_wrap img,
    .blog_card .thumb_wrap .thumb_placeholder_icon,
    .blog_card h3,
    .blog_card .btnDetails svg,
    .blog_grid,
    .blog_grid .blog_card {
        transition: none !important;
        animation: none !important;
    }
}

.trad_list_1 .search_box {
    transition: border-color .2s ease, box-shadow .2s ease;
}

.trad_list_1 .search_box:focus-within {
    border-color: #0C2E16;
    box-shadow: 0 0 0 3px rgba(12, 46, 22, .12);
}

/* The shared .search_box wrapper's padding isn't part of the <input>'s own
   hit area, leaving too small a real tap target on touch devices. Scoped to
   this page's input only — doesn't touch the shared .search_box class. */
#blogSearchInput {
    padding: 11px 0;
}

.blog_list_wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px 60px;
}

/* The site-wide fixed "Get your 3 quotes now" tab (.quote_btn_left) measures
   28.19px wide below 768px (zoom: 0.6 override in responsive.css) and
   42.3px at 768px and above (base zoom: 0.9 in style.css), plus it scales
   1.05x on hover — so padding needs to clear 28.19*1.05 ≈ 30px / 42.3*1.05
   ≈ 45px respectively. Applied equally on both sides (not just left) so
   the content block stays visually centered rather than shifting left.
   Scoped to this page only — blog_list.css is only loaded on /blogs. */
.trad_list_1,
.blog_list_wrap {
    padding-left: 30px;
    padding-right: 30px;
}

@media (min-width: 768px) {
    .trad_list_1,
    .blog_list_wrap {
        padding-left: 45px;
        padding-right: 45px;
    }
}

/* ---------------- Category pills ---------------- */
.category_pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
}

.category_pills .pill {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50px;
    padding: 8px 18px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: transform .3s ease-out, box-shadow .3s ease-out, background-color .3s ease-out, color .3s ease-out;
}

.category_pills .pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
}

.category_pills .pill:not(.active):hover {
    background: #f3f4f6;
}

.category_pills .pill:active {
    transform: scale(.96);
}

.category_pills .pill.active {
    background: #0C2E16;
    color: #CFFF7F;
    border-color: #0C2E16;
}

/* ---------------- Results count ---------------- */
.blog_list_wrap .results {
    font-size: 15px;
    color: #555;
    margin-bottom: 18px;
}

/* ---------------- Grid ---------------- */
.blog_grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    transition: opacity .2s ease;
}

.blog_grid.is-loading {
    opacity: .4;
}

/* Entrance animation — fires once when cards are inserted (page load / new
   search or filter results). Not scroll-linked: cards never re-animate on
   scroll, only when the underlying result set changes. */
@keyframes blogCardIn {
    from { opacity: 0; transform: translateY(16px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.blog_card.card-enter {
    animation: blogCardIn .4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@media (max-width: 992px) {
    .blog_grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .blog_grid { grid-template-columns: 1fr; }
    .category_pills { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; }
}

/* ---------------- Card ---------------- */
.blog_card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .25s ease-out, transform .25s ease-out;
    will-change: transform;
}

.blog_card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,.12);
}

.blog_card:active {
    transform: translateY(-1px) scale(.99);
}

.blog_card .thumb_wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #d6ff6b 0%, #a3e635 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.blog_card .thumb_wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog_card .thumb_wrap .thumb_placeholder_icon {
    width: 42px;
    height: 42px;
    color: #0C2E16;
    opacity: .55;
    transition: transform .3s ease;
}

.blog_card:hover .thumb_wrap .thumb_placeholder_icon,
.blog_card:hover .thumb_wrap img {
    transform: scale(1.05);
}

.blog_card .category_badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #CFFF7F;
    color: #0C2E16;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 50px;
}

.blog_card .body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog_card h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 8px;
    line-height: 1.35;
    color: #0C2E16;
    transition: color .2s ease;
}

.blog_card:hover h3 {
    color: #16a34a;
}

.blog_card .excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 14px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog_card .meta_row {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    color: #777;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.blog_card .meta_row .author {
    display: flex;
    align-items: center;
    gap: 6px;
}

.blog_card .meta_row .author .avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0C2E16;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.blog_card .meta_row span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.blog_card .meta_row svg {
    width: 13px;
    height: 13px;
}

.blog_card .btnDetails {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0C2E16;
    font-weight: 600;
    font-size: 14px;
    margin-top: auto;
}

.blog_card .btnDetails svg {
    width: 15px;
    height: 15px;
    transition: transform .15s ease;
}

.blog_card .btnDetails:hover svg {
    transform: translateX(3px);
}

/* ---------------- Load more ---------------- */
.blog_list_wrap .load-more {
    background: #fff;
    border: 1px solid #b7ee87;
    border-radius: 8px;
    padding: 10px 26px;
    font-size: 15px;
    color: #333;
    cursor: pointer;
}

.blog_list_wrap .load-more:hover {
    background: #f3fce0;
}

/* ---------------- Empty state ---------------- */
.blog_list_wrap .empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #555;
}

.blog_list_wrap .empty-state .empty-icon {
    margin-bottom: 14px;
    color: #999;
}

.blog_list_wrap .empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: #111;
}

.blog_list_wrap .btn-empty {
    margin-top: 14px;
    background: #0C2E16;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 10px 24px;
    cursor: pointer;
}

/* ---------------- Skeleton loading ---------------- */
.blog_grid .skeleton_card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    padding-bottom: 18px;
}

.blog_grid .skeleton {
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 37%, #eee 63%);
    background-size: 400% 100%;
    animation: blogSkeletonShine 1.4s ease infinite;
}

@keyframes blogSkeletonShine {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

.blog_grid .sk-img { width: 100%; aspect-ratio: 16/9; }
.blog_grid .sk-line { height: 14px; margin: 14px 18px 0; border-radius: 4px; }
.blog_grid .sk-line.sm { width: 80%; }
.blog_grid .sk-line.xs { width: 60%; }
