/* ============================================================
   CARTE RECETTE
   ============================================================ */

.zc-recipe-card {
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    max-width: 720px;
    margin: 32px auto;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
}

/* Image */
.zc-recipe-card__image img {
    width: 100%;
    height: 340px;
    object-fit: cover;
    display: block;
}

/* Header */
.zc-recipe-card__header {
    padding: 20px 24px 16px;
}
.zc-recipe-card__title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #1a1a1a;
}
.zc-recipe-card__description {
    color: #555;
    font-size: 14px;
    margin: 0 0 14px;
    line-height: 1.6;
}

/* ============================================================
   BARRE ACTIONS : votes (gauche) + impression (droite)
   ============================================================ */

.zc-recipe-card__actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    gap: .75rem;
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 1px solid #f0f0f0;
}

.zc-recipe-card__actions .zc-rating {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: wrap;
    gap: .4rem;
    flex: 1 1 auto;
    min-width: 0;
    width: auto !important;
}

.zc-recipe-card__actions .zc-print-btn--inline {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* ============================================================
   RATING — widget dans la carte
   ============================================================ */

.zc-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.zc-rating__stars {
    display: flex;
    gap: 3px;
    cursor: pointer;
}
.zc-star {
    font-size: 24px;
    color: #ddd;
    transition: color .15s, transform .1s;
    line-height: 1;
}
.zc-star--filled { color: #f5a623; }
.zc-star--hover  { color: #f5a623; transform: scale(1.15); }
.zc-rating__stars.zc-rated .zc-star { cursor: default; }
.zc-rating__info {
    font-size: 13px;
    color: #777;
}
.zc-rating__value {
    font-weight: 700;
    color: #333;
}

/*
 * CORRECTIF CLÉ :
 * width:100% forçait le message sur une nouvelle ligne
 * et cassait le flex de .zc-recipe-card__actions.
 * On le remplace par width:auto + display:none par défaut.
 */
.zc-rating__message {
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 4px;
    margin-top: 4px;
    display: none;
    width: auto;       /* ← était width:100%, c'était la cause */
    flex-basis: 100%;  /* repasse sur une nouvelle ligne quand visible */
}
.zc-msg--success { background: #eaffea; color: #2d7a2d; }
.zc-msg--info    { background: #eaf3ff; color: #1a5fa8; }
.zc-msg--error   { background: #ffeaea; color: #a81a1a; }

/* ============================================================
   MÉTA
   ============================================================ */

.zc-recipe-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}
.zc-meta-item {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 8px;
    border-right: 1px solid #f0f0f0;
    text-align: center;
}
.zc-meta-item:last-child { border-right: none; }
.zc-meta-icon  { font-size: 20px; margin-bottom: 4px; }
.zc-meta-label { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: #999; margin-bottom: 2px; }
.zc-meta-value { font-size: 14px; font-weight: 700; color: #333; }

/* ============================================================
   SECTIONS
   ============================================================ */

.zc-recipe-card__section {
    padding: 20px 24px;
    border-top: 1px solid #f0f0f0;
}
.zc-recipe-card__section h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 14px;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.zc-group-name {
    font-size: 14px;
    margin: 10px 0 4px;
    color: #555;
}

/* ============================================================
   ONGLETS INGRÉDIENTS / ÉTAPES
   ============================================================ */

.zc-tabs {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
}
.zc-tabs-nav {
    display: flex;
    border-bottom: 2px solid #e0a030;
    background: #fafafa;
}
.zc-tab-btn {
    flex: 1;
    padding: .75rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: .95rem;
    font-weight: 600;
    color: #888;
    transition: color .2s, background .2s;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}
.zc-tab-btn:hover  { color: #e0a030; background: #fff8ec; }
.zc-tab-btn.active { color: #b07020; border-bottom-color: #e0a030; background: #fff; }

.zc-tab-panel          { padding: 1.2rem 1.4rem; background: #fff; }
.zc-tab-panel[hidden],
.zc-tab-panel:not(.active) { display: none !important; }
.zc-tab-panel.active       { display: block !important; }

/* Ingrédients */
.zc-ingredient-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}
.zc-ingredient-list li {
    padding: .4rem 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: .95rem;
}
.zc-ingredient-list li:last-child { border-bottom: none; }
.zc-ingredient-group {
    font-size: .9rem;
    font-weight: 700;
    color: #b07020;
    margin: 1rem 0 .4rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.zc-ingredient-note {
    color: #999;
    font-size: .85rem;
    font-style: italic;
}

/* Étapes */
.zc-steps-list {
    padding-left: 0;
    counter-reset: step-counter;
    list-style: none;
}
.zc-step {
    counter-increment: step-counter;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-bottom: 1.4rem;
    padding-bottom: 1.4rem;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    padding-left: 2.8rem;
}
.zc-step:last-child { border-bottom: none; margin-bottom: 0; }
.zc-step::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: .1rem;
    width: 2rem;
    height: 2rem;
    background: #e0a030;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .9rem;
    flex-shrink: 0;
}
.zc-step p { margin: 0; font-size: .95rem; line-height: 1.6; }
.zc-step-img {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: 6px;
}
.zc-step-name {
    display: block;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #1a1a1a;
}
.zc-empty { color: #aaa; font-style: italic; font-size: .9rem; }

/* ============================================================
   NUTRITION
   ============================================================ */

.zc-nutrition-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.zc-nutrition-item {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 12px 16px;
    text-align: center;
    min-width: 80px;
    flex: 1;
}
.zc-nutrition-item span  { display: block; font-size: 18px; font-weight: 700; color: #f5a623; }
.zc-nutrition-item small { font-size: 11px; color: #999; text-transform: uppercase; letter-spacing: .4px; }

/* ============================================================
   BOUTON IMPRESSION
   ============================================================ */

/* Version standalone (shortcode [zc_print_recipe]) */
.zc-print-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: #e0a030;
    color: #fff;
    padding: .55rem 1.2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: .95rem;
    transition: background .2s;
}
.zc-print-btn:hover { background: #b07020; color: #fff; }

/* Version inline dans la carte */
.zc-print-btn--inline {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
    padding: .4rem .9rem;
    font-size: .85rem;
    background: #f5f5f5;
    color: #555;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: background .2s, color .2s, border-color .2s;
}
.zc-print-btn--inline:hover {
    background: #e0a030;
    color: #fff;
    border-color: #e0a030;
}

/* ============================================================
   RATING STANDALONE [zc_rating]
   ============================================================ */

.zc-rating-standalone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    margin: 1.8rem auto;
    padding: 1.4rem 2rem;
    max-width: 360px;
    background: #fffbf2;
    border: 1px solid #f0d080;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    text-align: center;
}
.zc-rating-label {
    font-size: 1.05rem;
    font-weight: 700;
    color: #333;
    margin: 0;
    letter-spacing: .01em;
}
.zc-rating-standalone .zc-stars-input {
    display: flex;
    gap: .3rem;
}
.zc-rating-standalone .zc-stars-input .zc-star {
    font-size: 2.2rem;
    cursor: pointer;
    color: #ddd;
    transition: color .15s, transform .1s;
    line-height: 1;
}
.zc-rating-standalone .zc-stars-input .zc-star.active,
.zc-rating-standalone .zc-stars-input .zc-star.hover {
    color: #e0a030;
    transform: scale(1.15);
}
.zc-rating-summary {
    font-size: .9rem;
    color: #666;
    margin: 0;
}
.zc-rating-summary strong { color: #b07020; font-size: 1rem; }
.zc-vote-message {
    font-size: .88rem;
    color: #2a7a2a;
    font-style: italic;
    margin: 0;
}

/* ============================================================
   GRILLE DE RECETTES
   ============================================================ */

.zc-grid-heading {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: #222;
    border-bottom: 2px solid #e0a030;
    padding-bottom: .35rem;
}
.zc-recipe-grid {
    display: grid;
    gap: 1.2rem;
    margin-bottom: 2rem;
}
.zc-grid-cols-1 { grid-template-columns: 1fr; }
.zc-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.zc-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.zc-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.zc-grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
.zc-grid-cols-6 { grid-template-columns: repeat(6, 1fr); }

.zc-recipe-card-grid {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
    transition: transform .2s, box-shadow .2s;
    background: #fff;
    max-height: 320px;
    display: flex;
    flex-direction: column;
}
.zc-recipe-card-grid:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 14px rgba(0,0,0,.13);
}
.zc-card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
    overflow: hidden;
}
.zc-card-image {
    width: 100%;
    height: 160px;
    flex-shrink: 0;
    overflow: hidden;
    background: #f5f5f5;
}
.zc-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}
.zc-recipe-card-grid:hover .zc-card-image img { transform: scale(1.04); }
.zc-card-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #ccc;
}
.zc-card-body {
    padding: .7rem .9rem;
    display: flex;
    flex-direction: column;
    gap: .3rem;
    flex: 1;
    overflow: hidden;
}
.zc-card-title {
    font-size: .92rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.35;
    color: #222;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.zc-card-meta {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    margin-top: auto;
}
.zc-card-rating {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 1px;
    font-size: .95rem;
    line-height: 1;
}
.zc-card-rating .zc-star--full  { color: #e0a030; }
.zc-card-rating .zc-star--half  { color: #e0a030; opacity: .5; }
.zc-card-rating .zc-star--empty { color: #d0d0d0; }
.zc-card-rating-value {
    font-size: .78rem;
    color: #666;
    margin-left: .4rem;
    white-space: nowrap;
}
.zc-card-no-rating { font-size: .78rem; color: #bbb; font-style: italic; }
.zc-card-time { font-size: .8rem; color: #666; display: flex; align-items: center; gap: .25rem; }
.zc-icon-clock { flex-shrink: 0; }
.zc-grid-empty { color: #888; font-style: italic; padding: 1rem 0; }

/* ============================================================
   RECETTES SIMILAIRES
   ============================================================ */

.zc-related-section {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e0a030;
}
.zc-related-title { font-size: 1.3rem; margin-bottom: 1rem; }

/* ============================================================
   BOUTON SAUVEGARDER
   ============================================================ */

.zc-fav-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: #fff;
    color: #e0a030;
    border: 2px solid #e0a030;
    border-radius: 4px;
    padding: .45rem 1rem;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, color .2s;
    margin-bottom: 1rem;
}
.zc-fav-btn:hover,
.zc-fav-btn.saved { background: #e0a030; color: #fff; }
.zc-fav-empty { color: #888; font-style: italic; padding: 1rem 0; }

/* ============================================================
   RECHERCHE LIVE
   ============================================================ */

.zc-search-wrap {
    position: relative;
    max-width: 520px;
    margin: 0 auto 1.5rem;
}
.zc-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.zc-search-input {
    width: 100%;
    padding: .65rem 2.8rem .65rem 1rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color .2s;
}
.zc-search-input:focus { outline: none; border-color: #e0a030; }
.zc-search-icon  { position: absolute; right: 2.2rem; color: #aaa; pointer-events: none; }
.zc-search-clear { position: absolute; right: .5rem; background: none; border: none; cursor: pointer; color: #aaa; font-size: 1rem; padding: 0 .3rem; }
.zc-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    z-index: 999;
    max-height: 420px;
    overflow-y: auto;
}
.zc-search-item {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .6rem .9rem;
    text-decoration: none;
    color: #222;
    border-bottom: 1px solid #f5f5f5;
    transition: background .15s;
}
.zc-search-item:hover { background: #fff8ec; }
.zc-search-item-img {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}
.zc-search-item-img img { width: 100%; height: 100%; object-fit: cover; }
.zc-search-item-body { display: flex; flex-direction: column; gap: .15rem; }
.zc-search-item-title { font-weight: 600; font-size: .95rem; }
.zc-search-item-body small { color: #888; font-size: .8rem; }
.zc-search-loading,
.zc-search-noresult { padding: .8rem 1rem; color: #888; font-size: .9rem; }

/* ============================================================
   COMMENTAIRES RECETTE
   ============================================================ */

.zc-comments-section {
    margin-top: 3rem;
    border-top: 2px solid #e0a030;
    padding-top: 1.5rem;
}
.zc-comments-title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .8rem;
}
.zc-global-rating { font-size: .95rem; color: #e0a030; font-weight: 400; }
.zc-comment {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}
.zc-comment--reply {
    margin-left: 3rem;
    padding-left: 1rem;
    border-left: 3px solid #e0a030;
    border-bottom: none;
}
.zc-comment-avatar {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e0a030;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}
.zc-comment-body { flex: 1; }
.zc-comment-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .4rem;
    font-size: .9rem;
}
.zc-comment-author { font-size: 1rem; }
.zc-comment-stars .zc-star { font-size: .95rem; }
.zc-comment-date { color: #999; }
.zc-comment-text { line-height: 1.6; color: #333; margin-bottom: .5rem; }
.zc-reply-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #e0a030;
    font-size: .85rem;
    padding: 0;
    text-decoration: underline;
}
.zc-no-comments { color: #888; font-style: italic; }
.zc-comment-form-wrap {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 1.5rem;
    margin-top: 2rem;
}
.zc-comment-form-wrap h4 { margin-top: 0; font-size: 1.15rem; margin-bottom: 1rem; }
.zc-form-row { display: flex; gap: 1rem; }
.zc-form-row--half .zc-form-group { flex: 1; }
.zc-form-group { display: flex; flex-direction: column; margin-bottom: 1rem; }
.zc-form-group label { font-size: .9rem; font-weight: 600; margin-bottom: .3rem; }
.zc-form-group .req { color: #e05030; }
.zc-form-group input,
.zc-form-group textarea {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: .5rem .75rem;
    font-size: .95rem;
    font-family: inherit;
    transition: border-color .2s;
}
.zc-form-group input:focus,
.zc-form-group textarea:focus { border-color: #e0a030; outline: none; }
.zc-stars-form .zc-star { font-size: 1.6rem; cursor: pointer; color: #ddd; transition: color .15s; }
.zc-stars-form .zc-star.active,
.zc-stars-form .zc-star.hover { color: #e0a030; }
.zc-star-clear { cursor: pointer; font-size: .9rem; color: #bbb; margin-left: .5rem; vertical-align: middle; }
.zc-form-footer { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.zc-submit-btn {
    background: #e0a030;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: .6rem 1.4rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
.zc-submit-btn:hover { background: #b07020; }
.zc-submit-btn:disabled { opacity: .6; cursor: not-allowed; }
.zc-form-message { font-size: .9rem; }
.zc-form-message.success { color: #2a7a2a; }
.zc-form-message.error   { color: #c0392b; }
.zc-reply-notice {
    background: #fff8ec;
    border-left: 3px solid #e0a030;
    padding: .5rem .75rem;
    font-size: .9rem;
    margin-bottom: .75rem;
    border-radius: 0 4px 4px 0;
}

/* ============================================================
   RESPONSIVE GLOBAL
   ============================================================ */

@media (max-width: 900px) {
    .zc-grid-cols-3,
    .zc-grid-cols-4,
    .zc-grid-cols-5,
    .zc-grid-cols-6 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
    .zc-recipe-grid       { grid-template-columns: 1fr; }
    .zc-recipe-card__image img { height: 220px; }
    .zc-meta-item         { min-width: 80px; padding: 10px 6px; }
    .zc-star              { font-size: 20px; }
    .zc-form-row          { flex-direction: column; }
    .zc-comment--reply    { margin-left: 1rem; }
}

@media (max-width: 480px) {
    .zc-recipe-card__actions {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    .zc-recipe-card__actions .zc-rating {
        width: 100% !important;
    }
    .zc-recipe-card__actions .zc-print-btn--inline {
        width: 100%;
        justify-content: center;
    }
}

