/* ========================================
   recipes.css — Strona wszystkich przepisów
   ======================================== */

/* ---- Page Header ---- */
.recipes-header {
  padding: calc(var(--nav-height) + 4rem) 0 3rem;
  text-align: center;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-subtle);
}

.recipes-page-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 800;
  color: var(--text-primary);
  margin: 0.5rem 0 0.75rem;
  line-height: 1;
}

.recipes-page-subtitle {
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  color: var(--text-secondary);
  margin-bottom: 3rem;
  letter-spacing: 0.02em;
}

/* ---- Filter Tabs Grid (Responsive Auto-Grouping 6 -> 3x2 -> 2x3) ---- */
.recipes-filters-wrap {
  width: 100%;
  max-width: 980px;
  margin: 0 auto 2.2rem;
  box-sizing: border-box;
}

/* ========================================================
   CATEGORY FILTER DROPDOWN (Rozsuwane Menu Wyboru Kategorii)
   ======================================================== */
.recipes-filter-dropdown-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 1.6rem 0 1.25rem;
  position: relative;
  z-index: 50;
}

.filter-dropdown {
  position: relative;
  width: 100%;
  max-width: 320px;
}

.filter-dropdown-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.85rem 1.4rem;
  background: var(--bg-elevated, #2A231E);
  border: 1.5px solid rgba(200, 150, 100, 0.28);
  border-radius: 100px;
  color: var(--text-primary, #FAF6F0);
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: all 0.25s var(--ease-out, ease);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  gap: 0.75rem;
}

.filter-dropdown-btn:hover {
  border-color: var(--accent-terracotta, #C8522C);
  background: #322b25;
  box-shadow: 0 8px 25px rgba(200, 82, 44, 0.25);
  transform: translateY(-1px);
}

.filter-dropdown.is-open .filter-dropdown-btn {
  border-color: var(--accent-gold, #D4A745);
  box-shadow: 0 0 0 2px rgba(212, 167, 69, 0.35), 0 8px 25px rgba(0, 0, 0, 0.5);
  background: #322b25;
}

.filter-dropdown-current {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary, #FAF6F0);
}

.filter-dropdown-chevron {
  flex-shrink: 0;
  color: var(--accent-gold, #D4A745);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.filter-dropdown.is-open .filter-dropdown-chevron {
  transform: rotate(180deg);
}

/* Rozwijana lista opcji */
.filter-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(34, 28, 24, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(200, 150, 100, 0.25);
  border-radius: 20px;
  padding: 0.55rem;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.75), 0 0 25px rgba(200, 82, 44, 0.15);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 3px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s ease;
  pointer-events: none;
}

.filter-dropdown.is-open .filter-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.filter-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.7rem 1.15rem;
  background: transparent;
  border: none;
  border-radius: 12px;
  color: var(--text-secondary, #B8A99A);
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

.filter-dropdown-item .item-label {
  flex: 1;
  pointer-events: none;
}

.filter-dropdown-item .item-check {
  font-size: 0.9rem;
  color: var(--accent-terracotta, #C8522C);
  opacity: 0;
  transform: scale(0.7);
  transition: all 0.2s ease;
  pointer-events: none;
}

.filter-dropdown-item:hover {
  background: rgba(250, 246, 240, 0.06);
  color: var(--text-primary, #FAF6F0);
  padding-left: 1.35rem;
}

.filter-dropdown-item.active {
  background: rgba(200, 82, 44, 0.16);
  color: var(--accent-terracotta, #C8522C);
  font-weight: 700;
}

.filter-dropdown-item.active .item-check {
  opacity: 1;
  transform: scale(1);
}

/* Wariant Pro w rozwijanej liście */
.filter-dropdown-item.filter-dropdown-pro {
  color: var(--accent-gold, #D4A745);
  font-weight: 600;
}

.filter-dropdown-item.filter-dropdown-pro:hover {
  background: rgba(212, 167, 69, 0.1);
  color: #fff;
}

.filter-dropdown-item.filter-dropdown-pro.active {
  background: rgba(212, 167, 69, 0.2);
  color: var(--accent-gold, #D4A745);
}

.filter-dropdown-item.filter-dropdown-pro.active .item-check {
  color: var(--accent-gold, #D4A745);
}

@media (max-width: 540px) {
  .recipes-header {
    padding: calc(var(--nav-height) + 1.25rem) 0 1.25rem;
  }
  .recipes-page-title {
    font-size: clamp(2rem, 8.5vw, 2.8rem);
  }
  .recipes-page-subtitle {
    margin-bottom: 1.2rem;
    font-size: 0.88rem;
  }
  .recipes-filter-dropdown-wrap {
    margin: 1.2rem 0 1rem;
  }
  .filter-dropdown {
    max-width: 100%;
  }
  .filter-dropdown-btn {
    padding: 0.78rem 1.2rem;
    font-size: 0.98rem;
  }
}

/* ---- Search Bar ---- */
.recipes-search-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.recipes-search {
  position: relative;
  width: 100%;
  max-width: 520px;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 1.2rem;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}

#recipeSearch {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  padding: 0.85rem 3rem 0.85rem 3rem;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

#recipeSearch::placeholder {
  color: var(--text-muted);
}

#recipeSearch:focus {
  border-color: var(--accent-terracotta);
  box-shadow: 0 0 0 3px rgba(200, 82, 44, 0.12);
}

.search-clear {
  position: absolute;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem;
  display: none;
  transition: color 0.2s ease;
}

.search-clear:hover {
  color: var(--text-primary);
}

.recipes-count {
  font-size: var(--fs-small);
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  min-height: 1.4em;
}

/* ---- Recipe Grid ---- */
.recipes-grid-section {
  background: var(--bg-primary);
  padding: 3rem 0 14rem;
  overflow: visible;
}

.recipes-grid {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  max-width: 1040px;
  margin: 0 auto;
  width: 100%;
}

/* Karta w katalogu przepisów — pełna spójność ze stroną główną (.featured-card) */
.rcard.featured-card {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  position: relative;
  /* Subtelny Ambient Glow wokół kart w katalogu */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4),
              0 0 24px rgba(200, 82, 44, 0.22);
}

/* ========================================
   DESKTOP SPOTLIGHT & ZOOM (Wersja na PC)
   Aktualny przepis jest na środku ekranu i lekko powiększony (scale 1.05),
   a poprzednie i następne karty są widoczne u góry i u dołu (scale 0.92, opacity 0.55).
   ======================================== */
@media (min-width: 769px) {
  .rcard.featured-card {
    height: 430px;
    min-height: 430px;
    max-height: 450px;
    grid-template-columns: 1fr 1.15fr;
    transform: scale(0.92);
    opacity: 0.55;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.4s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4),
                0 0 18px rgba(200, 82, 44, 0.15);
  }

  /* Zapewnienie, że wideo i zdjęcia mają DOKŁADNIE taką samą wysokość i nie rozpychają karty */
  .rcard.featured-card .featured-card-image {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    aspect-ratio: auto;
    overflow: hidden;
  }

  .rcard.featured-card .featured-card-image img,
  .rcard.featured-card .featured-card-image video {
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
  }

  /* Zbalansowany układ treści z gapem, żeby tekst opisu nigdy nie był ucinany */
  .rcard.featured-card .featured-card-content {
    height: 100%;
    max-height: 100%;
    padding: 1.85rem 2.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    gap: 0.65rem;
  }

  .rcard.featured-card .featured-card-content > * {
    flex-shrink: 0;
  }

  .rcard.featured-card .featured-card-content .mono-label {
    margin: 0 !important;
  }

  .rcard.featured-card .featured-card-content h3 {
    font-size: clamp(1.35rem, 2vw, 1.75rem) !important;
    line-height: 1.25 !important;
    margin: 0 !important;
    color: var(--text-primary) !important;
  }

  .rcard.featured-card .featured-card-content p {
    font-size: 0.92rem !important;
    line-height: 1.55 !important;
    margin: 0 !important;
    color: var(--text-secondary) !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
  }

  .rcard.featured-card .featured-card-content .recipe-meta {
    margin: 0.1rem 0 !important;
  }

  .rcard.featured-card:not(.is-focused):hover {
    opacity: 0.82;
    transform: scale(0.95);
    border-color: rgba(200, 82, 44, 0.3);
  }

  /* Wyśrodkowana, aktywna karta */
  .rcard.featured-card.is-focused {
    transform: scale(1.05);
    opacity: 1;
    border-color: rgba(200, 82, 44, 0.55);
    box-shadow: 0 22px 65px rgba(0, 0, 0, 0.65),
                0 0 42px rgba(200, 82, 44, 0.38);
    z-index: 10;
  }

  .rcard.featured-card.is-focused:hover {
    transform: scale(1.07);
    box-shadow: 0 28px 75px rgba(0, 0, 0, 0.72),
                0 0 50px rgba(200, 82, 44, 0.48);
  }
}

/* Stan ukryty dla wyszukiwarki i filtrów */
.rcard.hidden {
  display: none !important;
}

/* ---- Empty state ---- */
.recipes-empty {
  text-align: center;
  padding: 6rem 2rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.recipes-empty button {
  margin-top: 1.5rem;
}

/* ---- Section Paging w katalogu przepisów (html.recipes-snap) ---- */
html.recipes-snap {
  /* Płynne przewijanie obsługiwane bezpośrednio przez JS window.scrollTo({ behavior: 'smooth' }) */
}

html.recipes-snap .recipes-header {
  scroll-margin-top: 0;
}

/* ---- Stopka na stronie katalogu przepisów (Wyśrodkowana) ---- */
.site-footer {
  padding: 3rem 0 2.5rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-primary);
  text-align: center;
  width: 100%;
}

.footer-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  margin: 0 auto;
}

.site-footer .logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 0.25rem;
}

.footer-copy {
  font-size: var(--fs-small);
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

