/* Scoped to the occasion section; no overrides of existing homepage styles. */
.bg-occasions {
  margin: 36px 0 0;
  scroll-margin-top: 24px;
}
.bg-occasions-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 4px;
}
.bg-occasions h2 {
  margin: 0 0 8px;
  color: #1f1f1f;
  font-size: clamp(1.4rem, 2.5vw, 1.75rem);
  line-height: 1.3;
}
.bg-occasions-intro {
  max-width: 720px;
  margin: 0 0 16px;
  color: #555;
  line-height: 1.6;
}
.bg-occasions-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-shrink: 0;
}
.bg-occasions-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #1f1f1f;
  font-size: 1.35rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
  touch-action: manipulation;
}
.bg-occasions-btn:hover:not(:disabled) {
  background: #95432d;
  color: #ffffff;
  border-color: #95432d;
  box-shadow: 0 2px 6px rgba(149, 67, 45, 0.25);
}
.bg-occasions-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}
.bg-occasions-btn:focus-visible {
  outline: 2px solid #8b3e29;
  outline-offset: 2px;
}

/* Horizontal single-row scrollable carousel */
.bg-occasions-scroll-wrap {
  position: relative;
  width: 100%;
}
.bg-occasions .bg-occasions-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 14px;
  margin: 0;
  padding: 4px 4px 14px 4px;
  list-style: none;
  /* Free panning: even proximity snapping can undo short swipes or truncate a fling. */
  scroll-snap-type: none;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: auto; /* Buttons explicitly request smooth scrolling. */
  scrollbar-width: none; /* Hide scrollbar for seamless infinite loop */
  -ms-overflow-style: none;
}
.bg-occasions .bg-occasions-grid::-webkit-scrollbar {
  display: none;
}
.bg-occasions-grid > li {
  flex: 0 0 215px;
  min-width: 215px;
  max-width: 230px;
  margin: 0;
  padding: 0;
}
.bg-occasions .bg-occasion-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  height: 100%;
  min-height: 194px;
  padding: 18px;
  border: 1px solid #e4e4e4;
  border-radius: 14px;
  background: #fbfaf9;
  color: #222;
  text-decoration: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.bg-occasion-name {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.bg-occasion-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin-bottom: 10px;
}
.bg-occasion-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  color: #a4472d;
}
.bg-occasion-icon .bg-discovery-icon {
  display: block;
  width: 30px;
  height: 30px;
}
.bg-occasion-date {
  margin-top: auto;
  color: #666;
  font-size: .8rem;
  line-height: 1.5;
}
.bg-occasion-season {
  color: #8b3e29;
  font-size: .7rem;
  font-weight: 600;
  text-align: right;
  line-height: 1.4;
}
.bg-occasions .bg-occasion-card.is-seasonal {
  border-color: #b75b40;
  background: #f5e8e0;
}
@media (hover: hover) and (pointer: fine) {
  .bg-occasions .bg-occasion-card:hover {
    border-color: #95432d;
    background: #f3e6e1;
    color: #222;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(149, 67, 45, 0.12);
  }
}
.bg-occasions .bg-occasion-card:focus-visible {
  outline: 3px solid #8b3e29;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .bg-occasions .bg-occasions-grid {
    scroll-behavior: auto !important;
  }
}
@media (max-width: 768px) {
  .bg-occasions-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-bottom: 6px;
  }
  .bg-occasions-intro {
    max-width: 100%;
    margin-bottom: 8px;
  }
  .bg-occasions-nav {
    align-self: flex-end;
    margin-bottom: 8px;
    gap: 10px;
  }
  .bg-occasions-btn {
    width: 40px;
    height: 40px;
  }
}
@media (max-width: 600px) {
  .bg-occasions-grid > li {
    flex: 0 0 190px;
    min-width: 190px;
  }
  .bg-occasions .bg-occasion-card {
    padding: 14px 16px;
  }
}
@media (max-width: 400px) {
  .bg-occasions-grid > li {
    flex: 0 0 175px;
    min-width: 175px;
  }
}

/* Styles for the dynamic upcoming occasion spotlight */
.bg-home-upcoming {
  padding: 40px 0 16px;
}
/* Shared .bg-recipe-grid rules own columns and breakpoints for all home cards. */
.bg-home-upcoming .bg-recipe-card {
  background-color: #ffffff;
  padding: 18px 18px 20px 18px;
  border-radius: 8px;
  border: 1px solid #ebebeb;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.bg-home-upcoming .bg-recipe-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.bg-home-upcoming .bg-recipe-card-img {
  display: block;
  height: 220px;
  width: 100%;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 12px;
}
.bg-home-upcoming .bg-recipe-card-title {
  font-size: 20px;
  margin-bottom: 0;
  line-height: 1.35;
}
.bg-home-upcoming .bg-recipe-card-title a {
  text-decoration: none;
  color: inherit;
}
.bg-home-upcoming .bg-recipe-card-title a:hover {
  color: var(--accent-hover, #95432d);
}
