/* For recipe_list* form here*/




.recipe-page{
   
    margin: auto;
    padding: 2rem 0;
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.8rem;
    padding: 1rem 0;
    box-sizing: border-box;
}

/* Card */
.recipe-card {
    display: flex;
    flex-direction: column;
    background: var(--secondary);
    border-radius: 0.5rem ;
    border:solid 1px var(--secondary-hover);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    height: 20rem;
    width: 100%;
}


.recipe-card > a {
    display:flex;
    flex-direction: column;
    height: 20rem;
    color: inherit;
    text-decoration:none;
    min-height:0;
}
.recipe-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Photo */
.recipe-card-photo {
    width: 100%;
    flex:0 0 70% ;   
    background: white;
    height: 70%;
    object-fit: cover;
    display: block;
    min-height: 0;
    
}

.recipe-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    object-position: center;
}

.recipe-card-photo.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
    font-size: 0.9rem;
    width: 100%;
    height: 70%;
}

/* Body */
.recipe-card-body {
    height: 30%;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.recipe-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2px;
    line-height: 1.2;
    text-overflow: ellipsis;
    margin-bottom: 0.3rem;
}

.recipe-card-desc {
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.2;
    max-height: 2.6em; /* 2 lines */
    overflow: hidden;
    text-overflow: ellipsis;
}

@media only screen and (max-width: 1200px) {
    .recipe-page {
        width: 90%;
    }
    
}

/* end of recipe_list css*/
    

@media (prefers-color-scheme: dark) {
    .recipe-card {
            background: var(--primary);
            border:solid 1px var(--primary-hover);
    }
}

