/* ============================================================
   Purehearts Widgets – child-pages-grid.css
   3-column → 2-column tablet → 1-column mobile responsive grid
   with slide-up overlay on hover
   ============================================================ */

/* ── Grid container ─────────────────────────────────────────── */
.phw-cpg-grid {
    display: grid;
    grid-template-columns: repeat( 3, 1fr );
    gap: 24px;
    width: 100%;
}

/* ── Card shell ─────────────────────────────────────────────── */
.phw-cpg-card {
    position: relative;
    display: block;
    height: 320px;
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none !important;
    cursor: pointer;
}

/* ── Image layer ─────────────────────────────────────────────── */
.phw-cpg-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 1;
    /* Color by default, greyscale on card hover */
    filter: grayscale( 0% );
    transition: transform 0.55s cubic-bezier( 0.25, 0.46, 0.45, 0.94 ),
                filter 0.4s ease;
}

.phw-cpg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.phw-cpg-card:hover .phw-cpg-image,
.phw-cpg-card:focus-visible .phw-cpg-image {
    transform: scale( 1.04 );
    filter: grayscale( 100% );
}

/* ── Overlay — bottom-right pill, slides up on hover ─────────── */
.phw-cpg-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 2;
    width: 225px;
    min-height: 85px;
    background-color: #2F499E;

    /* Rounded top-left only — top-right sits flush against card's right edge */
    border-radius: 20px 0 0 0;

    /* Start translated fully down (hidden below card bottom) */
    transform: translateY( 100% );
    transition: transform 0.4s cubic-bezier( 0.25, 0.46, 0.45, 0.94 );

    display: flex;
    align-items: flex-end;
}

.phw-cpg-card:hover .phw-cpg-overlay,
.phw-cpg-card:focus-visible .phw-cpg-overlay {
    transform: translateY( 0 );
}

/* ── Overlay inner content ───────────────────────────────────── */
.phw-cpg-overlay-inner {
    width: 100%;
    padding: 14px 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Title ───────────────────────────────────────────────────── */
.phw-cpg-title {
    font-size: 32px;
    font-style: normal;
    font-weight: 600;
    line-height: 120%;
    color: #ffffff;
    margin: 0;
    padding: 0;
}

/* ── Read more link ──────────────────────────────────────────── */
.phw-cpg-readmore {
    display: inline-block;
    font-size: 18px;
    font-style: normal;
    font-weight: 700;
    line-height: 110%;
    text-transform: uppercase;
    color: #ffffff;
    text-decoration: underline !important;  /* always underlined */
    margin: 0;
    padding: 0;
}

/* ── Tablet: 2 columns ───────────────────────────────────────── */
@media ( max-width: 1024px ) {
    .phw-cpg-grid {
        grid-template-columns: repeat( 2, 1fr );
    }
}

/* ── Mobile: 1 column ────────────────────────────────────────── */
@media ( max-width: 767px ) {
    .phw-cpg-grid {
        grid-template-columns: 1fr;
    }

    .phw-cpg-title {
        font-size: 21px;
    }

    .phw-cpg-readmore {
        font-size: 14px;
    }

    .phw-cpg-overlay {
        width: 180px;
        min-height: 70px;
    }
}

/* ── Accessibility: reduced motion ──────────────────────────── */
@media ( prefers-reduced-motion: reduce ) {
    .phw-cpg-overlay,
    .phw-cpg-image {
        transition: none !important;
    }
}
