/* MyResipiRasa — one stylesheet. Tokens first; components below; print last. */
:root {
  --bg: #fbf8f3;
  --surface: #ffffff;
  --panel: #f3ece1;
  --text: #1f1a15;
  --muted: #5e554b;
  --accent: #a63a1c;
  --accent-ink: #ffffff;
  --line: #e4dacb;
  --field: #8c8073;
  --shadow: 0 1px 2px rgb(31 26 21 / 6%), 0 4px 14px rgb(31 26 21 / 6%);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --fs-sm: 0.889rem;
  --fs-base: 1.125rem;
  --fs-h3: clamp(1.2rem, 1.12rem + 0.4vw, 1.375rem);
  --fs-h2: clamp(1.4rem, 1.25rem + 0.75vw, 1.75rem);
  --fs-h1: clamp(1.75rem, 1.45rem + 1.5vw, 2.5rem);
  --lh: 1.6;

  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --tap: 44px;
  --measure: 70ch;
  --wrap: 72rem;
  --header-h: 56px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1612;
    --surface: #25201b;
    --panel: #2c261f;
    --text: #f3ede5;
    --muted: #bdb2a5;
    --accent: #f2906f;
    --accent-ink: #1a1612;
    --line: #3d352c;
    --field: #8c8073;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 4px 14px rgb(0 0 0 / 25%);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--sp-4));
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--lh);
  overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { line-height: 1.25; margin: var(--sp-8) 0 var(--sp-3); text-wrap: balance; }
h1 { font-size: var(--fs-h1); margin-top: var(--sp-4); letter-spacing: -0.01em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); margin-top: var(--sp-6); }
p, ul, ol, dl, table, figure { margin: 0 0 var(--sp-4); }
ul, ol { padding-left: 1.4em; }
li + li { margin-top: var(--sp-2); }

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: var(--sp-2); top: -100px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-sm); font-weight: 600;
}
.skip:focus { top: var(--sp-2); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--sp-4); }
.wrap-text { max-width: calc(var(--measure) + 2 * var(--sp-4)); margin: 0 auto; padding: 0 var(--sp-4); }
.prose { max-width: var(--measure); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-in { display: flex; align-items: center; gap: var(--sp-2); min-height: var(--header-h); }
.brand {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.15rem;
  min-height: var(--tap); margin-right: auto;
}
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand-name span { color: var(--accent); }

.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.nav-list li + li { margin-top: 0; }
.nav-list a, .sub-toggle {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--sp-3);
  color: var(--text); text-decoration: none; border-radius: var(--radius-sm); font-weight: 500;
}
.nav-list a:hover, .nav-list a[aria-current="page"], .nav-list .is-active > a { color: var(--accent); }
.nav-list a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.35em; }
.sub-toggle { background: none; border: 0; font: inherit; cursor: pointer; padding: 0 var(--sp-2); }
.sub-toggle svg { width: 16px; height: 16px; transition: transform 0.15s; }
.sub-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.has-sub { position: relative; display: flex; align-items: center; flex-wrap: wrap; }
.sub { list-style: none; margin: 0; padding: var(--sp-2); }
.sub a { width: 100%; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--tap); height: var(--tap); border-radius: var(--radius-sm);
  color: var(--text); background: none; border: 0; cursor: pointer;
}
.icon-btn:hover { color: var(--accent); }
.icon-btn svg { width: 22px; height: 22px; }
.nav-toggle { display: none; }

/* Mobile (JS): collapsible panel */
@media (max-width: 859px) {
  .js .nav-toggle { display: inline-flex; }
  .js .nav { display: none; }
  .js .nav.is-open {
    display: block; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    max-height: calc(100vh - var(--header-h)); overflow-y: auto; padding: var(--sp-2) var(--sp-4) var(--sp-4);
  }
  .js .nav-list { flex-direction: column; }
  .js .nav-list a { width: 100%; }
  .js .has-sub > a { flex: 1; }
  .js .sub { display: none; width: 100%; padding: 0 0 0 var(--sp-4); }
  .js .sub.is-open { display: block; }
  .no-js-hidden { display: none; }
  html:not(.js) .header-in { flex-wrap: wrap; }
  html:not(.js) .nav { order: 3; width: 100%; }
  html:not(.js) .sub-toggle, html:not(.js) .sub { display: none; }
}

/* Desktop: dropdown */
@media (min-width: 860px) {
  .nav { margin-right: var(--sp-2); }
  .sub {
    display: none; position: absolute; top: 100%; left: 0; min-width: 15rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow);
  }
  .sub li + li { margin-top: 0; }
  .has-sub:hover > .sub, .sub.is-open { display: block; }
}

/* ---------- Generic blocks ---------- */
.crumbs { font-size: var(--fs-sm); color: var(--muted); padding-top: var(--sp-4); }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; }
.crumbs li + li { margin-top: 0; }
.crumbs li + li::before { content: "›"; padding: 0 var(--sp-2); color: var(--muted); }
.crumbs a { color: var(--muted); display: inline-block; padding: var(--sp-1) 0; }
.crumbs [aria-current] { color: var(--text); }

.page-head h1 { margin-bottom: var(--sp-2); }
.byline { color: var(--muted); font-size: var(--fs-sm); margin-bottom: var(--sp-5); }
.byline a { color: var(--muted); }
.answer { font-size: 1.2rem; line-height: 1.55; }
.lead { max-width: var(--measure); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--tap); padding: 0 var(--sp-5); border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); border: 2px solid var(--accent);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-bottom: var(--sp-6); }

.panel { background: var(--panel); border-radius: var(--radius-lg); padding: var(--sp-5); }
.note {
  background: var(--panel); border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm); padding: var(--sp-3) var(--sp-4);
}

figure img, .banner img { border-radius: var(--radius-lg); background: var(--panel); }
figcaption { font-size: var(--fs-sm); color: var(--muted); margin-top: var(--sp-2); }

table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.table-wrap { overflow-x: auto; margin-bottom: var(--sp-4); }
caption { text-align: left; font-weight: 600; padding-bottom: var(--sp-2); }
th, td { text-align: left; padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--panel); }

/* ---------- Recipe ---------- */
.summary { margin-bottom: var(--sp-6); }
.summary h2 { margin-top: 0; font-size: var(--fs-h3); }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: var(--sp-3) var(--sp-4); margin: 0; }
.summary-grid div { min-width: 0; }
.summary-grid dt { font-size: var(--fs-sm); color: var(--muted); }
.summary-grid dd { margin: 0; font-weight: 600; }

.hero { margin-bottom: var(--sp-6); }
.recipe-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--sp-2) var(--sp-5) var(--sp-5); box-shadow: var(--shadow); }
.sec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.sec-head h2 { margin-bottom: var(--sp-2); }
.yield-note { color: var(--muted); font-size: var(--fs-sm); }

.scaler { display: inline-flex; align-items: center; gap: var(--sp-2); }
.scaler-label { font-size: var(--fs-sm); color: var(--muted); }
.sc-btn {
  width: var(--tap); height: var(--tap); border-radius: 50%; border: 2px solid var(--field);
  background: var(--surface); color: var(--text); font-size: 1.25rem; cursor: pointer; line-height: 1;
}
.sc-btn:hover { border-color: var(--accent); color: var(--accent); }
.sc-out { min-width: 2ch; text-align: center; font-weight: 700; }

.ing { list-style: none; padding: 0; }
.ing li + li { margin-top: 0; }
.ing label { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-2) 0; cursor: pointer; border-bottom: 1px dashed var(--line); }
.ing input {
  appearance: none; flex: none; width: 24px; height: 24px; margin: 0.15em 0 0;
  border: 2px solid var(--field); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer;
  display: grid; place-content: center;
}
.ing input::before { content: ""; width: 12px; height: 12px; transform: scale(0); transition: transform 0.1s; background: var(--accent-ink); clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); }
.ing input:checked { background: var(--accent); border-color: var(--accent); }
.ing input:checked::before { transform: scale(1); }
.ing input:checked + span { color: var(--muted); text-decoration: line-through; }
.q, .hh { font-weight: 600; }
.opt { color: var(--muted); font-size: var(--fs-sm); }

.recipe-card { counter-reset: step; }
.steps { padding-left: 0; list-style: none; }
.steps li { position: relative; padding-left: 3rem; counter-increment: step; margin: 0 0 var(--sp-5); }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 2rem; height: 2rem; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: grid; place-content: center; font-weight: 700; font-size: 1rem;
}
.step-name { display: block; }
.print-url { display: none; }

.tips li { margin-bottom: var(--sp-3); }
.hub-link { font-weight: 600; margin-top: var(--sp-8); }

.faq h3 { font-size: 1.15rem; margin-top: var(--sp-5); margin-bottom: var(--sp-2); }
.refs { font-size: var(--fs-sm); }

/* ---------- Cards & lists ---------- */
.cards { list-style: none; padding: 0; display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.cards li + li { margin-top: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); height: 100%; }
.card a { display: flex; flex-direction: column; height: 100%; color: var(--text); text-decoration: none; }
.card a:hover .card-title { color: var(--accent); text-decoration: underline; }
.card img { border-radius: 0; aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.card-body { display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-3) var(--sp-4) var(--sp-4); flex: 1; }
.card-title { font-size: 1.1rem; font-weight: 700; margin: 0; line-height: 1.3; }
.card-desc { font-size: 1rem; color: var(--muted); margin: 0; }
.card-meta { font-size: var(--fs-sm); color: var(--muted); margin-top: auto; padding-top: var(--sp-2); display: inline-flex; align-items: center; gap: var(--sp-1); }
.card-meta svg { width: 16px; height: 16px; }

.tiles { list-style: none; padding: 0; display: grid; gap: var(--sp-4); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tiles li + li { margin-top: 0; }
.tile a { display: block; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; height: 100%; }
.tile img { border-radius: 0; aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.tile span { display: block; padding: var(--sp-3) var(--sp-4); font-weight: 600; }
.tile small { display: block; color: var(--muted); font-weight: 400; font-size: var(--fs-sm); }
.tile a:hover span { color: var(--accent); }

.link-list { list-style: none; padding: 0; }
.link-list li { padding: var(--sp-2) 0; border-bottom: 1px solid var(--line); margin: 0; }
.link-list a { font-weight: 600; }
.link-list .meta { display: block; color: var(--muted); font-size: 1rem; }

.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chips li + li { margin-top: 0; }
.chips a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--sp-4); border: 1px solid var(--line); border-radius: 999px; background: var(--surface); text-decoration: none; font-weight: 600; }
.chips a:hover { border-color: var(--accent); }

/* ---------- Search ---------- */
.search-form { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: flex-end; margin: var(--sp-4) 0 var(--sp-6); max-width: 36rem; }
.search-form label { width: 100%; font-weight: 600; }
.search-form input {
  flex: 1; min-width: 12rem; min-height: var(--tap); padding: 0 var(--sp-4); font: inherit;
  border: 2px solid var(--field); border-radius: 999px; background: var(--surface); color: var(--text);
}
.search-form input:focus-visible { border-color: var(--accent); outline-offset: 1px; }
.results-count { color: var(--muted); }

/* ---------- Home ---------- */
.home-hero { padding-top: var(--sp-6); display: grid; gap: var(--sp-6); align-items: center; }
.home-hero-text { max-width: var(--measure); }
.banner { max-width: 760px; }
.home-hero .banner { margin: 0; }
@media (min-width: 960px) {
  .home-hero { grid-template-columns: 1.15fr 1fr; gap: var(--sp-10); }
}
.section { margin: var(--sp-10) 0; }
.section > h2:first-child { margin-top: 0; }

/* ---------- Footer ---------- */
.site-footer { margin-top: var(--sp-12); background: var(--panel); border-top: 1px solid var(--line); padding: var(--sp-8) 0 var(--sp-6); font-size: 1rem; }
.footer-grid { display: grid; gap: var(--sp-6); grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.footer-title { font-weight: 700; margin: 0 0 var(--sp-2); font-size: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li + li { margin-top: 0; }
.site-footer li a { display: inline-block; padding: var(--sp-1) 0; min-height: 2rem; }
.site-footer a { color: var(--text); }
.site-footer a:hover { color: var(--accent); }
.copy { color: var(--muted); font-size: var(--fs-sm); margin-top: var(--sp-6); border-top: 1px solid var(--line); padding-top: var(--sp-4); }

@media (min-width: 760px) {
  .recipe-card { padding: var(--sp-4) var(--sp-8) var(--sp-6); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Print: title, ringkasan, bahan, langkah, URL ---------- */
@media print {
  :root { --bg: #fff; --surface: #fff; --panel: #fff; --text: #000; --muted: #333; --accent: #000; --line: #999; }
  body { font-size: 11pt; }
  .site-header, .site-footer, .skip, .crumbs, .byline, .answer, .actions, .hero, .scaler,
  .recipe > section:not(.summary):not(.recipe-card), .hub-link, .related, .faq, .refs { display: none !important; }
  .recipe-card { border: 0; box-shadow: none; padding: 0; }
  .ing label { border: 0; padding: 2pt 0; }
  .ing input { width: 12px; height: 12px; }
  .steps li::before { background: none; color: #000; border: 1px solid #000; }
  .print-url { display: block; margin-top: 12pt; font-size: 9pt; }
  h1 { font-size: 18pt; margin-top: 0; }
  h2 { font-size: 13pt; margin-top: 10pt; }
  a { color: #000; text-decoration: none; }
}
