/*
 * Recipe detail panel — header, content shell, meta grid.
 * Companion: recipe-step-list.css (steps, ingredients, equipment).
 * The slide-in animation lives in layout.css (.recipe-panel.is-open).
 */

.recipe-panel-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
    position: sticky;
    top: 0;
    z-index: 2;
}

.recipe-panel-back,
.save-recipe-btn {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.recipe-panel-back:hover {
    background: var(--color-surface-hover);
}

.save-recipe-btn:hover,
.save-recipe-btn.is-saved {
    color: var(--color-accent);
    border-color: var(--color-accent);
}

.recipe-panel-title {
    flex: 1 1 auto;
    font-family: var(--font-display, inherit);
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recipe-panel-content {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: var(--space-md);
}

.recipe-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    padding: var(--space-sm);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    text-align: center;
}

.meta-item-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.meta-item-value {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-text);
}

/* Current detail renderer (.rsv*) */
.rsv-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.rsv-row {
    padding: var(--space-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.rsv-key {
    display: block;
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.rsv-val {
    display: block;
    margin-top: 0.15rem;
    color: var(--color-text);
    font-weight: 700;
}

.rsv-section {
    margin-top: var(--space-lg);
}

.rsv-h {
    margin: 0 0 var(--space-sm);
    color: var(--color-text);
    font-size: var(--font-size-lg);
}

.rsv-ing,
.rsv-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-sm);
}

.rsv-ing-item label,
.rsv-step {
    display: flex;
    gap: var(--space-sm);
    align-items: flex-start;
    padding: var(--space-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.rsv-ing-item input {
    width: 18px;
    height: 18px;
    margin: 0.15rem 0 0;
    accent-color: var(--color-accent);
    flex: 0 0 auto;
}

.rsv-ing-name {
    flex: 1 1 auto;
    color: var(--color-text);
    overflow-wrap: anywhere;
}

.rsv-ing-qty {
    margin-left: auto;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.rsv-step-num {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent);
    color: var(--bg-primary);
    font-weight: 800;
    flex: 0 0 auto;
}

.rsv-step-body {
    min-width: 0;
}

.rsv-step-text {
    margin: 0;
    color: var(--color-text);
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.rsv-step-time {
    margin: var(--space-1) 0 0;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

/* Timing breakdown bar */
.rsv-timing {
    margin: var(--space-md) 0;
}
.rsv-timing-bar {
    display: flex;
    width: 100%;
    height: 10px;
    border-radius: var(--radius-full);
    overflow: hidden;
    background: var(--color-surface-hover);
    border: 1px solid var(--color-border);
}
.rsv-timing-seg {
    display: block;
    height: 100%;
    min-width: 2px;
}
.rsv-timing-prep { background: var(--color-accent); }
.rsv-timing-cook { background: var(--color-success); }
.rsv-timing-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-2);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}
.rsv-legend { display: inline-flex; align-items: center; gap: 0.35rem; }
.rsv-dot { width: 8px; height: 8px; border-radius: 50%; }
.rsv-dot-prep { background: var(--color-accent); }
.rsv-dot-cook { background: var(--color-success); }
.rsv-legend-total { margin-left: auto; color: var(--color-text); font-weight: 600; }
