/**
 * Featured Recipes Shortcode CSS
 * Optimized for shortcode use with adjusted margins and spacing
 */

/* Main Grid Container */
.handy-featured-recipes-grid {
    display: grid;
    gap: 40px;
    justify-content: center;
    align-items: start;
    margin: 0 auto 30px auto; /* Less aggressive negative margin for shortcode */
    max-width: 1440px;
    padding: 0 20px;
}

/* Default 3-column layout */
.handy-featured-recipes-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1200px;
}

/* Recipe Cards - Matching archive styling exactly */
.handy-featured-recipes-grid .recipe-card {
    background: white;
    border-radius: 31px;
	border: 1px solid #E7EDF0;
    overflow: hidden;
    box-shadow: 15px 25px 0px #2329330F;
    margin-bottom: 30px; /* Reduced from 60px for shortcode */
    min-width: 350px; /* Slightly smaller for shortcode context */
}

.handy-featured-recipes-grid .recipe-card:hover {
    /* No hover effect currently */
}

.handy-featured-recipes-grid .recipe-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.handy-featured-recipes-grid .recipe-card-link:hover {
    text-decoration: none;
    color: inherit;
}

/* Recipe Image Container */
.handy-featured-recipes-grid .recipe-card-image-container {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.handy-featured-recipes-grid .recipe-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.handy-featured-recipes-grid .recipe-card-image-placeholder {
    width: 100%;
    height: 100%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1.125rem;
    font-weight: 500;
}

/* Recipe Content */
.handy-featured-recipes-grid .recipe-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.handy-featured-recipes-grid .recipe-card-title {
    font-family: Poppins, sans-serif;
    margin: 0 0 12px 0;
    font-size: 1.625rem;
    font-weight: 700;
    color: #0145AB;
    line-height: 1.2;
}

.handy-featured-recipes-grid .recipe-card-description {
    font-family: Poppins, sans-serif;
    font-weight: 400;
    margin: 0 0 15px 0;
    line-height: 1.6;
    color: #3E434A;
    font-size: 1.125rem;
}

/* Recipe Meta (Prep Time & Servings) */
.handy-featured-recipes-grid .recipe-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid #e9ecef;
    font-family: Poppins, sans-serif;
    position: relative;
}

.handy-featured-recipes-grid .recipe-card-meta::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1px;
    height: 60%;
    background-color: #e9ecef;
}

.handy-featured-recipes-grid .recipe-prep-time,
.handy-featured-recipes-grid .recipe-servings {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 1rem;
    color: #6c757d;
}

.handy-featured-recipes-grid .recipe-icon {
    font-size: 1rem;
    color: #B6006E;
}

.handy-featured-recipes-grid .recipe-prep-time-text,
.handy-featured-recipes-grid .recipe-servings-text {
    font-weight: 400;
	font-size: .875rem;
	font-style: italic;
    color: #627680;
}

/* Dynamic centering based on number of recipes - Less aggressive margins for shortcode */
.handy-featured-recipes-grid[data-columns="1"] {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto 30px auto; /* No negative margin for shortcode */
}

.handy-featured-recipes-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
    max-width: 800px;
    margin: 0 auto 30px auto; /* No negative margin for shortcode */
}

.handy-featured-recipes-grid[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1200px;
    margin: 0 auto 30px auto; /* No negative margin for shortcode */
}

/* Responsive design for Featured Recipes */
@media (max-width: 1199px) {
    /* On tablets, 3 cards become 2+1, 2 cards stay 2, 1 card stays 1 */
    .handy-featured-recipes-grid[data-columns="3"] {
        grid-template-columns: repeat(2, 1fr);
        max-width: 700px;
    }
    
    .handy-featured-recipes-grid[data-columns="2"] {
        grid-template-columns: repeat(2, 1fr);
        max-width: 700px;
    }
    
    .handy-featured-recipes-grid[data-columns="1"] {
        grid-template-columns: 1fr;
        max-width: 350px;
    }
    
    .handy-featured-recipes-grid {
        gap: 30px;
    }
    
    /* Tablet optimization for recipe cards */
    .handy-featured-recipes-grid .recipe-card {
        min-width: 300px;
    }
}

@media (max-width: 768px) {
    /* On mobile, all layouts become single column */
    .handy-featured-recipes-grid[data-columns="1"],
    .handy-featured-recipes-grid[data-columns="2"],
    .handy-featured-recipes-grid[data-columns="3"] {
        grid-template-columns: 1fr;
        max-width: 100%;
        gap: 20px;
        margin: 0 auto 20px auto;
    }
    
    /* Mobile optimization for recipe cards */
    .handy-featured-recipes-grid .recipe-card {
        min-width: 100%;
        margin-bottom: 20px;
    }
    
    .handy-featured-recipes-grid .recipe-card-title {
        font-size: 1.4rem;
    }
    
    .handy-featured-recipes-grid .recipe-card-content {
        padding: 15px;
    }
}

@media (max-width: 549px) {
    .handy-featured-recipes-grid {
        padding: 0 10px;
        gap: 15px;
    }
    
    .handy-featured-recipes-grid .recipe-card {
        margin-bottom: 15px;
    }
    
    .handy-featured-recipes-grid .recipe-card-image-container {
        height: 150px;
    }
}
