/* Deliberately small: system fonts, no frameworks, no web fonts to download. */
/* Colors (--background, --accent, …) come from /theme.css, generated from site.ini. */
:root { --radius: 10px; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--background); color: var(--text);
  font: 18px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
h1, h2, .brand { font-family: Georgia, "Iowan Old Style", "Times New Roman", serif; line-height: 1.2; }
h1 { font-size: 2rem; margin: 1.5rem 0 1rem; }
h2 { font-size: 1.35rem; margin: 2rem 0 .75rem; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.site-header .wrap { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; justify-content: space-between; padding-top: .9rem; padding-bottom: .9rem; }
.brand { font-size: 1.5rem; font-weight: 700; color: var(--text); text-decoration: none; }
.site-footer { margin-top: 4rem; padding: 1.5rem 0; border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.search { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: 1rem 0 1.5rem; }
.search input { flex: 1 1 240px; }
input, textarea, button, .button { font: inherit; }
input, textarea {
  width: 100%; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text);
}
input:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
textarea { resize: vertical; }
::placeholder { color: var(--muted); opacity: .55; font-style: italic; }
button, .button {
  display: inline-block; padding: .55rem 1rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none;
}
.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.primary:hover { background: var(--accent-dark); color: #fff; }
.danger { color: var(--danger); }
button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.big { padding: .8rem 1.4rem; font-size: 1.05em; font-weight: 600; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; }
form.inline { display: inline; }

.recipe-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.recipe-list a { display: block; padding: 1.1rem 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: inherit; text-decoration: none; }
.recipe-list a:hover { border-color: var(--accent); }
.recipe-list h2 { margin: 0 0 .25rem; color: var(--accent); }
.recipe-list p { margin: .25rem 0 0; }
.meta { color: var(--muted); font-size: .9rem; display: flex; gap: 1rem; }
.pager { display: flex; justify-content: space-between; margin: 1.5rem 0; }
.empty { color: var(--muted); padding: 2rem 0; }

.recipe .summary { font-size: 1.15rem; color: var(--muted); }
.facts { display: flex; flex-wrap: wrap; gap: 1.5rem; padding: .9rem 1.2rem; margin: 1.25rem 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.facts div { min-width: 70px; }
.facts dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.ingredients li { margin: .3rem 0; }
.steps li { margin: .7rem 0; padding-left: .3rem; }
.notes { background: var(--surface); border-left: 4px solid var(--accent); padding: .25rem 1.2rem .5rem; border-radius: 0 var(--radius) var(--radius) 0; }
.actions { margin-top: 2.5rem; color: var(--muted); }


.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-top: 2rem; }
.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.stack { display: grid; gap: 1.1rem; }
.stack label { display: grid; gap: .35rem; font-weight: 600; }
.stack label > .label { align-self: end; }
.hint { font-weight: 400; color: var(--muted); font-size: .9em; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.checkbox { display: flex !important; align-items: center; gap: .6rem; font-weight: 600; }
.checkbox input { width: 1.4rem; height: 1.4rem; flex: none; }
.slug-input { display: flex; align-items: center; gap: .25rem; font-weight: 400; color: var(--muted); }
details summary { cursor: pointer; color: var(--muted); }
details[open] summary { margin-bottom: .75rem; }
.form-actions { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; margin-top: .5rem; }
.notice, .error, .banner { padding: .8rem 1rem; border-radius: 8px; margin: 1rem 0; }
.notice { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); border: 1px solid var(--ok); }
.error { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); border: 1px solid var(--danger); }
.banner { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 1px solid var(--accent); }
.field-error { color: var(--danger); font-weight: 400; font-size: .95em; }

.toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.toolbar h1 small { color: var(--muted); font-size: .6em; font-weight: 400; }
table.recipes { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table.recipes th, table.recipes td { text-align: left; padding: .75rem .9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.recipes th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.row-actions { white-space: nowrap; }
.row-actions a { margin-right: .8rem; }
.pill { font-size: .8rem; padding: .15rem .55rem; border-radius: 999px; white-space: nowrap; }
.pill.live { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.pill.draft { background: var(--border); color: var(--muted); }
@media (max-width: 640px) {
  table.recipes thead { display: none; }
  table.recipes tr { display: grid; padding: .5rem 0; border-bottom: 1px solid var(--border); }
  table.recipes td { border: 0; padding: .2rem .9rem; }
}

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

/* ---- public navigation ---- */
.site-nav { display: flex; align-items: center; gap: .4rem 1.2rem; flex-wrap: wrap; }
.site-nav a { color: var(--text); text-decoration: none; font-weight: 500; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.nav-search input { width: 11rem; padding: .35rem .7rem; font-size: .95rem; border-radius: 999px; }
.crumbs { margin: 1.5rem 0 -.75rem; color: var(--muted); }
.tagline { text-align: center; font: italic 1.2rem Georgia, serif; color: var(--muted); margin: 1.25rem 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.more { text-align: center; margin: 1.5rem 0; }

/* ---- recipe cards ---- */
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.cards a { display: flex; flex-direction: column; height: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.cards a:hover { border-color: var(--accent); transform: translateY(-2px); }
.cards img, .card-noimg { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.card-noimg, .slide-noimg, .nothumb { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 25%, var(--surface)), color-mix(in srgb, var(--accent) 8%, var(--surface))); }
.card-body { padding: .8rem 1rem 1rem; }
.card-body h3 { margin: 0 0 .25rem; font: 700 1.15rem/1.25 Georgia, serif; color: var(--accent); }
.card-body p { margin: .25rem 0 0; font-size: .95rem; }

/* ---- category chips and grid ---- */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 1rem 0; }
.chips a { display: inline-block; padding: .3rem .85rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); text-decoration: none; font-size: .95rem; }
.chips a:hover { border-color: var(--accent); color: var(--accent); }
.chips span { color: var(--muted); font-size: .85em; }
.category-grid { list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.category-grid a { display: block; padding: 1.3rem 1.2rem; background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--accent); border-radius: var(--radius); text-decoration: none; color: var(--text); }
.category-grid a:hover { border-color: var(--accent); }
.category-grid .name { display: block; font: 700 1.25rem Georgia, serif; }
.category-grid .count { color: var(--muted); font-size: .9rem; }

/* ---- spotlight carousel ---- */
.spotlight { position: relative; margin-top: 1.5rem; border-radius: calc(var(--radius) * 1.5); overflow: hidden; background: var(--surface); }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slides:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.slide { flex: 0 0 100%; scroll-snap-align: start; position: relative; }
.slide a { display: block; color: #fff; text-decoration: none; }
.slide img, .slide-noimg { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.caption { position: absolute; inset: auto 0 0 0; padding: 3rem 1.5rem 1.25rem; background: linear-gradient(transparent, rgba(0,0,0,.72)); }
.caption h2 { margin: 0; font-size: clamp(1.4rem, 4vw, 2.2rem); color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.caption p { margin: .3rem 0 0; max-width: 40rem; color: #f5f5f5; }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-70%); width: 2.6rem; height: 2.6rem; padding: 0; border-radius: 50%; border: 0; background: rgba(255,255,255,.88); color: #222; font-size: 1.7rem; line-height: 1; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.carousel-btn.prev { left: .75rem; }
.carousel-btn.next { right: .75rem; }
.dots { position: absolute; right: 1rem; bottom: .9rem; display: flex; gap: .4rem; }
.dots button { width: .7rem; height: .7rem; padding: 0; border-radius: 50%; border: 2px solid #fff; background: transparent; }
.dots button[aria-current="true"] { background: #fff; }

@media (max-width: 640px) {
  /* Phones: swipe the spotlight instead of tapping arrows, and show two
     compact cards per row. */
  .carousel-btn { display: none; }
  .caption { padding: 2.5rem 1rem 1.6rem; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: .7rem; }
  .card-body { padding: .6rem .7rem .8rem; }
  .card-body h3 { font-size: 1rem; }
  .card-body p:not(.meta) { display: none; }
  .meta { flex-direction: column; gap: 0; font-size: .8rem; }
}

/* ---- recipe page photo ---- */
.recipe .hero { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); margin-top: 1.5rem; }

/* ---- portal ---- */
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem 1.2rem; margin: 0; display: grid; gap: .8rem; }
legend { font-weight: 600; padding: 0 .3rem; }
.photo-preview { max-width: 280px; border-radius: 8px; border: 1px solid var(--border); }
input[type=file] { padding: .5rem; background: var(--background); }
.category-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .5rem 1rem; }
.category-checks .checkbox { font-weight: 400; }
td.thumb { width: 64px; padding-right: 0; }
td.thumb img, .nothumb { display: block; width: 56px; height: 42px; object-fit: cover; border-radius: 6px; }
.pill.star { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.add-category { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1rem 0 1.5rem; }
.add-category input { flex: 1 1 240px; }
form.rename { display: flex; gap: .5rem; }
form.rename input { padding: .4rem .6rem; }
form.rename button { padding: .4rem .8rem; }

/* ---- light/dark toggle ---- */
.theme-toggle { width: 2.4rem; height: 2.4rem; padding: 0; border-radius: 50%; font-size: 1.2rem; line-height: 1; flex: none; }
/* Brand on the left; navigation and the toggle together on the right. */
.site-header .wrap { justify-content: flex-start; }
.site-header .brand { margin-right: auto; }

/* ---- portal: site settings ---- */
select { font: inherit; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
table.colors { border-collapse: collapse; width: 100%; max-width: 560px; }
table.colors th, table.colors td { text-align: left; padding: .35rem .5rem; border-bottom: 1px solid var(--border); font-weight: 400; }
table.colors thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
table.colors tbody th { font-weight: 600; }
table.colors tbody th .hint { display: block; font-weight: 400; font-size: .85rem; }
input[type=color] { width: 3.5rem; height: 2.4rem; padding: .15rem; cursor: pointer; }
.no-dark .dark-col { display: none; }
.previews { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: .5rem; }
.theme-preview { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--pv-border, var(--border)); background: var(--pv-background, var(--background)); color: var(--pv-text, var(--text)); font-size: .95rem; }
.pv-header { display: flex; justify-content: space-between; align-items: center; padding: .6rem .9rem; background: var(--pv-surface, var(--surface)); border-bottom: 1px solid var(--pv-border, var(--border)); font: 700 1.05rem Georgia, serif; }
.pv-label { font: 600 .7rem system-ui, sans-serif; text-transform: uppercase; letter-spacing: .08em; color: var(--pv-muted, var(--muted)); }
.pv-body { padding: .9rem; display: grid; gap: .7rem; }
.pv-card { background: var(--pv-surface, var(--surface)); border: 1px solid var(--pv-border, var(--border)); border-radius: 8px; padding: .7rem .8rem; }
.pv-title { font: 700 1.05rem Georgia, serif; color: var(--pv-accent, var(--accent)); }
.pv-muted { color: var(--pv-muted, var(--muted)); font-size: .85rem; }
.pv-row { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.pv-btn { background: var(--pv-accent, var(--accent)); color: #fff; padding: .35rem .8rem; border-radius: 6px; font-weight: 600; }
.pv-btn:hover { background: var(--pv-accent-dark, var(--accent-dark)); }
.pv-link { color: var(--pv-accent, var(--accent)); text-decoration: underline; }
.pv-ok { color: var(--pv-ok, var(--ok)); font-weight: 600; }
.pv-danger { color: var(--pv-danger, var(--danger)); font-weight: 600; }
.start-over { margin-top: 2.5rem; color: var(--muted); }
.start-over p { max-width: 36rem; }
.error ul { margin: .3rem 0 0; padding-left: 1.3rem; }
.error p { margin: 0; }

/* ---- colors helper page ---- */
button.code { font: 600 .85rem ui-monospace, Menlo, Consolas, monospace; padding: .3rem .5rem; margin-left: .3rem; vertical-align: middle; }
button.code.copied::after { content: " ✓"; color: var(--ok); }
code.role { display: block; font-size: .75rem; color: var(--muted); font-weight: 400; }
[data-cards] > li[hidden] { display: none; }

@media print {
  .site-header, .site-footer, .no-print, .banner, .chips, .theme-toggle { display: none !important; }
  .recipe .hero { max-height: 3in; width: auto; }
  body { background: #fff; color: #000; font-size: 12pt; }
  a { color: #000; text-decoration: none; }
  .facts, .notes { border-color: #999; background: none; }
}
