/**
 * FIFE Projects Grid — Elementor widget styles.
 *
 * Scoped entirely under .fife-elementor-projects-grid so this can never
 * collide with the legacy homepage / Our Impact / archive project card
 * markup, which keeps its own separate classes and rules in style.css.
 *
 * The card's meta row (date/location/category) is rendered by the shared
 * inc/project-card-meta.php partial and styled by its own global,
 * theme-wide .fife-proj-meta / .fife-proj-status rules in style.css — not
 * duplicated here.
 */

.fife-elementor-projects-grid {
    --fife-projects-columns: 1;
    --fife-projects-gap: 24px;
    --fife-projects-image-width: 20rem;
    --fife-projects-image-height: 16rem;
}

.fife-elementor-projects-grid__header {
    max-width: 760px;
    margin: 0 auto 2rem;
    text-align: center;
}

.fife-elementor-projects-grid__heading {
    margin: 0 0 0.75rem;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.15;
    color: hsl(311, 50%, 37%);
}

.fife-elementor-projects-grid__description {
    margin: 0;
    font-size: 1.05rem;
    color: #6b6b70;
}

.fife-elementor-projects-grid__grid {
    display: grid;
    grid-template-columns: repeat(var(--fife-projects-columns), minmax(0, 1fr));
    gap: var(--fife-projects-gap);
    align-items: stretch;
}

.fife-elementor-projects-grid__grid--natural-height {
    align-items: start;
}

.fife-elementor-projects-grid__card {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    border: 1px solid rgba(147, 49, 131, 0.12);
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Image left / content right on wider screens — same breakpoint used by
   the legacy .homepage-project-card this widget reproduces. */
@media (min-width: 768px) {
    .fife-elementor-projects-grid__card {
        flex-direction: row;
    }
}

a.fife-elementor-projects-grid__card:hover,
a.fife-elementor-projects-grid__card:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.18);
    border-color: rgba(147, 49, 131, 0.25);
}

.fife-elementor-projects-grid__card:focus-visible {
    outline: 2px solid hsl(311, 50%, 37%);
    outline-offset: 2px;
}

.fife-elementor-projects-grid__image {
    width: 100%;
    height: var(--fife-projects-image-height);
    overflow: hidden;
    background-color: #f4f4f5;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .fife-elementor-projects-grid__image {
        width: var(--fife-projects-image-width);
        height: auto;
        min-height: 200px;
    }
}

.fife-elementor-projects-grid__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.6s ease, object-position 0.6s ease;
}

a.fife-elementor-projects-grid__card:hover .fife-elementor-projects-grid__image img {
    transform: scale(1.08);
    object-position: center center;
}

.fife-elementor-projects-grid__info {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.fife-elementor-projects-grid__title {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: hsl(311, 50%, 37%);
    line-height: 1.3;
    transition: color 0.3s ease;
}

@media (min-width: 768px) {
    .fife-elementor-projects-grid__title {
        font-size: 1.5rem;
    }
}

a.fife-elementor-projects-grid__card:hover .fife-elementor-projects-grid__title {
    color: hsl(311, 50%, 30%);
}

/**
 * Column count itself is fully responsive via the widget's "Columns"
 * control (desktop/tablet/mobile), which sets --fife-projects-columns
 * per breakpoint using Elementor's own breakpoint system — no manual
 * media queries needed here for that. This query only trims card
 * padding/typography on small screens, matching the legacy mobile
 * adjustments for the homepage project cards.
 */
@media (max-width: 767px) {
    .fife-elementor-projects-grid__info {
        padding: 1rem;
    }

    .fife-elementor-projects-grid__title {
        font-size: 1.125rem;
        margin-bottom: 0.5rem;
    }

    .fife-elementor-projects-grid__image {
        height: 12rem;
    }
}
