/*
============================================
VERDANT / RECIPOHUB — Recipe Stylesheet
============================================
Consolidated styles for all recipe-related
templates: single-recipe.php, content-recipe.php,
archive-recipe.php, and the front-page recipe grid.

Do NOT duplicate these rules in style.css.
============================================
*/

/* ============================================================
   LAYOUT — Recipe grid (responsive 1/2/3-col)
   ============================================================ */

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin: 40px 0;
}

/* Tablet: 2-col */
@media (max-width: 1024px) {
    .recipe-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }
}

/* Mobile: 1-col */
@media (max-width: 768px) {
    .recipe-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ============================================================
   ARCHIVE HEADER & EMPTY STATE
   ============================================================ */

.archive-hero {
    background: var(--verdant-footer-bg);
    padding: 60px 20px;
    text-align: center;
    margin-bottom: 40px;
}

.archive-hero .page-header-inner h1 {
    color: var(--verdant-bg);
    font-size: 2.5rem;
    margin: 0 0 12px;
}

.archive-hero .page-header-inner p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.1rem;
    margin: 0;
}

.no-recipes-found {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.no-recipes-found p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 24px;
}

.button {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease;
}

.button-primary {
    background: var(--verdant-primary);
    color: #fff;
}

.button-primary:hover {
    background: #155c3a;
}

@media (max-width: 768px) {
    .archive-hero {
        padding: 40px 16px;
    }

    .archive-hero .page-header-inner h1 {
        font-size: 1.8rem;
    }
}

/* ============================================================
   SINGLE RECIPE PAGE (single-recipe.php)
   ============================================================ */

.recipe-single {
    padding: 40px 0;
}

.recipe-hero {
    position: relative;
    margin: 0 0 40px 0;
    border-radius: 12px;
    overflow: hidden;
    background: #f5f5f5;
}

.recipe-hero-image img {
    width: 100%;
    height: 380px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.recipe-hero-info {
    padding: 30px;
    background: var(--verdant-primary);
    color: #fff;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.recipe-title {
    font-size: 2rem;
    margin: 0 0 12px 0;
    color: #fff;
}

.recipe-intro {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.92);
    margin: 0;
}

/* Meta badges */
.recipe-meta-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.recipe-meta-badges .badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    transition: background 0.2s ease;
}

.recipe-meta-badges .badge:hover {
    background: rgba(255, 255, 255, 0.35);
}

.recipe-meta-badges .badge strong {
    font-weight: 700;
}

/* Badge variants */
.badge-prep { border-color: #5d9f5d; }
.badge-cook { border-color: #6db3a1; }
.badge-total { border-color: #8ab6a8; }
.badge-servings { border-color: #a7c8b9; }
.badge-difficulty { border-color: #c5e1d5; }

/* Section blocks: ingredients / steps / tips */
.recipe-ingredients,
.recipe-steps,
.recipe-tips {
    background: var(--verdant-bg);
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 24px;
    margin: 40px 0;
}

.recipe-ingredients h2,
.recipe-steps h2,
.recipe-tips h2 {
    font-size: 1.3rem;
    margin: 0 0 20px 0;
    color: var(--verdant-heading);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--verdant-primary);
}

/* Lists */
.ingredient-list,
.step-list,
.tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ingredient-list li,
.step-list li,
.tips-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ingredient-list li:last-child,
.step-list li:last-child,
.tips-list li:last-child {
    border-bottom: none;
}

/* Ingredients */
.ingredient-amount {
    font-weight: 600;
    color: var(--verdant-primary);
    min-width: 80px;
    display: inline-block;
}

.ingredient-name {
    color: var(--verdant-body);
}

/* Steps */
.step-list li {
    align-items: flex-start;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--verdant-primary);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    text-align: center;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-heading {
    margin: 0 0 6px 0;
    font-size: 1.05rem;
    color: var(--verdant-heading);
}

.step-body {
    margin: 0;
    line-height: 1.6;
    color: var(--verdant-body);
}

/* Tips */
.recipe-tips .tips-list li {
    background: #f9f9f9;
    padding: 12px 16px;
    border-left: 4px solid var(--verdant-primary);
    margin-bottom: 8px;
    border-radius: 4px;
    list-style: none;
}

/* Fallback (no valid recipe_data) */
.recipe-fallback {
    text-align: center;
    padding: 40px;
    background: #f9f9f9;
    border-radius: 12px;
    border: 2px dashed var(--verdant-primary);
    margin: 40px 0;
}

.recipe-fallback-title {
    color: var(--verdant-primary);
    font-size: 1.5rem;
    margin: 0 0 16px;
}

.recipe-fallback-notice {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 20px;
}

/* --- Mobile tweaks for single recipe --- */
@media (max-width: 1024px) {
    .recipe-hero-info {
        position: static;
        padding: 20px;
        background: var(--verdant-primary);
        color: #fff;
    }

    .recipe-title {
        font-size: 1.6rem;
    }

    .recipe-hero-image img {
        height: 260px;
    }
}

@media (max-width: 768px) {
    .recipe-meta-badges {
        justify-content: center;
    }

    .recipe-meta-badges .badge {
        font-size: 0.8rem;
        padding: 4px 10px;
    }

    .ingredient-amount,
    .step-number {
        min-width: auto;
    }
}

/* ============================================================
   RECIPE CARD (content-recipe.php)
   ============================================================ */

.recipe-card {
    background: var(--verdant-bg);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid transparent;
    overflow: hidden;
}

.recipe-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: rgba(30, 122, 76, 0.3);
}

.recipe-card:focus-within {
    outline: 2px solid var(--verdant-primary);
    outline-offset: 2px;
}

.recipe-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 21;
    overflow: hidden;
    background: var(--verdant-primary);
}

.recipe-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.recipe-card:hover .recipe-card-image img {
    transform: scale(1.05);
}

.recipe-card-image-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--verdant-primary);
    font-size: 3rem;
}

.recipe-card-image-fallback .recipe-card-image-emoji {
    display: block;
}

.recipe-card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.recipe-card-body {
    padding: 20px 20px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.recipe-card-title {
    font-size: 1.2rem;
    margin: 0 0 8px 0;
    color: var(--verdant-heading);
    line-height: 1.4;
}

.recipe-card-title a {
    text-decoration: none;
    color: inherit;
}

.recipe-card-title a:focus {
    outline: 2px solid var(--verdant-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

.recipe-card-link-title {
    text-decoration: none;
    color: inherit;
}

.recipe-card-excerpt {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.recipe-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.recipe-card-meta .badge-small {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(30, 122, 76, 0.15);
    color: var(--verdant-primary);
    border: 1px solid rgba(30, 122, 76, 0.3);
}

.recipe-card-meta .badge-small .badge-difficulty {
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(30, 122, 76, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ============================================================
   ADSENSE SLOTS (single-recipe.php)
   ============================================================ */

.recipe-ad {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 40px 0;
    padding: 20px 0;
    min-height: 100px;
    width: 100%;
    text-align: center;
    clear: both;
}

.recipe-ad-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #aaa;
    margin-bottom: 8px;
}

.recipe-ad .adsbygoogle {
    max-width: 728px;
    width: 100%;
}