/* =============================================================================
   HOME — homepage-only component styles
   Conditionally loaded on is_front_page() via inc/setup.php
   All values reference tokens from style.css :root
   ============================================================================= */


/* =============================================================================
   HERO — SEARCH VARIANT
   ============================================================================= */

.hero--search {
  text-align: center;
  padding-bottom: var(--mfc-space-12);
}

.hero--search .hero__subtitle {
  color: var(--mfc-text-secondary);
  font-size: var(--mfc-text-lg);
  margin: var(--mfc-space-3) auto 0;
  max-width: 480px;
}

.hero__search {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 560px;
  margin: var(--mfc-space-8) auto 0;
  background: #fff;
  border: 1.5px solid var(--mfc-border);
  border-radius: var(--mfc-radius-full);
  box-shadow: 0 2px 16px rgba(28, 43, 30, 0.07);
  transition:
    box-shadow var(--mfc-transition),
    border-color var(--mfc-transition);
}

.hero__search:focus-within {
  border-color: var(--mfc-electric);
  box-shadow: 0 4px 24px rgba(122, 175, 135, 0.22);
}

.hero__search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: var(--mfc-space-4) var(--mfc-space-5);
  font-size: var(--mfc-text-base);
  font-family: var(--mfc-font);
  color: var(--mfc-text);
  outline: none;
  border-radius: var(--mfc-radius-full) 0 0 var(--mfc-radius-full);
  min-width: 0;
}

.hero__search-input::placeholder {
  color: var(--mfc-text-muted);
}

/* WebKit search cancel button resets */
.hero__search-input::-webkit-search-decoration,
.hero__search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.hero__search-btn {
  flex-shrink: 0;
  margin: 4px 4px 4px 0;
  padding: var(--mfc-space-3) var(--mfc-space-4);
  background: var(--mfc-electric);
  color: var(--mfc-deep); /* white fails contrast on pastel sage */
  border: none;
  border-radius: var(--mfc-radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--mfc-transition);
}

.hero__search-btn:hover {
  background: var(--mfc-electric-dark);
}

.hero__chips {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--mfc-space-2);
  margin-top: var(--mfc-space-5);
}

.hero__chips-label {
  font-size: var(--mfc-text-sm);
  font-weight: 600;
  color: var(--mfc-text-muted);
}

.hero__chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  background: rgba(107, 158, 120, 0.08);
  border: 1.5px solid rgba(107, 158, 120, 0.22);
  border-radius: var(--mfc-radius-full);
  font-size: var(--mfc-text-sm);
  font-weight: 600;
  color: var(--mfc-forest);
  text-decoration: none;
  transition:
    background var(--mfc-transition),
    border-color var(--mfc-transition),
    color var(--mfc-transition);
}

.hero__chip:hover {
  background: var(--mfc-electric-surface);
  border-color: var(--mfc-electric);
  color: var(--mfc-electric-dark);
}

.hero__chips-divider {
  color: var(--mfc-text-muted);
  font-size: var(--mfc-text-sm);
  line-height: 1;
  pointer-events: none;
}

.hero__surprise {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: var(--mfc-pop-surface);
  border: 1.5px solid rgba(244, 162, 97, 0.35);
  border-radius: var(--mfc-radius-full);
  font-size: var(--mfc-text-sm);
  font-weight: 700;
  color: var(--mfc-pop-dark);
  text-decoration: none;
  transition:
    background var(--mfc-transition),
    border-color var(--mfc-transition),
    transform var(--mfc-transition),
    opacity var(--mfc-transition);
}

.hero__surprise:hover {
  background: rgba(244, 162, 97, 0.18);
  border-color: var(--mfc-pop);
  transform: translateY(-1px);
}

.hero__surprise.is-loading {
  pointer-events: none;
  opacity: 0.65;
}

.hero__surprise-icon {
  display: inline-block;
  line-height: 1;
  transition: transform 0.15s ease;
}

.hero__surprise:hover .hero__surprise-icon {
  transform: rotate(15deg) scale(1.15);
}

.hero__surprise.is-loading .hero__surprise-icon {
  animation: mfc-dice-spin 0.5s linear infinite;
}

@keyframes mfc-dice-spin {
  0%   { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(180deg) scale(0.8); }
  100% { transform: rotate(360deg) scale(1); }
}

@media (max-width: 768px) {
  .hero--search {
    padding-bottom: var(--mfc-space-10);
  }

  .hero__search {
    max-width: 100%;
  }

  .hero--search .hero__subtitle {
    font-size: var(--mfc-text-base);
  }
}


/* =============================================================================
   DINNER FINDER TEASER — seeded entry module (replaces the goal quiz)
   Deep-links into the /dinner-finder/ tool with a protein pre-selected.
   Markup: front-page.php · URL/proteins: inc/dinner-finder.php
   ============================================================================= */

.mfc-df-teaser-section {
  padding-top: 0;
}

.mfc-df-teaser {
  background: var(--mfc-bg-secondary);
  border: 1px solid var(--mfc-border);
  border-radius: var(--mfc-radius-xl);
  padding: var(--mfc-space-8) var(--mfc-space-10);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--mfc-space-10);
  align-items: center;
}

.mfc-df-teaser__intro {
  display: flex;
  flex-direction: column;
  gap: var(--mfc-space-3);
}

.mfc-df-teaser__title {
  font-size: var(--mfc-text-3xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--mfc-text);
  margin: 0;
}

.mfc-df-teaser__subtitle {
  font-size: var(--mfc-text-lg);
  line-height: 1.55;
  color: var(--mfc-text-secondary);
  margin: 0;
  max-width: 42ch;
}

.mfc-df-teaser__picker {
  display: flex;
  flex-direction: column;
  gap: var(--mfc-space-4);
}

.mfc-df-teaser__prompt {
  font-size: var(--mfc-text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mfc-text-tertiary);
}

.mfc-df-teaser__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--mfc-space-2);
}

.mfc-df-teaser__chip {
  display: inline-flex;
  align-items: center;
  gap: var(--mfc-space-2);
  padding: 10px var(--mfc-space-4);
  background: var(--mfc-bg);
  border: 1.5px solid var(--mfc-border);
  border-radius: var(--mfc-radius-full);
  font-size: var(--mfc-text-sm);
  font-weight: 700;
  color: var(--mfc-text);
  text-decoration: none;
  transition:
    border-color var(--mfc-transition),
    background var(--mfc-transition),
    transform var(--mfc-transition),
    box-shadow var(--mfc-transition);
}

.mfc-df-teaser__chip:hover {
  border-color: var(--mfc-electric);
  background: var(--mfc-electric-surface);
  color: var(--mfc-deep);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(122, 175, 135, 0.18);
}

.mfc-df-teaser__chip-emoji {
  font-size: 1.1rem;
  line-height: 1;
}

.mfc-df-teaser__more {
  display: inline-flex;
  align-items: center;
  padding: 10px var(--mfc-space-2);
  font-size: var(--mfc-text-sm);
  font-weight: 700;
  color: var(--mfc-forest);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--mfc-transition), border-color var(--mfc-transition);
}

.mfc-df-teaser__more:hover {
  color: var(--mfc-electric-dark);
  border-bottom-color: currentColor;
}

@media (max-width: 900px) {
  .mfc-df-teaser {
    grid-template-columns: 1fr;
    gap: var(--mfc-space-6);
    padding: var(--mfc-space-6);
  }

  .mfc-df-teaser__title {
    font-size: var(--mfc-text-2xl);
  }

  .mfc-df-teaser__subtitle {
    font-size: var(--mfc-text-base);
  }
}


/* =============================================================================
   RECIPE FEED TABS (replaces .mfc-recipe-filters)
   ============================================================================= */

.mfc-feed-tabs {
  display: flex;
  gap: var(--mfc-space-2);
  flex-wrap: wrap;
  margin-bottom: var(--mfc-space-8);
}

.mfc-feed-tab {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: var(--mfc-radius-full);
  border: 1.5px solid var(--mfc-border);
  background: transparent;
  font-size: var(--mfc-text-sm);
  font-weight: 600;
  color: var(--mfc-text-secondary);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background var(--mfc-transition),
    border-color var(--mfc-transition),
    color var(--mfc-transition);
}

.mfc-feed-tab:hover {
  border-color: var(--mfc-electric);
  color: var(--mfc-electric-dark);
}

.mfc-feed-tab.is-active {
  background: var(--mfc-electric);
  border-color: var(--mfc-electric);
  color: var(--mfc-deep); /* matches .archive-filter-pill.is-active */
}


/* =============================================================================
   RECIPE CARD ITEM WRAPPER (filter target)
   display: contents = transparent to the grid, but exists in DOM for data attrs
   ============================================================================= */

.recipe-card-item {
  display: contents;
}

.recipe-card-item.is-hidden {
  display: none;
}



/* =============================================================================
   CATEGORY ICONS ROW
   ============================================================================= */

.mfc-categories {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  justify-items: center;
  gap: var(--mfc-space-6) var(--mfc-space-4);
}

.mfc-category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--mfc-space-2);
  text-decoration: none;
  color: var(--mfc-text);
  transition: color var(--mfc-transition);
}

.mfc-category-item:hover {
  color: var(--mfc-forest);
}

.mfc-category-item:hover .mfc-category-item__icon {
  transform: translateY(-4px) scale(1.05);
  box-shadow:
    0 10px 28px rgba(28, 43, 30, 0.13),
    0 0 0 3px var(--mfc-border);
}

/* Fluid circle: shrinks with the grid column so the 8-col row never
   overflows on narrow desktops/tablets (columns go under 112px below ~1080px) */
.mfc-category-item__icon {
  width: clamp(72px, 9.5vw, 112px);
  height: clamp(72px, 9.5vw, 112px);
  border-radius: var(--mfc-radius-full);
  background: var(--mfc-bg-secondary);
  color: var(--mfc-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  transition:
    transform var(--mfc-transition-slow),
    box-shadow var(--mfc-transition-slow);
}

/* SVG icons (fallback path) scale with the circle */
.mfc-category-item__icon svg {
  width: 50%;
  height: 50%;
  display: block;
  flex-shrink: 0;
}

/* Uploaded images fill the full circle */
.mfc-category-item__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--mfc-radius-full);
}

/* Per-category accent colours */
.mfc-category-item--breakfast    .mfc-category-item__icon { background: var(--mfc-electric-surface); color: var(--mfc-electric-dark); }
.mfc-category-item--main-course  .mfc-category-item__icon { background: var(--mfc-bg-stone); color: var(--mfc-text-secondary); }
.mfc-category-item--snack        .mfc-category-item__icon { background: var(--mfc-forest-surface); color: var(--mfc-forest); }
.mfc-category-item--high-protein .mfc-category-item__icon { background: var(--mfc-bg-secondary); color: var(--mfc-forest); }
.mfc-category-item--low-calorie-recipes .mfc-category-item__icon { background: var(--mfc-forest-surface); color: var(--mfc-forest); }
.mfc-category-item--keto         .mfc-category-item__icon { background: var(--mfc-bg-tertiary); color: var(--mfc-text-secondary); }

.mfc-category-item__label {
  font-size: var(--mfc-text-xs);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--mfc-text-secondary);
  text-align: center;
  transition: color var(--mfc-transition);
}

.mfc-category-item:hover .mfc-category-item__label {
  color: var(--mfc-forest);
}


/* =============================================================================
   SECTION HEADER (eyebrow + h2 + optional "See all" link)
   ============================================================================= */

.mfc-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--mfc-space-4);
  margin-bottom: var(--mfc-space-8);
}

.mfc-section-header__text {
  display: flex;
  flex-direction: column;
  gap: var(--mfc-space-2);
}

.mfc-section-header__text h2 {
  margin: 0;
}

.mfc-section-header__link {
  font-size: var(--mfc-text-sm);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--mfc-forest);
  text-decoration: none;
  white-space: nowrap;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: border-color var(--mfc-transition), color var(--mfc-transition);
}

.mfc-section-header__link:hover {
  color: var(--mfc-forest);
  border-bottom-color: var(--mfc-forest);
}


/* =============================================================================
   RECIPE CATEGORY FILTER PILLS
   Individual pill styles come from archive.css (.archive-filter-pill)
   ============================================================================= */

.mfc-recipe-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mfc-space-2);
  margin-bottom: var(--mfc-space-8);
}


/* =============================================================================
   LATEST ARTICLES LIST
   ============================================================================= */

.mfc-post-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: var(--mfc-space-10);
}


/* =============================================================================
   NEWSLETTER SECTION
   ============================================================================= */

.newsletter__inner {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--mfc-space-6);
}

.newsletter__headline {
  font-size: var(--mfc-text-4xl);
  font-weight: 800;
  color: var(--mfc-text-inverse);
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.newsletter__headline em {
  font-style: normal;
  color: var(--mfc-electric);
}

.newsletter__subtitle {
  color: rgba(245, 249, 246, 0.65);
  font-size: var(--mfc-text-lg);
  line-height: 1.5;
  margin: 0;
}

/* Kit/ConvertKit form override — force brand styles */
.newsletter__inner .ck-form,
.newsletter__inner form {
  width: 100%;
  max-width: 440px;
}

.newsletter__inner .form-inline {
  width: 100%;
  max-width: 440px;
}


/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 768px) {
  .mfc-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--mfc-space-2);
  }

  .mfc-post-list {
    grid-template-columns: 1fr;
  }

  .newsletter__headline {
    font-size: var(--mfc-text-3xl);
  }
}

/* =============================================================================
   MEET MATT
   ============================================================================= */

.mfc-meet-matt {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: var(--mfc-space-16);
  align-items: center;
}

.mfc-meet-matt__photo img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--mfc-radius-xl);
  display: block;
}

.mfc-meet-matt__placeholder {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--mfc-radius-xl);
  background: var(--mfc-bg-tertiary);
  border: 2px dashed var(--mfc-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mfc-text-muted);
  font-size: var(--mfc-text-sm);
  font-weight: 600;
  text-align: center;
  padding: var(--mfc-space-6);
}

.mfc-meet-matt__text {
  display: flex;
  flex-direction: column;
  gap: var(--mfc-space-4);
}

.mfc-meet-matt__name {
  font-size: var(--mfc-text-4xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.0;
  color: var(--mfc-text);
  margin: 0;
}

.mfc-meet-matt__tagline {
  font-size: var(--mfc-text-sm);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--mfc-forest);
  margin: 0;
}

.mfc-meet-matt__bio {
  font-size: var(--mfc-text-lg);
  line-height: 1.65;
  color: var(--mfc-text-secondary);
  max-width: 500px;
  margin: var(--mfc-space-2) 0 0;
}


@media (max-width: 768px) {
  .mfc-meet-matt {
    grid-template-columns: 1fr;
    gap: var(--mfc-space-8);
  }

  .mfc-meet-matt__photo img,
  .mfc-meet-matt__placeholder {
    max-width: 280px;
    margin: 0 auto;
  }

  .mfc-meet-matt__text {
    text-align: center;
    align-items: center;
  }

  .mfc-meet-matt__bio {
    text-align: left;
  }

  .mfc-meet-matt__name {
    font-size: var(--mfc-text-3xl);
  }
}

@media (max-width: 768px) {
  .mfc-categories {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--mfc-space-6) var(--mfc-space-3);
  }

  /* 4-col row: 19vw keeps 4 circles + gaps inside even 320px viewports */
  .mfc-category-item__icon {
    width: clamp(56px, 19vw, 96px);
    height: clamp(56px, 19vw, 96px);
  }
}
