/* ── Recipe index page ── */
.recipe-index {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-7);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* ── Toolbar: title + total count + new button ── */
.recipe-index__toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.recipe-index__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--ink);
  margin: 0;
}

.recipe-index__total {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--ink-lt);
  flex: 1;
}

/* ── Search ── */
.recipe-index__search-wrap {
  position: relative;
}

.recipe-index__search {
  width: 100%;
  padding: 0.6em var(--space-5);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--ink);
  background: var(--warm-white);
  border: 2.5px solid var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--duration-fast);
}

.recipe-index__search::placeholder {
  color: var(--peach-dk);
  font-weight: 600;
}

.recipe-index__search:focus {
  border-color: var(--coral);
}

/* ── Tag filters ── */
.recipe-index__filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.recipe-index__filter-tag {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 800;
  color: var(--ink-lt);
  background: var(--warm-white);
  border: 2px solid var(--paper);
  border-radius: var(--radius-full);
  padding: 0.25em 0.85em;
  cursor: pointer;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: border-color var(--duration-fast), color var(--duration-fast), background var(--duration-fast);
  white-space: nowrap;
  user-select: none;
}

.recipe-index__filter-tag:hover {
  border-color: var(--coral);
  color: var(--coral);
}

.recipe-index__filter-checkbox {
  display: none;
}

.recipe-index__filter-count {
  opacity: 0.55;
  font-weight: 600;
  margin-left: 0.3rem;
}

.recipe-index__filter-tag:has(.recipe-index__filter-checkbox:checked) {
  background: var(--coral);
  border-color: var(--coral);
  color: white;
}

/* ── Results frame ── */
.recipe-index__results {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.recipe-index__count {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--ink-lt);
}

.recipe-index__empty {
  color: var(--ink-lt);
  font-style: italic;
}

/* ── Category section ── */
.recipe-index__section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  scroll-margin-top: var(--space-4);
}

.recipe-index__category {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.recipe-index__category-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--card-bg-2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.13), 0 0 0 2px rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.recipe-index__category-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-index__category-initial {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: color-mix(in srgb, white 85%, transparent);
}

.recipe-index__category-info {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  min-width: 0;
  flex: 1;
  border-bottom: 3px solid var(--paper);
  padding-bottom: var(--space-2);
}

.recipe-index__category-name {
  margin: 0;
  line-height: 1;
}

.recipe-index__category-name a {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--ink);
  text-decoration: none;
}

.recipe-index__category-name a:hover {
  color: var(--coral);
}

.recipe-index__category-count {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--ink-lt);
}

/* ── Dense column list ── */
.recipe-index__columns {
  columns: 2;
  column-gap: var(--space-6);
}

@media (min-width: 640px) {
  .recipe-index__columns {
    columns: 3;
  }
}

.recipe-index__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 0.3em 0;
  border-bottom: 1px solid var(--paper);
  text-decoration: none;
  break-inside: avoid;
  color: inherit;
}

.recipe-index__item:hover .recipe-index__item-name {
  color: var(--coral);
}

.recipe-index__item-name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--ink);
  flex: 1;
  min-width: 0;
  transition: color var(--duration-fast);
}

.recipe-index__item-time {
  font-size: var(--text-2xs);
  font-weight: 800;
  color: var(--ink-lt);
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Mobile ── */
@media (max-width: 599px) {
  .recipe-index {
    padding: var(--space-4);
    gap: var(--space-5);
  }

  .recipe-index__title {
    font-size: var(--text-xl);
  }

  /* Horizontal scroll strip instead of wrapping rows */
  .recipe-index__filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: var(--space-1);
  }

  .recipe-index__filters::-webkit-scrollbar {
    display: none;
  }

  /* Adequate tap targets on filter pills */
  .recipe-index__filter-tag {
    min-height: 44px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }

  .recipe-index__columns {
    columns: 1;
  }

  /* Adequate tap targets on recipe items */
  .recipe-index__item {
    min-height: 44px;
    align-items: center;
    padding: var(--space-2) 0;
  }
}
