/* DiabeticPlate Recipe Card — Frontend Styles */
/* Designed to complement the Kale WordPress theme */

:root {
    --dp-primary:    #2d7dd2;
    --dp-primary-dk: #1a5fa8;
    --dp-accent:     #f4a532;
    --dp-green:      #27ae60;
    --dp-bg:         #f7f9fc;
    --dp-card:       #ffffff;
    --dp-border:     #e4eaf2;
    --dp-text:       #2c3e50;
    --dp-muted:      #6c7a89;
    --dp-radius:     12px;
    --dp-shadow:     0 4px 20px rgba(0,0,0,0.08);
    --dp-red-light:  #fff5f5;
    --dp-red-border: #fac5c5;
    --dp-blue-light: #eef4fc;
}

/* ── Wrapper ── */
.dprg-recipe-card {
    background: var(--dp-card);
    border: 1px solid var(--dp-border);
    border-radius: 16px;
    box-shadow: var(--dp-shadow);
    margin: 36px 0;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--dp-text);
}

/* ── Card Header ── */
.dprg-card-header {
    background: linear-gradient(135deg, var(--dp-primary) 0%, var(--dp-primary-dk) 100%);
    padding: 32px 36px;
    color: white;
}

.dprg-card-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.dprg-card-title {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
    color: white !important;
}

.dprg-card-tagline {
    margin: 0 0 24px;
    opacity: 0.9;
    font-size: 15px;
    line-height: 1.5;
}

/* ── Quick Stats ── */
.dprg-quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.dprg-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 10px 8px;
    text-align: center;
}

.dprg-stat-icon  { font-size: 20px; }
.dprg-stat-label { font-size: 10px; opacity: 0.75; text-transform: uppercase; letter-spacing: 0.5px; }
.dprg-stat-value { font-size: 14px; font-weight: 700; }

/* ── Nutrition Panel ── */
.dprg-nutrition-panel {
    background: var(--dp-bg);
    padding: 28px 36px;
    border-bottom: 1px solid var(--dp-border);
}

.dprg-nutrition-title {
    margin: 0 0 20px;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.dprg-usda-badge {
    font-size: 11px;
    font-weight: 600;
    background: var(--dp-green);
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

.dprg-nutrition-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.dprg-nutrition-item {
    background: white;
    border: 1px solid var(--dp-border);
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.dprg-nutrition-hero {
    border-color: var(--dp-primary);
    border-width: 2px;
    background: var(--dp-blue-light);
    box-shadow: 0 2px 8px rgba(45,125,210,0.12);
}

.dprg-nutrition-icon  { font-size: 24px; margin-bottom: 2px; }
.dprg-nutrition-value { font-size: 24px; font-weight: 800; line-height: 1; color: var(--dp-text); }
.dprg-nutrition-unit  { font-size: 13px; font-weight: 600; color: var(--dp-muted); margin-left: 2px; }
.dprg-nutrition-label { font-size: 12px; color: var(--dp-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.dprg-nutrition-note  { font-size: 11px; color: var(--dp-muted); }

/* ── Notes Banners ── */
.dprg-diabetic-notes,
.dprg-fat-notes {
    display: flex;
    gap: 16px;
    padding: 20px 36px;
    border-bottom: 1px solid var(--dp-border);
    align-items: flex-start;
}

.dprg-diabetic-notes {
    background: var(--dp-blue-light);
    border-left: 4px solid var(--dp-primary);
}

.dprg-fat-notes {
    background: var(--dp-red-light);
    border-left: 4px solid #e74c3c;
}

.dprg-notes-icon { font-size: 28px; flex-shrink: 0; margin-top: 2px; }
.dprg-diabetic-notes strong,
.dprg-fat-notes strong { display: block; font-size: 14px; margin-bottom: 4px; }
.dprg-diabetic-notes p,
.dprg-fat-notes p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--dp-text); }

/* ── Card Body (Ingredients + Instructions) ── */
.dprg-card-body {
    grid-template-columns: 1fr 1.6fr;
    gap: 0;
}

/* ── Section Titles ── */
.dprg-section-title {
    font-size: 18px !important;
    font-weight: 800 !important;
    margin: 0 0 16px !important;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--dp-border);
    color: var(--dp-text) !important;
}

/* ── Ingredients ── */
.dprg-ingredients {
    padding: 28px 32px;
    border-right: 1px solid var(--dp-border);
    background: #fafbfc;
}

.dprg-ingredient-list { list-style: none; margin: 0; padding: 0; }

.dprg-ingredient {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f2f5;
    font-size: 14px;
}

.dprg-ingredient:last-child { border-bottom: none; }

.dprg-ing-checkbox {
    position: relative;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.dprg-ing-checkbox input { opacity: 0; position: absolute; width: 100%; height: 100%; cursor: pointer; margin: 0; }

.dprg-checkmark {
    position: absolute;
    top: 0; left: 0;
    width: 18px;
    height: 18px;
    border: 2px solid var(--dp-border);
    border-radius: 4px;
    background: white;
    transition: all 0.2s;
    pointer-events: none;
}

.dprg-ing-checkbox input:checked ~ .dprg-checkmark {
    background: var(--dp-green);
    border-color: var(--dp-green);
}

.dprg-ing-checkbox input:checked ~ .dprg-checkmark::after {
    content: '✓';
    position: absolute;
    top: -1px;
    left: 2px;
    color: white;
    font-size: 13px;
    font-weight: 700;
}

.dprg-ingredient.checked .dprg-ing-amount,
.dprg-ingredient.checked .dprg-ing-name { opacity: 0.4; text-decoration: line-through; }

.dprg-ing-amount { font-weight: 700; color: var(--dp-primary); white-space: nowrap; min-width: 60px; }
.dprg-ing-name   { flex: 1; }
.dprg-ing-notes  { font-size: 12px; color: var(--dp-muted); font-style: italic; }

/* ── Instructions ── */
.dprg-instructions {
    padding: 28px 32px;
}

.dprg-instruction-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }

.dprg-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.dprg-step-number {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: var(--dp-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
}

.dprg-step-content { flex: 1; }
.dprg-step-title   { display: block; font-weight: 700; margin-bottom: 4px; font-size: 14px; }
.dprg-step-content p { margin: 0; font-size: 14px; line-height: 1.7; color: #4a5568; }

/* ── Tips ── */
.dprg-tips {
    padding: 24px 36px;
    background: #fffbf0;
    border-top: 1px solid var(--dp-border);
    border-bottom: 1px solid var(--dp-border);
}

.dprg-tips-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dprg-tips-list li {
    font-size: 14px;
    padding: 8px 12px 8px 28px;
    position: relative;
    background: rgba(255,255,255,0.6);
    border-radius: 6px;
}
.dprg-tips-list li::before { content: '→'; position: absolute; left: 10px; color: var(--dp-accent); font-weight: 700; }

/* ── Side Pairings ── */
.dprg-pairings {
    padding: 28px 36px;
    border-bottom: 1px solid var(--dp-border);
}

.dprg-pairings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.dprg-pairing-card {
    background: var(--dp-bg);
    border: 1px solid var(--dp-border);
    border-radius: 8px;
    padding: 16px;
}

.dprg-pairing-card strong { display: block; font-size: 14px; margin-bottom: 6px; color: var(--dp-primary); }
.dprg-pairing-card p { margin: 0; font-size: 13px; color: var(--dp-muted); line-height: 1.5; }

/* ── Storage ── */
.dprg-storage {
    padding: 20px 36px;
    border-bottom: 1px solid var(--dp-border);
    background: var(--dp-bg);
}
.dprg-storage p { margin: 8px 0 0; font-size: 14px; line-height: 1.6; }

/* ── Card Footer ── */
.dprg-card-footer {
    padding: 16px 36px;
    background: #f0f4f8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--dp-muted);
    border-top: 1px solid var(--dp-border);
}

/* ── Force full width — override Kale theme column constraints ── */
#dprg-recipe-card,
#dprg-recipe-card .dprg-recipe-card,
.dprg-recipe-card {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    text-align: left !important;
    box-sizing: border-box;
}

/* ── Featured Image (injected above post content) ── */
.dprg-featured-image-wrap {
    margin: 0 0 32px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--dp-shadow);
    line-height: 0; /* remove gap below image */
}

.dprg-featured-image-wrap .dprg-featured-image,
.dprg-featured-image-wrap img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    max-height: 520px;
    object-fit: cover;
}

/* ── Jump to Recipe Button ── */
.dprg-jump-wrap {
    margin: 0 0 28px;
}

.dprg-jump-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--dp-primary);
    color: #fff !important;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 22px;
    border-radius: 30px;
    text-decoration: none !important;
    border: none;
    transition: background 0.2s, transform 0.15s;
    box-shadow: 0 2px 8px rgba(45,125,210,0.25);
}

.dprg-jump-btn:hover {
    background: var(--dp-primary-dk);
    transform: translateY(-1px);
    color: #fff !important;
}

/* ── Post Blocks ── */
.dprg-post-intro { margin-bottom: 32px; font-size: 16px; line-height: 1.8; text-align: left; }
.dprg-post-body  { margin-bottom: 40px; font-size: 16px; line-height: 1.8; text-align: left; }
.dprg-post-body h2 { font-size: 24px; margin: 32px 0 12px; text-align: left; }
.dprg-post-body h3 { font-size: 20px; margin: 24px 0 10px; text-align: left; }
.dprg-post-body p,
.dprg-post-body ul,
.dprg-post-body ol,
.dprg-post-body li { text-align: left; }

.dprg-disclaimer {
    margin-top: 32px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-left: 4px solid var(--dp-accent);
    border-radius: 8px;
    padding: 16px 20px;
    font-size: 13px;
    color: #5d4037;
    text-align: left;
}
.dprg-disclaimer p { margin: 0; line-height: 1.6; }

/* ── Ingredient checkbox — full row is clickable ── */
.dprg-ingredient {
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 6px;
    padding: 10px 8px;
}

.dprg-ingredient:hover {
    background: #f0f4f8;
}

/* Hide real checkbox, make entire row the label */
.dprg-ing-checkbox {
    position: relative;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    pointer-events: none; /* row handles the click */
}

.dprg-ing-checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.dprg-checkmark {
    position: absolute;
    top: 0; left: 0;
    width: 18px;
    height: 18px;
    border: 2px solid var(--dp-border);
    border-radius: 4px;
    background: white;
    transition: all 0.2s;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dprg-ingredient.checked .dprg-checkmark {
    background: var(--dp-green);
    border-color: var(--dp-green);
}

.dprg-ingredient.checked .dprg-checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.dprg-ingredient.checked .dprg-ing-amount,
.dprg-ingredient.checked .dprg-ing-name,
.dprg-ingredient.checked .dprg-ing-notes {
    opacity: 0.4;
    text-decoration: line-through;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .dprg-card-header { padding: 24px 20px; }
    .dprg-card-title  { font-size: 22px; }
    .dprg-card-body   { grid-template-columns: 1fr; }
    .dprg-ingredients { border-right: none; border-bottom: 1px solid var(--dp-border); }
    .dprg-nutrition-panel,
    .dprg-diabetic-notes,
    .dprg-fat-notes,
    .dprg-tips,
    .dprg-pairings,
    .dprg-storage { padding: 20px; }
    .dprg-tips-list { grid-template-columns: 1fr; }
    .dprg-card-footer { flex-direction: column; text-align: center; }
    .dprg-quick-stats { grid-template-columns: repeat(3, 1fr); }
}
