/* ================================
   I4P Query Loop Card System
   ================================ */

.i4p-grid,
.i4p-card-grid,
.i4p-card {
    box-sizing: border-box;
}

/* Outer Query Loop / Grid wrapper */
.i4p-grid {
    width: 100%;
}

/* Post Template grid */
.i4p-card-grid {
    align-items: stretch;
}

/* Each repeated post item inside the Query Loop */
.i4p-card-grid > li {
    display: flex;
    min-width: 0;
}

/* Main card container */
.i4p-card {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;

    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;

    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* Remove unwanted top margins from direct children */
.i4p-card > * {
    margin-top: 0;
}

/* ================================
   Featured image
   ================================ */

.i4p-card-metadata-featured-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    margin-bottom: 20px;

    border-radius: 12px;
    overflow: hidden;
    background: #f5f5f2;
}

.i4p-card-metadata-featured-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* If the image block outputs a figure */
.i4p-card-metadata-featured-image figure {
    width: 100%;
    height: 100%;
    margin: 0;
}

/* ================================
   Title
   ================================ */

.i4p-card-metadata-title {
    margin-bottom: 28px;
}

.i4p-card-metadata-title,
.i4p-card-metadata-title a,
.i4p-card-metadata-title h1,
.i4p-card-metadata-title h2,
.i4p-card-metadata-title h3,
.i4p-card-metadata-title h4,
.i4p-card-metadata-title p {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
    color: #111827;
    text-decoration: none;
}

/* ================================
   Metadata fields
   ================================ */

.i4p-card-metadata-fefco-category,
.i4p-card-metadata-usecase-array,
.i4p-card-metadata-fefco-code {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 14px;
}

.i4p-card-metadata-fefco-category,
.i4p-card-metadata-usecase-array {
    color: #666666;
}

.i4p-card-metadata-fefco-code {
    font-weight: 700;
    color: #111827;
}

/* Optional: make shortcode output inherit the container style */
.i4p-card-metadata-fefco-category *,
.i4p-card-metadata-usecase-array *,
.i4p-card-metadata-fefco-code * {
    font: inherit;
    color: inherit;
}

/* ================================
   ACF images rendered by the shortcode renderer
   ================================ */

.i4p-acf-image {
    width: 100%;
    height: auto;
    display: block;
}

/* ================================
   Link / CTA area
   ================================ */

.i4p-card-metadata-link-to-record {
    margin-top: auto;
    padding-top: 24px;
}

.i4p-card-metadata-link-to-record a {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    color: #65cfc6;
    font-weight: 600;
    text-decoration: none;
}

.i4p-card-metadata-link-to-record a:hover {
    text-decoration: underline;
}

/* ================================
   Optional button style
   Use this if you want "Read more"
   to look more like a button.
   ================================ */

/*
.i4p-card-metadata-link-to-record a {
    width: 100%;
    justify-content: center;

    padding: 12px 16px;
    border: 1px solid #65cfc6;
    border-radius: 10px;

    color: #256f6a;
    background: #ffffff;
    text-decoration: none;
}

.i4p-card-metadata-link-to-record a:hover {
    background: #f0fffd;
    text-decoration: none;
}
*/

/* ================================
   Responsive adjustments
   ================================ */

@media (max-width: 768px) {
    .i4p-card {
        padding: 20px;
    }

    .i4p-card-metadata-title,
    .i4p-card-metadata-title a,
    .i4p-card-metadata-title h1,
    .i4p-card-metadata-title h2,
    .i4p-card-metadata-title h3,
    .i4p-card-metadata-title h4,
    .i4p-card-metadata-title p {
        font-size: 17px;
    }
}
