/* ====== Blog post card (design 2026-11) ======
   Markup: views/posts/partials/post-card.blade.php, used on /blog,
   /blog/category/* and the home "posts" widget carousel.
   Follows .product-card-new in kalasoon.css: 19px radius, soft
   slate shadow, #00bcd4 accent, 13px-radius buttons. */

.blog-card {
    --bc-primary: #00bcd4;
    --bc-primary-dark: #0097a7;
    --bc-light: #ebf6f8;
    --bc-gray: #9e9e9e;
    --bc-text: #6b6b6b;
    --bc-divider: #f1f1f1;
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    margin: 10px 0 20px;
    padding: 10px;
    background-color: #fff;
    border-radius: 19px;
    box-shadow: 0 2px 10px 0 rgba(51, 73, 94, 0.08);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.blog-card:hover {
    box-shadow: 0 8px 24px 0 rgba(51, 73, 94, 0.14);
    transform: translateY(-3px);
}

/* Equal-height cards in grid columns and carousel slides (same approach
   as .product-card-new). */
.row > [class*="col-"]:has(> .blog-card),
.owl-item > .item:has(> .blog-card) {
    display: flex;
    flex-direction: column;
}

.owl-stage:has(.blog-card),
.owl-stage:has(.blog-card) > .owl-item {
    display: flex;
}

.owl-item > .item:has(> .blog-card) {
    width: 100%;
}

/* --- Image --- */
.blog-card .bc-media {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    background-color: var(--bc-light);
    aspect-ratio: 16 / 10;
}

.blog-card .bc-thumb {
    display: block;
    width: 100%;
    height: 100%;
}

.blog-card .bc-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .bc-thumb img {
    transform: scale(1.06);
}

.blog-card .bc-media::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 45%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.blog-card:hover .bc-media::after {
    opacity: 1;
}

.blog-card .bc-tag {
    position: absolute;
    top: 10px;
    inset-inline-start: 10px;
    z-index: 2;
    max-width: calc(100% - 20px);
    height: 26px;
    padding: 0 10px;
    overflow: hidden;
    border-radius: 9px;
    background-color: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 6px rgba(51, 73, 94, 0.12);
    color: var(--bc-primary-dark);
    font-size: 11px;
    font-weight: 700;
    line-height: 26px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* --- Body --- */
.blog-card .bc-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 12px 6px 4px;
    text-align: start;
}

.blog-card .bc-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--bc-gray);
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
}

.blog-card .bc-meta .mdi {
    color: var(--bc-primary);
    font-size: 15px;
    line-height: 1;
}

.blog-card .bc-title {
    min-height: 52px;
    margin: 8px 0 0;
    font-size: 15px;
    line-height: 26px;
}

.blog-card .bc-title a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--bc-primary);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s;
}

.blog-card .bc-title a:hover {
    color: var(--bc-primary-dark);
}

.blog-card .bc-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 6px 0 0;
    color: var(--bc-text);
    font-size: 13px;
    font-weight: 400;
    line-height: 23px;
}

/* --- Footer: pinned to the bottom so buttons line up across a row --- */
.blog-card .bc-footer {
    margin-top: auto;
    padding-top: 12px;
}

.blog-card .bc-more {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    height: 40px;
    padding: 0 14px;
    border-radius: 13px;
    background-color: var(--bc-light);
    color: var(--bc-primary-dark);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.blog-card .bc-more .mdi {
    font-size: 18px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.blog-card:hover .bc-more,
.blog-card .bc-more:hover,
.blog-card .bc-more:focus-visible {
    background-color: var(--bc-primary);
    color: #fff;
}

.blog-card:hover .bc-more .mdi {
    transform: translateX(-4px);
}

[dir="ltr"] .blog-card .bc-more .mdi {
    transform: scaleX(-1);
}

[dir="ltr"] .blog-card:hover .bc-more .mdi {
    transform: scaleX(-1) translateX(-4px);
}

.blog-card a:focus-visible {
    outline: 2px solid var(--bc-primary);
    outline-offset: 2px;
}

/* --- Small screens: the home carousel shows two narrow cards --- */
@media (max-width: 575.98px) {
    .posts-widget-owl .blog-card {
        padding: 8px;
        border-radius: 16px;
    }

    .posts-widget-owl .blog-card .bc-media {
        border-radius: 12px;
    }

    .posts-widget-owl .blog-card .bc-tag {
        top: 6px;
        inset-inline-start: 6px;
        max-width: calc(100% - 12px);
        height: 22px;
        padding: 0 8px;
        font-size: 10px;
        line-height: 22px;
    }

    .posts-widget-owl .blog-card .bc-body {
        padding: 10px 2px 2px;
    }

    .posts-widget-owl .blog-card .bc-meta {
        font-size: 11px;
    }

    .posts-widget-owl .blog-card .bc-title {
        min-height: 44px;
        font-size: 13px;
        line-height: 22px;
    }

    .posts-widget-owl .blog-card .bc-excerpt {
        display: none;
    }

    .posts-widget-owl .blog-card .bc-more {
        height: 36px;
        padding: 0 10px;
        font-size: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .blog-card,
    .blog-card .bc-thumb img,
    .blog-card .bc-more .mdi {
        transition: none;
    }

    .blog-card:hover,
    .blog-card:hover .bc-thumb img {
        transform: none;
    }
}
