/* =========================================================
   Kirby Features CSS
   ---------------------------------------------------------
   Purpose:
   Styles for Kirby-native features added on top of
   Webflow-exported layouts, including:

   - Ingredient → Product card grids
   - Ingredient → Blog card grids
   - Pagination navigation for related content

   These styles are intentionally isolated so Webflow CSS
   can be removed cleanly in the future.
   ========================================================= */


/* =========================================================
   INGREDIENT → PRODUCT CARDS
   ========================================================= */

.ingredient-related-products {
  margin-top: 3rem;
}

/* Grid container for product cards */
.ingredient-product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* Individual product card (entire card is clickable) */
.ingredient-product-card {
  display: flex;
  flex-direction: column;
  align-items: center;   /* Center image + title */
  text-align: center;
  text-decoration: none;
}

/* Product image:
   Fixed height + object-fit ensures all rows align cleanly
*/
.ingredient-product-card img {
  width: 100%;
  max-width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 0.5rem;
}

/* Product title under image */
.ingredient-product-title {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: underline;
}


/* =========================================================
   PRODUCT PAGINATION (PREVIOUS / NEXT)
   ========================================================= */

.ingredient-product-nav {
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  max-width: 680px;
}

.ingredient-product-nav a {
  text-decoration: underline;
  font-weight: 500;
}


/* =========================================================
   INGREDIENT → RELATED BLOG CARDS
   ========================================================= */

.ingredient-related-blogs {
  margin-top: 3rem;
}

/* Grid container for blog cards */
.ingredient-blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* Individual blog card */
.ingredient-blog-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
}

/* Blog image:
   Slightly shorter than product cards for visual hierarchy
*/
.ingredient-blog-card img {
  width: 100%;
  max-width: 200px;
  height: 140px;
  object-fit: cover;
  border-radius: 0.5rem;
}

/* Blog title under image */
.ingredient-blog-title {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: underline;
}


/* =========================================================
   BLOG PAGINATION
   ========================================================= */

.ingredient-blog-nav {
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  max-width: 680px;
}

.ingredient-blog-nav a {
  text-decoration: underline;
  font-weight: 500;
}


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

/* Tablet */
@media (max-width: 768px) {
  .ingredient-product-grid,
  .ingredient-blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ingredient-product-card img {
    max-width: 160px;
    height: 160px;
  }

  .ingredient-blog-card img {
    max-width: 160px;
    height: 120px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .ingredient-product-grid,
  .ingredient-blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .ingredient-product-card img {
    max-width: 140px;
    height: 140px;
  }

  .ingredient-blog-card img {
    max-width: 140px;
    height: 110px;
  }

  .ingredient-product-title,
  .ingredient-blog-title {
    font-size: 0.9rem;
  }
}
/* =========================================================
   HEADER SEARCH – FORCE BLACK (NO BROWSER DEFAULTS)
   ========================================================= */

.navbar7_search-input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  background-color: #000 !important;
  color: #fff !important;

  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 4px;

  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;

  caret-color: #fff;
}

/* Placeholder */
.navbar7_search-input::placeholder {
  color: rgba(255,255,255,0.6);
}

/* Focus */
.navbar7_search-input:focus {
  outline: none;
  border-color: #fff;
}

/* =========================================================
   Header search layout integration
   ========================================================= */

.navbar7_menu-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar7_search {
  display: flex;
  align-items: center;
}

@media (max-width: 768px) {
  .navbar7_search {
    width: 100%;
    margin-top: 0.75rem;
  }

  .navbar7_search-input {
    width: 100%;
  }
}

/* =========================================================
   Search page layout adjustments
   ========================================================= */

/* Make search grids denser than ingredient pages */
.search-results-group .ingredient-product-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

/* Slightly smaller blog cards in search */
.search-results-group .ingredient-blog-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

/* Ingredient cards in search (no image) */
.search-results-group
  .ingredient-product-card
  .ingredient-product-title {
  padding: 1.25rem;
  text-align: center;
  font-weight: 600;
}
/* =========================================================
   Search page – reduce product card image height
   ---------------------------------------------------------
   Search results reuse ingredient-product-card styles,
   but need a tighter visual footprint.
   ========================================================= */

.search-results-group .ingredient-product-card img {
  max-height: 180px;
  object-fit: cover;
}

/* =========================================================
   Search page – FINAL left-aligned grid + cards
   ---------------------------------------------------------
   The ingredient/product grids were designed for centered
   detail pages. On the search page we need strict,
   left-aligned, list-like behavior for fast scanning.
   ========================================================= */

/* Force grid items to start at the left edge */
.search-results-group .ingredient-product-grid,
.search-results-group .ingredient-blog-grid {
  justify-items: start;
}

/* Left-align entire card contents */
.search-results-group .ingredient-product-card,
.search-results-group .ingredient-blog-card {
  align-items: flex-start;
  text-align: left;
}

/* Remove implicit centering caused by image sizing */
.search-results-group .ingredient-product-card img,
.search-results-group .ingredient-blog-card img {
  margin-left: 0;
  margin-right: 0;
}

/* Ensure titles span full width and align left */
.search-results-group .ingredient-product-title,
.search-results-group .ingredient-blog-title {
  width: 100%;
  text-align: left;
}

/* Ensure excerpts align left */
.search-results-group .search-article-excerpt {
  text-align: left;
}

/* =========================================================
   Footer – FORCE social icon layout & sizing (FINAL)
   ========================================================= */

/* Take control of bottom footer layout (override Webflow) */
.footer7_bottom-wrapper {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 1.5rem;
  width: 100%;
}

/* Social icon container */
.footer7_social-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Normalize ALL social icons */
.footer7_social-links img {
  width: 24px;
  height: 24px;
  object-fit: contain; /* CRITICAL for Instagram PNG */
  display: block;
}

/* Ensure links don’t add spacing weirdness */
.footer7_social-links a {
  display: inline-flex;
  align-items: center;
}

/* Mobile stacking */
@media (max-width: 600px) {
  .footer7_bottom-wrapper {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.75rem;
  }
}
/* =========================================================
   Accent Button Override (GREEN)
   Overrides Webflow button background-image
   ========================================================= */

.button-1.is-accent.w-button {
  background-image: none !important; /* CRITICAL */
  background-color: var(--_primitives---colors--fruit-salad) !important;
  color: #ffffff !important;
}

.button-1.is-accent.w-button:hover {
  background-image: none !important;
  background-color: var(--_primitives---colors--fruit-salad-dark) !important;
}

/* =========================================================
   OVERRIDE WEBFLOW INPUT STYLES (HEADER SEARCH)
   ========================================================= */

.navbar7_search-input,
.navbar7_search-input.w-input {
  background-color: #000 !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.4) !important;
}

.navbar7_search-input::placeholder {
  color: rgba(255,255,255,0.6) !important;
}
/* =========================================================
   Search page – force readable colors
   ========================================================= */

.section_blog {
  background-color: #000;
  color: #fff;
}

.section_blog a {
  color: #fff;
}

/* =========================================================
   PRODUCTS IMAGE GRID OVERLAY — RESPONSIVE (DESKTOP → MOBILE)
   Matches markup:
   .image-grid-card (relative)
   .image-grid-card .absolute.inset-0 (overlay)
========================================================= */

/* Ensure the card has a predictable image area so overlay has room */
.image-grid-card {
  /* If your images don’t have a fixed height coming from elsewhere,
     this prevents “short cards” on mobile that cause overflow. */
  aspect-ratio: 1 / 1;
}

@media (min-width: 768px) {
  .image-grid-card {
    aspect-ratio: 4 / 5;
  }
}

/* Make sure the image fills the card area */
.image-grid-card > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Overlay: gradient for readability + responsive padding */
.image-grid-card > .absolute.inset-0 {
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.78),
    rgba(0,0,0,0.35),
    rgba(0,0,0,0.05)
  ) !important;

  padding: clamp(0.75rem, 3vw, 1.5rem) !important;
}

/* Responsive title sizing */
.image-grid-card > .absolute.inset-0 h3 {
  font-size: clamp(1.05rem, 2.8vw, 1.6rem);
  line-height: 1.2;
  margin: 0 0 0.25rem 0;
}

/* Responsive body sizing (desktop/tablet) */
.image-grid-card > .absolute.inset-0 p {
  font-size: clamp(0.9rem, 2.2vw, 1.05rem);
  line-height: 1.45;
  margin: 0;
}

/* =========================================================
   MOBILE: limit body copy (OPTIONAL)
   Keep headline only to prevent overflow
========================================================= */
@media (max-width: 640px) {
  .image-grid-card > .absolute.inset-0 {
    padding: 0.75rem !important;
  }

  .image-grid-card > .absolute.inset-0 h3 {
    font-size: 1rem;
  }

  /* Hide the paragraph on mobile */
  .image-grid-card > .absolute.inset-0 p {
    display: none !important;
  }
}
/* Override utility font sizes inside image grid overlay */
.image-grid-card > .absolute.inset-0 p {
  font-size: clamp(0.9rem, 2.2vw, 1.05rem) !important;
  line-height: 1.45;
}