/*
 * Zapechka recipe cards
 *
 * v0.0.36 — Recipe Cards 2.0
 *
 * Visual layer only.
 * No JS/API changes.
 */


/* ==========================================================
   Card shell
   ========================================================== */

.home-recipe-card {

    display: flex;
    flex-direction: column;

    min-height: 100%;

    border-radius: 28px;

    overflow: hidden;

    background: var(--surface);

    box-shadow:
        0 12px 35px rgba(70,44,25,.08);

    transition:
        transform .22s ease,
        box-shadow .22s ease;
}


.home-recipe-card:hover {

    transform:
        translateY(-7px);

    box-shadow:
        0 28px 75px rgba(70,44,25,.16);
}


/* ==========================================================
   Image
   ========================================================== */

.home-recipe-image {

    position: relative;

    aspect-ratio:
        4 / 3;

    overflow:
        hidden;

}


.home-recipe-image::after {

    content:"";

    position:absolute;

    inset:55% 0 0;

    background:
        linear-gradient(
            to bottom,
            transparent,
            rgba(0,0,0,.12)
        );

}


.home-recipe-image img {

    width:100%;

    height:100%;

    object-fit:cover;

    transition:
        transform .45s ease;

}


.home-recipe-card:hover
.home-recipe-image img {

    transform:
        scale(1.08);

}


/* ==========================================================
   Body
   ========================================================== */

.home-recipe-body {

    display:flex;

    flex-direction:column;

    flex:1;

    padding:
        24px;

}


.home-recipe-title {

    min-height:
        52px;

    margin:0;

    font-size:
        23px;

    font-weight:
        850;

    line-height:
        1.15;

    letter-spacing:
        -.7px;

}


.home-recipe-description {

    min-height:
        44px;

    margin-top:
        11px;

    color:
        var(--muted);

    line-height:
        1.55;

    display:
        -webkit-box;

    -webkit-line-clamp:
        2;

    -webkit-box-orient:
        vertical;

    overflow:
        hidden;

}


/* ==========================================================
   Meta badges
   ========================================================== */

.home-recipe-meta {

    margin-top:auto;

    padding-top:
        20px;

    display:flex;

    flex-wrap:wrap;

    gap:
        8px;

}


.home-recipe-meta span {

    display:inline-flex;

    align-items:center;

    min-height:
        29px;

    padding:
        6px 12px;

    border-radius:
        999px;

    background:
        rgba(247,231,219,.8);

    border:
        1px solid rgba(225,198,187,.55);

    color:
        #765548;

    font-size:
        12px;

    font-weight:
        750;

}


/* Rating */

.home-recipe-rating {

    background:
        #fff0bf !important;

    border-color:
        #ead18a !important;

    color:
        #8a6200 !important;

}


/* Difficulty */

.difficulty-badge {

    font-weight:
        800;

}


.difficulty-easy {

    background:#dff3df !important;

    border-color:#b8ddb8 !important;

    color:#32733a !important;

}


.difficulty-medium {

    background:#ffe8a8 !important;

    border-color:#e9c96a !important;

    color:#855800 !important;

}


.difficulty-hard {

    background:#ffdada !important;

    border-color:#e8aaaa !important;

    color:#a03939 !important;

}


/* ==========================================================
   Favorite
   ========================================================== */

.recipe-card-favorite {

    backdrop-filter:
        blur(8px);

}


/* ==========================================================
   Empty image placeholder
   ========================================================== */

.home-recipe-placeholder {

    opacity:.75;

    filter:
        saturate(.85);

}


/* ==========================================================
   Mobile
   ========================================================== */

@media(max-width:520px){

    .home-recipe-body {

        padding:
            18px;

    }


    .home-recipe-title {

        font-size:
            20px;

    }

}


/*
 * Recipe card author
 *
 * Canonical author component for recipe cards.
 *
 * The existing .home-recipe-body already uses a flex column,
 * so margin-top:auto anchors the author area near the bottom
 * of cards with different description lengths.
 */


.home-recipe-author {

    margin-top:
        auto;

    padding-top:
        14px;

    border-top:
        1px solid rgba(225,198,187,.45);

    display:
        flex;

    align-items:
        center;

    gap:
        10px;

    color:
        #65483b;

    font-size:
        14px;

    font-weight:
        750;

}


.home-recipe-author img,
.home-recipe-author-letter {

    width:
        36px;

    height:
        36px;

    flex:
        0 0 36px;

    border-radius:
        50%;

}


.home-recipe-author img {

    object-fit:
        cover;

    border:
        2px solid rgba(255,255,255,.9);

    box-shadow:
        0 3px 12px rgba(70,44,25,.15);

}


.home-recipe-author span {

    line-height:
        1;

}


/*
 * Keeps the author row stable before/without an avatar.
 */
.home-recipe-author:not(:has(img)) {

    min-height:
        36px;

}


.home-recipe-author-letter {

    display:
        inline-flex;

    align-items:
        center;

    justify-content:
        center;

    background:
        #f3d8c7;

    color:
        #765548;

    font-weight:
        850;

    font-size:
        16px;

}


@media (max-width:520px) {

    .home-recipe-author {

        font-size:
            13px;

    }


    .home-recipe-author img,
    .home-recipe-author-letter {

        width:
            32px;

        height:
            32px;

        flex-basis:
            32px;

    }


    .home-recipe-author:not(:has(img)) {

        min-height:
            32px;

    }

}


/*
 * Recipe engagement counters.
 */


.home-recipe-stats {

    margin-top:12px;

    display:flex;

    gap:10px;

    color:#765548;

    font-size:13px;

    font-weight:700;

}
