/**
 * Recipe card — Bold Modernist.
 *
 * A 2px black rectangle. No radius, no resting shadow, no scrim over the
 * photograph: the border is the frame and the photo sits square inside it.
 *
 * The meta line moved above the title and turned orange, so the card reads
 * category-and-time first, then the dish. That is the order someone scanning
 * for "what can I cook in ten minutes" actually needs.
 */

.fmr-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--fmr-surface);
    border: 2px solid var(--fmr-border-strong);
    border-radius: 0;
    overflow: hidden;
    text-decoration: none;
    transition: transform .3s cubic-bezier(.22, .68, .3, 1),
        box-shadow .3s cubic-bezier(.22, .68, .3, 1);
}

.fmr-card:hover,
.fmr-card:focus-visible {
    transform: translate(-3px, -3px);
    box-shadow: 6px 6px 0 0 var(--fmr-brand-500);
}

/* ---- Media ---------------------------------------------------------------- */

.fmr-card__media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--fmr-surface-muted);
    border-bottom: 2px solid var(--fmr-border-strong);
}

.fmr-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1);
    transition: transform .7s cubic-bezier(.22, .68, .3, 1);
}

.fmr-card:hover .fmr-card__media img {
    transform: scale(1.04);
}

.fmr-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fmr-surface-muted);
    color: var(--fmr-ink-400);
    font-family: var(--font-serif);
    font-size: var(--fmr-text-2xl);
    font-weight: 700;
}

/* ---- Labels on the photograph ---------------------------------------------
   A solid black strip along the bottom of the image, category left, time right
   in orange. The strip is opaque, so it works over any photograph. */

.fmr-card__cat,
.fmr-card__time {
    position: absolute;
    bottom: 0;
    z-index: 2;
    background: var(--fmr-surface-dark);
    color: var(--fmr-on-dark);
    font-family: "Geist", var(--font-sans, sans-serif);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: var(--fmr-track-label);
    text-transform: uppercase;
    padding: 7px 12px;
    line-height: 1;
}

.fmr-card__cat {
    left: 0;
}

.fmr-card__time {
    right: 0;
    color: var(--fmr-brand-300);
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    font-variant-numeric: tabular-nums;
}

.fmr-card__time span {
    font-size: 9.5px;
    color: var(--fmr-on-dark);
    opacity: .7;
}

/* ---- Body ------------------------------------------------------------------ */

.fmr-card__body {
    padding: var(--fmr-space-4) var(--fmr-space-4) var(--fmr-space-4);
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.fmr-card__title {
    margin: 0;
    font-family: var(--font-serif);
    font-size: var(--fmr-text-lg);
    font-weight: 700;
    line-height: 1.14;
    letter-spacing: var(--fmr-track-title);
    color: var(--fmr-ink-900);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* The rule is now a hard block that snaps to full width on hover. */
.fmr-card__rule {
    height: 3px;
    width: 0;
    background: var(--fmr-brand-500);
    transition: width .35s cubic-bezier(.22, .68, .3, 1);
}

.fmr-card:hover .fmr-card__rule {
    width: 40px;
}

.fmr-card__meta {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--fmr-border);
    font-family: "Geist", var(--font-sans, sans-serif);
    font-variant-numeric: tabular-nums;
    font-size: var(--fmr-text-xs);
    font-weight: 500;
    color: var(--fmr-ink-500);
    display: flex;
    align-items: center;
    gap: var(--fmr-space-2);
}

.fmr-card__meta strong {
    color: var(--fmr-ink-900);
    font-weight: 700;
}

/* ---- Layout helpers --------------------------------------------------------- */

.fmr-card--rail {
    flex: 0 0 300px;
    width: 300px;
}

.fmr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--fmr-space-6);
}

@media (max-width: 640px) {
    .fmr-card--rail {
        flex-basis: 82vw;
        width: 82vw;
    }
}

@media (prefers-reduced-motion: reduce) {

    .fmr-card,
    .fmr-card__media img,
    .fmr-card__rule {
        transition: none;
    }

    .fmr-card:hover {
        transform: none;
        box-shadow: 4px 4px 0 0 var(--fmr-brand-500);
    }

    .fmr-card:hover .fmr-card__media img {
        transform: none;
    }
}
