/**
 * template-parts/home/section-news.php
 *
 * Homepage News, Updates and Announcements.
 *
 * @package jpd-theme
 */

.jpd-home-news {
    padding: 36px 0 40px;
    background: #ffffff;
    color: #292929;
}

.jpd-home-news__inner {
    width: min(1440px, calc(100% - 64px));
    margin: 0 auto;
}

.jpd-home-news__label-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #b8b8b8;
}

.jpd-home-news__label-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    color: #292929;
}

.jpd-home-news__label-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.jpd-home-news__label {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
}

.jpd-home-news__body {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
    gap: clamp(32px, 4vw, 64px);
    align-items: start;
    margin-top: 38px;
}

.jpd-home-news__intro {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.jpd-home-news__heading {
    max-width: 650px;
    margin: 0;
    color: #2a2a2a;
    font-size: clamp(2.4rem, 4vw, 4.6rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.025em;
}

.jpd-news-title-line {
    display: block;
}

.jpd-home-news__description {
    max-width: 580px;
    margin: 22px 0 0;
    color: #4e4e4e;
    font-size: clamp(0.98rem, 1.1vw, 1.12rem);
    line-height: 1.62;
    text-align: justify;
}

.jpd-home-news__view-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    margin-top: 22px;
    padding: 0 13px;
    border: 1px solid #555555;
    border-radius: 2px;
    background: #ffffff;
    color: #2b2b2b;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.jpd-home-news__view-all:hover,
.jpd-home-news__view-all:focus-visible {
    background: #2b2b2b;
    color: #ffffff;
}

.jpd-home-news__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.jpd-home-news__item {
    min-width: 0;
}

.jpd-home-news__card {
    display: flex;
    flex-direction: column;
    min-height: 270px;
    height: 100%;
    padding: 26px 24px 20px;
    border: 1px solid #d3d3d3;
    border-radius: 12px;
    background: #ffffff;
    box-sizing: border-box;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s ease;
}

.jpd-home-news__card:hover {
    transform: translateY(-4px);
    border-color: #bdbdbd;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.jpd-home-news__card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #c7ff7a;
    color: #243127;
}

.jpd-home-news__card-icon svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.jpd-home-news__card-title {
    margin: 20px 0 0;
    color: #2b2b2b;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
}

.jpd-home-news__card-blurb {
    display: -webkit-box;
    height: calc(1.38em * 3);
    margin: 10px 0 0;
    overflow: hidden;
    color: #4f4f4f;
    font-size: 0.93rem;
    line-height: 1.38;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.jpd-home-news__read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin-top: auto;
    padding-top: 28px;
    color: #2b2b2b;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
}

.jpd-home-news__read-more svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    transition: transform 0.2s ease;
}

.jpd-home-news__read-more:hover svg,
.jpd-home-news__read-more:focus-visible svg {
    transform: translateX(4px);
}

@media (max-width: 1024px) {
    .jpd-home-news__body {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .jpd-home-news__heading {
        max-width: 800px;
    }

    .jpd-home-news__description {
        max-width: 780px;
    }
}

@media (max-width: 700px) {
    .jpd-home-news {
        padding: 24px 0 28px;
    }

    .jpd-home-news__inner {
        width: min(100% - 28px, 1440px);
    }

    .jpd-home-news__body {
        margin-top: 28px;
        gap: 28px;
    }

    .jpd-home-news__heading {
        font-size: 2.35rem;
    }

    .jpd-home-news__description {
        text-align: left;
    }

    .jpd-home-news__grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .jpd-home-news__card {
        min-height: 250px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .jpd-home-news__card,
    .jpd-home-news__read-more svg,
    .jpd-home-news__view-all {
        transition: none;
    }
}
