/* ── RECIPE DETAIL ─────────────────────────────────────── */

.recipe-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-highlight);
  margin-bottom: var(--space-lg);
}

#recipe-view-content .page-section {
  margin-top: var(--space-xl);
}

.recipe-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-hero-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--brand-100), var(--brand-200));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-700);
  font-family: var(--font-display);
  font-size: var(--text-3xl);
}

.recipe-info-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: var(--space-md);
  padding: var(--space-lg) 0;
}

.recipe-info-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  text-align: center;
}

.recipe-info-icon {
  width: 24px;
  height: 24px;
  color: var(--brand-600);
}

.recipe-info-value {
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--text-primary);
}

.recipe-info-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.nutrition-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--glass-border);
  font-size: var(--text-sm);
}

.nutrition-item-name {
  color: var(--text-secondary);
  overflow-wrap: break-word;
}

.nutrition-item-value {
  font-weight: 600;
  color: var(--text-primary);
}

.ingredients-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.ingredient-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--glass-bg);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--text-primary);
  overflow-wrap: break-word;
  min-height: var(--touch-target);
  cursor: pointer;
}

.ingredient-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border: 2px solid var(--brand-600);
  border-radius: 4px;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  background: transparent;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.ingredient-checkbox:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
}

.ingredient-checkbox:checked {
  background: var(--brand-600);
  border-color: var(--brand-600);
}

.ingredient-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 11px;
  border: solid var(--text-on-brand);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.ingredient-checkbox:checked+.ingredient-name {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

#edit-recipe-image-area:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
}

.instructions-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.instruction-step {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.step-number {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--brand-700);
  color: var(--text-on-brand);
  font-weight: 700;
  font-size: var(--text-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[data-theme="dark"] .step-number {
  background: var(--brand-600);
  color: #FFEEE4;
}

.step-text {
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: 1.6;
  padding-top: var(--space-xs);
  overflow-wrap: break-word;
}

.step-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  cursor: grab;
  color: var(--text-tertiary);
  border-radius: 4px;
  transition: color 0.15s, background 0.15s, box-shadow 0.15s;
}

.step-drag-handle:hover {
  color: var(--text-secondary);
  background: var(--glass-bg);
}

.step-drag-handle:active {
  cursor: grabbing;
}

.step-drag-handle:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(184, 69, 13, 0.2);
}

.instruction-step.step-dragging {
  opacity: 0.4;
}

.instruction-step.step-drag-over,
.edit-instruction-row.step-drag-over {
  box-shadow: inset 0 3px 0 0 var(--brand-600);
}

.instruction-step.step-drag-over-end,
.edit-instruction-row.step-drag-over-end {
  box-shadow: inset 0 -3px 0 0 var(--brand-600);
}

.edit-instruction-row.step-dragging {
  opacity: 0.4;
}

.edit-instruction-row {
  display: flex;
  gap: var(--space-sm);
}

.import-ingredient-row.edit-instruction-row {
  align-items: flex-start;
}

.edit-instruction-row .glass-textarea {
  flex: 1;
}

.recipe-actions {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-lg) 0;
}

.recipe-actions .btn {
  flex: 1;
}

#btn-favorite.active {
  color: var(--favorite);
  background: var(--favorite-bg);
  border-color: var(--favorite-border);
}

.recipe-source-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  padding: var(--space-sm) 0;
  min-height: var(--touch-target);
  overflow-wrap: break-word;
}

.recipe-source-link:hover {
  color: var(--brand-600);
}

@media (min-width: 768px) {
  .nutrition-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .ingredients-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}