﻿/* ─────────────────────────────────────────────────────────────
   آشپزتو — سایت معرفی
   پوستهٔ مجله‌ای نزدیک دموی Pixwell Recipe: کارت تصویر، عنوان درشت،
   رنگ تأکیدی مرجانی. پس‌زمینهٔ نسکافه‌ای فقط در لایت‌مود است.
   ───────────────────────────────────────────────────────────── */

:root, html[data-theme="light"] {
  --primary: #ff8763;
  --primary-dark: #e86a45;
  --secondary: #6b5e54;
  --light: #fbf7f2;
  --white: #fff;
  --brand-soft: rgba(255, 135, 99, .16);
  --ink: #2a241f;
  --ink-soft: #6b5e54;
  --muted: #6b5e54;
  --line: #e7ddd2;
  --bg: #f6f0e8;
  --bg-elev: #fff;
  --card: #fff;
  --field: #fff;
  --ok: #2f9d62;
  --ok-soft: rgba(47, 157, 98, .14);
  --danger: #d64545;
  --danger-soft: rgba(214, 69, 69, .12);
  --radius: 10px;
  --radius-lg: 12px;
  --shadow: 0 4px 30px rgba(42, 36, 31, .05);
  --shadow-lift: 0 12px 32px rgba(42, 36, 31, .12);
  --glass-bg: #fff;
  --glass-border: var(--line);
  --glass-blur: none;
  --container: 1140px;
  --gutter: 20px;
  --header-h: 64px;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--bg);
  --bs-heading-color: var(--ink);
  --bs-secondary-color: var(--muted);
  --bs-border-color: var(--line);
  --bs-tertiary-bg: var(--bg-elev);
  --bs-emphasis-color: var(--ink);
}

html[data-theme="dark"] {
  --white: #221e1b;
  --secondary: #c4b6aa;
  --light: #2a2521;
  --primary-dark: #ffb199;
  --brand-soft: rgba(255, 135, 99, .18);
  --ink: #f3ece6;
  --ink-soft: #c4b6aa;
  --muted: #c4b6aa;
  --line: #3a322c;
  --bg: #171411;
  --bg-elev: #221e1b;
  --card: #221e1b;
  --field: #2a2521;
  --ok: #5dce8a;
  --ok-soft: rgba(93, 206, 138, .16);
  --danger-soft: rgba(255, 120, 120, .18);
  --shadow: 0 4px 24px rgba(0, 0, 0, .28);
  --shadow-lift: 0 12px 32px rgba(0, 0, 0, .4);
  --glass-bg: #221e1b;
  --glass-border: var(--line);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
}
html[data-theme="dark"] { color-scheme: dark; }
@media (min-width: 768px) { html { font-size: 16px; } }

body {
  margin: 0;
  font-family: "IRANSans", Tahoma, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font-family: inherit; }

main { flex: 1 0 auto; }

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  line-height: 1.35;
  font-weight: 700;
  margin: 0 0 .5em;
  color: var(--ink);
}
.page-head h1::first-letter,
.section-head h2::first-letter,
.cook-group h2::first-letter,
.block-title::first-letter {
  color: var(--primary);
}
h1 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: none; }
.prose a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container.narrow { max-width: 760px; }

.section { padding-block: 32px; }
.section-flush { padding: 0; }
.text-center { text-align: center; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.section-head h2 { margin: 0; }
.section-more { font-size: .95rem; white-space: nowrap; }

.page-head { margin-bottom: 2rem; }
.page-head h1 { margin-bottom: .25rem; }

.back-link {
  display: inline-block;
  font-size: .9rem;
  color: var(--muted);
  margin-bottom: .75rem;
}

/* ── دکمه‌ها ───────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: 0;
  border-radius: 8px;
  padding: 11px 20px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: 3px solid var(--brand-soft); outline-offset: 2px; }
.btn-lg { padding: 12px 20px; font-size: 15px; }

.btn-brand { background: var(--primary); color: #fff; }
.btn-brand:hover { background: var(--primary-dark); color: #fff; }

.btn-ghost {
  background: var(--light);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: var(--bg-elev); color: var(--ink); }

/* ── هدر ──────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass-bg);
  box-shadow: 0 4px 30px rgba(0, 0, 0, .04);
}
.site-header::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: var(--primary);
  pointer-events: none;
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--header-h);
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-search {
  display: flex;
  align-items: center;
  gap: .15rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding-inline-start: .75rem;
  background: var(--field);
}
.header-search input {
  width: 8.5rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  padding: .35rem 0;
}
.header-search input:focus { outline: none; }
.header-search button { flex: none; }
@media (max-width: 720px) {
  .header-search input { width: 5.5rem; }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
}
.brand:hover { color: var(--ink); text-decoration: none; }
.brand-mark { width: 22px; height: 22px; object-fit: contain; }

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--ink);
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
}
.icon-btn:hover { background: var(--light); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { display: block; }

html[data-theme="light"] .theme-icon-sun,
html[data-theme="dark"] .theme-icon-moon { display: none; }

.menu-bars {
  width: 19px;
  height: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.menu-bars span {
  display: block;
  height: 2.3px;
  border-radius: 1.15px;
  background: var(--ink);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  flex: 1;
  justify-content: flex-end;
}

.nav-link {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  position: relative;
}
.nav-link:hover { background: transparent; color: var(--primary); text-decoration: none; }
.nav-link.active { color: var(--primary); background: transparent; }

.nav-sep {
  width: 1px;
  height: 16px;
  background: var(--line);
  margin-inline: .4rem;
}

.nav-lang {
  padding: .25rem .5rem;
  font-size: .85rem;
  color: var(--muted);
  border-radius: 8px;
}
.nav-lang:hover { color: var(--ink); text-decoration: none; }
.nav-lang.active { color: var(--ink); font-weight: 700; }

.nav-cta { margin-inline-start: .5rem; padding: 8px 14px; font-size: 13px; }

.nav-drop { position: relative; }
.nav-drop > summary { list-style: none; cursor: pointer; }
.nav-drop > summary::-webkit-details-marker { display: none; }
.nav-drop > summary.nav-link a { color: inherit; text-decoration: none; }
.nav-drop-panel {
  display: none;
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% - 2px);
  min-width: 220px;
  max-height: min(70vh, 420px);
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: .35rem;
  z-index: 60;
}
.nav-drop-panel a {
  display: block;
  padding: .45rem .75rem;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 600;
  font-size: .92rem;
}
.nav-drop-panel a:hover,
.nav-drop-panel a.active { background: var(--brand-soft); color: var(--primary); text-decoration: none; }
.nav-drop-panel a.nav-drop-child {
  font-weight: 500;
  font-size: .86rem;
  padding-inline-start: 1.35rem;
  color: var(--muted);
}
.chip-row + .chip-row-sub { margin-top: -1rem; }
.nav-drop[open] > .nav-drop-panel,
.nav-drop:hover > .nav-drop-panel,
.nav-drop:focus-within > .nav-drop-panel { display: block; }

.nav-toggle-btn { display: none; }

@media (max-width: 860px) {
  .nav-toggle-btn { display: inline-flex; }
  .header-actions { margin-inline-start: auto; }
  .site-nav {
    display: none;
    order: 3;
    width: 100%;
    flex: 1 1 100%;
    justify-content: flex-start;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding-bottom: 12px;
  }
  .nav-toggle:checked ~ .site-nav { display: flex; }
  .nav-sep { display: none; }
  .nav-cta { margin-inline-start: 0; margin-top: 8px; }
  .nav-lang { display: inline-block; }
  .nav-link.active { background: var(--brand-soft); }
  .nav-drop-panel {
    position: static;
    max-height: none;
    border: 0;
    box-shadow: none;
    padding: .15rem .35rem .35rem 0;
  }
  .nav-drop:hover > .nav-drop-panel { display: none; }
  .nav-drop[open] > .nav-drop-panel,
  .nav-drop:focus-within > .nav-drop-panel { display: block; }
}

/* ── هیرو ─────────────────────────────────────────────────── */

.hero {
  padding-block: 32px 8px;
  text-align: start;
  background: transparent;
}
.hero-mark { width: 52px; height: 52px; object-fit: contain; margin-bottom: .75rem; }
.hero-lead { font-size: 1.05rem; color: var(--muted); max-width: 46rem; margin-inline: 0; }
.hero-actions {
  display: flex;
  gap: .75rem;
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

/* ── اسلایدشو ─────────────────────────────────────────────── */

.slideshow {
  position: relative;
  overflow: hidden;
  width: 100%;
  background: var(--bg-elev);
  /* اسکرول و فلش‌ها همیشه LTR می‌مانند تا در صفحهٔ فارسی اسلاید به راست نچسبد. */
  direction: ltr;
  container-type: inline-size;
}

.slideshow-track {
  display: flex;
  flex-flow: row nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  direction: ltr;
}
.slideshow-track::-webkit-scrollbar { display: none; }

.slideshow-slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  scroll-snap-align: start;
  /* ارتفاع از عرض کامل اسلاید حساب می‌شود؛ aspect-ratio روی خود اسلاید عرض را در دسکتاپ کم می‌کرد. */
  height: min(72vh, calc(100cqw / (var(--slide-ratio, 16 / 9))));
}

.slideshow-image { width: 100%; height: 100%; object-fit: cover; display: block; }
.slideshow-slide picture { display: contents; }

.slideshow-link { position: absolute; inset: 0; }

.slideshow-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: clamp(1.25rem, 1rem + 3vw, 3rem);
  color: #fff;
  background: linear-gradient(to top, rgba(12, 11, 24, .82), rgba(12, 11, 24, .1) 70%, transparent);
}
[dir="rtl"] .slideshow-caption {
  direction: rtl;
  text-align: right;
}
.slideshow-title { color: #fff; margin-bottom: .35rem; }
.slideshow-text { color: rgba(255, 255, 255, .88); max-width: 55ch; margin-bottom: .9rem; }

.slideshow-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 2;
}
.slideshow-arrow:hover { background: var(--light); }
.slideshow-prev { left: 16px; }
.slideshow-next { right: 16px; }

.slideshow-dots {
  position: absolute;
  inset-inline: 0;
  bottom: 12px;
  display: flex;
  justify-content: center;
  gap: .4rem;
}
.slideshow-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .5);
  cursor: pointer;
}
.slideshow-dot.active { background: #fff; width: 22px; border-radius: 999px; }

@media (prefers-reduced-motion: reduce) {
  .slideshow-track { scroll-behavior: auto; }
}

/* ── کارت مطلب ────────────────────────────────────────────── */

.post-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
@media (min-width: 900px) {
  .post-grid-lead {
    grid-template-columns: 1.35fr 1fr;
  }
  .post-grid-lead > :first-child {
    grid-row: span 2;
  }
  .post-grid-lead > :first-child .post-card-media { aspect-ratio: 16 / 11; min-height: 280px; }
  .post-grid-lead > :first-child .post-card-title { font-size: 1.45rem; }
}

.post-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--card);
  border: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow .2s ease, transform .2s ease;
}
.post-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }

/* عکس از جریان خارج می‌شود تا نسبت ذاتی فایل، ارتفاع کارت را عوض نکند. */
.post-card-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-elev);
}
.post-card-media img,
.post-card-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.recipe-card .post-card-media { max-height: 220px; }
.post-card-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--brand-soft), var(--bg-elev));
}

.post-card-body { padding: 1.1rem 1.25rem 1.25rem; display: flex; flex-direction: column; flex: 1; }

.post-card-cat {
  font-size: .78rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: .4rem;
}
.post-card-title { font-size: 1.05rem; margin-bottom: .45rem; }
.post-card-title a { color: var(--ink); }
.post-card-title a:hover { color: var(--primary); text-decoration: none; }

.post-card-excerpt {
  color: var(--muted);
  font-size: .92rem;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  margin-top: auto;
  display: flex;
  gap: .75rem;
  font-size: .82rem;
  color: var(--muted);
}

/* ── چیپ دسته‌بندی و صفحه‌بندی ────────────────────────────── */

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.75rem;
}
.chip {
  padding: .35rem .9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--card);
}
.chip:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-sm { padding: .2rem .7rem; font-size: .8rem; }
.chip-label { font-size: .85rem; color: var(--muted); align-self: center; }

.cook-search {
  display: flex;
  gap: .6rem;
  margin: 0 0 1.25rem;
}
.cook-search input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--field);
  color: var(--ink);
  font: inherit;
  padding: .7rem .9rem;
}
.cook-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.25rem;
  margin-bottom: 1.25rem;
}
.cook-toolbar p { margin: 0; }
.cook-sort-note { color: var(--muted); margin-inline-start: .75rem; }
.cook-toolbar form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem .9rem;
}
.cook-toolbar label {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: var(--muted);
  font-size: .88rem;
}
.cook-toolbar select {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  padding: .35rem .6rem;
}

.recipe-comments-note {
  padding-top: 0;
}
.recipe-comments-note h2 { margin-bottom: .4rem; }
.recipe-comments-note p { color: var(--ink-soft); margin-top: 0; }

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .55rem 1rem;
  margin-top: 2.5rem;
}
.pager-status { font-size: .9rem; color: var(--muted); }
.pager-num {
  min-width: 2.4rem;
  height: 2.4rem;
  padding: 0 .55rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.pager-num.active,
.pager-num:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  text-decoration: none;
}
.pager-gap { color: var(--muted); padding: 0 .15rem; }

.empty-state {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--muted);
  background: var(--bg-elev);
  border-radius: var(--radius-lg);
}

/* ── متن محتوا (خروجی CMS) ────────────────────────────────── */

.prose { font-size: 1.02rem; color: var(--ink-soft); }
.prose > :first-child { margin-top: 0; }
.prose h2, .prose h3, .prose h4 { color: var(--ink); margin-top: 1.8em; }
.prose img { border-radius: var(--radius); margin-block: 1.2em; }
.prose ul, .prose ol { padding-inline-start: 1.4em; margin-bottom: 1.2em; }
.prose li { margin-bottom: .4em; }
.prose blockquote {
  margin: 1.5em 0;
  padding: .2em 1.2em;
  border-inline-start: 3px solid var(--primary);
  background: var(--bg-elev);
  border-radius: var(--radius);
  color: var(--ink);
}
.prose table { width: 100%; border-collapse: collapse; margin-block: 1.4em; }
.prose th, .prose td { border: 1px solid var(--line); padding: .6em .8em; text-align: start; }
.prose th { background: var(--bg-elev); }
.prose pre {
  background: var(--bg-elev);
  padding: 1em 1.2em;
  border-radius: var(--radius);
  overflow-x: auto;
  direction: ltr;
  text-align: left;
}
.prose iframe { max-width: 100%; border-radius: var(--radius); }

.post-head { max-width: 760px; }
.post-kicker { margin: .2rem 0 .85rem; }
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .85rem;
  font-size: .88rem;
  color: var(--muted);
}
.post-meta a { color: var(--ink-soft); font-weight: 600; }
.post-meta a:hover { color: var(--primary); text-decoration: none; }
.post-hero { margin: 1.35rem 0 0; }
.post-hero img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-lg);
  display: block;
  background: var(--bg-elev);
}
.post-layout {
  display: grid;
  gap: 1.75rem;
  margin-top: 1.75rem;
  align-items: start;
}
@media (min-width: 980px) {
  .post-layout { grid-template-columns: minmax(0, 1fr) 280px; }
  .post-side { position: sticky; top: calc(var(--header-h) + 16px); }
}
.post-lead {
  margin: 0 0 1.4rem;
  font-size: 1.12rem;
  line-height: 1.85;
  color: var(--ink);
}
.post-tags { margin-top: 2.5rem; }

.author-card {
  display: flex;
  gap: .85rem;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.05rem 1.1rem;
  margin-bottom: 1rem;
}
.author-card h2 { margin: 0; font-size: 1.05rem; }
.author-kicker { margin: 0 0 .15rem; font-size: .75rem; color: var(--muted); }
.author-headline { margin: .2rem 0 0; color: var(--primary); font-size: .82rem; font-weight: 700; }
.author-bio { margin: .45rem 0 0; color: var(--ink-soft); font-size: .88rem; }
.author-photo,
.author-fallback {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex: none;
}
.author-photo { object-fit: cover; display: block; }
.author-fallback {
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--primary);
  font-weight: 800;
  font-size: 1.25rem;
}

/* ── پخت و پز ─────────────────────────────────────────────── */

.cook-lead { color: var(--muted); margin: 0; max-width: 42rem; }
.cook-group { margin-top: 2.25rem; }
.cook-group h2 {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1rem;
}
.cook-count {
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg-elev);
  border-radius: 999px;
  padding: .1rem .55rem;
}
.cook-card-tags { margin: 0 0 .75rem; }
.cook-names { color: var(--muted); margin: .35rem 0 .8rem; }
.cook-description { font-size: 1.05rem; color: var(--ink-soft); text-align: justify; }

.recipe-hero { margin: 1.25rem 0 0; }
.recipe-hero img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-lg);
  display: block;
  background: var(--bg-elev);
}

.recipe-thumbs {
  display: flex;
  gap: .65rem;
  margin-top: .8rem;
  overflow-x: auto;
  padding-bottom: .2rem;
}
.recipe-thumb {
  width: 68px;
  height: 68px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-elev);
  cursor: pointer;
  flex: none;
}
.recipe-thumb.active { border-color: var(--primary); }
.recipe-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.recipe-intro { margin-top: 1.15rem; }
.recipe-intro .cook-description { margin: 0; }
.recipe-intro .post-meta { margin-top: .75rem; }

.recipe-times {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.recipe-times li {
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--line);
  border-inline-start: 1px solid var(--line);
}
.recipe-times li:nth-child(odd) { border-inline-start: 0; }
.recipe-times small {
  display: block;
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.3;
}
.recipe-times strong { display: block; font-size: .98rem; font-weight: 700; }
@media (min-width: 720px) {
  .recipe-times { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
  .recipe-times li { border-bottom: 0; border-inline-start: 1px solid var(--line); }
  .recipe-times li:first-child { border-inline-start: 0; }
}

.recipe-layout {
  display: grid;
  gap: 1.75rem;
  margin-top: 1.75rem;
  align-items: start;
}
@media (min-width: 980px) {
  .recipe-layout { grid-template-columns: minmax(0, 1fr) 280px; }
  .recipe-side { position: sticky; top: calc(var(--header-h) + 16px); }
}

.recipe-block { margin-top: 2rem; }
.recipe-block:first-child { margin-top: 0; }
.recipe-block h2 { margin-bottom: .9rem; }
.recipe-ingredients,
.recipe-notes { list-style: none; padding: 0; margin: 0; }
.recipe-ingredients li,
.recipe-notes li {
  padding: .75rem 0;
  border-bottom: 1px solid var(--line);
}
.ingredient {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  cursor: pointer;
}
.ingredient-check {
  appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: .3rem;
  border: 1.5px solid var(--line);
  border-radius: 3px;
  background: var(--card) center / 12px no-repeat;
  flex: none;
  cursor: pointer;
}
.ingredient-check:checked {
  background-color: var(--primary);
  border-color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.2 6.4 11 12.5 4.8'/%3E%3C/svg%3E");
}
.ingredient-check:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ingredient:has(.ingredient-check:checked) .ingredient-line {
  color: var(--muted);
  text-decoration: line-through;
}
.ingredient-line { display: flex; flex-wrap: wrap; gap: .25rem .5rem; }
.recipe-amount { color: var(--ink); font-weight: 700; }
.ingredient:has(.ingredient-check:checked) .recipe-amount { color: var(--muted); font-weight: 600; }
.recipe-note {
  display: block;
  margin-inline-start: 1.85rem;
  color: var(--muted);
  font-size: .88rem;
}
.recipe-steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.recipe-steps li {
  position: relative;
  margin-bottom: 1.15rem;
  padding-inline-start: 2.8rem;
}
.recipe-steps li p { margin: 0; white-space: pre-wrap; }
.step-heading { display: block; margin-bottom: .2rem; }
.step-tip { margin-top: .35rem; color: var(--muted); font-size: .9rem; }
.step-photo {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 12px;
  margin: 0 0 .55rem;
}
.recipe-steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  inset-inline-start: 0;
  top: .1rem;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.step-time {
  display: inline-block;
  margin-top: .35rem;
  color: var(--muted);
  font-size: .85rem;
}
.recipe-notes p { margin: .35rem 0 0; }

.nutrition-card,
.recipe-share {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.05rem 1.1rem 1.15rem;
  margin-bottom: 1rem;
}
.nutrition-card h2,
.recipe-share h2 { font-size: 1.05rem; margin-bottom: .7rem; }
.nutrition-cal {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.03em;
}
.nutrition-unit { margin: .15rem 0 0; color: var(--muted); font-size: .85rem; }
.nutrition-hint { margin: .7rem 0 .2rem; color: var(--muted); font-size: .78rem; }
.nutrition-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .15rem .75rem;
  margin-top: .75rem;
  font-size: .88rem;
}
.nutrition-pct { color: var(--muted); }
.nutrition-bar {
  grid-column: 1 / -1;
  display: block;
  height: 6px;
  border-radius: 99px;
  background: var(--bg);
  overflow: hidden;
}
.nutrition-bar i {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: inherit;
}

.share-row { display: flex; flex-wrap: wrap; gap: .55rem; }
.share-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  padding: 0;
  cursor: pointer;
}
.share-btn:hover { border-color: var(--primary); color: var(--primary); }
.share-btn svg { width: 18px; height: 18px; }
.share-btn.is-copied { border-color: var(--ok); color: var(--ok); }

.allergen-row { margin: 0; }
.allergen-chip {
  border-color: transparent;
  background: var(--danger-soft);
  color: var(--danger);
}
.recipe-app-hint ul {
  margin: 0 0 .9rem;
  padding-inline-start: 1.15rem;
  color: var(--ink-soft);
  font-size: .92rem;
}
.recipe-app-hint li { margin-bottom: .35rem; }
.recipe-app-hint .btn { width: 100%; }

/* ── بنر اپ ───────────────────────────────────────────────── */

.app-cta { background: transparent; }
.app-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.6rem;
}
.app-cta-inner h2 { margin-bottom: .25rem; }
.app-cta-inner p { margin: 0; color: var(--muted); }
.app-cta-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

.download-actions {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  max-width: 340px;
  margin: 2rem auto 0;
}
.app-version { color: var(--muted); font-size: .9rem; }

/* ── فرم تماس ─────────────────────────────────────────────── */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
}

.contact-intro { margin-bottom: 2rem; }

.contact-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.field { margin-bottom: 1.1rem; }
.field label,
.contact-form label,
.comment-form label {
  display: block;
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: .35rem;
  color: var(--ink);
}
.field-row { display: grid; gap: 0 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

.form-control,
.form-control:focus,
.form-control:hover,
textarea.form-control {
  width: 100%;
  padding: .6rem .9rem;
  font: inherit;
  font-size: .95rem;
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
  background-color: var(--light);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  caret-color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--brand-soft);
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
  background-color: var(--light);
}
.form-control::placeholder {
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
  opacity: 1;
}
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  box-shadow: 0 0 0 1000px var(--light) inset;
  transition: background-color 9999s ease-out;
}
textarea.form-control { resize: vertical; min-height: 140px; }

.field-error { display: block; color: var(--danger); font-size: .82rem; margin-top: .3rem; }

.captcha-image {
  display: inline-block;
  padding: .3rem .6rem;
  margin-bottom: .5rem;
  background: var(--bg-elev);
  border-radius: var(--radius);
}
.captcha-image svg { display: block; }

/* هانی‌پات باید برای کاربر نامرئی باشد ولی برای بات در DOM بماند */
.honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: .92rem;
}
.alert:empty { display: none; }
.alert-success { background: var(--ok-soft); color: var(--ok); }
.alert-danger { background: var(--danger-soft); color: var(--danger); }

.contact-info h2 { margin-bottom: 1rem; }
.contact-group { font-size: .95rem; color: var(--muted); margin: 1.2rem 0 .5rem; }
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .92rem;
}
.contact-list li:last-child { border-bottom: 0; }
.contact-title { color: var(--muted); }
.contact-map { font-size: .85rem; }

/* ── فوتر ─────────────────────────────────────────────────── */

.site-footer {
  margin-top: auto;
  background: #241c18;
  border-top: 0;
  padding-top: 2.4rem;
  font-size: .92rem;
  color: #eadfd4;
}
.site-footer .brand,
.site-footer .footer-heading { color: #fff; }
.site-footer .footer-about,
.site-footer .footer-links a,
.site-footer .footer-contact,
.site-footer .footer-copy,
.site-footer .footer-credit,
.site-footer .text-primary-hover { color: #d8cdc2; }
.site-footer .footer-links a:hover,
.site-footer .footer-credit:hover,
.site-footer .text-primary-hover:hover { color: var(--primary); }
.site-footer .footer-bottom { border-top-color: rgba(255, 255, 255, .1); color: #cbbfb4; }
.site-footer .social-links a {
  background: transparent;
  border-color: rgba(255, 255, 255, .16);
  color: #eadfd4;
}
.site-footer .social-links a:hover { border-color: var(--primary); color: var(--primary); }

.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  padding-bottom: 2rem;
}

.footer-brand { margin-bottom: .75rem; }
.footer-about { color: var(--muted); max-width: 40ch; }

.footer-links { display: flex; flex-direction: column; gap: .45rem; }
.footer-links a { color: var(--ink-soft); }
.footer-links a:hover { color: var(--primary); }
.footer-heading { font-weight: 700; color: var(--ink); margin-bottom: .25rem; }

.social-links { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: .75rem; }
.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding-inline: .6rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink-soft);
}
.social-links a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

.footer-contact { display: block; color: var(--ink-soft); margin-bottom: .3rem; }

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-block: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.5rem;
  flex-wrap: wrap;
  direction: ltr;
  color: var(--muted);
  font-size: .85rem;
}
.footer-copy { margin: 0; text-align: end; }
.footer-credit {
  color: var(--ink-soft);
  text-decoration: none;
}
.footer-credit:hover { text-decoration: none; }

.text-primary-hover { color: var(--ink-soft); }
.text-primary-hover:hover { color: var(--primary); text-decoration: none; }

.hover-underline-animation {
  display: inline-block;
  position: relative;
}
.hover-underline-animation::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform .25s ease-out;
}
.hover-underline-animation:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}
@media (prefers-reduced-motion: reduce) {
  .hover-underline-animation::after { transition: none; }
}

.app-url { margin: .35rem 0 0; font-size: .92rem; }

.error-code {
  font-size: clamp(3rem, 2rem + 6vw, 5rem);
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: .5rem;
}

.page-photo {
  margin: 0 0 1.4rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elev);
}
.page-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.page-photo-wide img { height: min(42vh, 280px); }

.photo-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 2rem;
}
.photo-grid .page-photo { margin: 0; }
.photo-grid img { height: 200px; }

.contact-side { display: grid; gap: 1.5rem; }
.contact-side .page-photo { margin: 0; }
.contact-side .page-photo img { min-height: 280px; }

@media (max-width: 860px) {
  .photo-grid { grid-template-columns: 1fr; }
  .photo-grid img { height: 220px; }
  .contact-side .page-photo img { min-height: 200px; }
}

/* ── دیدگاه‌ها ────────────────────────────────────────────── */

.comments { background: transparent; }

.tile-row {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.cat-tile {
  position: relative;
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 180px;
  color: #fff;
}
.cat-tile img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}
.cat-tile span {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2.2rem 1rem .95rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
  background: linear-gradient(to top, rgba(28, 18, 12, .78), transparent);
}
.cat-tile:hover { color: #fff; }
.cat-tile:hover img { transform: scale(1.04); }
.cat-tile img { transition: transform .35s ease; }
@media (max-width: 720px) {
  .tile-row { grid-template-columns: 1fr; }
  .cat-tile img { height: 160px; }
}

.comments-title {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1.5rem;
}
.comments-count {
  font-size: .85rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--brand-soft);
  border-radius: 999px;
  padding: .1rem .7rem;
}

.comment-list, .comment-replies { list-style: none; margin: 0; padding: 0; }

.comment {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

/* پاسخ‌ها با یک خط عمودی از کامنت والد جدا می‌شوند تا تودرتویی در RTL هم خوانا بماند. */
.comment-replies {
  margin-top: 1rem;
  padding-inline-start: 1rem;
  border-inline-start: 2px solid var(--line);
}
.comment-replies .comment { background: var(--bg-elev); }
.comment-replies .comment:last-child { margin-bottom: 0; }

.comment-staff { border-color: var(--primary); background: var(--brand-soft); }
.comment-pending { border-color: var(--primary); background: var(--brand-soft); }
.comment-badge-pending { color: var(--primary-dark); background: var(--card); }
.comment-pending-note {
  margin: .35rem 0 0;
  font-size: .88rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.comment-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: .4rem;
}
.comment-author { font-weight: 700; }
.comment-badge {
  font-size: .72rem;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border-radius: 999px;
  padding: .1rem .6rem;
}
.comment-date { font-size: .8rem; color: var(--muted); }

/* متن کاربر ممکن است چند خطی باشد و HTML آن escape شده، پس شکستن خط باید حفظ شود. */
.comment-body {
  margin: 0 0 .5rem;
  color: var(--ink-soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.comment-reply { font-size: .85rem; font-weight: 600; }

.comment-form { margin-top: 2rem; }
.comment-form h3 { margin-bottom: 1.25rem; }

.reply-context {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  font-size: .9rem;
  color: var(--muted);
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: .5rem .9rem;
  margin-bottom: 1.25rem;
}

.field-hint { display: block; font-size: .8rem; color: var(--muted); margin-top: .3rem; }

.skeleton {
  display: block;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--line) 25%, var(--bg-elev) 50%, var(--line) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}
.skeleton-media { aspect-ratio: 16 / 10; border-radius: 0; }
.skeleton-line { height: .9rem; margin-bottom: .55rem; }
.skeleton-line.short { width: 55%; }
.skeleton-title { height: 1.8rem; width: min(16rem, 70%); margin: .4rem 0 0; }
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}
@keyframes skeleton-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
