/**
 * Recipe Card Styles Matching Giao diện công thức new.png
 * Sage Green Design System - Clean Typography - Fully Responsive
 *
 * @package AIO_Food_Blog
 */

:root {
    --aio-sage-primary: #57664a;
    --aio-sage-dark: #3f4d34;
    --aio-sage-light: #e3eadd;
    --aio-sage-border: #b9caaa;
    --aio-text-dark: #27272a;
    --aio-text-muted: #52525b;
}

.aio-recipe-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 28px 32px;
    margin: 35px auto;
    max-width: 100%;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--aio-text-dark);
    line-height: 1.6;
}

/* ==========================================================================
   1. HEADER SECTION
   ========================================================================== */
.aio-card-top-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 22px;
}

.aio-card-top-left {
    flex: 1;
}

.aio-recipe-pretitle {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--aio-sage-primary);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.aio-recipe-title {
    font-family: Georgia, Cambria, "Times New Roman", Times, serif;
    font-size: 27px;
    font-weight: 700;
    line-height: 1.28;
    color: #1e1e1e;
    margin: 0 0 12px 0;
}

.aio-meta-pills-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--aio-text-muted);
    letter-spacing: 0.3px;
    margin-bottom: 14px;
}

.aio-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    position: relative;
}

.aio-yield-trigger {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    border-bottom: 1px dashed var(--aio-sage-primary);
    padding-bottom: 1px;
}

.aio-yield-trigger:hover {
    color: var(--aio-sage-primary);
}

.aio-yield-edit-hint {
    font-size: 10px;
    color: var(--aio-sage-primary);
    margin-left: 2px;
}

.aio-yield-stepper-popover {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    padding: 8px 12px;
    z-index: 50;
    display: none;
    flex-direction: column;
    gap: 6px;
    min-width: 130px;
}

.aio-yield-stepper-popover.is-visible {
    display: flex;
}

.aio-popover-label {
    font-size: 11px;
    font-weight: 700;
    color: #4b5563;
    text-transform: uppercase;
}

.aio-stepper-inner {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    overflow: hidden;
}

.aio-stepper-btn {
    background: #f3f4f6;
    border: none;
    color: #1f2937;
    width: 28px;
    height: 28px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.aio-stepper-btn:hover {
    background: #e5e7eb;
}

.aio-stepper-input {
    width: 44px;
    height: 28px;
    text-align: center;
    border: none;
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    outline: none;
}

.aio-meta-dot {
    font-size: 8px;
    color: var(--aio-sage-primary);
}

.aio-meta-pill strong {
    color: #18181b;
    font-weight: 700;
}

.aio-author-link {
    color: #18181b !important;
    text-decoration: underline !important;
}

.aio-recipe-summary {
    font-size: 14.5px;
    font-style: italic;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 12px;
}

.aio-recipe-rating-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
}

.aio-stars-wrap {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.aio-star-btn {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0;
    cursor: pointer;
    color: #d1d5db; /* pale gray when empty */
    display: inline-flex;
    align-items: center;
    transition: color 0.15s ease, transform 0.1s ease;
}

.aio-star-btn svg {
    display: block;
}

.aio-star-btn:hover,
.aio-star-btn:focus,
.aio-star-btn:active {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    transform: scale(1.15);
}

.aio-star-btn svg {
    display: block;
    fill: transparent;
    stroke: #9ca3af;
    stroke-width: 1.5px;
    stroke-linejoin: round;
    transition: all 0.15s ease;
}

.aio-star-btn.is-filled svg {
    fill: #4a5b40;
    stroke: #4a5b40;
}

.aio-stars-wrap:hover .aio-star-btn svg {
    fill: transparent;
    stroke: #d1d5db;
}

.aio-star-btn.is-hover svg {
    fill: #f59e0b !important;
    stroke: #d97706 !important;
    stroke-width: 1.5px !important;
    filter: drop-shadow(0 2px 5px rgba(245, 158, 11, 0.4));
}

.aio-recipe-rating-text {
    color: #71717a;
    font-size: 13px;
}

.aio-rating-msg {
    font-size: 12px;
    font-weight: 600;
    color: #16a34a;
}

.aio-card-top-right {
    flex-shrink: 0;
}

.aio-recipe-featured-thumb {
    width: 135px;
    height: 135px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ==========================================================================
   2. 2 ACTION BUTTONS (SAGE GREEN: PRINT & LEAVE A REVIEW)
   ========================================================================== */
.aio-recipe-action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 28px;
}

.aio-action-btn {
    background-color: var(--aio-sage-primary);
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 4px;
    padding: 10px 14px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s ease-in-out;
}

.aio-action-btn:hover {
    background-color: var(--aio-sage-dark);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.12);
}

.aio-action-btn svg {
    flex-shrink: 0;
}

/* ==========================================================================
   3. SECTIONS COMMON (INGREDIENTS, EQUIPMENT, INSTRUCTIONS, NOTES)
   ========================================================================== */
.aio-recipe-section {
    margin-bottom: 28px;
}

.aio-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 12px;
    margin-bottom: 18px;
}

.aio-section-heading {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.aio-heading-caps {
    letter-spacing: 0.5px;
}

.aio-section-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Unit Toggle US / Metric matching ingredients.png */
.aio-unit-toggle {
    display: inline-flex;
    border: 1px solid #9cb095;
    border-radius: 4px;
    overflow: hidden;
    background: #ffffff;
}

.aio-unit-btn {
    border: none;
    background: #ffffff;
    padding: 5px 14px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #52525b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.aio-unit-btn.is-active {
    background: #9cb095;
    color: #ffffff;
}

/* Servings Multipliers matching ingredients.png: Pill capsules */
.aio-servings-multipliers {
    display: inline-flex;
    gap: 8px;
}

.aio-btn-mult {
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #1f2937;
    border-radius: 9999px; /* Pill capsule shape */
    padding: 3px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.aio-btn-mult:hover {
    border-color: #9cb095;
    color: #9cb095;
}

.aio-btn-mult.is-active {
    background: #9cb095;
    color: #ffffff;
    border-color: #9cb095;
    font-weight: 700;
}

/* ==========================================================================
   4. CHECKLISTS (INGREDIENTS & EQUIPMENT)
   ========================================================================== */
.aio-ingredients-checklist,
.aio-equipment-checklist {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 16px 0 !important;
}

.aio-ing-item,
.aio-equipment-item {
    margin-bottom: 8px;
    line-height: 1.5;
}

.aio-checkbox-label {
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 15px;
}

.aio-checkbox-input {
    display: none !important;
}

.aio-custom-checkbox {
    width: 17px;
    height: 17px;
    border: 1.5px solid #6b7280;
    border-radius: 2px;
    margin-top: 3px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    transition: all 0.15s ease;
}

.aio-checkbox-input:checked + .aio-custom-checkbox {
    background: var(--aio-sage-primary);
    border-color: var(--aio-sage-primary);
}

.aio-checkbox-input:checked + .aio-custom-checkbox::after {
    content: "✓";
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
}

.aio-checkbox-input:checked ~ .aio-ing-details,
.aio-checkbox-input:checked ~ .aio-equipment-details {
    text-decoration: line-through;
    opacity: 0.6;
}

.aio-ing-amount-unit strong {
    font-weight: 700;
    color: #18181b;
}

.aio-ing-link,
.aio-eq-link {
    color: #0369a1 !important;
    text-decoration: underline !important;
}

.aio-ing-link:hover,
.aio-eq-link:hover {
    color: #075985 !important;
}

.aio-ing-notes {
    color: #6b7280;
    font-size: 14px;
}

/* Cook Mode Toggle Row */
.aio-cook-mode-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-top: 1px dashed #e5e7eb;
    margin-top: 14px;
    cursor: pointer;
    user-select: none;
    border-radius: 8px;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.aio-cook-mode-row:hover {
    background-color: #f8fafc;
}

.aio-cook-mode-row.is-active {
    background-color: #f0fdf4;
    border-top-color: transparent;
}

.aio-cook-mode-row.is-active .aio-cook-mode-text strong {
    color: #15803d;
}

.aio-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
    flex-shrink: 0;
}

.aio-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.aio-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 22px;
}

.aio-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .aio-slider {
    background-color: var(--aio-sage-primary);
}

input:checked + .aio-slider:before {
    transform: translateX(16px);
}

.aio-cook-mode-text {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.3;
}

.aio-cook-mode-text strong {
    color: #18181b;
    margin-right: 6px;
}

/* ==========================================================================
   5. INSTRUCTIONS (NUMBERED CIRCLES)
   ========================================================================== */
.aio-instruction-steps {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.aio-step-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 18px;
    font-size: 15px;
    line-height: 1.6;
}

.aio-step-num {
    background-color: #e2e8df;
    color: var(--aio-sage-dark);
    font-weight: 700;
    font-size: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.aio-step-content {
    flex: 1;
}

.aio-step-text strong {
    color: #18181b;
    font-weight: 700;
}

.aio-step-image img {
    margin-top: 10px;
    border-radius: 6px;
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   6. NOTES SECTION
   ========================================================================== */
.aio-notes-bullets {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.aio-notes-bullets li {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 14.5px;
    color: #374151;
    line-height: 1.6;
}

.aio-note-bullet {
    font-size: 8px;
    color: #9ca3af;
    margin-top: 6px;
    flex-shrink: 0;
}

.aio-note-text {
    flex: 1;
}

.aio-note-text strong {
    font-weight: 700;
    color: #1f2937;
}

/* ==========================================================================
   7. NUTRITION INFORMATION BOX
   ========================================================================== */
.aio-nutrition-box {
    background: #fbfbf9;
    border: 1px solid #e7e5e4;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 24px;
    font-size: 12.5px;
    line-height: 1.8;
    color: #57534e;
}

.aio-nutrition-title {
    font-weight: 800;
    color: #292524;
    margin-right: 6px;
    letter-spacing: 0.5px;
}

.aio-nutr-dot {
    font-size: 7px;
    color: #a8a29e;
    vertical-align: middle;
    margin: 0 4px;
    display: inline-block;
}

/* ==========================================================================
   7b. VIDEO EMBED & PLAYER (Under Nutrition - 16:9 Aspect Ratio - No Overflow)
   ========================================================================== */
.aio-recipe-section.aio-video-section {
    margin-top: 24px;
    margin-bottom: 0;
    width: 100%;
    clear: both;
    box-sizing: border-box;
}

.aio-video-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    background: #000000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

@supports not (aspect-ratio: 16 / 9) {
    .aio-video-container {
        padding-bottom: 56.25%;
        height: 0;
    }
}

.aio-video-container iframe,
.aio-video-container video,
.aio-video-container embed,
.aio-video-container object {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    border: 0 !important;
    border-radius: 8px;
    display: block;
    object-fit: contain;
    box-sizing: border-box;
}

/* ==========================================================================
   8. FOOTER CALL-TO-ACTION MATCHING Did you make this recipe.png
   ========================================================================== */
.aio-recipe-footer-cta {
    background: #e5ecd9; /* Soft light sage green from image */
    border-radius: 6px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: center; /* Căn giữa cụm nội dung vào giữa khung */
    gap: 16px;
    margin-top: 26px;
    box-sizing: border-box;
}

.aio-footer-star-badge {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aio-footer-star-badge svg {
    fill: #9cb095;
    width: 32px;
    height: 32px;
}

.aio-footer-cta-text h4 {
    margin: 0 0 4px 0;
    font-size: 17px;
    font-weight: 700;
    color: #273223;
    line-height: 1.3;
}

.aio-footer-cta-text p {
    margin: 0;
    font-size: 13.5px;
    color: #4a5568;
    line-height: 1.4;
}

.aio-footer-cta-text a,
.aio-cta-review-link {
    color: #273223 !important;
    font-weight: 600;
    text-decoration: underline !important;
    transition: color 0.2s ease;
}

.aio-footer-cta-text a:hover,
.aio-cta-review-link:hover {
    color: #1e3a1e !important;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .aio-recipe-card {
        padding: 16px 14px;
    }

    /* Tiêu đề layout 6, Hình 4 nằm ngang trên mobile */
    .aio-card-top-header {
        display: grid;
        grid-template-columns: 6fr 4fr;
        gap: 12px;
        align-items: flex-start;
        margin-bottom: 18px;
    }

    .aio-card-top-header:not(:has(.aio-card-top-right)) {
        display: block;
    }

    .aio-card-top-left {
        min-width: 0;
    }

    .aio-recipe-pretitle {
        font-size: 10.5px;
        letter-spacing: 0.8px;
        margin-bottom: 4px;
    }

    .aio-recipe-title {
        font-size: clamp(16px, 4.5vw, 20px);
        line-height: 1.25;
        margin: 0 0 8px 0;
        word-break: break-word;
    }

    .aio-meta-pills-row {
        gap: 4px 8px;
        font-size: 10.5px;
        margin-bottom: 8px;
    }

    .aio-meta-pill {
        gap: 3px;
    }

    .aio-recipe-summary {
        font-size: 12px;
        line-height: 1.45;
        margin-bottom: 8px;
    }

    .aio-recipe-rating-row {
        gap: 5px;
        font-size: 11.5px;
        flex-wrap: wrap;
    }

    .aio-star-btn svg {
        width: 14px;
        height: 14px;
    }

    .aio-card-top-right {
        width: 100%;
        margin: 0;
    }

    .aio-recipe-featured-thumb {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        object-fit: cover;
        border-radius: 8px;
        display: block;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .aio-recipe-action-buttons {
        grid-template-columns: 1fr;
    }
    .aio-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .aio-recipe-footer-cta {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding: 16px 14px;
    }
    .aio-footer-cta-text {
        text-align: center;
    }
}
