/* malvecooks — the site layer on top of the Organic tokens in tokens.css.
   Everything here uses the design-system variables, so retuning a colour or a
   font in tokens.css retunes the whole site. */

/* ── base ───────────────────────────────────────────────────────────────── */

[hidden] { display: none !important; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: 1040px;
  margin-inline: auto;
  padding-inline: 22px;
}
main.wrap { flex: 1; padding-bottom: 40px; }

.kicker {
  display: block;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.lead {
  font-size: 15px;
  line-height: 1.55;
  color: color-mix(in srgb, var(--color-text) 72%, transparent);
}
.lead p { margin: 0 0 10px; }
.lead p:last-child { margin-bottom: 0; }

/* Filtering is a progressive enhancement: with JS off every card is still
   rendered and readable, so the controls that would do nothing stay hidden. */
html:not(.js) .search,
html:not(.js) .chips,
html:not(.js) .list-foot { display: none; }

/* ── header ─────────────────────────────────────────────────────────────── */

.site-head { padding-block: 17px; }
.head-inner { display: flex; align-items: center; gap: 16px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-right: auto;
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--color-text);
  text-decoration: none;
}
.brand-mark {
  width: 27px;
  height: 27px;
  flex: none;
  border-radius: 999px;
  background: var(--color-accent);
  color: var(--color-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 15px;
  line-height: 1;
  padding-bottom: 2px;
}

.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links a {
  font-size: 13px;
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-links a:hover,
.nav-links a[aria-current='page'] { color: var(--color-accent); }

/* ── footer ─────────────────────────────────────────────────────────────── */

.site-foot { margin-top: auto; border-top: 1px solid var(--color-divider); }
.foot-inner {
  padding-block: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.copy { font-size: 12px; color: color-mix(in srgb, var(--color-text) 50%, transparent); }
.ig {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-accent);
  text-decoration: none;
}
.ig:hover { color: var(--color-accent-700); }

/* ── hero ───────────────────────────────────────────────────────────────── */

.hero {
  padding-block: 12px 8px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.hero-text { max-width: 560px; }
.hero-text h1 {
  font-size: 27px;
  line-height: 1.08;
  margin: 0 0 10px;
}
.hero-text .kicker + h1 { margin-top: 8px; }

/* ── search ─────────────────────────────────────────────────────────────── */

.search { position: relative; display: block; width: 100%; }
.search .ico-search {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: color-mix(in srgb, var(--color-text) 45%, transparent);
  pointer-events: none;
}
.srch {
  width: 100%;
  padding: 9px 14px 9px 42px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-text);
  caret-color: var(--color-accent);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: 999px;
}
.srch::placeholder { color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.srch:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 0; border-color: var(--color-accent); }
.srch::-webkit-search-cancel-button { cursor: pointer; }

/* ── chips ──────────────────────────────────────────────────────────────── */

.chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  padding-block: 12px 4px;
}
.chip {
  border: 1px solid var(--color-divider);
  background: transparent;
  font-family: var(--font-body);
  font-size: 12.5px;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--color-text);
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover { background: color-mix(in srgb, var(--color-text) 6%, transparent); }
.chip[aria-pressed='true'] {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-bg);
}

/* ── card grid ──────────────────────────────────────────────────────────── */

.grid {
  padding-block: 14px 4px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 13px;
}

.card {
  position: relative;
  gap: 7px;
  padding: 17px 19px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s, transform 0.18s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card:has(a:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: 2px; }

.card-h {
  font-family: var(--font-heading);
  font-size: 20px;
  line-height: 1.15;
  margin: 0;
}
.card-h a { color: inherit; text-decoration: none; }
/* One focusable target per card: the title link covers the whole surface. */
.card-h a::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.card-h a:focus-visible { outline: none; }

.card-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: color-mix(in srgb, var(--color-text) 76%, transparent);
}

.card-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 5px;
}
.card-info { display: flex; flex-direction: column; gap: 7px; }
.metas { display: flex; gap: 13px; flex-wrap: wrap; }
.meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: color-mix(in srgb, var(--color-text) 58%, transparent);
}
.meta svg { flex: none; }

/* wrap is a last resort: on an extremely narrow screen the pots fold onto a
   second line rather than escaping the card. */
.pots { display: inline-flex; gap: 3px; flex-wrap: wrap; max-width: 100%; }
.pots svg { display: block; }

.arrowbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 999px;
  background: var(--color-accent);
  color: var(--color-bg);
  text-decoration: none;
  transition: background 0.15s;
}
.card:hover .arrowbtn { background: var(--color-accent-600); }

.post-card { gap: 9px; padding: 19px 20px; }
.post-card .tag { align-self: flex-start; }
.card-desc--3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.readmore {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--color-accent);
  margin-top: 2px;
}

/* ── list footer ────────────────────────────────────────────────────────── */

.empty {
  text-align: center;
  font-size: 14px;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
  padding: 30px 0;
}
.list-foot {
  padding-block: 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.count { font-size: 12px; color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.list-foot .btn-secondary { border: 1px solid var(--color-divider); }

/* ── FAQ ────────────────────────────────────────────────────────────────── */

.faq-sec { padding-block: 26px 8px; }
.faq-head { max-width: 640px; }
.faq-head h2 { font-size: 23px; margin: 0 0 6px; }
.faq-head p {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.55;
  color: color-mix(in srgb, var(--color-text) 68%, transparent);
}
.faq-list { display: flex; flex-direction: column; gap: 10px; max-width: 760px; }

.fq {
  background: var(--color-surface);
  border-radius: 20px;
  padding: 2px 18px;
  box-shadow: var(--shadow-sm);
}
.fq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 0;
  font-family: var(--font-heading);
  font-size: 15.5px;
  line-height: 1.25;
}
.fq summary::-webkit-details-marker { display: none; }
.fq .fq-ic { flex: none; transition: transform 0.2s; color: var(--color-accent); display: inline-flex; }
.fq[open] .fq-ic { transform: rotate(45deg); }
.fq .fq-a {
  padding: 0 0 16px;
  font-size: 13.5px;
  line-height: 1.55;
  color: color-mix(in srgb, var(--color-text) 78%, transparent);
}

/* ── article pages ──────────────────────────────────────────────────────── */

.page-recipe, .page-post { max-width: 780px; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-block: 10px 0;
  font-size: 13px;
  color: var(--color-accent);
  text-decoration: none;
}
.back:hover { color: var(--color-accent-700); }

.rc-head { padding-block: 14px 6px; }
.rc-head h1 { font-size: 34px; line-height: 1.06; margin: 8px 0 12px; }
.rc-head .lead { font-size: 15.5px; line-height: 1.6; color: color-mix(in srgb, var(--color-text) 80%, transparent); }

/* Tag pills. Each one links to the list filtered by that word. */
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.tag-row .tag {
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.tag-row .tag::before { content: '#'; opacity: 0.45; margin-right: 1px; }
.tag-row .tag:hover { background: var(--color-accent-2-600); color: var(--color-bg); }
.page-post .tag-row { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--color-divider); }

.hero-media { margin-block: 16px 4px; border-radius: 26px; overflow: hidden; }
.hero-media img { width: 100%; height: auto; border-radius: 26px; }
.hero-media--empty {
  height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 13px;
  background: var(--color-accent-2-200);
  color: var(--color-accent-2-700);
}
.hero-media--post { height: 200px; background: var(--color-accent-200); color: var(--color-accent-800); }

.stats {
  margin-block: 16px 4px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--color-surface);
  border-radius: 22px;
  padding: 16px 18px;
}
.stat { flex: 1; min-width: 96px; display: flex; flex-direction: column; gap: 4px; }
/* Five 22px pots + gaps = 122px. Without this the column shrinks to an even
   share of the row (~104px on a 412px phone) and the pots overflow the card. */
.stat--rating { min-width: 130px; }
.stat-k {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 48%, transparent);
}
.stat-v { font-family: var(--font-heading); font-size: 19px; line-height: 1.2; }

.rc-cols { display: flex; gap: 26px; padding-block: 20px 6px; flex-wrap: wrap; }
.rc-ing { flex: 1; min-width: 190px; }
.rc-steps { flex: 1.5; min-width: 240px; }
.rc-cols h2 { font-size: 21px; margin: 0 0 10px; }

.ing-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.ing-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; }
.ing-list .dot {
  width: 7px;
  height: 7px;
  flex: none;
  margin-top: 7px;
  border-radius: 999px;
  background: var(--color-accent);
}

.step-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.step-list li { display: flex; gap: 12px; align-items: flex-start; }
.step-n {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 999px;
  background: var(--color-accent-100);
  color: var(--color-accent-800);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 13px;
}
.step-t { font-size: 14px; line-height: 1.55; padding-top: 2px; }
.step-t p { margin: 0 0 8px; }
.step-t p:last-child { margin-bottom: 0; }

.note {
  margin-block: 16px 8px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--color-accent-2-100);
  border-radius: 22px;
  padding: 15px 18px;
}
.note-ic { font-size: 22px; line-height: 1; flex: none; }
.note-body { font-size: 13.5px; line-height: 1.5; }
.note-body strong {
  font-family: var(--font-heading);
  font-weight: 400;
  color: var(--color-accent-2-800);
}
.note-body p { display: inline; margin: 0; }

/* ── post + prose ───────────────────────────────────────────────────────── */

.pt-head { padding-block: 16px 6px; }
.pt-head h1 { font-size: 33px; line-height: 1.08; margin: 10px 0 12px; }
.pt-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.pt-meta .sep { width: 4px; height: 4px; border-radius: 999px; background: currentColor; }

.prose { padding-block: 20px 8px; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 15px; font-size: 15px; line-height: 1.68; color: color-mix(in srgb, var(--color-text) 86%, transparent); }
.prose h2 { font-size: 24px; margin: 26px 0 10px; }
.prose h3 { font-size: 21px; margin: 22px 0 8px; }
.prose ul, .prose ol { margin: 0 0 15px; padding-left: 22px; font-size: 15px; line-height: 1.68; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--color-accent); }
.prose blockquote {
  margin: 0 0 15px;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--color-accent-300);
  color: color-mix(in srgb, var(--color-text) 72%, transparent);
}
.prose code {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.9em;
  background: var(--color-surface);
  padding: 2px 6px;
  border-radius: 6px;
}
.prose pre {
  background: var(--color-surface);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  overflow-x: auto;
}
.prose pre code { background: none; padding: 0; }
.prose img { border-radius: 20px; margin: 6px 0 18px; }
.prose hr { height: 1px; border: 0; margin: 26px 0; background: var(--color-divider); }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 15px; }
.prose th, .prose td { text-align: left; padding: 8px; border-bottom: 1px solid var(--color-divider); }

/* ── 404 ────────────────────────────────────────────────────────────────── */

.page-404 { padding-block: 60px 80px; text-align: center; }
.page-404 h1 { font-size: 72px; margin: 0 0 10px; color: var(--color-accent); }

/* ── wider screens ──────────────────────────────────────────────────────── */

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

@media (min-width: 760px) {
  .wrap { padding-inline: 34px; }
  .site-head { padding-block: 20px; }
  .head-inner { gap: 22px; }
  .brand { font-size: 22px; gap: 10px; }
  .brand-mark { width: 30px; height: 30px; font-size: 16px; }
  .nav-links a { font-size: 14px; }

  .hero { padding-block: 18px 8px; }
  .hero-text h1 { font-size: 38px; line-height: 1.05; }
  .hero .search { width: 300px; flex: none; }

  .chips { gap: 8px; }
  .grid { padding-block: 18px 8px; }
  .card-h { font-size: 19px; }
  .recipe-card .card-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .arrowbtn { width: 40px; height: 40px; }

  .faq-head h2 { font-size: 28px; }
  .faq-head p { font-size: 14px; }
  .count { font-size: 12px; }
}

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

/* ── print: a recipe you can take to the stove ──────────────────────────── */

@media print {
  .site-head, .site-foot, .back, .hero-media, .faq-sec, .search, .chips, .list-foot { display: none !important; }
  body { background: #fff; }
  .card, .stats, .note, .fq { box-shadow: none; }
  .page-recipe { max-width: none; }
  .rc-cols { display: block; }
  .rc-steps { margin-top: 20px; }
}

/* ── motion ─────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
