/* Koleksi Resepi Dessert & Bakery Homemade — web edition */

:root {
  --ink: #3A1A1F;
  --ink-soft: #6B4A4F;
  --rose: #B04A5E;
  --rose-deep: #8E3246;
  --blush: #FBF4F1;
  --blush-deep: #F4E4DF;
  --paper: #FFFCFA;
  --pandan: #6F8F55;
  --pandan-tint: #EEF3E7;
  --caramel: #C98B43;
  --line: #E9D5CF;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Figtree", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --topbar: 60px;
  --sidebar: 300px;
  --measure: 40rem;
  --radius-s: 6px;
  --radius-m: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--blush);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--rose-deep); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--caramel); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* language panes */
[data-lang-pane] { display: none; }
html[data-lang="ms"] [data-lang-pane="ms"],
html[data-lang="en"] [data-lang-pane="en"] { display: block; }
html[data-lang="ms"] span[data-lang-pane="ms"],
html[data-lang="en"] span[data-lang-pane="en"] { display: inline; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: var(--radius-s); }
.skip:focus { top: 10px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  background: rgba(251, 244, 241, .92);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__menu {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 .95rem var(--sans); color: var(--ink);
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px 7px 11px; cursor: pointer;
}
.topbar__menu:hover { background: var(--paper); }
.topbar__brand {
  font-family: var(--serif); font-weight: 600; font-size: 1.15rem;
  color: var(--ink); text-decoration: none; margin-right: auto;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
  font-variation-settings: "opsz" 40;
}
@media (max-width: 340px) { .topbar__brand { visibility: hidden; } }
.lang-switch {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--blush-deep); border-radius: 999px;
}
.lang-switch button {
  font: 700 .85rem/1 var(--sans); letter-spacing: .02em;
  color: var(--ink-soft); background: transparent;
  border: 0; border-radius: 999px; padding: 9px 14px; cursor: pointer;
  transition: background-color .2s, color .2s;
}
.lang-switch button[aria-pressed="true"] { background: var(--rose-deep); color: #fff; }
.lang-switch button:not([aria-pressed="true"]):hover { color: var(--ink); }

/* ---------- layout ---------- */
.layout { display: block; }
main { outline: none; padding: 0 20px 64px; }
.pane { max-width: var(--measure); margin: 0 auto; }

/* drawer (mobile) */
.drawer {
  position: fixed; z-index: 40; top: 0; bottom: 0; left: 0;
  width: min(86vw, 340px);
  background: var(--paper);
  border-right: 1px solid var(--line);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 0 0 40px;
  transform: translateX(-102%);
  transition: transform .28s ease;
  visibility: hidden;
}
body.drawer-open .drawer { transform: none; visibility: visible; }
.scrim { position: fixed; inset: 0; z-index: 35; background: rgba(58, 26, 31, .35); }
.drawer__head {
  position: sticky; top: 0; background: var(--paper);
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 10px 22px; border-bottom: 1px solid var(--line);
}
.drawer__title { margin: 0; font: 600 1.2rem var(--serif); }
.drawer__close { border: 0; background: transparent; color: var(--ink); padding: 8px; border-radius: 999px; cursor: pointer; }
.drawer__close:hover { background: var(--blush); }

.toc, .toc ul { list-style: none; margin: 0; padding: 0; }
.toc { padding: 10px 10px 0; }
.toc a {
  display: block; text-decoration: none; color: var(--ink-soft);
  font-size: .93rem; line-height: 1.35; padding: 7px 12px; border-radius: var(--radius-s);
}
.toc a:hover { background: var(--blush); color: var(--ink); }
.toc__chapter { margin-top: 6px; }
.toc__chapter > a { font-weight: 700; color: var(--ink); font-size: .98rem; }
.toc__chapter ul a { padding-left: 24px; }
.toc a.is-current { background: var(--blush-deep); color: var(--rose-deep); font-weight: 600; }

@media (min-width: 1080px) {
  .topbar__menu { display: none; }
  .layout { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
  .drawer {
    position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar));
    width: auto; transform: none; visibility: visible; transition: none;
    background: transparent;
  }
  .drawer__head { background: var(--blush); }
  .drawer__close { display: none; }
  .scrim { display: none !important; }
  main { padding: 0 40px 80px; }
}

/* ---------- hero ---------- */
.hero {
  display: grid; gap: 28px; align-items: center;
  padding: 36px 0 56px;
  border-bottom: 1px solid var(--line);
}
.hero__cover img {
  width: min(72vw, 340px); margin: 0 auto;
  border-radius: 4px 10px 10px 4px;
  box-shadow: -6px 0 0 -2px rgba(58, 26, 31, .12), 0 24px 48px -18px rgba(58, 26, 31, .45);
}
.hero__brand { margin: 0 0 6px; color: var(--rose-deep); font-weight: 600; }
.hero h1 {
  margin: 0; font-family: var(--serif); font-weight: 650;
  font-size: clamp(2.3rem, 7.5vw, 3.4rem); line-height: 1.02; letter-spacing: -.015em;
  font-variation-settings: "opsz" 144;
}
.hero__small { display: block; font-size: .42em; font-weight: 500; font-style: italic; letter-spacing: 0; margin-bottom: .35em; color: var(--rose-deep); }
.hero__lede { margin: 18px 0 26px; color: var(--ink-soft); max-width: 34rem; }
.button {
  display: inline-block; text-decoration: none;
  font-weight: 700; color: #fff; background: var(--rose-deep);
  padding: 13px 24px; border-radius: 999px;
}
.button:hover { background: var(--ink); }
@media (min-width: 900px) {
  .pane { max-width: 58rem; }
  .hero { grid-template-columns: 340px minmax(0, 1fr); gap: 48px; padding: 56px 0 72px; }
  .hero__cover img { margin: 0; }
  .chapter { max-width: var(--measure); margin-left: auto; margin-right: auto; }
}

/* ---------- chapters ---------- */
.chapter { padding-top: 56px; }
.chapter__head { padding-bottom: 12px; }
.chapter__num { margin: 0; font: italic 500 1.05rem var(--serif); color: var(--caramel); }
.chapter__title {
  margin: 2px 0 14px; font-family: var(--serif); font-weight: 650;
  font-size: clamp(2rem, 6vw, 2.8rem); line-height: 1.05; letter-spacing: -.01em;
  font-variation-settings: "opsz" 144;
}
.chapter__intro > p:first-child { font-family: var(--serif); font-size: 1.15rem; line-height: 1.6; color: var(--ink-soft); }
.chapter--guide .chapter__intro > p:first-child, .chapter--intro .chapter__intro > p:first-child { font-family: var(--serif); }

/* illustrated recipe index */
.chapter__index { margin: 28px 0 8px; }
.chapter__index-label { margin: 0 0 10px; font-weight: 600; font-size: .95rem; color: var(--ink-soft); }
.chapter__index ul {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px;
}
.chapter__index a {
  display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%;
  text-decoration: none; color: var(--ink); text-align: center;
  font-size: .86rem; line-height: 1.3; font-weight: 500;
  padding: 10px 8px 12px; border-radius: var(--radius-m);
  background: var(--paper); border: 1px solid var(--line);
}
.chapter__index a:hover { border-color: var(--rose); }
.chapter__index .index__thumb { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--blush-deep); margin-bottom: 4px; }
.index__blank { display: block; width: 100%; aspect-ratio: 1; border-radius: 10px; background: var(--blush-deep); margin-bottom: 4px; }

/* ---------- recipe / section ---------- */
.recipe, .section { padding-top: 44px; margin-top: 44px; border-top: 1px dashed var(--line); }
.chapter__head + .recipe, .chapter__head + .section { border-top: 0; margin-top: 8px; }
.recipe__head { display: flex; align-items: flex-start; gap: 14px; }
.recipe__title {
  flex: 1; margin: 0; font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.55rem, 4.8vw, 2rem); line-height: 1.15;
  font-variation-settings: "opsz" 72;
}
.recipe__head + p, .recipe__photo + p, .photo-trio + p { margin-top: 6px; font-family: var(--serif); font-style: italic; color: var(--ink-soft); font-size: 1.08rem; }

h4 {
  margin: 30px 0 10px; font-family: var(--serif); font-weight: 600; font-style: italic;
  font-size: 1.22rem; color: var(--rose-deep);
  font-variation-settings: "opsz" 36;
}
p { margin: 0 0 14px; }
ul, ol { margin: 0 0 16px; padding-left: 1.3em; }
li { margin-bottom: 6px; }
li::marker { color: var(--rose); }
ol > li::marker { font-weight: 700; }
strong { font-weight: 700; color: var(--ink); }
hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

/* recipe tag: pan / temp / time / level */
.meta {
  margin: 18px 0 8px; padding: 14px 16px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m);
  position: relative;
}
.meta::before {
  content: ""; position: absolute; left: -1px; top: 16px; bottom: 16px; width: 4px;
  background: var(--rose); border-radius: 0 4px 4px 0;
}
.meta div { min-width: 0; }
.meta dt { font-size: .8rem; color: var(--ink-soft); font-weight: 500; }
.meta dd { margin: 0; font-weight: 700; font-size: .98rem; line-height: 1.35; }
@media (min-width: 720px) { .meta { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* recipe photos */
.recipe__photo, .photo-trio figure { margin: 16px 0 12px; border-radius: var(--radius-m); overflow: hidden; background: var(--blush-deep); aspect-ratio: 4 / 3; }
.recipe__photo img, .photo-trio img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-trio { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0 12px; }
.photo-trio figure { margin: 0; position: relative; }
.photo-trio figure:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.photo-trio figcaption { position: absolute; left: 10px; bottom: 10px; background: rgba(255, 252, 250, .92); color: var(--rose-deep); font-weight: 700; font-size: .8rem; padding: 4px 10px; border-radius: 999px; }
@media print { .recipe__photo, .photo-trio { break-inside: avoid; } }

/* tickable ingredients */
.ingredients { list-style: none; padding: 0; }
.ingredients li { margin: 0; }
.ingredients label {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  padding: 8px 10px; margin: 0 -10px; border-radius: var(--radius-s);
}
.ingredients label:hover { background: var(--paper); }
.ingredients input {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 20px; height: 20px; margin: 3px 0 0; border-radius: 50%;
  border: 2px solid var(--rose); background: var(--paper); cursor: pointer;
  display: grid; place-content: center;
}
.ingredients input::after {
  content: ""; width: 10px; height: 6px; margin-top: -2px;
  border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg) scale(0);
  transition: transform .15s ease;
}
.ingredients input:checked { background: var(--pandan); border-color: var(--pandan); }
.ingredients input:checked::after { transform: rotate(-45deg) scale(1); }
.ingredients input:checked + span { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: rgba(107, 74, 79, .5); }

/* notes */
.note {
  margin: 20px 0; padding: 14px 16px 14px 18px;
  background: var(--pandan-tint); border-left: 4px solid var(--pandan);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
}
.note p { margin: 0; }
.note p + p { margin-top: 8px; }
.note--fix { background: #F9E7E9; border-left-color: var(--rose); }

/* tables */
.table-wrap { overflow-x: auto; margin: 16px 0 20px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--paper); -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; min-width: 30rem; font-size: .93rem; }
th, td { text-align: left; padding: 10px 14px; vertical-align: top; border-bottom: 1px solid var(--line); }
th { font-weight: 700; background: var(--blush-deep); color: var(--ink); }
tr:last-child td { border-bottom: 0; }
.chapter--guide table { min-width: 26rem; }

/* footer, to-top */
.footer { max-width: var(--measure); margin: 72px auto 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: .9rem; }
.to-top {
  position: fixed; right: 16px; bottom: 16px; z-index: 20;
  font-weight: 700; font-size: .9rem; text-decoration: none;
  color: var(--ink); background: var(--paper); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 999px; font-size: .85rem;
  box-shadow: 0 8px 20px -12px rgba(58, 26, 31, .5);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .drawer, .lang-switch button, .ingredients input::after { transition: none; }
}

@media print {
  .topbar, .drawer, .scrim, .to-top, .chapter__index { display: none !important; }
  body { background: #fff; }
  .layout { display: block; }
  .recipe { break-inside: avoid-page; }
}
