/* =========================================================================
   Blog cards
   -------------------------------------------------------------------------
   One card component, used by the blog listing, the homepage, product pages
   and the Load More / search results. Rendered by
   app/Views/frontend/blog/_card.php.

   Everything here is namespaced .blog-card*. That is the point of the file.
   The old cards leaned on .post-title / .post-info / .single-blog-item, which
   several page templates redeclare unscoped and some with !important - the
   product page sets `.post-title { font-size: 28px !important }` - so a card
   changed shape depending on which page it landed on. Nothing outside this
   file styles .blog-card*, and .blog-card* styles nothing outside itself.

   Loaded last in the frontend <head>, after original-footer.css.
   ========================================================================= */

/* Bootstrap's .row is flex, so columns already stretch to the tallest in the
   line. The card fills that height; without this it shrink-wraps its text and
   the row looks ragged. */
.blog-card-col {
    display: flex;
    margin-bottom: 30px;
}

.blog-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: #ffffff;
    border: 1px solid #e3e6ed;
    border-radius: 10px;
    overflow: hidden;
    /* The old homepage card was pinned to `height: 500px` with no overflow
       rule, so a long headline pushed the summary straight out of the bottom
       of the box. Height is driven by content now, and the clamps below keep
       that content bounded instead. */
    transition: box-shadow .2s ease, transform .2s ease;
}

.blog-card:hover {
    box-shadow: 0 6px 22px rgba(34, 34, 129, .13);
    transform: translateY(-3px);
}

/* --- Head: headline and date, above the picture, as on coredocuments.com -- */

.blog-card-head {
    padding: 18px 20px 12px;
}

.blog-card-title {
    margin: 0 0 8px;
    font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    /* !important on the sizes only, and deliberately.
       Several page templates declare bare element rules with !important -
       product/view.php has `h3 { font-size: 28px !important }` in an inline
       <style> block - and a bare element selector carrying !important beats a
       class selector that does not. Without this the card's headline was 28px
       on product pages and 18px everywhere else, which is precisely the
       "not the same as the other cards" being fixed. */
    font-size: 18px !important;
    font-weight: 700;
    line-height: 1.35;
    /* Titles come from a WordPress archive and some are very long, others
       carry an unbroken URL or product code. Both used to run past the edge
       of the card. */
    overflow-wrap: break-word;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-title a {
    color: #222281;
    text-decoration: none;
}

.blog-card:hover .blog-card-title a {
    color: #b30909;
}

.blog-card-date {
    font-size: 13px !important;
    font-weight: 500;
    color: #6b7280;
}

.blog-card-date-icon {
    margin-right: 6px;
    color: #222281;
}

/* --- Media ---------------------------------------------------------------
   A fixed 16:9 box whatever the picture's own proportions, so every card in a
   row has its text at the same height. Posts with no picture get the
   placeholder rather than no box at all - dropping the box was what left some
   cards 200px shorter than their neighbours. */

.blog-card-media {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #eef0f6;
    overflow: hidden;
}

.blog-card-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* The stand-in is artwork, not a photograph - show all of it rather than
   cropping it to fill. */
.blog-card-media.is-placeholder img {
    object-fit: contain;
}

/* --- Body: summary, then Read more pinned to the bottom ------------------ */

.blog-card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 16px 20px 18px;
}

.blog-card-excerpt {
    margin: 0;
    font-size: 14.5px !important;
    line-height: 1.6;
    color: #4b5563;
    overflow-wrap: break-word;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* margin-top:auto is what squares the row off: whatever slack a short card
   has collects above the button, so every Read more sits on the same line. */
.blog-card-more {
    margin: 14px 0 0;
    padding-top: 12px;
    border-top: 1px solid #eef0f4;
    margin-top: auto;
}

.blog-card-more a {
    font-size: 14px !important;
    font-weight: 600;
    color: #222281;
    text-decoration: none;
}

.blog-card-more a i {
    margin-left: 6px;
    font-size: 12px;
    transition: transform .2s ease;
}

.blog-card:hover .blog-card-more a {
    color: #b30909;
}

.blog-card:hover .blog-card-more a i {
    transform: translateX(3px);
}

/* --- The 2-up variant used on the homepage and product pages ------------- */

.blog-card--large .blog-card-title {
    font-size: 20px !important;
}

.blog-card--large .blog-card-excerpt {
    -webkit-line-clamp: 4;
}

/* --- Narrow screens ------------------------------------------------------ */

@media (max-width: 991.98px) {

    .blog-card-title {
        /* The theme drops h3 to 28px and .post-title to 29px !important inside
           its own narrow-screen blocks; the card keeps its own scale. */
        font-size: 17px !important;
    }

    .blog-card--large .blog-card-title {
        font-size: 18px !important;
    }
}

@media (max-width: 575.98px) {

    .blog-card-col {
        margin-bottom: 20px;
    }

    .blog-card-head {
        padding: 15px 16px 10px;
    }

    .blog-card-body {
        padding: 14px 16px 16px;
    }

    /* One card per line on a phone, so there is room for more of the summary. */
    .blog-card-excerpt {
        -webkit-line-clamp: 4;
    }
}
