/* ============================================================
   Karla Lee's Kitchen — design tokens
   Palette pulled from the raspberry-white-chocolate cheesecake
   cookie swirl: deep berry + honey gold on warm butter-cream.
   Display: Fraunces (soft, generous, handmade feel)
   Body: Karla (yes, really — matches the name)
   ============================================================ */
:root {
  --bg: #FAF4E4;
  --bg-alt: #F1E4C6;
  --ink: #382A21;
  --ink-soft: #6B5B4C;
  --berry: #A62A3F;
  --berry-dark: #7A1C2E;
  --gold: #D9A441;
  --gold-soft: #EAD09A;
  --sage: #7C8A5E;
  --white: #FFFDF8;
  --line: rgba(56, 42, 33, 0.12);

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Karla", -apple-system, BlinkMacSystemFont, sans-serif;

  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 12px 32px rgba(56, 42, 33, 0.10);
  --shadow-sm: 0 4px 14px rgba(56, 42, 33, 0.08);

  --container: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 0.5em;
  color: var(--ink);
}
h1 { font-size: clamp(2.4rem, 5.5vw, 4.4rem); font-weight: 500; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; color: var(--ink-soft); }
a { color: var(--berry); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); }
.eyebrow {
  font-family: var(--font-body); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  font-size: 0.78rem; color: var(--berry); margin-bottom: 10px; display: block;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 700; font-size: 0.98rem;
  padding: 13px 26px; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--berry); color: var(--white); }
.btn-primary:hover { background: var(--berry-dark); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--white); }
.btn-ghost { background: transparent; color: var(--berry); border: none; padding: 8px 4px; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-danger { background: transparent; color: #A33; border: 2px solid #C55; }
.btn-danger:hover { background: #C55; color: #fff; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

/* ---------- Nav ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 40; background: rgba(250, 244, 228, 0.92);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.site-nav .inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; max-width: var(--container); margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-size: 1.25rem; color: var(--ink); }
.brand img { width: 40px; height: 40px; border-radius: 50%; }
.nav-links { display: flex; gap: 30px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ink); font-weight: 600; font-size: 0.95rem; }
.nav-links a[aria-current="page"] { color: var(--berry); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; }

@media (max-width: 780px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0; background: var(--bg);
    flex-direction: column; gap: 0; border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height 0.25s ease;
  }
  .nav-links.open { max-height: 320px; }
  .nav-links li { border-top: 1px solid var(--line); }
  .nav-links a { display: block; padding: 16px 24px; }
}

/* ---------- Hero / swirl motif ---------- */
.hero { position: relative; padding: 96px 0 64px; overflow: hidden; }
.hero .swirl-bg {
  position: absolute; right: -120px; top: -80px; width: 620px; height: 620px;
  opacity: 0.5; pointer-events: none;
}
.hero-content { position: relative; max-width: 720px; }
.hero-emoji-row { font-size: 1.4rem; margin-bottom: 18px; letter-spacing: 4px; }
.hero .lede { font-size: 1.2rem; max-width: 540px; }
.hero-actions { display: flex; gap: 16px; margin-top: 30px; flex-wrap: wrap; }

.swirl-divider { display: block; width: 64px; height: 64px; margin: 0 auto; opacity: 0.85; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 28px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 880px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card a.card-link { color: inherit; text-decoration: none; display: flex; flex-direction: column; height: 100%; }
.card-media { aspect-ratio: 4/3; background: var(--bg-alt); overflow: hidden; position: relative; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-media .placeholder-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.card-body { padding: 20px 22px 24px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { margin-bottom: 8px; }
.card-body p { font-size: 0.95rem; margin-bottom: 14px; }
.card-meta { margin-top: auto; font-size: 0.8rem; color: var(--ink-soft); font-weight: 600; }
.tag {
  display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; background: var(--gold-soft); color: var(--berry-dark);
  padding: 4px 10px; border-radius: 999px; margin-bottom: 10px;
}

.empty-state {
  text-align: center; padding: 60px 20px; color: var(--ink-soft);
}
.empty-state .swirl-divider { margin-bottom: 18px; }

/* ---------- Recipe / post detail ---------- */
.detail-hero { padding: 48px 0 12px; }
.detail-image { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.detail-meta { display: flex; gap: 18px; flex-wrap: wrap; margin: 18px 0; font-weight: 600; color: var(--ink-soft); font-size: 0.9rem; }
.detail-columns { display: grid; grid-template-columns: 280px 1fr; gap: 48px; align-items: start; }
@media (max-width: 780px) { .detail-columns { grid-template-columns: 1fr; } }
.ingredients-card {
  background: var(--white); border-radius: var(--radius); padding: 26px 26px; box-shadow: var(--shadow-sm);
  position: sticky; top: 90px;
}
.ingredients-card h3 { color: var(--berry); }
.ingredients-card ul { padding-left: 20px; margin: 0; }
.ingredients-card li { margin-bottom: 8px; }
.method-list { padding-left: 22px; }
.method-list li { margin-bottom: 20px; }
.method-pending {
  border: 2px dashed var(--gold); background: var(--bg-alt); border-radius: var(--radius-sm);
  padding: 18px 20px; color: var(--ink-soft); font-weight: 600;
}

/* ---------- Forms (admin) ---------- */
.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.9rem; }
.form-field input, .form-field textarea, .form-field select {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--line);
  font-family: var(--font-body); font-size: 1rem; background: var(--white); color: var(--ink);
}
.form-field textarea { min-height: 120px; resize: vertical; }
.form-field .hint { font-size: 0.82rem; color: var(--ink-soft); margin-top: 4px; }
.form-error {
  background: #FBE5E5; color: #8A2A2A; padding: 12px 16px; border-radius: var(--radius-sm);
  font-weight: 600; margin-bottom: 18px; font-size: 0.92rem;
}
.form-success {
  background: #E8EFDD; color: #445A2A; padding: 12px 16px; border-radius: var(--radius-sm);
  font-weight: 600; margin-bottom: 18px; font-size: 0.92rem;
}

.auth-shell { max-width: 420px; margin: 0 auto; padding: 100px 24px 60px; }
.auth-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 36px 32px; }

/* ---------- Admin dashboard ---------- */
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; gap: 12px; }
.tabs { display: flex; gap: 8px; margin: 28px 0 20px; border-bottom: 1px solid var(--line); }
.tab-btn {
  background: none; border: none; padding: 12px 4px; margin-right: 24px; font-family: var(--font-body);
  font-weight: 700; font-size: 1rem; color: var(--ink-soft); cursor: pointer; border-bottom: 3px solid transparent;
}
.tab-btn.active { color: var(--berry); border-color: var(--berry); }
.admin-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.admin-table th, .admin-table td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.admin-table th { background: var(--bg-alt); font-weight: 700; }
.status-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }
.status-pill.published { background: #E8EFDD; color: #445A2A; }
.status-pill.draft { background: #F1E4C6; color: #8A6A2A; }
.row-actions { display: flex; gap: 10px; }
.dynamic-list { margin-top: 10px; }
.dynamic-list .row { display: flex; gap: 10px; margin-bottom: 10px; }
.dynamic-list input { flex: 1; }

/* ---------- Footer ---------- */
footer.site-footer { border-top: 1px solid var(--line); padding: 48px 0 32px; margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.footer-brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-size: 1.1rem; }
.footer-brand img { width: 34px; height: 34px; border-radius: 50%; }
.footer-links { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.footer-links a { color: var(--ink-soft); font-size: 0.9rem; font-weight: 600; }
.footer-credit { margin-top: 22px; font-size: 0.82rem; color: var(--ink-soft); text-align: center; }
.footer-credit a { color: var(--ink-soft); text-decoration: underline; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--berry); color: #fff;
  padding: 10px 18px; border-radius: 0 0 8px 0; z-index: 100;
}
.skip-link:focus { left: 0; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
