/* Home Kitchen design system (Claude Design): tokens, then components (hk-), then site pages. */

:root {
  /* Color */
  --surface-100: #faf5ec;  /* page background */
  --surface-200: #f2e8d7;  /* recipe cards, recipe box */
  --hairline: #e2d5c1;     /* 1px dividers and card borders */
  --ink: #2b211a;          /* headings and body text */
  --ink-muted: #6b5a4c;    /* metadata, captions */
  --brand: #a4462a;        /* terracotta: links, buttons, active tags */
  --brand-strong: #843620; /* hover / pressed */
  --sage: #5f7050;         /* dietary tags, step numbers */
  --butter: #e8c26a;       /* badge fill only, ink text */
  --danger: #a3302a;

  /* Type */
  --font-serif: Fraunces, Georgia, serif;
  --font-sans: "Source Sans 3", system-ui, sans-serif;

  /* Spacing and radius */
  --space-2: 8px;
  --space-4: 16px;
  --space-6: 24px;
  --space-10: 40px;
  --radius-sm: 4px;
  --radius-md: 12px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--surface-100); color: var(--ink); font-family: var(--font-sans); font-size: 17px; line-height: 28px; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-strong); }
h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; }
h1 { font-size: 32px; line-height: 38px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- Button ---------- */
.hk-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0 20px;
  font-family: var(--font-sans); font-size: 16px; font-weight: 600; line-height: 1;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  text-decoration: none; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s;
}
.hk-btn--primary { background: var(--brand); color: var(--surface-100); }
.hk-btn--primary:hover { background: var(--brand-strong); color: var(--surface-100); }
.hk-btn--secondary { background: var(--surface-100); color: var(--brand); border-color: var(--brand); }
.hk-btn--secondary:hover { background: var(--surface-200); color: var(--brand-strong); border-color: var(--brand-strong); }
.hk-btn--danger { background: var(--surface-100); color: var(--danger); border-color: var(--danger); }
.hk-btn--danger:hover { background: var(--danger); color: var(--surface-100); }
.hk-btn--sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.hk-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.75; }

/* ---------- Tag & Badge ---------- */
.hk-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.hk-tag {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px;
  font-family: var(--font-sans); font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  border-radius: var(--radius-pill); border: 1px solid var(--hairline); color: var(--ink-muted); background: var(--surface-100);
  text-decoration: none;
}
a.hk-tag:hover { border-color: var(--brand); color: var(--brand); }
.hk-tag--diet { border-color: var(--sage); color: var(--sage); }
.hk-tag--active { background: var(--brand); border-color: var(--brand); color: var(--surface-100); }

/* ---------- Photo ---------- */
.hk-photo { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-md); background: var(--hairline); }
.hk-photo--wide { aspect-ratio: 16 / 9; }

/* ---------- Recipe card (grid tile) ---------- */
.hk-grid { display: grid; gap: var(--space-6); grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.hk-card { display: flex; flex-direction: column; background: var(--surface-200); border-radius: var(--radius-md); overflow: hidden; text-decoration: none; color: var(--ink); }
.hk-card .hk-photo { border-radius: 0; }
.hk-card__body { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); }
.hk-card__title { margin: 0; font-family: var(--font-serif); font-weight: 600; font-size: 22px; line-height: 28px; }
.hk-card:hover { color: var(--ink); }
.hk-card:hover .hk-card__title { color: var(--brand); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.hk-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.hk-card__meta { margin: 0; font-size: 14px; line-height: 20px; color: var(--ink-muted); }

/* ---------- Recipe meta ---------- */
.hk-meta { display: flex; flex-wrap: wrap; row-gap: var(--space-2); margin: 0; padding: 0; }
.hk-meta > div { padding: 0 var(--space-6); border-left: 1px solid var(--hairline); }
.hk-meta > div:first-child { padding-left: 0; border-left: 0; }
.hk-meta dt { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.hk-meta dd { margin: 4px 0 0; font-family: var(--font-serif); font-weight: 600; font-size: 20px; line-height: 26px; color: var(--ink); }

/* ---------- Ingredient list ---------- */
.hk-ingredients { margin: 0; padding: 0; list-style: none; }
.hk-ingredients li { border-bottom: 1px solid var(--hairline); }
.hk-ingredients li:last-child { border-bottom: 0; }
.hk-ingredients label { display: flex; gap: 12px; align-items: flex-start; padding: var(--space-2) 0; font-size: 16px; line-height: 24px; cursor: pointer; }
.hk-ingredients input { flex: none; width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--brand); cursor: pointer; }
.hk-ingredients input:checked + span { color: var(--ink-muted); text-decoration: line-through; }

/* ---------- Method steps ---------- */
.hk-steps { margin: 0; padding: 0; list-style: none; counter-reset: hk-step; }
.hk-steps li { position: relative; padding: 0 0 var(--space-6) 48px; counter-increment: hk-step; }
.hk-steps li:last-child { padding-bottom: 0; }
.hk-steps li::before {
  content: counter(hk-step); position: absolute; left: 0; top: 0;
  width: 32px; height: 32px; border-radius: var(--radius-pill); background: var(--sage); color: var(--surface-100);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-weight: 600; font-size: 16px; line-height: 1;
}
.hk-steps p { margin: 2px 0 0; font-size: 17px; line-height: 28px; }

/* ---------- Recipe box ---------- */
.hk-recipe { container-type: inline-size; background: var(--surface-200); border: 1px solid var(--hairline); border-radius: var(--radius-md); padding: var(--space-6); }
.hk-recipe__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: var(--space-4); padding-bottom: var(--space-6); margin-bottom: var(--space-6); border-bottom: 1px solid var(--hairline); }
.hk-recipe__title { margin: 0 0 var(--space-2); font-family: var(--font-serif); font-weight: 600; font-size: 32px; line-height: 38px; }
.hk-recipe__actions { display: flex; gap: var(--space-2); }
.hk-recipe__body { display: grid; gap: var(--space-10); grid-template-columns: 1fr; }
.hk-recipe h3 { margin: 0 0 var(--space-2); font-family: var(--font-serif); font-weight: 600; font-size: 22px; line-height: 28px; }
@container (max-width: 479px) {
  .hk-meta { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2) var(--space-4); }
  .hk-meta > div, .hk-meta > div:first-child { padding: 0; border-left: 0; }
}
@container (min-width: 680px) {
  .hk-recipe { padding: var(--space-10); }
  .hk-recipe__body { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
}

/* ---------- Site header ---------- */
.hk-header { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6); padding: var(--space-4) var(--space-6); background: var(--surface-100); border-bottom: 1px solid var(--hairline); }
.hk-header__brand { margin-right: auto; display: flex; flex-direction: column; }
.hk-header__name { font-family: var(--font-serif); font-weight: 600; font-size: 26px; line-height: 32px; color: var(--ink); text-decoration: none; }
.hk-header__name:hover { color: var(--brand); }
.hk-header__tagline { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.hk-nav { display: flex; flex-wrap: wrap; gap: var(--space-6); margin: 0; padding: 0; list-style: none; }
.hk-nav a { display: inline-block; padding: 6px 0; font-size: 16px; line-height: 24px; color: var(--ink); text-decoration: none; border-bottom: 2px solid transparent; }
.hk-nav a:hover { color: var(--brand); }
.hk-nav a[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); }
.hk-search { display: flex; align-items: center; gap: var(--space-2); height: 40px; padding: 0 12px; min-width: 200px; background: var(--surface-100); border: 1px solid var(--hairline); border-radius: var(--radius-sm); color: var(--ink-muted); }
.hk-search:focus-within { border-color: var(--brand); outline: 2px solid var(--brand); outline-offset: 1px; }
.hk-search svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; }
.hk-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 15px; color: var(--ink); }
.hk-search input::placeholder { color: var(--ink-muted); }
@media (max-width: 560px) { .hk-search { flex: 1 1 100%; } }

/* ---------- Pages ---------- */
main { max-width: 1040px; margin: 0 auto; padding: var(--space-6) var(--space-4) var(--space-10); }
.page-title { margin: 0 0 var(--space-6); }
.empty { color: var(--ink-muted); }
.site-footer { border-top: 1px solid var(--hairline); text-align: center; color: var(--ink-muted); padding: var(--space-6) var(--space-4); font-size: 14px; line-height: 20px; }

/* Recipe page: title, meta, tags, photo, story, then the recipe box */
.recipe { max-width: 820px; margin: 0 auto; display: grid; gap: var(--space-6); }
.recipe > * { margin: 0; }
.recipe__title { font-size: 48px; line-height: 52px; }
.recipe__meta { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.recipe__intro { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); }
.recipe__story { font-size: 17px; line-height: 28px; }
@media (max-width: 560px) {
  .recipe__title { font-size: 36px; line-height: 42px; }
  .hk-recipe__title { font-size: 26px; line-height: 32px; }
}

.ad-slot { margin: var(--space-6) 0; min-height: 90px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--hairline); border-radius: var(--radius-md); color: var(--ink-muted); font-size: 12px; line-height: 16px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.recipe .ad-slot { margin: 0; }
.ad-slot.ad-live { border: 0; display: block; }

@media print {
  .hk-header, .site-footer, .ad-slot, .recipe__intro .hk-btn, .hk-photo { display: none; }
  .hk-recipe { border: 0; background: none; padding: 0; }
  .hk-recipe__actions { display: none; }
  main { padding: 0; }
}

/* ---------- Admin ---------- */
.whoami { color: var(--ink-muted); font-size: 14px; line-height: 20px; margin: 0; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--surface-200); border-radius: var(--radius-md); overflow: hidden; }
.admin-table th, .admin-table td { text-align: left; padding: 12px var(--space-4); border-bottom: 1px solid var(--hairline); }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table th { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.recipe-form { display: grid; gap: var(--space-4); max-width: 720px; }
.recipe-form label { display: grid; gap: 4px; font-weight: 600; font-size: 16px; line-height: 24px; }
.recipe-form small { font-weight: normal; color: var(--ink-muted); }
.recipe-form input, .recipe-form textarea { font: inherit; font-weight: 400; padding: 8px 12px; border: 1px solid var(--hairline); border-radius: var(--radius-sm); background: #fff; color: var(--ink); width: 100%; }
.recipe-form input:focus, .recipe-form textarea:focus { border-color: var(--brand); outline: 2px solid var(--brand); outline-offset: 1px; }
.recipe-form .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-4); }
.recipe-form .check { display: flex; align-items: center; gap: var(--space-2); }
.recipe-form .check input { width: 18px; height: 18px; accent-color: var(--brand); }
.thumb { max-width: 200px; border-radius: var(--radius-md); }
.actions { display: flex; gap: 12px; }
.error { background: #fbe3e0; color: #7a2018; padding: 10px var(--space-4); border-radius: var(--radius-sm); }
.saved { background: #e6ebdf; color: #3f4c34; padding: 10px var(--space-4); border-radius: var(--radius-sm); }
