@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=DM+Serif+Display&display=swap");

:root { --ink: #233128; --muted: #647168; --cream: #f8f4eb; --paper: #fffdf8; --sage: #dce5d5; --green: #315b43; --orange: #d96b3b; --line: #deded4; --shadow: 0 18px 55px rgba(43, 54, 45, .10); }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "DM Sans", sans-serif; line-height: 1.6; }
a { color: inherit; }
.site-header { width: min(1180px, calc(100% - 40px)); margin: 0 auto; min-height: 96px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; line-height: 1; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50% 50% 48% 52%; color: white; background: var(--orange); font: 28px/1 "DM Serif Display", serif; transform: rotate(-4deg); }
.brand strong { display: block; font: 24px/0.9 "DM Serif Display", serif; }
.brand small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.header-link { color: var(--green); font-size: 14px; font-weight: 700; text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 20px; }
.link-button { padding: 0; border: 0; color: var(--muted); background: transparent; font: 700 14px "DM Sans", sans-serif; cursor: pointer; }
.flash { width: min(1180px, calc(100% - 40px)); margin: 0 auto 18px; padding: 12px 16px; border-radius: 10px; font-weight: 600; }
.flash.notice { color: #244b35; background: #dcebdc; }
.flash.alert { color: #7b3029; background: #f7ded8; }
.hero { position: relative; overflow: hidden; background: var(--cream); border-block: 1px solid #eee8dc; }
.hero::after { content: ""; position: absolute; width: 370px; height: 370px; right: -80px; top: -145px; border: 75px solid rgba(217, 107, 59, .09); border-radius: 50%; }
.hero-inner, .page-width { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.hero-inner { position: relative; z-index: 1; padding: 80px 0 88px; }
.eyebrow { margin: 0 0 14px; color: var(--orange); font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
h1, h2, h3 { font-family: "DM Serif Display", serif; font-weight: 400; line-height: 1.08; }
.hero h1 { max-width: 680px; margin: 0; font-size: clamp(48px, 7vw, 82px); letter-spacing: -.03em; }
.hero-copy { max-width: 600px; margin: 24px 0 0; color: var(--muted); font-size: 18px; }
.recipe-library { padding-block: 64px 90px; }
.library-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 28px; }
.library-heading h2 { margin: 0; font-size: 42px; }
.recipe-count { color: var(--muted); font-size: 14px; }
.search-form { display: flex; gap: 10px; margin-bottom: 38px; }
.search-form input { width: min(100%, 440px); padding: 14px 18px; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--ink); font: inherit; }
.search-form input:focus { outline: 3px solid var(--sage); border-color: var(--green); }
.button { padding: 13px 22px; border: 0; border-radius: 999px; color: white; background: var(--green); font: 700 14px "DM Sans", sans-serif; cursor: pointer; }
.recipe-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.recipe-card { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 1px 0 rgba(0, 0, 0, .02); transition: transform .2s ease, box-shadow .2s ease; }
.recipe-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-photo { display: block; width: 100%; height: 215px; object-fit: cover; background: var(--cream); }
.card-photo-placeholder { display: grid; place-items: center; color: rgba(255, 255, 255, .88); background: linear-gradient(135deg, var(--recipe-colour), var(--sage)); }
.card-photo-placeholder span { font: 76px/1 "DM Serif Display", serif; }
.card-colour { height: 12px; background: var(--recipe-colour, var(--orange)); }
.card-body { padding: 26px; }
.category { color: var(--recipe-colour, var(--orange)); font-size: 11px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.recipe-card h3 { margin: 10px 0 12px; font-size: 29px; }
.recipe-card h3 a { text-decoration: none; }
.summary { color: var(--muted); }
.meta-row { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 600; }
.empty-state { padding: 50px; text-align: center; background: var(--cream); border-radius: 18px; }
.recipe-hero { padding: 66px 0 52px; background: var(--cream); border-block: 1px solid #eee8dc; }
.back-link { color: var(--green); font-size: 14px; font-weight: 700; text-decoration: none; }
.edit-link { margin-left: 20px; color: var(--orange); font-size: 14px; font-weight: 700; text-decoration: none; }
.recipe-actions { display: flex; align-items: center; gap: 20px; }
.recipe-actions .edit-link { margin-left: 0; }
.print-button { margin-left: auto; padding: 9px 16px; border: 1px solid var(--green); border-radius: 999px; color: var(--green); background: transparent; font: 700 13px "DM Sans", sans-serif; cursor: pointer; }
.print-button:hover { color: white; background: var(--green); }
.recipe-hero .eyebrow { margin-top: 32px; }
.recipe-hero h1 { max-width: 850px; margin: 14px 0 18px; font-size: clamp(44px, 7vw, 76px); }
.recipe-intro { max-width: 720px; color: var(--muted); font-size: 18px; }
.recipe-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; width: min(1180px, calc(100% - 40px)); margin: 48px auto 0; }
.recipe-photo-wrap { max-height: 680px; margin: 0; overflow: hidden; border-radius: 20px; background: var(--cream); box-shadow: var(--shadow); }
.recipe-photo-wrap:first-child { grid-column: 1 / -1; }
.recipe-photo { display: block; width: 100%; max-height: 680px; object-fit: cover; }
.recipe-meta { display: flex; flex-wrap: wrap; gap: 32px; margin-top: 32px; }
.recipe-meta div { min-width: 95px; }
.recipe-meta dt { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.recipe-meta dd { margin: 3px 0 0; font-weight: 700; }
.recipe-sharing { display: flex; align-items: center; gap: 12px; margin-top: 26px; }
.share-button, .copy-link-button { padding: 9px 16px; border: 1px solid var(--recipe-colour, var(--green)); border-radius: 999px; color: var(--recipe-colour, var(--green)); background: white; font: 700 13px "DM Sans", sans-serif; cursor: pointer; }
.share-button:hover, .copy-link-button:hover { color: white; background: var(--recipe-colour, var(--green)); }
.share-status { color: var(--muted); font-size: 12px; font-weight: 600; }
.recipe-content { display: grid; grid-template-columns: minmax(250px, .7fr) minmax(0, 1.3fr); gap: clamp(45px, 8vw, 110px); padding-block: 70px 100px; }
.recipe-content h2 { margin: 0 0 28px; font-size: 38px; }
.ingredients { margin: 0; padding: 0; list-style: none; }
.ingredients li { padding: 13px 0; border-bottom: 1px solid var(--line); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: steps; }
.steps li { position: relative; min-height: 48px; margin-bottom: 28px; padding-left: 68px; counter-increment: steps; }
.recipe-hero .eyebrow { color: var(--recipe-colour, var(--orange)); }
.steps li::before { content: counter(steps); position: absolute; left: 0; top: -5px; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: white; background: var(--recipe-colour, var(--orange)); font-family: "DM Serif Display", serif; font-size: 20px; }
footer { padding: 32px 20px; color: #d4dbd6; background: var(--ink); text-align: center; font-size: 13px; }
.site-footer p { margin: 0; }
.site-footer .copyright { margin-top: 8px; color: white; font-weight: 600; }
.site-footer .ownership-notice { max-width: 720px; margin: 8px auto 0; color: #aebbb2; font-size: 11px; }
.admin-page { padding-block: 60px 90px; }
.admin-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 42px; }
.admin-heading h1, .form-page h1 { margin: 0; font-size: clamp(44px, 6vw, 64px); }
.admin-intro { margin-bottom: 0; color: var(--muted); }
.admin-list { border-top: 1px solid var(--line); }
.admin-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 4px; border-bottom: 1px solid var(--line); }
.admin-row h2 { margin: 5px 0; font-size: 25px; }
.admin-row h2 a { text-decoration: none; }
.admin-row p { margin: 0; color: var(--muted); font-size: 13px; }
.row-actions, .form-actions { display: flex; align-items: center; gap: 12px; }
.secondary-button { display: inline-block; padding: 11px 18px; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--green); font-size: 14px; font-weight: 700; text-decoration: none; }
.danger-link { padding: 8px; border: 0; color: #a33f35; background: transparent; font: 700 13px "DM Sans", sans-serif; cursor: pointer; }
.form-page > .eyebrow { margin-top: 30px; }
.recipe-form { max-width: 820px; margin-top: 42px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.field { display: grid; gap: 7px; }
.field-wide { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 700; }
.field input, .field textarea, .field select { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: white; font: inherit; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 3px solid var(--sage); border-color: var(--green); }
.field textarea { resize: vertical; line-height: 1.5; }
.field input[type="color"] { width: 70px; min-height: 47px; padding: 5px; }
.form-photo { display: block; width: min(100%, 420px); max-height: 280px; object-fit: cover; border-radius: 12px; }
.form-photo-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 10px; }
.form-photo-item { display: grid; align-content: start; gap: 8px; }
.form-photo-item .form-photo { width: 100%; aspect-ratio: 3 / 2; }
.field small { color: var(--muted); font-size: 12px; }
.form-actions { margin-top: 32px; }
.error-summary { margin: 30px 0; padding: 18px 22px; border-left: 4px solid #a33f35; border-radius: 8px; color: #752d26; background: #f9e7e3; }
.error-summary h2 { margin: 0 0 8px; font: 700 16px "DM Sans", sans-serif; }
.error-summary ul { margin: 0; padding-left: 20px; }
.auth-shell { min-height: calc(100vh - 220px); display: grid; place-items: center; padding: 60px 20px 90px; background: var(--cream); border-top: 1px solid #eee8dc; }
.auth-card { width: min(100%, 440px); padding: 38px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: var(--shadow); }
.auth-card h1 { margin: 0; font-size: 46px; }
.auth-card > p:not(.eyebrow) { color: var(--muted); }
.auth-form { display: grid; gap: 20px; margin: 28px 0 18px; }
.check-field { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.auth-link { color: var(--green); font-size: 13px; font-weight: 700; }
.analytics-page { padding-block: 60px 90px; }
.analytics-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 42px; }
.analytics-summary article { padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--cream); }
.analytics-summary span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.analytics-summary strong { display: block; margin-top: 8px; font: 42px/1 "DM Serif Display", serif; }
.analytics-section { margin-top: 36px; padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: white; }
.analytics-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.analytics-heading h2 { margin: 0; font-size: 30px; }
.analytics-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.view-chart { display: grid; grid-template-columns: repeat(30, minmax(5px, 1fr)); align-items: end; height: 220px; gap: 5px; padding-top: 16px; border-bottom: 1px solid var(--line); }
.view-day { display: grid; grid-template-rows: 1fr 22px; align-items: end; height: 100%; min-width: 0; }
.view-bar { display: block; min-height: 2px; height: var(--view-height); border-radius: 5px 5px 0 0; background: var(--orange); }
.view-day small { overflow: visible; color: var(--muted); font-size: 9px; white-space: nowrap; transform: translateX(-2px); }
.analytics-table-wrap { overflow-x: auto; }
.analytics-table { width: 100%; border-collapse: collapse; }
.analytics-table th, .analytics-table td { padding: 13px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.analytics-table th:last-child, .analytics-table td:last-child { text-align: right; }
.analytics-table th { color: var(--muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.analytics-table a { font-weight: 700; text-decoration: none; }
.status-badge { display: inline-block; margin-right: 10px; padding: 3px 9px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.status-badge.published { color: #244b35; background: #dcebdc; }
.status-badge.draft { color: #76531f; background: #f6e7c9; }
.draft-banner { padding: 10px 20px; color: #68491c; background: #f6e7c9; text-align: center; font-size: 13px; font-weight: 700; }
@media (max-width: 820px) { .recipe-grid { grid-template-columns: 1fr 1fr; } .recipe-content { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .site-header { min-height: 80px; } .header-actions .header-link:first-child { display: none; } .header-actions { gap: 12px; } .hero-inner { padding: 56px 0 62px; } .recipe-library { padding-block: 48px 65px; } .library-heading, .admin-heading { display: block; } .admin-heading .button { margin-top: 22px; } .admin-row { align-items: start; flex-direction: column; } .form-grid, .form-photo-list { grid-template-columns: 1fr; } .recipe-grid, .recipe-gallery { grid-template-columns: 1fr; } .search-form { display: grid; } .search-form input { width: 100%; } .recipe-hero { padding: 42px 0; } .recipe-meta { gap: 20px; } .auth-card { padding: 28px 24px; } .analytics-summary { grid-template-columns: 1fr; } .analytics-section { padding: 20px 16px; } .view-chart { gap: 2px; } }

@page { margin: 15mm; }
@media print {
  body { color: #111; background: white; font-family: Arial, sans-serif; font-size: 10.5pt; line-height: 1.35; }
  .site-header, footer, .flash, .draft-banner, .recipe-actions, .recipe-sharing, .recipe-gallery { display: none !important; }
  .page-width { width: auto; margin: 0; }
  .recipe-hero { padding: 0 0 6mm; background: none; border: 0; border-bottom: 1px solid #999; }
  .recipe-hero .eyebrow { margin: 0 0 2mm; color: #444; font-size: 8pt; }
  .recipe-hero h1 { max-width: none; margin: 0 0 3mm; font-size: 26pt; }
  .recipe-intro { display: none; }
  .recipe-meta { gap: 8mm; margin: 0; }
  .recipe-meta div { min-width: 18mm; }
  .recipe-meta dt { color: #444; font-size: 7.5pt; }
  .recipe-meta dd { margin-top: 1mm; }
  .recipe-content { grid-template-columns: minmax(45mm, .7fr) minmax(0, 1.3fr); gap: 10mm; padding: 8mm 0 0; }
  .recipe-content h2 { margin-bottom: 4mm; font-size: 18pt; }
  .ingredients li { padding: 2.5mm 0; border-color: #bbb; break-inside: avoid; }
  .steps li { min-height: 7mm; margin-bottom: 5mm; padding-left: 10mm; break-inside: avoid; }
  .steps li::before { top: -.5mm; width: 7mm; height: 7mm; border: 1px solid #555; color: #111; background: white; font-family: Arial, sans-serif; font-size: 9pt; }
}
