/* Latest Insight section (reusable) */

/*
   This section includes its own scoped blog-card styling so we don't need to
   globally load blog-card styles on every page.

   Blog pages still get blog-card styling from blog.css.
*/

.latest-insight-section .blog-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--axis-white);
    border: 1px solid var(--axis-gray-200);
    border-radius: var(--axis-radius-lg);
    overflow: hidden;
    transition: all var(--axis-transition-base);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.latest-insight-section .blog-card:focus-within {
    border-color: var(--axis-primary);
    box-shadow: 0 8px 20px rgba(0, 136, 204, 0.15);
}

@media (hover: hover) and (pointer: fine) {
    .latest-insight-section .blog-card:hover {
        border-color: var(--axis-primary);
        box-shadow: 0 8px 20px rgba(0, 136, 204, 0.15);
        transform: translateY(-4px);
    }
}

.latest-insight-section .blog-card__image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 60%;
    background: var(--axis-gray-200);
    overflow: hidden;
}

.latest-insight-section .blog-card__image,
.latest-insight-section .blog-card__image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--axis-transition-base);
}

.latest-insight-section .blog-card__image:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 3px var(--axis-primary);
}

@media (hover: hover) and (pointer: fine) {
    .latest-insight-section .blog-card:hover .blog-card__image {
        transform: scale(1.05);
    }
}

.latest-insight-section .blog-card__category {
    position: absolute;
    top: var(--axis-space-4);
    left: var(--axis-space-4);
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: var(--axis-space-2);
    max-width: calc(100% - (var(--axis-space-4) * 2));
}

.latest-insight-section .blog-card__category a {
    display: inline-block;
    padding: var(--axis-space-2) var(--axis-space-4);
    background: var(--axis-primary);
    color: var(--axis-white);
    border-radius: var(--axis-radius-sm);
    font-size: var(--axis-text-xs);
    font-weight: var(--axis-font-bold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* If a post has multiple categories, keep cards clean by showing only the first. */
.latest-insight-section .blog-card__category a:not(:first-child) {
    display: none;
}

.latest-insight-section .blog-card__category a:focus-visible {
    outline: 2px solid var(--axis-white);
    outline-offset: 2px;
}

.latest-insight-section .blog-card__content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: var(--axis-space-6);
}

.latest-insight-section .blog-card__title {
    font-size: var(--axis-text-lg);
    font-weight: var(--axis-font-bold);
    color: var(--axis-dark);
    margin-bottom: var(--axis-space-3);
    line-height: var(--axis-line-height-tight);
    transition: color var(--axis-transition-base);
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.latest-insight-section .blog-card__title-link {
    color: inherit;
    text-decoration: none;
}

.latest-insight-section .blog-card__title-link:focus-visible {
    outline: 2px solid var(--axis-primary);
    outline-offset: 3px;
    border-radius: var(--axis-radius-sm);
}

@media (hover: hover) and (pointer: fine) {
    .latest-insight-section .blog-card:hover .blog-card__title {
        color: var(--axis-primary);
    }
}

.latest-insight-section .blog-card__excerpt {
    font-size: var(--axis-text-base);
    color: var(--axis-gray-700);
    line-height: var(--axis-line-height-relaxed);
    margin-bottom: var(--axis-space-4);
    flex-grow: 1;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.latest-insight-section .blog-card__meta {
    display: flex;
    align-items: center;
    gap: var(--axis-space-4);
    font-size: var(--axis-text-sm);
    color: var(--axis-gray-600);
    margin-bottom: var(--axis-space-4);
    padding-top: var(--axis-space-4);
    border-top: 1px solid var(--axis-gray-100);
    flex-wrap: wrap;
}

.latest-insight-section .blog-card__date,
.latest-insight-section .blog-card__author {
    display: flex;
    align-items: center;
    gap: var(--axis-space-2);
}

.latest-insight-section .blog-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.latest-insight-section .blog-card__read-more {
    display: inline-flex;
    align-items: center;
    gap: var(--axis-space-2);
    color: var(--axis-primary);
    text-decoration: none;
    font-weight: var(--axis-font-semibold);
    font-size: var(--axis-text-base);
    transition: all var(--axis-transition-base);
    padding: var(--axis-space-2) var(--axis-space-3);
    border-radius: var(--axis-radius-sm);
}

.latest-insight-section .blog-card__read-more:focus-visible {
    outline: 2px solid var(--axis-primary);
    outline-offset: 3px;
}

.latest-insight-section .blog-card__read-more::after {
    content: "→";
    transition: transform var(--axis-transition-base);
}

.latest-insight-section .latest-insight__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--axis-space-6);
}

.latest-insight-section .latest-insight__grid .blog-card {
    width: 100%;
    max-width: none;
}

/* Mobile: show only the most recent post */
.latest-insight-section .latest-insight__grid .blog-card:nth-child(n + 2) {
    display: none;
}

@media (min-width: 768px) {
    .latest-insight-section .latest-insight__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--axis-space-8);
    }

    .latest-insight-section .latest-insight__grid .blog-card:nth-child(n + 2) {
        display: flex;
    }
}

@media (min-width: 1024px) {
    .latest-insight-section .latest-insight__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.latest-insight-section .latest-insight__cta {
    display: flex;
    justify-content: center;
    margin-top: var(--axis-space-8);
}