/* =========================================
   PAGES — Recipe to Grocery List v2.0
   ========================================= */

/* ══════════════════════════════════════════
   HOME PAGE: RECIPE LIST
   ══════════════════════════════════════════ */
.recipe-list-section {
  container-type: inline-size;
  container-name: recipe-list;
}

.recipe-category-heading {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-text-muted);
  margin-block: var(--space-6) var(--space-3);
  padding-inline: var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.recipe-category-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

/* ══════════════════════════════════════════
   ADD / EDIT RECIPE PAGE
   ══════════════════════════════════════════ */
.recipe-form__section-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  margin-block-end: var(--space-2);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.ingredients-list,
.steps-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2-5);
}

.recipe-form__add-btn {
  align-self: flex-start;
  margin-block-start: var(--space-2);
}

/* Page header back button */
.page-header .btn-ghost {
  margin-block-start: var(--space-3);
}

/* ══════════════════════════════════════════
   GROCERY LIST PAGE
   ══════════════════════════════════════════ */
.grocery-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-block-end: var(--space-5);
}

/* Progress stats */
.grocery-stats {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--gradient-brand-soft);
  border: 1px solid var(--color-border-brand);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.grocery-stats__icon {
  font-size: 1.75rem;
  filter: drop-shadow(0 2px 6px rgb(16 185 129 / 0.25));
}

.grocery-stats__info { flex: 1; }

.grocery-stats__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  margin-block-end: var(--space-1);
}

.grocery-stats__subtitle {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  font-weight: var(--weight-medium);
}

.grocery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.grocery-category + .grocery-category {
  margin-block-start: 0; /* already handled by gap in grocery-list flex */
}

/* ══════════════════════════════════════════
   MEAL PLAN PAGE
   ══════════════════════════════════════════ */
.meal-plan {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.meal-plan__day {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition:
    box-shadow   var(--transition-base),
    border-color var(--transition-base),
    transform    var(--transition-base);
}

.meal-plan__day:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-strong);
}

.meal-plan__day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  background: var(--gradient-brand-soft);
  border-block-end: 1px solid var(--color-border);
}

.meal-plan__day-name {
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-text-brand);
}

.meal-plan__day-date {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: var(--weight-medium);
  background: var(--color-surface);
  padding: var(--space-0-5) var(--space-2);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
}

.meal-plan__recipes {
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-height: 56px;
}

.meal-plan__recipe-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  transition:
    background    var(--transition-fast),
    border-color  var(--transition-fast);
}

.meal-plan__recipe-item:hover {
  background: var(--color-brand-subtle);
  border-color: var(--color-brand);
}

/* Colored dot for recipe */
.meal-plan__recipe-item::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--gradient-brand);
  flex-shrink: 0;
}

.meal-plan__recipe-title {
  flex: 1;
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}

.meal-plan__recipe-remove {
  flex-shrink: 0;
  padding: var(--space-1);
  min-width: var(--size-touch-min);
  min-height: var(--size-touch-min);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.meal-plan__recipe-remove:hover {
  background: var(--error-bg);
  color: var(--error-text);
}

.meal-plan__add-btn {
  width: 100%;
  justify-content: center;
  border-style: dashed;
  border-color: var(--color-border-strong);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.meal-plan__add-btn:hover {
  border-color: var(--color-brand);
  color: var(--color-brand);
  background: var(--color-brand-subtle);
  border-style: solid;
}

.meal-plan__empty-day {
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  padding: var(--space-3);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
}

/* ── Meal Plan Actions ── */
.meal-plan-actions {
  display: flex;
  gap: var(--space-3);
  margin-block-start: var(--space-5);
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════
   RECIPE PICKER (Meal Plan Modal)
   ══════════════════════════════════════════ */
.recipe-picker {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 320px;
  overflow-y: auto;
  padding-right: var(--space-1);
}

.recipe-picker__item {
  display: flex;
  align-items: center;
  gap: var(--space-2-5);
  padding: var(--space-2-5) var(--space-3);
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
  transition: background var(--transition-fast), transform var(--transition-fast);
  border: 1px solid transparent;
}

.recipe-picker__item:hover {
  background: var(--color-brand-subtle);
  border-color: var(--color-border-brand);
  transform: translateX(2px);
}

/* ══════════════════════════════════════════
   PRINT STYLES
   ══════════════════════════════════════════ */
@media print {
  .app-header,
  .app-nav,
  .skip-link,
  .btn,
  .toast-container,
  .modal,
  .action-bar,
  .search-bar,
  .recipe-card__actions,
  .recipe-card__select,
  .grocery-actions,
  .meal-plan__add-btn,
  .meal-plan__recipe-remove,
  .meal-plan-actions {
    display: none !important;
  }

  .app-main { padding: 0; max-width: 100%; }

  .card,
  .grocery-category {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }

  body { font-size: 12pt; color: #000; background: #fff; }
}