/**
 * FIFE Publication Cards — Elementor widget styles.
 *
 * Scoped entirely under .fife-elementor-publication-cards so this can
 * never collide with page-our-impact.php's ".impact-publication-card"
 * (the source this reproduces) or page-our-works.php's unstyled
 * ".ow-publication-card" markup — neither is touched. Literal values
 * below are copied from page-our-impact.php's own inline <style> block,
 * not computed from style.css custom properties, so this widget has no
 * live dependency on it.
 */

.fife-elementor-publication-cards {
    --fife-pub-columns: 1;
    --fife-pub-gap: 1.5rem;
    --fife-pub-image-width: 12rem;
    --fife-pub-image-height: 8rem;
}

.fife-elementor-publication-cards__heading {
    margin: 0 0 1.5rem;
    font-size: clamp(1.75rem, 3.5vw, 2.25rem);
    font-weight: 700;
    line-height: 1.2;
    color: hsl(310, 58%, 35%);
}

.fife-elementor-publication-cards__grid {
    display: grid;
    grid-template-columns: repeat(var(--fife-pub-columns), minmax(0, 1fr));
    gap: var(--fife-pub-gap);
}

.fife-elementor-publication-cards__card {
    display: block;
    background-color: #ffffff;
    border: 1px solid hsl(0, 0%, 89.8%);
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.fife-elementor-publication-cards__card:hover,
.fife-elementor-publication-cards__card:focus-visible {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: rgba(147, 49, 131, 0.3);
}

.fife-elementor-publication-cards__card:focus-visible {
    outline: 2px solid hsl(310, 58%, 35%);
    outline-offset: 2px;
}

.fife-elementor-publication-cards__inner {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .fife-elementor-publication-cards__inner {
        flex-direction: row;
    }
}

.fife-elementor-publication-cards__image {
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    height: 180px;
}

@media (min-width: 768px) {
    .fife-elementor-publication-cards__image {
        width: var(--fife-pub-image-width);
        height: var(--fife-pub-image-height);
    }
}

.fife-elementor-publication-cards__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.fife-elementor-publication-cards__card:hover .fife-elementor-publication-cards__image img,
.fife-elementor-publication-cards__card:focus-visible .fife-elementor-publication-cards__image img {
    transform: scale(1.05);
}

.fife-elementor-publication-cards__content {
    flex: 1;
    min-width: 0;
}

.fife-elementor-publication-cards__type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    margin-bottom: 1rem;
    background-color: rgba(147, 49, 131, 0.1);
    color: hsl(310, 58%, 35%);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

.fife-elementor-publication-cards__title {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
    color: hsl(0, 0%, 3.9%);
    transition: color 0.3s ease;
}

.fife-elementor-publication-cards__card:hover .fife-elementor-publication-cards__title,
.fife-elementor-publication-cards__card:focus-visible .fife-elementor-publication-cards__title {
    color: hsl(310, 58%, 35%);
}

.fife-elementor-publication-cards__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    color: hsl(0, 0%, 45.1%);
}

.fife-elementor-publication-cards__abstract {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: hsl(0, 0%, 45.1%);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fife-elementor-publication-cards__read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: hsl(310, 58%, 35%);
}

/**
 * The source only reveals this arrow on :hover (opacity 0→1), which
 * hides it from keyboard-focus-only users. Kept always visible here —
 * a deliberate accessibility fix, not a visual regression, since the
 * label text is already always shown either way.
 */
.fife-elementor-publication-cards__read-more svg {
    width: 1rem;
    height: 1rem;
    transition: transform 0.3s ease;
}

.fife-elementor-publication-cards__card:hover .fife-elementor-publication-cards__read-more svg,
.fife-elementor-publication-cards__card:focus-visible .fife-elementor-publication-cards__read-more svg {
    transform: translateX(3px);
}

/**
 * Column count is fully responsive via the widget's "Columns" control
 * (desktop/tablet/mobile), which sets --fife-pub-columns per breakpoint
 * using Elementor's own breakpoint system — no manual media query
 * needed here for that. This query only reproduces the source's real
 * mobile image treatment (full-width, fixed 180px height).
 */
@media (max-width: 767px) {
    .fife-elementor-publication-cards__image {
        width: 100%;
        height: 180px;
    }

    .fife-elementor-publication-cards__content {
        padding: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fife-elementor-publication-cards__card,
    .fife-elementor-publication-cards__image img,
    .fife-elementor-publication-cards__title,
    .fife-elementor-publication-cards__read-more svg {
        transition-duration: 0.01ms !important;
    }
}
