/* ==========================================================================
   Reset & base
   ========================================================================== */

:root {
  --bg: #000000;
}
.page {
  width: 1440px;
  min-height: 1024px; /* matches your Figma height as baseline */
  margin: 0 auto; /* centers the whole design */
  background-color: #1c1c1c; /* same as body so it blends  */
  position: relative;
}
.page.margin {
  color: #000000;
}
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background-color: var(--bg);
  min-height: 100vh;
  font-family: "Raleway", sans-serif;
  color: #ffffff;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

img {
  display: block;
}

/* ==========================================================================
   Top bar (social strip)
   ========================================================================== */
.top-bar {
  background-color: #0d0d0d;
  width: 100%;
  height: 51px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.top-bar__tagline {
  font-family: "Raleway", sans-serif;
  font-size: 13px;
  letter-spacing: 0.8px;
  font-weight: 400;
  margin: 0;
}

.top-bar__socials {
  display: flex;
  align-items: center;
  gap: 20px;
}

.icon--instagram {
  height: 18px;
  width: 18px;
  object-fit: contain;
}
.icon--youtube {
  height: 22px;
  width: 22px;
  object-fit: contain;
}
.icon--twitter {
  height: 20px;
  width: 20px;
  object-fit: contain;
}
.icon--tiktok {
  height: 18px;
  width: 18px;
  object-fit: contain;
}

/* ==========================================================================
   Header / Menu
   ========================================================================== */
.site-header {
  position: relative;
  width: 100%;
  background-color: #1c1c1c;
}

.site-header__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 24px 24px;
}

.site-header__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  height: 80px;
}

.logo {
  display: block;
  flex-shrink: 0;
  width: 230px;
  height: 120px;
}

.logo img {
  width: 120%;
  height: 120%;
  object-fit: contain;
  object-position: left;
}

/* Main nav */
.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 50px;
  flex-wrap: wrap;
}

.main-nav__link {
  font-size: 19px;
  font-weight: 300;
  letter-spacing: 1.2px;
  transition: opacity 0.2s ease;
}

.main-nav__link:hover {
  opacity: 0.7;
}

.main-nav__link--active {
  font-weight: 600;
}

/* Header icons */
.header-icons {
  width: 230px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header-icons__btn {
  transition: opacity 0.2s ease;
}

.header-icons__btn:hover {
  opacity: 0.7;
}

.header-icons__btn img {
  width: 24px;
  height: 27px;
  object-fit: contain;
}

header,
.main-content {
  background-color: var(--bg);
}

/* Search bar */
.search-row {
  display: flex;
  justify-content: center;
  margin-top: 0px;
}

.search-bar {
  position: relative;
  width: 160px;
  transition: width 0.35s ease;
}

.search-bar__input {
  width: 100%;
  height: 34px;
  border-radius: 999px;
  background-color: #d9d9d9;
  border: none;
  padding: 0 16px 0 40px;
  font-size: 14px;
  outline: none;
  transition: box-shadow 0.3s ease;
}

.search-bar__input:focus {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.search-bar:focus-within {
  width: 320px; /* expands smoothly when you click into it */
}

.search-bar__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* Page title */
.header-title-row {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.header-title {
  font-family: "Bungee", cursive;
  font-size: 19px;
  letter-spacing: 1px;
  font-weight: 400;
  line-height: 1.3;
  margin: 0;
  text-transform: none;
}

/* ==========================================================================
   Filter pills
   ========================================================================== */
.filters {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  margin-top: 8px;
  margin-bottom: 23px;
}

.filters__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pill {
  background-color: #111111; /* slightly softer than pure black */
  color: #ffffff;
  font-family: "Mona Sans", "Raleway", sans-serif;
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 0.3px;
  border-radius: 999px; /* fully rounded capsule */
  height: 42px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08); /* very subtle edge */
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.pill:hover {
  background-color: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.18);
}

.pill--active {
  background-color: transparent;
  background-image:
    linear-gradient(rgba(12, 12, 12, 0.88), rgba(12, 12, 12, 0.88)),
    url("Assets/Icons/bgbtn.png");
  background-size: cover;
  background-position: center;
  color: #ffffff;
  border: 1px solid transparent;
  font-weight: 300;
  animation: pillBorder 0.4s ease-out forwards;
}

@keyframes pillBorder {
  0% {
    border-color: rgba(255, 255, 255, 0);
  }
  100% {
    border-color: rgba(255, 255, 255, 0.32);
  }
}

.pill--active .pill__icon {
  opacity: 1; /* full opacity on the icon/flag */
}

.pill__icon {
  width: 18px;
  height: 18px;
  opacity: 0.9;
}

.pill__icon--wide {
  width: 28px;
}

/* ==========================================================================
   Recipe grid
   ========================================================================== */
.content {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 32px 64px;
  position: relative;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.recipe-card/* text below recipe*/ {
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  background-color: transparent;
  text-decoration: none;
  color: inherit;
}

.recipe-card__image-wrap {
  position: relative;
  width: 100%;
  height: 185px; /* keep the same height as before */
  border-radius: 10px;
  overflow: hidden;
  background-color: #262626;
}

.recipe-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}

.recipe-card:hover .recipe-card__img {
  transform: scale(1.05);
}

.recipe-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 4px 0; /* small gap under the image */
  gap: 8px;
}

.recipe-card__title {
  font-family: "Mona Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: 100;
  font-style: normal;
  font-variation-settings: "wdth" 100;
  font-size: 16px;
  margin: 0;
  line-height: 1.3;
}

.recipe-card__bookmark {
  width: 16px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}

/* Side rail buttons */
.rail-btn {
  display: none;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: -83px; /* sits high, near top of first recipe row */
  transform: none;
  background-color: #111111;
  width: 67px;
  height: 74px;
  transition: background-color 0.2s ease;
  z-index: 10;
}

.rail-btn:hover {
  background-color: #262626;
}

/* Push out to the colour-change edge of the 1440px .page */
.rail-btn--left {
  left: -190px; /* reaches left margin of .page */
  border-radius: 0px 30px 30px 0px;
}

.rail-btn--right {
  right: -190px; /* reaches right margin of .page */
  border-radius: 30px 0px 0px 30px;
}

.rail-btn img {
  object-fit: contain;
}

.rail-btn--left img {
  width: 32px;
  height: 32px;
}

.rail-btn--right img {
  width: 32px;
  height: 32px;
}

.rail-btn--right::before {
  content: "Filter";
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.rail-btn--right:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

.rail-btn--left::before {
  content: "Kitchen Tools";
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.rail-btn--left:hover::before {
  opacity: 1;
  transform: translate(-50%) translateY(-2px);
}

/* ==========================================================================
   Filter Drawer (right side)
   ========================================================================== */

.filter-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  height: 100vh;
  background-color: #141414;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s ease;
}

.filter-drawer.is-open {
  transform: translateX(0);
}

.filter-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.filter-drawer__title {
  font-family: "Mona Sans", "Raleway", sans-serif;
  font-size: 20px;
  font-weight: 500;
  margin: 0;
  color: #fff;
}

.filter-drawer__close {
  font-size: 28px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1;
  padding: 0;
  transition: color 0.2s ease;
}

.filter-drawer__close:hover {
  color: #fff;
}

.filter-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.filter-group {
  margin-bottom: 32px;
}

.filter-group__title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 14px;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 300;
  color: #fff;
  margin-bottom: 12px;
  cursor: pointer;
}

.filter-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #fff;
}

.filter-drawer__footer {
  display: flex;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.filter-btn {
  flex: 1;
  height: 42px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn--ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

.filter-btn--ghost:hover {
  border-color: rgba(255, 255, 255, 0.4);
}

.filter-btn--primary {
  background: #fff;
  color: #000;
  border: none;
}

.filter-btn--primary:hover {
  background: #eaeaea;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (min-width: 1200px) {
  .rail-btn {
    display: flex;
  }
}

@media (max-width: 900px) {
  .recipe-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .recipe-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .top-bar__tagline {
    font-size: 12px;
    text-align: left;
  }

  .main-nav {
    gap: 24px;
  }

  .main-nav__link {
    font-size: 18px;
  }
}
