/* Ladle & Legacy: "Soda Fountain" in Heritage Blue with Butterscotch accents */
:root {
  color-scheme: light;
  --hb: #1d3f72;          /* Heritage Blue */
  --hb-deep: #142c52;
  --hb-soft: #dfe5ee;
  --accent: #e0ad4f;      /* Butterscotch, on blue */
  --accent-ink: #a8741c;  /* Butterscotch, on cream (readable) */
  --cherry: #b8352f;
  --paper: #f5eedc;
  --paper-2: #fffcf4;
  --cream: #fbf7ec;
  --ink: #1b2233;
  --ink-soft: #4a5670;
  --rule: #d9cfb6;
  --dots: #b9bfcb;
  --ok: #3f6b3a;
  --ok-bg: #e4ecd9;
  --warn-bg: #f6e6c2;
  --err: #a12c26;
  --err-bg: #f6dcd6;
  --radius: 6px;
  --body: "Old Standard TT", Georgia, "Times New Roman", serif;
  --head: "Bevan", Georgia, serif;
  --ui: "Libre Franklin", system-ui, -apple-system, "Segoe UI", sans-serif;
  --script: "Playfair Display", Georgia, serif;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45  0 0 0 0 .33  0 0 0 0 .18  0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  /* logo colors (overridden per surface) */
  --logo-ink: var(--hb);
  --logo-acc: var(--accent-ink);
  --logo-soft: rgba(29, 63, 114, .45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper) var(--grain);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
}
a { color: var(--hb); text-underline-offset: 2px; }
a:hover { color: var(--accent-ink); }
h1, h2, h3 { font-family: var(--head); font-weight: 400; line-height: 1.15; margin: 0 0 .5em; color: var(--hb); }
h1 { font-size: clamp(1.9rem, 5vw, 2.4rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
h1 em, h2 em { color: var(--accent-ink); font-style: normal; }
img { max-width: 100%; }
.pf { font-family: var(--script); font-style: italic; }
.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; }
.lf { font-family: var(--ui); font-weight: 600; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
main.wrap { flex: 1; padding-top: 30px; padding-bottom: 48px; }
main.narrow, .narrow { max-width: 640px; }
form.narrow { margin-left: 0; }

/* Header: solid blue with a cream gap and red pinstripe beneath */
.site-header { background: var(--hb); position: relative; margin-bottom: 8px; --logo-ink: var(--cream); --logo-acc: var(--accent); }
.site-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 8px;
  background: linear-gradient(var(--paper) 0 3px, var(--cherry) 3px 6px, transparent 6px); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 70px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.brand { display: block; line-height: 0; }
.brand .logo-swash { height: 52px; width: auto; }
.site-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-family: var(--ui); font-weight: 500; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
.site-nav a, .switcher summary { color: var(--cream); text-decoration: none; }
.site-nav a:hover, .switcher summary:hover { color: var(--accent); }
.site-nav a.nav-feedback { border: 1px solid var(--accent); color: var(--accent); border-radius: 999px; padding: 4px 12px; }
.site-nav a.nav-feedback:hover { background: var(--accent); color: var(--hb); }
.switcher { position: relative; }
.switcher summary { cursor: pointer; list-style: none; }
.switcher summary::-webkit-details-marker { display: none; }
.switcher summary::after { content: " ▾"; }
.switcher ul { position: absolute; right: 0; top: 2em; z-index: 10; margin: 0; padding: 6px 0; list-style: none; min-width: 230px;
  background: var(--paper-2); border: 1px solid var(--rule); border-top: 3px solid var(--hb); border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 8px 20px rgba(20, 44, 82, .18);
  text-transform: none; letter-spacing: 0; font-size: .95rem; }
.switcher li a { display: block; padding: 7px 14px; color: var(--hb); }
.switcher li a:hover { background: var(--hb-soft); color: var(--hb); }

/* Footer */
.site-footer { border-top: 3px double var(--hb); color: var(--ink-soft); font-size: .82rem; font-family: var(--ui); }
.footer-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 16px; }
.site-footer a { color: var(--hb); font-weight: 600; }

/* Menu-style cards: double rules top and bottom */
.card {
  background: var(--paper-2);
  border-top: 3px solid var(--hb);
  border-bottom: 3px solid var(--hb);
  box-shadow: inset 0 3px 0 var(--paper-2), inset 0 4px 0 var(--hb), inset 0 -3px 0 var(--paper-2), inset 0 -4px 0 var(--hb);
  padding: 22px 22px;
  margin-bottom: 22px;
  overflow-x: auto;
}
.card-page { background: var(--paper-2); border-top: 3px solid var(--hb); border-bottom: 3px solid var(--hb);
  box-shadow: inset 0 3px 0 var(--paper-2), inset 0 4px 0 var(--hb), inset 0 -3px 0 var(--paper-2), inset 0 -4px 0 var(--hb);
  padding: 30px 26px; margin-top: 30px; margin-bottom: 48px; }
main.card-page { flex: 0 0 auto; }
main.card-page + .site-footer { margin-top: auto; }
.card-page h1 { font-size: 1.9rem; }
.hero { text-align: center; padding: 36px 24px 34px; }
.hero .logo-crest { width: 100%; max-width: 300px; height: auto; display: block; margin: 0 auto 8px; }
.tagline { font-style: italic; color: var(--ink-soft); margin: 0 0 12px; }
.eyebrow { font-family: var(--ui); font-weight: 700; text-transform: uppercase; letter-spacing: .25em; font-size: .72rem; color: var(--ink-soft); margin: 0; }
hr.short { border: 0; height: 1px; width: 120px; margin: 18px auto; background: var(--rule); }
.muted { color: var(--ink-soft); }
.small, small { font-size: .875rem; }
.empty { text-align: center; }
.coming { border-top-style: dashed; border-bottom-style: dashed; box-shadow: none; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 30px 0 14px; }
.section-head h2 { margin: 0; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; align-items: start; }
.two-col > .card { margin-bottom: 0; }
.two-col + * { margin-top: 22px; }
blockquote { margin: 16px auto; padding: 6px 16px; border-left: 3px solid var(--accent-ink); font-style: italic; text-align: left; max-width: 440px; }
ul.plain { list-style: none; padding: 0; }

/* Book header & tabs */
.book-head { margin-bottom: 26px; }
.book-head h1 { margin-bottom: 4px; }
.book-head h1 a { color: var(--hb); text-decoration: none; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin-top: 14px; overflow-x: auto; font-family: var(--ui); font-weight: 600; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; }
.tabs a { padding: 9px 14px; color: var(--ink-soft); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--hb); }
.tabs a[aria-current="page"] { color: var(--hb); border-bottom-color: var(--hb); }
.badge { display: inline-block; min-width: 1.5em; padding: 0 .45em; border-radius: 1em; background: var(--accent); color: var(--hb-deep); font-size: .72rem; text-align: center; letter-spacing: 0; }

/* Lists */
.book-list, .member-list, .people-grid, .stat-row { list-style: none; padding: 0; margin: 0 0 22px; }
.book-list li { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 14px; }
.book-list li a { font-family: var(--head); font-size: 1.2rem; text-decoration: none; }
.member-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; padding: 16px 18px; }
.member-row strong { font-family: var(--head); font-weight: 400; color: var(--hb); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; }
.person-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; margin: 0; height: 100%; color: var(--ink); text-decoration: none; transition: transform .15s; }
.person-card:hover { transform: translateY(-2px); color: var(--ink); }
.person-card strong { font-family: var(--head); font-weight: 400; color: var(--hb); font-size: 1.05rem; margin-top: 4px; }
.pill { display: inline-block; padding: 1px 10px; border: 1px solid var(--hb); border-radius: 1em; font-family: var(--ui); font-weight: 700; font-size: .7rem; letter-spacing: .06em; color: var(--hb); }
.pill.memorial { border-color: var(--accent-ink); color: var(--accent-ink); }

/* Avatars: blue disc, butterscotch ring, italic initials */
.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none; outline: 2px solid var(--accent-ink); outline-offset: 3px; margin: 4px; }
.avatar.lg { width: 92px; height: 92px; margin-bottom: 8px; }
.avatar.xl { width: 160px; height: 160px; }
.photo-field { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.photo-field label.photo-button { cursor: pointer; display: inline-block; }
.photo-field input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.photo-field input[type=file]:focus-visible + * , .photo-field:focus-within label.photo-button { outline: 2px solid var(--accent); outline-offset: 2px; }
.avatar.initials { display: inline-flex; align-items: center; justify-content: center; background: var(--hb); color: var(--cream); font-family: var(--script); font-style: italic; font-weight: 700; font-size: 1.1rem; }
.avatar.initials.lg { font-size: 2rem; }
.avatar.initials.xl { font-size: 3.2rem; }
.profile { display: flex; gap: 30px; align-items: flex-start; flex-wrap: wrap; }
.profile-body { flex: 1; min-width: 240px; }
.profile-body h2 { font-size: 1.9rem; margin-bottom: 2px; }
.bio { margin-top: 12px; }

/* Forms */
.form .field { margin-bottom: 18px; }
.field label, .card-page label { display: block; margin-bottom: 5px; font-family: var(--ui); font-weight: 600; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--hb); }
.req { color: var(--accent-ink); }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=file], textarea, select {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 1rem; color: var(--ink);
  background: #fffefa; border: 1px solid var(--dots); border-radius: var(--radius);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--hb); outline-offset: 1px; border-color: var(--hb); }
.field ul { list-style: none; padding: 0; margin: 0; }
.field ul li label { display: flex; gap: 8px; align-items: center; text-transform: none; letter-spacing: 0; font-family: var(--body); font-weight: 400; font-size: 1rem; color: var(--ink); }
.help { display: block; color: var(--ink-soft); margin-top: 4px; font-style: italic; }
.error { display: block; color: var(--err); margin-top: 4px; }
.form-errors, .errorlist { color: var(--err); }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

button, .button {
  display: inline-block; padding: 10px 20px; font-family: var(--ui); font-weight: 700; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; line-height: 1.3;
  color: var(--paper-2); background: var(--hb); border: 2px solid var(--hb); border-radius: 999px; cursor: pointer; text-decoration: none;
}
button:hover, .button:hover { background: var(--hb-deep); border-color: var(--hb-deep); color: var(--paper-2); }
button.secondary, .button.secondary { background: transparent; color: var(--hb); }
button.secondary:hover, .button.secondary:hover { background: var(--hb-soft); color: var(--hb); }
button.danger { background: transparent; color: var(--err); border-color: var(--err); }
button.danger:hover { background: var(--err-bg); color: var(--err); }
button.link-button { background: none; border: 0; padding: 0; color: var(--hb); text-decoration: underline; font-size: .78rem; letter-spacing: .04em; text-transform: none; }
.share-link { display: grid; gap: 4px; margin-bottom: 16px; }

/* allauth pages */
.card-page form { margin-top: 14px; }
.card-page form > p, .card-page form > div { margin-bottom: 16px; }
/* Born / Died: Month, Day, Year dropdowns side by side */
.date-parts { display: grid; grid-template-columns: 2fr 1fr 1.3fr; gap: 8px; }
.card-page input[type=checkbox] { width: auto; margin-right: 6px; }
.card-page label:has(input[type=checkbox]) { display: flex; align-items: center; text-transform: none; letter-spacing: 0; font-family: var(--body); font-weight: 400; font-size: 1rem; color: var(--ink); }
.card-page button { margin-top: 6px; }

/* Messages */
.messages { list-style: none; padding: 0; margin: 0 0 22px; }
.msg { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 8px; background: var(--warn-bg); font-family: var(--ui); font-size: .9rem; border-left: 4px solid var(--accent-ink); }
.msg-success { background: var(--ok-bg); color: var(--ok); border-left-color: var(--ok); }
.msg-error { background: var(--err-bg); color: var(--err); border-left-color: var(--err); }
.notice { padding: 10px 14px; border-radius: var(--radius); background: var(--warn-bg); border-left: 4px solid var(--accent-ink); }

/* Insights */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.stat { display: flex; flex-direction: column; margin: 0; }
.stat .num { font-family: var(--head); font-size: 2.1rem; color: var(--hb); line-height: 1.1; }
.stat .label { font-family: var(--ui); font-weight: 600; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.stat small { color: var(--accent-ink); }
.table { width: 100%; border-collapse: collapse; font-family: var(--ui); font-size: .88rem; }
.table th { text-align: left; padding: 6px 8px; border-bottom: 2px solid var(--hb); color: var(--hb); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; }
.table td { text-align: left; padding: 6px 8px; border-bottom: 1px dotted var(--dots); }
.table .r { text-align: right; }
.feedback-item { border-bottom: 1px dotted var(--dots); padding: 10px 0; }
.feedback-item p { margin: 6px 0 0; }

/* Recipes */
.minor-head { font-family: var(--ui); font-weight: 700; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin: 18px 0 10px; }
.recipe-grid { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.recipe-card { display: flex; flex-direction: column; gap: 3px; margin: 0; height: 100%; color: var(--ink); text-decoration: none; padding: 16px 18px 18px; transition: transform .15s; }
.recipe-card:hover { transform: translateY(-2px); color: var(--ink); }
.recipe-card strong { font-family: var(--head); font-weight: 400; color: var(--hb); font-size: 1.12rem; line-height: 1.2; }
.recipe-thumb { width: calc(100% + 36px); margin: -12px -18px 8px; aspect-ratio: 4 / 3; object-fit: cover; }
.recipe-cat { font-family: var(--ui); font-weight: 700; font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); }
.recipe-from { font-style: italic; color: var(--ink-soft); font-size: .95rem; }
.recipe-card .pill { align-self: flex-start; margin-top: 6px; }
.status-pending { border-color: var(--accent-ink); color: var(--accent-ink); }
.status-rejected { border-color: var(--err); color: var(--err); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 20px; font-family: var(--ui); font-size: .78rem; font-weight: 600; }
.chips a { padding: 5px 12px; border: 1px solid var(--hb); border-radius: 999px; text-decoration: none; color: var(--hb); }
.chips a[aria-current="true"] { background: var(--hb); color: var(--paper-2); }
ul.tight { margin: 6px 0 0; padding-left: 20px; }

.recipe { max-width: 860px; }
.recipe-head h1 { font-size: clamp(2rem, 6vw, 2.8rem); margin: 4px 0 10px; }
.recipe-credit { display: flex; align-items: center; gap: 10px; font-style: italic; margin: 0 0 12px; }
.recipe-credit .avatar { width: 40px; height: 40px; font-size: .95rem; }
.recipe-meta { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 24px; font-family: var(--ui); font-size: .9rem; }
.recipe-meta span { display: block; font-size: .66rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); }
.recipe-photo-link { display: inline-block; margin: 0 0 18px; }
.recipe-photo { display: block; width: auto; max-width: 100%; height: 180px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--rule); }
.recipe-story { max-width: none; margin: 0 0 22px; font-size: 1.1rem; }
.recipe-body { display: grid; grid-template-columns: minmax(240px, 1fr) 2fr; gap: 26px; align-items: start; }
@media (max-width: 720px) { .recipe-body { grid-template-columns: 1fr; } }
.ingredients ul { padding-left: 18px; margin: 0 0 12px; }
.ingredients li { padding: 3px 0; border-bottom: 1px dotted var(--dots); }
.ingredients h3, .recipe-notes h3 { font-family: var(--ui); font-weight: 700; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); margin: 12px 0 4px; }
.steps ol { padding-left: 0; list-style: none; counter-reset: step; margin: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 14px 44px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%; background: var(--hb); color: var(--paper-2); font-family: var(--head); display: flex; align-items: center; justify-content: center; font-size: .95rem; }
.recipe-notes { margin-top: 10px; border-top: 1px dotted var(--dots); padding-top: 6px; }
.recipe-actions { display: flex; gap: 10px; margin: 18px 0 24px; }
.scans summary { cursor: pointer; font-family: var(--ui); font-weight: 600; font-size: .85rem; color: var(--hb); }
.scan-strip { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.scan-strip img { height: 160px; width: auto; border: 1px solid var(--rule); border-radius: 4px; }

.review-layout { display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; gap: 22px; align-items: start; }
.review-layout > * { min-width: 0; }
.review-scans img { width: 100%; border: 1px solid var(--rule); border-radius: 4px; margin-bottom: 10px; }
/* Side by side: keep the original in view while typing, but never taller than the screen. */
@media (min-width: 821px) {
  .review-scans { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
}
/* Phones, unfolded foldables, tablets: one column, the original as a compact preview (tap to enlarge). */
@media (max-width: 820px) {
  .review-layout { grid-template-columns: 1fr; }
  .review-scans { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
  .review-scans .minor-head { flex-basis: 100%; margin-bottom: 0; }
  .review-scans img { width: auto; max-width: 100%; max-height: 32vh; margin-bottom: 0; }
}
.reading { display: flex; gap: 16px; align-items: center; border-top-color: var(--accent-ink); }
.reading.failed { border-top-color: var(--err); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--hb-soft); border-top-color: var(--hb); animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.delete-form { margin: 8px 0 30px; }

/* Sharing */
.shared-by { display: flex; flex-direction: column; gap: 2px; margin: 0 0 14px; padding: 12px 16px; background: var(--paper-2); border-left: 4px solid var(--accent-ink); border-radius: var(--radius); }
.share-note { max-width: 640px; margin: 0 0 22px; }
.share-note cite { display: block; margin-top: 6px; font-style: normal; font-family: var(--ui); font-size: .78rem; font-weight: 600; letter-spacing: .06em; color: var(--ink-soft); }
.share-note cite::before { content: "— "; }
.share-ready { border-top-color: var(--accent-ink); }
.share-ready .row-actions { margin-top: 8px; }
.share-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dotted var(--dots); }
.pitch { display: grid; grid-template-columns: 200px 1fr; gap: 26px; align-items: center; margin-top: 34px; padding: 28px; }
.pitch-logo .logo-crest { width: 100%; height: auto; }
.pitch h2 { font-size: 1.6rem; }
.pitch-list { padding-left: 20px; margin: 0 0 16px; }
.pitch-list li { margin-bottom: 6px; }
@media (max-width: 680px) { .pitch { grid-template-columns: 1fr; text-align: left; } .pitch-logo { max-width: 180px; margin: 0 auto; } }

@media print {
  .site-header, .site-footer, .no-print, .messages { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  main.wrap { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; padding: 0; background: none; }
  .recipe-photo { height: 150px; }
  .steps li::before { background: none; color: #000; border: 1px solid #000; }
  a { color: inherit; text-decoration: none; }
}

@media (max-width: 560px) {
  .brand .logo-swash { height: 42px; }
  .profile { flex-direction: column; align-items: center; text-align: center; }
  .member-row { align-items: flex-start; }
}
