/* Presentation layer for the home, category and recipe views. No DLE behavior changes. */
:root {
  --editorial-ink: #1d2b1d;
  --editorial-rule: #d7dfd0;
  --editorial-paper: #fbfcf8;
}

.header {
  background: rgba(251, 252, 248, .97);
}

.nav-link,
.home-category-nav a,
.section-heading a {
  text-underline-offset: 4px;
}

/* One featured dish and a quieter, genuinely scannable row of new recipes. */
#hero { padding-top: 22px; }
.hero-grid {
  grid-template-columns: minmax(280px, .82fr) minmax(0, 1.18fr);
  gap: 22px 36px;
  padding: 12px 0 22px;
}
.hero-left-box {
  align-self: center;
  padding: 0;
  border: 0;
}
.hero-left-box::before {
  content: 'ДОМАШНЯ КУЛІНАРНА КНИГА';
  display: block;
  margin-bottom: 19px;
  color: var(--green-main);
  font: 800 .68rem/1.4 var(--font-body);
  letter-spacing: .16em;
}
.hero-main-title {
  max-width: 13ch;
  margin-bottom: 21px;
  font-size: clamp(2.7rem, 4.1vw, 4.8rem);
  line-height: 1.07;
  letter-spacing: -.04em;
}
.hero-main-title span { display: inline; }
.hero-sub { max-width: 37ch; font-size: 1.06rem; line-height: 1.65; }
.hero-social-proof {
  max-width: 38ch;
  padding-top: 18px;
  border-top: 1px solid var(--editorial-rule);
  font-weight: 500;
}
.hero-feature-slot { min-width: 0; max-width: none; }
.hero-center-card { border-radius: 20px; }
.hero-card-img-wrapper { height: clamp(250px, 25vw, 355px); }
.hero-card-body { padding: 24px 28px; }
.hero-card-title { max-width: 30ch; font-size: clamp(1.65rem, 2.2vw, 2.1rem); line-height: 1.16; }
.hero-card-desc { max-width: 64ch; }
.hero-right-stack {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.mini-recipe-card { height: 138px; min-width: 0; }
.mini-recipe-overlay { padding: 15px 17px; }
.mini-recipe-overlay b { font-size: .98rem; }

/* A real entry point to browsing, without inventing new content or routes. */
.home-category-nav {
  display: flex;
  align-items: center;
  gap: 25px;
  padding-top: 21px;
  padding-bottom: 29px;
  border-bottom: 1px solid var(--editorial-rule);
}
.home-category-nav__label {
  flex: none;
  color: var(--text-muted);
  font: 700 .72rem/1.3 var(--font-body);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.home-category-nav__links { display: flex; flex-wrap: wrap; gap: 8px; }
.home-category-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid var(--editorial-rule);
  border-radius: 999px;
  background: var(--editorial-paper);
  color: var(--editorial-ink);
  font-size: .83rem;
  font-weight: 700;
}
.home-category-nav a:hover,
.home-category-nav a:focus-visible {
  border-color: var(--green-main);
  background: var(--green-light);
}
.home-category-nav a:last-child { border-color: transparent; background: transparent; color: var(--green-main); }

/* Give every recipe card a stable visual rhythm, even with long editorial titles. */
.category-collection { padding-top: 45px; padding-bottom: 45px; }
.section-heading { align-items: baseline; }
.section-heading h2 { line-height: 1.15; }
.section-heading a { white-space: nowrap; text-decoration: underline; text-decoration-thickness: 1px; }
.recipes-grid-4 { align-items: stretch; }
.recipe-card-modern { height: 100%; overflow: hidden; }
.card-content-box { display: flex; flex-direction: column; flex: 1; }
.card-title-text { line-height: 1.24; }
.card-content-box > p { flex: 1; }
.card-meta-row { margin-top: auto; }

/* Categories: breadcrumb first, then title, then the first image. */
.page-shell { padding-top: 28px; }
.page-shell > .speedbar { margin-bottom: 22px; }
.page-intro { max-width: 900px; margin-bottom: 27px; }
.page-intro h1 { font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1.08; }
.page-intro p { max-width: 62ch; line-height: 1.6; }
.category-catalog-page__head { margin-bottom: 24px; }
.category-catalog-card { min-height: 250px; }
.category-catalog-card__body { padding: 23px; }

/* Recipe: the story stays readable, while the ingredients remain easy to use. */
.recipe-full { padding: clamp(18px, 3vw, 42px); background: #fff; }
.detail-top-grid {
  grid-template-areas: 'cover title' 'cover summary';
  grid-template-rows: auto 1fr;
  gap: 0 clamp(25px, 3vw, 46px);
  align-items: start;
}
.detail-top-grid > .detail-title-main { grid-area: title; }
.detail-top-grid > .recipe-cover-column { grid-area: cover; }
.detail-top-grid > .recipe-summary-column { grid-area: summary; }
.detail-large-img { height: clamp(310px, 34vw, 450px); border-radius: 16px; }
.detail-title-main { font-size: clamp(2.2rem, 3.55vw, 3.7rem); line-height: 1.12; letter-spacing: -.035em; }
.recipe-lead { max-width: 65ch; line-height: 1.7; }
.detail-meta-pills { gap: 7px 16px; }
.recipe-body { font-size: 1rem; line-height: 1.7; }
.ingredients-box { border-radius: 16px; }
.recipe-instructions { margin-top: 42px; }
.recipe-instructions h2,
.ingredients-box h2 { font-size: clamp(1.6rem, 2.1vw, 2.1rem); line-height: 1.2; }

@media (max-width: 950px) {
  .hero-grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 20px; }
  .hero-right-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-category-nav { align-items: flex-start; flex-direction: column; gap: 12px; }
}

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; gap: 18px; padding-top: 8px; }
  .hero-left-box { max-width: 660px; }
  .hero-main-title { max-width: 16ch; }
  .hero-feature-slot { max-width: none; }
  .hero-right-stack { grid-column: auto; }
  .detail-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'title' 'cover' 'summary';
    gap: 15px;
  }
  .recipe-cover-column { width: 100%; }
}

@media (max-width: 560px) {
  #hero { padding-top: 17px; }
  .hero-grid { gap: 18px; padding-bottom: 18px; }
  .hero-left-box::before { margin-bottom: 9px; font-size: .63rem; }
  .hero-main-title { max-width: 16ch; margin-bottom: 11px; font-size: clamp(2.35rem, 9vw, 3.05rem); line-height: 1.09; }
  .hero-sub { max-width: 43ch; margin-bottom: 14px; font-size: .9rem; line-height: 1.5; }
  .hero-cta { margin: 0; }
  .hero-social-proof { display: none; }
  .hero-card-img-wrapper { height: 220px; }
  .hero-card-body { padding: 18px; }
  .hero-card-title { font-size: 1.45rem; }
  .hero-card-desc { display: none; }
  .hero-card-meta { font-size: .72rem; }
  .hero-right-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .mini-recipe-card { height: 130px; }
  .mini-recipe-overlay { padding: 11px; }
  .mini-recipe-overlay b { font-size: .83rem; }
  .home-category-nav { padding-top: 16px; padding-bottom: 19px; }
  .home-category-nav__links { flex-wrap: nowrap; width: 100%; overflow-x: auto; padding-bottom: 7px; scrollbar-width: thin; }
  .home-category-nav a { flex: none; min-height: 42px; }
  .category-collection { padding-top: 34px; padding-bottom: 34px; }
  .section-heading { align-items: flex-start; }
  .section-heading h2 { font-size: 1.65rem; }
  .section-heading a { padding-top: 5px; }
  .page-shell { padding-top: 22px; }
  .page-intro { margin-bottom: 22px; }
  .page-intro h1 { font-size: 2.25rem; }
  .category-catalog-page { padding-top: 2px; }
  .category-catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .category-catalog-card { min-height: 195px; }
  .category-catalog-card__body { padding: 14px; gap: 5px; }
  .category-catalog-card__body strong { font-size: 1.28rem; }
  .category-catalog-card__body span { font-size: .72rem; }
  .category-catalog-card__body em { font-size: .66rem; }
  .recipe-full { padding: 16px; }
  .detail-title-main { margin-bottom: 0; font-size: clamp(1.72rem, 6.3vw, 2.1rem); line-height: 1.17; }
  .recipe-lead { font-size: .94rem; }
  .detail-meta-pills { margin: 13px 0; font-size: .77rem; }
  .detail-large-img { height: 250px; }
  .recipe-cover-column .recipe-rating { justify-content: flex-start !important; flex-wrap: wrap; }
  .recipe-rating__copy { text-align: left !important; }
}

@media (max-width: 390px) {
  .hero-main-title { font-size: 2.15rem; }
  .category-catalog-grid { grid-template-columns: 1fr; }
  .category-catalog-card { min-height: 205px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-center-card:hover,
  .recipe-card-modern:hover,
  .category-catalog-card:hover img { transform: none; }
}

/* Premium editorial pass: photography stays open, text sits on the page, not in boxes. */
:root {
  --editorial-ink: #1b271c;
  --editorial-rule: #cbd7c8;
  --editorial-paper: #f7f9f5;
  --editorial-radius: 12px;
}

.header { background: rgba(247, 249, 245, .97); box-shadow: none; }
.logo-title { letter-spacing: -.025em; }
.nav-link { font-weight: 700; }
.footer { border-top: 0; }
.footer-logo { letter-spacing: -.025em; }

/* A featured photograph, not another raised card. */
#hero { padding-top: 31px; }
.hero-grid { column-gap: clamp(26px, 4vw, 66px); row-gap: 32px; padding-bottom: 34px; }
.hero-left-box::before { margin-bottom: 22px; }
.hero-main-title { max-width: 14ch; font-size: clamp(2.75rem, 4vw, 4.45rem); line-height: 1.1; }
.hero-sub { color: #455443; }
.hero-cta { box-shadow: none; transition: background .2s ease, transform .2s ease; }
.hero-cta:hover { background: var(--green-hover); transform: translateY(-2px); }
.hero-center-card { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.hero-center-card:hover { transform: none; box-shadow: none; }
.hero-card-img-wrapper { height: clamp(290px, 28vw, 375px); border-radius: var(--editorial-radius); }
.hero-card-body { padding: 19px 1px 0; }
.hero-card-kicker { padding: 0; border-radius: 0; background: transparent; letter-spacing: .13em; }
.hero-card-title { display: -webkit-box; max-width: 36ch; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: clamp(1.65rem, 2.2vw, 2.18rem); line-height: 1.22; }
.hero-card-desc { display: -webkit-box; margin-top: 4px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.hero-card-meta { border-top-color: var(--editorial-rule); }
.mini-recipe-card { border-radius: var(--editorial-radius); box-shadow: none; }

/* Navigation is a quiet text-led table of contents. */
.home-category-nav { border-top: 1px solid var(--editorial-rule); }
.home-category-nav__label { color: #455d43; }
.home-category-nav a { border: 0; border-bottom: 1px solid transparent; border-radius: 0; background: transparent; padding-inline: 2px; }
.home-category-nav a:hover,
.home-category-nav a:focus-visible { background: transparent; border-bottom-color: var(--green-main); }
.home-category-nav a:last-child { border-bottom-color: var(--editorial-rule); }

/* Lists read like a food magazine rather than a storefront grid. */
.category-collection { padding-block: clamp(42px, 6vw, 76px); }
.section-heading { padding-bottom: 19px; margin-bottom: 26px; border-bottom: 1px solid var(--editorial-rule); }
.section-heading h2 { letter-spacing: -.04em; }
.section-heading a { color: #3f623a; }
.recipes-grid-4 { column-gap: 25px; row-gap: 43px; }
.recipe-card-modern { overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.recipe-card-modern:hover { transform: none; box-shadow: none; }
.card-img-box { height: auto; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--editorial-radius); background: var(--green-light); }
.card-content-box { padding: 16px 1px 0; }
.recipe-card-category { margin-bottom: 10px; padding: 0; border-radius: 0; background: transparent; color: #426840; letter-spacing: .11em; }
.card-title-text { font-size: clamp(1.24rem, 1.5vw, 1.52rem); line-height: 1.24; }
.card-content-box > p { color: #4b584a; }
.card-meta-row { border-top-color: var(--editorial-rule); }
.card-meta-row b { color: #426840; }

/* The category index gives the imagery room, with captions below the crop. */
.category-catalog-page__head { max-width: 760px; margin-bottom: 34px; }
.category-catalog-page__head h1 { letter-spacing: -.04em; }
.category-catalog-grid { column-gap: 24px; row-gap: 36px; }
.category-catalog-card { display: flex; flex-direction: column; align-items: stretch; min-height: 0; overflow: visible; border-radius: 0; background: transparent; color: var(--editorial-ink); box-shadow: none; }
.category-catalog-card::before { display: none; }
.category-catalog-card img { position: relative; inset: auto; z-index: auto; display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: var(--editorial-radius); object-fit: cover; }
.category-catalog-card:hover img { transform: none; filter: brightness(.94); }
.category-catalog-card__body { padding: 17px 1px 0; gap: 5px; }
.category-catalog-card__body strong { font-size: clamp(1.5rem, 2vw, 1.85rem); line-height: 1.2; }
.category-catalog-card__body span { color: #495748; opacity: 1; }
.category-catalog-card__body em { margin-top: 8px; color: #426840; }

/* Recipe title and food image should lead; tools and supporting boxes recede. */
.recipe-full { border: 0; border-radius: 0; background: #fff; box-shadow: none; }
.detail-top-grid { margin-bottom: 45px; }
.detail-title-main { max-width: 21ch; font-size: clamp(2.15rem, 3.25vw, 3.5rem); line-height: 1.12; text-wrap: balance; }
.detail-large-img { height: auto; aspect-ratio: 4 / 3; max-height: 490px; border-radius: var(--editorial-radius); }
.recipe-rating { border-top-color: var(--editorial-rule); }
.recipe-lead { color: #485647; font-size: 1.03rem; }
.detail-meta-pills { border-top: 1px solid var(--editorial-rule); padding-top: 16px; }
.ingredients-box { border: 1px solid var(--editorial-rule); border-radius: var(--editorial-radius); background: #f6f9f4; }
.recipe-instructions .full-text > ol > li { border-radius: var(--editorial-radius); box-shadow: none; }
.related-recipes { border: 0; border-top: 1px solid var(--editorial-rule); border-radius: 0; box-shadow: none; padding-inline: 0; }

@media (max-width: 820px) {
  .hero-grid { row-gap: 23px; }
  .detail-top-grid { gap: 19px; }
  .detail-title-main { max-width: 24ch; }
}

@media (max-width: 560px) {
  #hero { padding-top: 18px; }
  .hero-grid { gap: 19px; }
  .hero-left-box::before { margin-bottom: 9px; }
  .hero-main-title { font-size: clamp(2.25rem, 8.4vw, 2.85rem); line-height: 1.12; }
  .hero-card-img-wrapper { height: 240px; }
  .hero-card-body { padding-top: 14px; }
  .hero-card-title { font-size: 1.5rem; }
  .home-category-nav { gap: 5px; }
  .home-category-nav__links { gap: 17px; }
  .home-category-nav a { padding-inline: 0; }
  .category-collection { padding-block: 37px; }
  .section-heading { padding-bottom: 13px; margin-bottom: 20px; }
  .section-heading h2 { font-size: 1.65rem; }
  .recipes-grid-4 { row-gap: 30px; }
  .card-img-box { aspect-ratio: 4 / 3; }
  .card-content-box { padding-top: 13px; }
  .card-title-text { font-size: 1.3rem; }
  .category-catalog-grid { gap: 25px 12px; }
  .category-catalog-card { min-height: 0; }
  .category-catalog-card img { aspect-ratio: 1 / 1; }
  .category-catalog-card__body { padding: 11px 1px 0; gap: 3px; }
  .category-catalog-card__body strong { font-size: 1.23rem; }
  .category-catalog-card__body span { font-size: .72rem; line-height: 1.3; }
  .category-catalog-card__body em { margin-top: 4px; font-size: .66rem; }
  .recipe-full { padding: 3px 0 20px; }
  .detail-title-main { max-width: 100%; font-size: clamp(1.67rem, 6.2vw, 2rem); line-height: 1.18; }
  .detail-large-img { height: auto; aspect-ratio: 4 / 3; }
  .detail-top-grid { margin-bottom: 31px; }
  .ingredients-box { padding: 20px 17px; }
}

@media (max-width: 390px) {
  .category-catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-catalog-card__body strong { font-size: 1.12rem; }
  .category-catalog-card__body span { display: none; }
}

/* Home directory: paired editorial shelves replace eight identical full-width grids. */
.category-collections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(30px, 5vw, 72px);
  row-gap: clamp(42px, 5vw, 68px);
  padding-top: clamp(48px, 6vw, 82px);
}
.category-collections > .section-heading {
  grid-column: 1 / -1;
  margin: 0 0 -8px;
  padding: 0;
  border: 0;
}
.category-collections > .section-heading h2 { font-size: clamp(2rem, 3vw, 2.8rem); }
.category-collections > .category-collection {
  min-width: 0;
  padding: 0;
  border: 0;
}
.category-collections > .category-collection > .section-heading {
  margin-bottom: 19px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--editorial-rule);
}
.category-collections > .category-collection > .section-heading h2 {
  font-size: clamp(1.55rem, 2vw, 1.9rem);
}
.category-collections > .category-collection .recipes-grid-4 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 17px;
}
.category-collections .recipe-card-modern {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}
.category-collections .recipe-card-modern:first-child {
  grid-template-columns: minmax(0, .92fr) minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 10px;
}
.category-collections .card-img-box,
.category-collections .recipe-card-modern:first-child .card-img-box {
  height: 112px;
  aspect-ratio: auto;
}
.category-collections .recipe-card-modern:first-child .card-img-box { height: 245px; }
.category-collections .card-content-box { padding: 0; }
.category-collections .recipe-card-category { display: none; }
.category-collections .card-title-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 1.13rem;
  line-height: 1.27;
}
.category-collections .recipe-card-modern:first-child .card-title-text {
  display: block;
  overflow: visible;
  font-size: clamp(1.35rem, 1.8vw, 1.6rem);
}
.category-collections .recipe-card-modern:not(:first-child) .card-content-box > p { display: none; }
.category-collections .card-content-box > p { line-height: 1.5; }
.category-collections .card-meta-row { padding-top: 8px; font-size: .72rem; }
.category-collections .card-meta-row b { font-size: .62rem; }

@media (max-width: 950px) {
  .category-collections { column-gap: 25px; }
  .category-collections .recipe-card-modern:first-child { grid-template-columns: 1fr; gap: 12px; }
  .category-collections .recipe-card-modern:first-child .card-img-box { height: auto; aspect-ratio: 4 / 3; }
}

@media (max-width: 700px) {
  .category-collections { grid-template-columns: 1fr; row-gap: 43px; }
  .category-collections > .section-heading { margin-bottom: -12px; }
  .category-collections .recipe-card-modern:first-child { grid-template-columns: minmax(0, .92fr) minmax(0, 1fr); gap: 18px; }
  .category-collections .recipe-card-modern:first-child .card-img-box { height: 205px; aspect-ratio: auto; }
}

@media (max-width: 480px) {
  .category-collections { padding-top: 47px; row-gap: 39px; }
  .category-collections > .section-heading { align-items: baseline; }
  .category-collections > .section-heading h2 { font-size: 1.72rem; }
  .category-collections > .section-heading a { font-size: .74rem; }
  .category-collections > .category-collection > .section-heading { margin-bottom: 17px; }
  .category-collections .recipe-card-modern:first-child { grid-template-columns: 1fr; gap: 11px; }
  .category-collections .recipe-card-modern:first-child .card-img-box { height: auto; aspect-ratio: 4 / 3; }
  .category-collections .recipe-card-modern { grid-template-columns: 104px minmax(0, 1fr); gap: 12px; }
  .category-collections .card-img-box { height: 100px; }
  .category-collections .card-title-text { font-size: 1.05rem; }
}
