/* ==========================================================================
   Post Cards Block — acf/post-cards
   ========================================================================== */

.kftheme-post-cards__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin: 0;
    padding: 0;
}

/* --------------------------------------------------------------------------
   Card (anchor wrapper)
   -------------------------------------------------------------------------- */
.kftheme-post-card {
    --height: 350px;
    
    display: flex;
    flex-direction: column;
    min-height: var(--height);
    overflow: hidden;
    border-radius: 20px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0px 6px 26px 0px #0A0B5A0A;
}

/* --------------------------------------------------------------------------
   Image — top half
   -------------------------------------------------------------------------- */
.kftheme-post-card__image {
    flex: 1 1 calc(var(--height) / 2);
    overflow: hidden;
    background-color: #2a2a2a;
    position: relative;
}

.kftheme-post-card__image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(25, 25, 25, 0) 77%, #191919 100%);
    pointer-events: none;
    opacity: 0.8;
}

.kftheme-post-card__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --------------------------------------------------------------------------
   Content — bottom half (blurred + flipped + darkened background)
   -------------------------------------------------------------------------- */
.kftheme-post-card__content {
    position: relative;
    flex: 1 1 calc(var(--height) / 2);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 14px;
    overflow: hidden;
    background-color: #1a1a1a; /* fallback when no image */
}

/* Horizontally-flipped, blurred, darkened cover */
.kftheme-post-card__content::before {
    content: "";
    position: absolute;
    inset: -30px; /* overshoot to hide blur fringe */
    background: var(--card-bg-image, none) center / cover no-repeat;
    transform: scaleX(-1);
    filter: blur(14px) brightness(0.8);
    z-index: 0;
}

.kftheme-post-card__content::after {
    content: "";
    background: linear-gradient(180deg, #191919 0%, rgba(25, 25, 25, 0) 100%);
    position: absolute;
    inset: 0;
    opacity: .8;
}


.kftheme-post-card__content__inner {
    position: relative;
    padding: 25px 25px;
    border-radius: 10px;
    background: #FFFFFF1A;
    border: 1px solid #0A0B5A14;
    box-shadow: 0px 24px 26px 0px #0A0B5A14;

    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.kftheme-post-card__content__inner::before {
    content: '';
    position: absolute;
    z-index: 1;
    inset: 0px;
   
    border-radius: inherit;
    /* this is the border width */
    padding: 1px;

    background: linear-gradient(to bottom right, #fff8f870 0%, #bfbfbf57 62%, #fefefe99 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;

    pointer-events: none;
  }


/* --------------------------------------------------------------------------
   Title
   -------------------------------------------------------------------------- */
.kftheme-post-card__term {
    color: #ffffffD3;
    z-index: 1;

    font-weight: 600;
    font-size: 12px;
    line-height: 167%;
    letter-spacing: 8%;
    text-transform: uppercase;

}

.kftheme-post-card__title.kftheme-post-card__title {
    position: relative;
    z-index: 1;
    margin: 0 0 12px 0;
    padding: 0;
    color: #ffffff;

    font-weight: 500;
    font-size: 24px;
    line-height: 90%;
    letter-spacing: -2%;

    

    /* Multiline ellipsis — mobile default: 2 lines */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;

    margin: 0;
}

/* --------------------------------------------------------------------------
   Read-more label
   -------------------------------------------------------------------------- */
.kftheme-post-card__read-more {
    position: relative;
    z-index: 1;
    color: #ffffff;
    /* font-size: 18px; */

    font-weight: 600;
    font-size: 16px;
    line-height: 100%;

}

.kftheme-post-card__read-more::after {
    content: url('data:image/svg+xml,<svg width="4" height="9" viewBox="0 0 4 9" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 4L0 9L4 6.50104L0 4Z" fill="white"/></svg>');
    display: inline-block;
    position: relative;
    top: -.03em;
    right: -.2em;

    transition: transform 0.2s ease;
}

.kftheme-post-card:hover .kftheme-post-card__read-more::after {
    transform: translateX(4px);
}


/* ==========================================================================
   MOBILE  (≤ 767px)
   Non-first cards collapse to simple text rows.
   ========================================================================== */
@media (max-width: 767px) {
    .kftheme-post-cards__grid {
        gap: 0;
    }

    /* Keep first card visual, add spacing below */
    .kftheme-post-card--first {
        margin-bottom: 8px;
    }

    /* ---- Non-first cards: text-only ---- */
    .kftheme-post-card:not(.kftheme-post-card--first) {
        min-height: auto;
        border-radius: 0;
        box-shadow: none;
        border-bottom: 1px solid #e2e2e2;
    }

    .kftheme-post-card:not(.kftheme-post-card--first) .kftheme-post-card__content::after,
    .kftheme-post-card:not(.kftheme-post-card--first) .kftheme-post-card__content__inner::before {
        display: none;
    }

    .kftheme-post-card:not(.kftheme-post-card--first) .kftheme-post-card__content__inner {
        border-radius: 0;
        border: 0;
        height: auto;
        box-shadow: none;
    }

    .kftheme-post-card:not(.kftheme-post-card--first):last-child {
        border-bottom: none;
    }

    .kftheme-post-card:not(.kftheme-post-card--first) .kftheme-post-card__image {
        display: none;
    }

    .kftheme-post-card:not(.kftheme-post-card--first) .kftheme-post-card__content {
        background-color: transparent;
        padding: 0;
        flex-basis: auto;
    }

    .kftheme-post-card:not(.kftheme-post-card--first) .kftheme-post-card__content::before {
        display: none;
    }

    .kftheme-post-card:not(.kftheme-post-card--first) .kftheme-post-card__title {
        font-family: "degular-variable", sans-serif;
        /* font-weight: 500; */
        font-size: 24px;
        line-height: 120%;
        
        color: #191919;
    }

    .kftheme-post-card:not(.kftheme-post-card--first) .kftheme-post-card__read-more {
        font-family: "degular-variable", sans-serif;
        /* font-weight: 500; */
        font-size: 18px;
        line-height: 100%;
        color: #191919;

        margin-top: 10px;
    }

    .kftheme-post-card:not(.kftheme-post-card--first) .kftheme-post-card__read-more::after {
        filter: invert(37%) sepia(88%) saturate(3015%) hue-rotate(225deg) brightness(102%) contrast(101%);
    }
}

/* ==========================================================================
   DESKTOP  (≥ 768px)
   All cards render as full visual cards, 3 per row.
   ========================================================================== */
@media (min-width: 768px) {
    .kftheme-post-cards__grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .kftheme-post-card {
        --height: 400px;

        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .kftheme-post-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    }

    .kftheme-post-card__title.kftheme-post-card__title {
        -webkit-line-clamp: 3;
        font-size: 30px;
    }

    .kf-nav__panel .kftheme-post-cards {
        margin-top: calc(var(--header-nav-panel-padding-y) * -1);
        margin-right: calc(var(--header-nav-panel-padding-x) * -1);
        margin-bottom: calc(var(--header-nav-panel-padding-y) * -1);
        height: calc(100% + var(--header-nav-panel-padding-y) * 2);

        box-shadow: 0px 6px 26px 0px #0A0B5A0A;
    }


    .kf-nav__panel .kftheme-post-card {
        border-radius: 0;
        border-bottom-right-radius: var(--header-nav-panel-radius);
        border-top-right-radius: var(--header-nav-panel-radius);

        margin: 0;
    }

    .kf-nav__panel .kftheme-post-card.kftheme-post-card {
        --height: 310px;
        text-decoration: none;
    }

    .kf-nav__panel .kftheme-post-cards__grid {
        height: 100%;
    }

    .kf-nav__panel .kftheme-post-card__content__inner {
        border-bottom-right-radius: 20px;
    }

    .kf-nav__panel .kftheme-post-card__title.kftheme-post-card__title {
        -webkit-line-clamp: 2;
        font-size: 20px;
        line-height: 120%
    }

    .kf-nav__panel .kftheme-post-card:hover {
        transform: none;
    }
}