/* Scope all styles to the cook page only */
.page--cook {
  --cook-spacing-section: 4rem;
  --cook-spacing-gap: 1.5rem;
}

/* Hero Section */
.page--cook .cook-hero {
  padding: 6rem 1.5rem;
  text-align: center;
  background-color: var(--color-bg-secondary, #f5f5f5);
  border-bottom: 1px solid var(--color-border, #e0e0e0);
}

.page--cook .cook-hero__content {
  max-width: 800px;
  margin: 0 auto;
}

.page--cook #cook-hero-title {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--color-text-primary, #333);
}

.page--cook .cook-hero__subtitle {
  font-size: 1.25rem;
  color: var(--color-text-secondary, #666);
  margin-bottom: 2rem;
}

.page--cook .cook-hero__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.page--cook .cook-hero__actions .btn-primary {
  background: var(--color-primary, #2d5016);
  border-color: var(--color-primary, #2d5016);
  color: #fff;
}

/* Generic Section Styling */
.page--cook .cook-section {
  padding: var(--cook-spacing-section) 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  /* Advertising space on sides */
  padding-left: calc(1.5rem + 300px);
  padding-right: calc(1.5rem + 300px);
}

@media (max-width: 1800px) {
  .page--cook .cook-section {
    padding-left: calc(1.5rem + 250px);
    padding-right: calc(1.5rem + 250px);
  }
}

@media (max-width: 1600px) {
  .page--cook .cook-section {
    padding-left: calc(1.5rem + 200px);
    padding-right: calc(1.5rem + 200px);
  }
}

@media (max-width: 1400px) {
  .page--cook .cook-section {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* For Feed Section, allow wider container for 8 items */
.page--cook .cook-section--feed {
  max-width: 95%; /* Use most of the screen width */
}

.page--cook .cook-section__header {
  text-align: center;
  margin-bottom: 3rem;
}

.page--cook .cook-section__header h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--color-text-primary, #333);
}

/* Horizontal Sections Container */
.page--cook .cook-section--horizontal {
  padding-top: 3rem;
  padding-bottom: 3rem;
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}

.page--cook .cook-horizontal-sections__container {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.page--cook .cook-horizontal-section {
  width: 100%;
}

.page--cook .cook-horizontal-section__header {
  margin-bottom: 2rem;
}

.page--cook .cook-horizontal-section__title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-text-primary, #333);
}

.page--cook .cook-horizontal-section__subtitle {
  font-size: 1rem;
  color: var(--color-text-secondary, #666);
}

/* Series Grid - Horizontal Scroll */
.page--cook .cook-series__grid-horizontal {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  overflow-y: visible;
  padding: 1rem 0 1.5rem 0;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  justify-content: flex-start;
}

@media (min-width: 1400px) {
  .page--cook .cook-series__grid-horizontal {
    justify-content: center;
  }
}

.page--cook .cook-series__grid-horizontal::-webkit-scrollbar {
  height: 8px;
}

.page--cook .cook-series__grid-horizontal::-webkit-scrollbar-track {
  background: var(--color-bg-secondary, #f5f5f5);
  border-radius: 4px;
}

.page--cook .cook-series__grid-horizontal::-webkit-scrollbar-thumb {
  background: var(--color-primary, #2ecc71);
  border-radius: 4px;
}

.page--cook .cook-series__grid-horizontal .series-card {
  flex: 0 0 320px;
  scroll-snap-align: start;
}

.page--cook .series-card {
  background: var(--color-bg-card, #fff);
  border: 2px solid var(--color-border, #e0e0e0);
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.page--cook .series-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-color: var(--color-primary, #2ecc71);
}

.page--cook .series-card__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--color-text-primary, #333);
  line-height: 1.3;
}

.page--cook .series-card__meta {
  font-size: 0.9rem;
  color: var(--color-text-secondary, #666);
  margin-bottom: 1rem;
  font-weight: 500;
}

.page--cook .series-card__description {
  flex-grow: 1;
  color: var(--color-text-secondary, #666);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.page--cook .series-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  font-weight: 600;
  color: var(--color-primary, #2ecc71);
  text-decoration: none;
  transition: all 0.3s ease;
}

.page--cook .series-card__link:hover {
  gap: 0.75rem;
  color: var(--color-primary-dark, #27ae60);
}

.page--cook .series-card__link::after {
  content: '→';
  transition: transform 0.3s ease;
}

.page--cook .series-card:hover .series-card__link::after {
  transform: translateX(4px);
}

/* ============================================
   SUBCATEGORIES EXPANDABLE GRID (Fiverr Top Layout)
   ============================================ */
.page--cook .cook-section--subcategories {
  padding-top: 2rem;
  padding-bottom: 2rem;
  max-width: 95%; /* Allow wider container for 5 columns */
}

.page--cook .cook-subcategories__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  align-items: flex-start;
}

.page--cook .cook-subcategory {
  background: var(--color-bg-card, #fff);
  border-radius: 8px;
  border: 1px solid var(--color-border, #e0e0e0);
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 240px;
  height: auto;
  min-height: 160px;
  z-index: 1;
}

.page--cook .cook-subcategory:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  border-color: var(--color-primary, #2ecc71);
  transform: translateY(-4px);
  z-index: 10;
}

/* Active State for Subcategories (Selected Filter) */
.page--cook .cook-subcategory.active {
  border-color: var(--color-primary, #2ecc71);
  background-color: var(--color-bg-card, #fff);
  box-shadow: 0 0 0 3px var(--color-primary-light, #e8f8f5);
}

.page--cook .cook-subcategory.active .cook-subcategory__title {
  color: var(--color-primary, #2ecc71);
  font-weight: 700;
}

.page--cook .cook-subcategory.active .cook-subcategory__icon {
  background-color: var(--color-primary-light, #e8f8f5);
  color: var(--color-primary, #2ecc71);
}

.page--cook .cook-subcategory__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  margin-bottom: 0; /* Collapsed state */
}

.page--cook .cook-subcategory__icon {
  font-size: 2rem;
  color: var(--color-primary, #2ecc71);
  background: var(--color-surface-elevated, #f5f5f5);
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.page--cook .cook-subcategory__text {
  flex-grow: 1;
}

.page--cook .cook-subcategory__title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  color: var(--color-text-primary, #333);
  line-height: 1.2;
}

.page--cook .cook-subcategory__subtitle {
  font-size: 0.85rem;
  color: var(--color-text-secondary, #666);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.page--cook .cook-subcategory.active .cook-subcategory__subtitle {
  color: var(--color-text-primary, #444);
  font-weight: 500;
}

/* Content Expansion on Hover */
.page--cook .cook-subcategory__content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease-out, opacity 0.3s ease, margin-top 0.3s ease;
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
}

.page--cook .cook-subcategory:hover .cook-subcategory__content {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 1rem;
  border-top: 1px solid var(--color-border-light, #eee);
  padding-top: 0.75rem;
}

.page--cook .subcategory-list {
  min-height: 0; /* Required for grid transition */
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
}

.page--cook .subcategory-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--color-border-light, #f0f0f0);
  color: var(--color-text-primary, #333);
  font-size: 0.9rem;
  font-weight: 500;
}

.page--cook .subcategory-list li:last-child {
  border-bottom: none;
}

.page--cook .cook-subcategory.active .subcategory-list li {
  color: var(--color-text-primary, #333);
}

/* ============================================
   ADVERTISEMENT CONTAINER (Inside Feed Grid - Matching Discover Page)
   ============================================ */
.page--cook .cook-feed__grid > .discover__advertisement {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
}

/* ============================================
   FEED GRID (Discover Content)
   ============================================ */
.page--cook .cook-feed__grid {
  display: grid;
  /* Responsive fallback */
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

/* Force 4 columns on large desktops (bigger cards) */
@media (min-width: 1600px) {
  .page--cook .cook-feed__grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }
}

.page--cook .cook-feed__loading {
  text-align: center;
  margin-top: 2rem;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Video Card Styles (Feed) */
.page--cook .video-card {
  display: block;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border, #e0e0e0);
  transition: all 0.3s ease;
  font-size: 1rem;
}

.page--cook .video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.page--cook .video-card__link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.page--cook .video-card__thumbnail {
  position: relative;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  background: #eee;
}

.page--cook .video-card__thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page--cook .video-card__duration {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

.page--cook .video-card__info {
  padding: 1rem;
}

.page--cook .video-card__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.4rem 0;
  color: var(--color-text-primary, #333);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.page--cook .video-card__creator {
  font-size: 0.9rem;
  color: var(--color-text-secondary, #666);
  margin: 0 0 0.25rem 0;
}

.page--cook .video-card__stats {
  font-size: 0.85rem;
  color: var(--color-text-muted, #595959);
}

/* Projects Grid - Horizontal Scroll */
.page--cook .cook-projects__grid-horizontal {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  overflow-y: visible;
  padding: 1rem 0 1.5rem 0;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  justify-content: flex-start;
}

@media (min-width: 1400px) {
  .page--cook .cook-projects__grid-horizontal {
    justify-content: center;
  }
}

.page--cook .cook-projects__grid-horizontal::-webkit-scrollbar {
  height: 8px;
}

.page--cook .cook-projects__grid-horizontal::-webkit-scrollbar-track {
  background: var(--color-bg-secondary, #f5f5f5);
  border-radius: 4px;
}

.page--cook .cook-projects__grid-horizontal::-webkit-scrollbar-thumb {
  background: var(--color-primary, #2ecc71);
  border-radius: 4px;
}

.page--cook .cook-projects__grid-horizontal .project-card {
  flex: 0 0 320px;
  scroll-snap-align: start;
}

.page--cook .project-card {
  background: linear-gradient(135deg, rgba(139, 105, 20, 0.03) 0%, rgba(255, 255, 255, 1) 100%);
  border: 2px solid var(--color-border, #e0e0e0);
  padding: 2.5rem;
  border-radius: 12px;
  text-align: center;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.page--cook .project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-color: var(--color-primary, #2ecc71);
}

.page--cook .project-card__content {
  flex-grow: 1;
}

.page--cook .project-card__meta {
  font-size: 0.875rem;
  color: var(--color-primary, #2ecc71);
  margin-bottom: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.page--cook .project-card__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--color-text-primary, #333);
  line-height: 1.3;
}

.page--cook .project-card p {
  color: var(--color-text-secondary, #666);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.page--cook .project-card__action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  padding: 0.75rem 1.5rem;
  background: var(--color-primary, #2ecc71);
  color: white;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.page--cook .project-card__action:hover {
  background: var(--color-primary-dark, #27ae60);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

/* Challenges Layout - Horizontal Scroll */
.page--cook .cook-challenges__list-horizontal {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  overflow-y: visible;
  padding: 1rem 0 1.5rem 0;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  justify-content: flex-start;
}

@media (min-width: 1400px) {
  .page--cook .cook-challenges__list-horizontal {
    justify-content: center;
  }
}

.page--cook .cook-challenges__list-horizontal::-webkit-scrollbar {
  height: 8px;
}

.page--cook .cook-challenges__list-horizontal::-webkit-scrollbar-track {
  background: var(--color-bg-secondary, #f5f5f5);
  border-radius: 4px;
}

.page--cook .cook-challenges__list-horizontal::-webkit-scrollbar-thumb {
  background: var(--color-primary, #2ecc71);
  border-radius: 4px;
}

.page--cook .cook-challenges__list-horizontal .challenge-card {
  flex: 0 0 400px;
  scroll-snap-align: start;
}

.page--cook .challenge-card {
  background: linear-gradient(135deg, rgba(139, 105, 20, 0.08) 0%, rgba(251, 191, 36, 0.05) 100%);
  border: 2px solid rgba(139, 105, 20, 0.2);
  padding: 2.5rem;
  border-radius: 16px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.page--cook .challenge-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--color-primary, #2ecc71);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.page--cook .challenge-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-color: var(--color-primary, #2ecc71);
}

.page--cook .challenge-card:hover::before {
  transform: scaleY(1);
}

.page--cook .challenge-card__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--color-text-primary, #333);
}

.page--cook .challenge-card p {
  color: var(--color-text-secondary, #666);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.page--cook .challenge-card__cta {
  margin-top: 1.5rem;
  font-size: 1rem;
  color: var(--color-text-primary, #333);
}

.page--cook .challenge-card__cta strong {
  color: var(--color-primary, #2ecc71);
  font-weight: 700;
}

@media (max-width: 768px) {
  .page--cook .cook-horizontal-sections__container {
    gap: 3rem;
  }
  
  .page--cook .cook-horizontal-section__title {
    font-size: 1.5rem;
  }
  
  .page--cook .cook-series__grid-horizontal .series-card,
  .page--cook .cook-projects__grid-horizontal .project-card {
    flex: 0 0 280px;
  }
  
  .page--cook .cook-challenges__list-horizontal .challenge-card,
  .page--cook .cook-qa__list-horizontal .qa-card {
    flex: 0 0 320px;
  }
  
  .page--cook .cook-subcategories__grid {
    justify-content: center;
  }
  
  .page--cook .cook-subcategory {
    width: 100%;
    max-width: 350px;
  }
}

/* QA Section - Horizontal Scroll */
.page--cook .cook-qa__list-horizontal {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  overflow-y: visible;
  padding: 1rem 0 1.5rem 0;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  justify-content: flex-start;
}

@media (min-width: 1400px) {
  .page--cook .cook-qa__list-horizontal {
    justify-content: center;
  }
}

.page--cook .cook-qa__list-horizontal::-webkit-scrollbar {
  height: 8px;
}

.page--cook .cook-qa__list-horizontal::-webkit-scrollbar-track {
  background: var(--color-bg-secondary, #f5f5f5);
  border-radius: 4px;
}

.page--cook .cook-qa__list-horizontal::-webkit-scrollbar-thumb {
  background: var(--color-primary, #2ecc71);
  border-radius: 4px;
}

.page--cook .cook-qa__list-horizontal .qa-card {
  flex: 0 0 400px;
  scroll-snap-align: start;
}

.page--cook .qa-card {
  background: #fff;
  border: 2px solid var(--color-border, #e0e0e0);
  padding: 2rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transition: all 0.3s ease;
}

.page--cook .qa-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  border-color: var(--color-primary, #2ecc71);
}

.page--cook .qa-card__question {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: var(--color-text-primary, #333);
  line-height: 1.4;
  flex-grow: 1;
}

.page--cook .qa-card .btn {
  align-self: flex-start;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .page--cook .cook-hero {
    padding: 4rem 1rem;
  }
  
  .page--cook #cook-hero-title {
    font-size: 2.25rem;
  }
  
  .page--cook .cook-hero__actions {
    flex-direction: column;
  }
  
  .page--cook .qa-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}
