/* === Catalog pages — shared styles === */
/* Matches the existing site's design system (Inter font, -0.04em headings,
   -0.02em body, rounded buttons, max-width 1122px container) */

body.page-catalogue {
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Ensure main fills full width of viewport */
body.page-catalogue main {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* === Hero band (catalog index + list page) === */
.catalogue-page,
.list-page,
.recipe-page {
  width: 100%;
}

/* === Catalog index page === */
.catalogue-page .catalogue-header {
  width: 100%;
  background: #fff;
  padding: 60px 120px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.catalogue-page .catalogue-header > h1,
.catalogue-page .catalogue-header > p,
.catalogue-page .catalogue-header > input {
  max-width: 1122px;
  width: 100%;
}

.catalogue-page .catalogue-header h1 {
  font-family: 'Inter', sans-serif;
  font-size: 60px;
  font-weight: 600;
  color: #000;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0 0 20px;
  text-align: center;
}

.catalogue-page .catalogue-header p {
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: #000;
  letter-spacing: -0.04em;
  line-height: 1.4;
  margin: 0 0 32px;
  max-width: 720px;
  text-align: center;
}

#catalogue-search {
  width: 100%;
  max-width: 720px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #000;
  letter-spacing: -0.02em;
  background: #F5F5F7;
  border: 1px solid #E3E5E8;
  border-radius: 45px;
  padding: 16px 24px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

#catalogue-search::placeholder {
  color: #737373;
}

#catalogue-search:focus {
  border-color: #000;
  background: #fff;
}

/* === Catalog cards grid === */
.catalogue-grid {
  width: 100%;
  max-width: 1122px;
  margin: 0 auto;
  padding: 40px 120px 80px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
  box-sizing: content-box;
}

.cat-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #E3E5E8;
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}

.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.cat-card-photos {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2px;
  aspect-ratio: 3 / 2;
  background: #f3f3f3;
}

.cat-card-photos img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cat-card-title {
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: #000;
  letter-spacing: -0.04em;
  line-height: 1.2;
  margin: 0;
  padding: 20px 24px 4px;
}

.cat-card-meta {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #737373;
  letter-spacing: -0.02em;
  margin: 0;
  padding: 0 24px 20px;
}

.catalogue-no-results {
  width: 100%;
  max-width: 1122px;
  margin: 0 auto;
  padding: 40px 120px 80px;
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: #737373;
  text-align: center;
  letter-spacing: -0.02em;
}

/* === Back link === */
.back-link {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #737373;
  letter-spacing: -0.02em;
  text-decoration: none;
  padding: 0;
  margin: 0;
  transition: color 0.2s;
}

.back-link:hover {
  color: #000;
}

/* === List page === */
.list-page .back-link {
  width: 100%;
  max-width: 1122px;
  margin: 32px auto 0;
  padding: 0 120px;
  box-sizing: content-box;
}

.list-page .list-header {
  width: 100%;
  background: #fff;
  padding: 40px 120px 40px;
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.list-page .list-header > * {
  width: 100%;
  max-width: 1122px;
  margin-left: auto;
  margin-right: auto;
}

.list-page .list-header h1 {
  font-family: 'Inter', sans-serif;
  font-size: 60px;
  font-weight: 600;
  color: #000;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0 auto 12px;
  text-align: left;
}

.list-page .list-meta {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: #000;
  letter-spacing: -0.02em;
  margin: 0 auto;
  text-align: left;
}

/* === Author block (shared by list page + recipe page) === */
.author-block {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  box-sizing: border-box;
}

/* List page version: full-width container */
.list-page .author-block {
  width: 100%;
  max-width: 1122px;
  margin: 60px auto 0;
  padding: 0 120px;
  box-sizing: content-box;
}

.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #f3f3f3;
}

.author-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

.author-name {
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: #000;
  letter-spacing: -0.04em;
  line-height: 1.2;
  margin: 0;
}

.author-bio {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #737373;
  letter-spacing: -0.02em;
  line-height: 1.5;
  margin: 0;
  max-width: 640px;
}

.author-socials {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #737373;
  letter-spacing: -0.02em;
  margin: 4px 0 0;
}

.author-socials a {
  color: #000;
  text-decoration: none;
  transition: opacity 0.2s;
}

.author-socials a:hover {
  opacity: 0.7;
}

/* === Recipes section (list page) === */
.recipes-section {
  width: 100%;
  max-width: 1122px;
  margin: 60px auto 0;
  padding: 0 120px;
  box-sizing: content-box;
}

.recipes-section h2 {
  font-family: 'Inter', sans-serif;
  font-size: 32px;
  font-weight: 600;
  color: #000;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin: 0 0 24px;
}

.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.recipe-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #E3E5E8;
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}

.recipe-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.recipe-card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f3f3f3;
  overflow: hidden;
}

.recipe-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.recipe-card-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.recipe-card-info h3 {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #000;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 0;
}

.recipe-card-cal {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #737373;
  letter-spacing: -0.02em;
  margin: 0;
}

/* === Recipe page === */
/* Two-column layout: left column has back link, title, calories, recipe, author.
   Right column has the dish image. Stacks on mobile (image first). */
.recipe-article {
  width: 100%;
  max-width: 1122px;
  margin: 32px auto 0;
  padding: 0 120px;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 60px;
  align-items: start;
  box-sizing: content-box;
}

.recipe-col-left {
  min-width: 0; /* prevent overflow from long words */
}

.recipe-col-left .back-link {
  display: inline-block;
  margin: 0 0 24px;
}

.recipe-title {
  font-family: 'Inter', sans-serif;
  font-size: 48px;
  font-weight: 600;
  color: #000;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 0 0 16px;
}

.recipe-cal {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #737373;
  letter-spacing: -0.02em;
  margin: 0 0 40px;
}

.recipe-cal strong {
  color: #000;
  font-weight: 600;
}

.recipe-body {
  margin: 0 0 40px;
}

.recipe-body h2 {
  font-family: 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 600;
  color: #000;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin: 0 0 16px;
}

.recipe-text {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 400;
  color: #111;
  letter-spacing: -0.02em;
  line-height: 1.6;
}

/* Recipe page author block — left-column-only, with separator above */
.recipe-page .author-block {
  width: 100%;
  margin: 0;
  padding: 32px 0 0;
  border-top: 1px solid #E3E5E8;
}

/* Right column: image */
.recipe-col-right .recipe-photo {
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  background: #f3f3f3;
  position: sticky;
  top: 100px; /* sits below sticky header */
}

.recipe-col-right .recipe-photo img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* === Features row (plan / no ads / iOS) — copied from home.css so catalog pages render it correctly === */
.features-row-section {
  width: 100%;
  background: #fff;
  padding: 60px 24px;
  display: flex;
  justify-content: center;
}

.features-row-inner {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 60px;
  max-width: 1200px;
  width: 100%;
  flex-wrap: wrap;
}

.features-row-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 120px;
}

.features-row-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
}

.features-row-text {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #000;
  text-align: center;
  margin: 0;
  letter-spacing: -0.02em;
}

/* === Responsive === */
@media (max-width: 1100px) {
  .catalogue-page .catalogue-header,
  .list-page .list-header {
    padding-left: 60px;
    padding-right: 60px;
  }
  .catalogue-grid,
  .list-page .author-block,
  .recipes-section,
  .list-page .back-link,
  .recipe-article {
    padding-left: 60px;
    padding-right: 60px;
  }
  .recipe-article {
    grid-template-columns: 1fr 300px;
    gap: 40px;
  }
}

@media (max-width: 900px) {
  /* Stack the recipe page columns: image first, then text */
  .recipe-article {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .recipe-col-right {
    order: -1; /* image goes first on mobile */
  }
  .recipe-col-right .recipe-photo {
    position: static;
    max-width: 480px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .catalogue-page .catalogue-header {
    padding: 40px 32px 32px;
  }
  .list-page .list-header {
    padding: 40px 32px 32px;
  }
  .catalogue-page .catalogue-header h1,
  .list-page .list-header h1 {
    font-size: 44px;
  }
  .catalogue-page .catalogue-header p {
    font-size: 18px;
  }
  .catalogue-grid {
    padding: 32px 32px 60px;
    gap: 24px;
  }
  .list-page .author-block {
    padding-left: 32px;
    padding-right: 32px;
    gap: 16px;
  }
  .author-avatar {
    width: 64px;
    height: 64px;
  }
  .author-name { font-size: 20px; }
  .author-bio { font-size: 15px; }
  .recipes-section {
    padding-left: 32px;
    padding-right: 32px;
  }
  .recipes-section h2 { font-size: 28px; }
  .recipes-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
  }
  .list-page .back-link {
    padding: 0 32px;
  }
  .recipe-article {
    padding: 32px 32px 0;
    margin-top: 24px;
  }
  .recipe-title { font-size: 36px; }
  .recipe-body h2 { font-size: 24px; }
  .recipe-text { font-size: 16px; }
}

@media (max-width: 480px) {
  .catalogue-page .catalogue-header {
    padding: 32px 16px 24px;
  }
  .list-page .list-header {
    padding: 32px 16px 24px;
  }
  .catalogue-page .catalogue-header h1,
  .list-page .list-header h1 {
    font-size: 36px;
  }
  .catalogue-page .catalogue-header p {
    font-size: 16px;
  }
  #catalogue-search {
    font-size: 15px;
    padding: 14px 20px;
  }
  .catalogue-grid {
    padding: 24px 16px 48px;
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .cat-card-title { font-size: 18px; }
  .list-page .author-block {
    padding-left: 16px;
    padding-right: 16px;
  }
  .author-avatar {
    width: 56px;
    height: 56px;
  }
  .recipes-section {
    padding-left: 16px;
    padding-right: 16px;
    margin-top: 40px;
  }
  .recipes-section h2 { font-size: 24px; }
  .recipes-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .recipe-card-info { padding: 12px; }
  .recipe-card-info h3 { font-size: 14px; }
  .recipe-card-cal { font-size: 12px; }
  .recipe-article {
    padding: 24px 16px 0;
    gap: 24px;
  }
  .recipe-title { font-size: 28px; }
  .recipe-col-right .recipe-photo { border-radius: 16px; }
  .recipe-body h2 { font-size: 20px; }
  .recipe-text { font-size: 15px; }
}
