* { box-sizing: border-box; }
:root {
  --ink: #17321d;
  --deep-green: #174b2a;
  --orange: #d96b00;
  --orange-dark: #9e4900;
  --cream: #fff9dd;
  --paper: rgba(255, 253, 232, .94);
  --line: #d2b978;
  --blue: #004f9e;
}
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: #f5edd2 url('../images/tubackground.gif') repeat fixed;
  font-family: Verdana, Arial, Helvetica, sans-serif;
  line-height: 1.55;
}
a { color: var(--blue); }
a:hover, a:focus { color: #6b2500; }
img { max-width: 100%; height: auto; }
.site-shell { width: min(1120px, calc(100% - 28px)); margin: 20px auto 44px; }
.paper {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(55, 42, 10, .16);
  padding: clamp(18px, 3vw, 34px);
}
.site-header { text-align: center; margin-bottom: 24px; }
.cookbook-logo-home,
.cookbook-logo-small {
  display: block;
  height: auto;
  margin-left: auto;
  margin-right: auto;
}
.cookbook-logo-home { width: min(100%, 980px); margin-top: 10px; margin-bottom: 18px; }
.cookbook-logo-small { width: min(100%, 520px); margin-top: 2px; margin-bottom: 10px; }
.cookbook-logo-link { display: block; width: 100%; text-decoration: none; }
.site-header .presented { font-size: .9rem; margin-bottom: 10px; }
.site-header .tu-letters { max-width: 470px; }
.site-header .tu-mark { max-width: 150px; margin-top: 8px; }
h1, h2, h3 { color: var(--deep-green); line-height: 1.2; }
h1 { font-size: clamp(1.8rem, 5vw, 3rem); margin: .4em 0; }
h2 { font-size: clamp(1.35rem, 3vw, 2rem); margin-top: 1.3em; }
h3 { font-size: 1.15rem; }
.lead { font-size: 1.05rem; }
.navbar, .category-jump, .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 16px 0; }
.menu, .button, button {
  display: inline-block;
  border: 1px solid var(--orange-dark);
  border-radius: 7px;
  padding: 8px 13px;
  background: #ffe0a6;
  color: #281600;
  font: 700 .9rem Verdana, Arial, sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.menu:hover, .button:hover, button:hover { background: #ffc96a; color: #1b1000; }
.note {
  margin: 18px 0;
  padding: 13px 16px;
  border-left: 5px solid var(--orange);
  background: #fff3c8;
}
.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 18px 0; }
.category-card { padding: 12px 14px; background: #fff7d2; border: 1px solid var(--line); border-radius: 8px; }
.category-card a { font-weight: bold; text-decoration: none; }
.category-card small { display: block; margin-top: 3px; color: #5f604d; }
.recipe-category { border-top: 2px solid var(--line); padding-top: 8px; margin-top: 34px; }
.recipe-list { list-style: none; padding: 0; }
.recipe-list li { padding: 9px 4px; border-bottom: 1px dotted #c4aa67; }
.recipe-list .recipe-title { font-weight: bold; }
.recipe-list .meta { color: #62634f; font-size: .88rem; margin-left: 6px; }
.source-link { font-size: .78rem; margin-left: 8px; }
.recipe-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 22px; }
.recipe-meta div { padding: 8px 10px; background: #fff4c7; border: 1px solid #dfcb91; border-radius: 6px; }
.recipe-title-main { text-align: center; margin-bottom: .15em; }
.recipe-cook { text-align: center; margin-top: 0; font-weight: normal; }
.recipe-description { text-align: center; font-style: italic; margin: 18px auto 24px; max-width: 780px; }
.recipe-layout { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(240px, .8fr); gap: 28px; align-items: start; }
.recipe-image { text-align: center; }
.recipe-image img { max-height: 420px; object-fit: contain; border-radius: 8px; }
.ingredients li, .directions li { margin-bottom: 8px; }
.comments { margin-top: 24px; padding: 14px 16px; background: #fff3c8; border-radius: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field.full { grid-column: 1 / -1; }
label { font-weight: bold; }
input, select, textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #aa9b70;
  border-radius: 5px;
  background: #fffef7;
  color: #1d241d;
  font: inherit;
}
textarea { min-height: 90px; resize: vertical; }
.dynamic-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; margin-bottom: 8px; }
.dynamic-row button { padding: 7px 10px; background: #f5d9c8; }
#xml-output { min-height: 380px; font-family: Consolas, 'Courier New', monospace; font-size: .86rem; white-space: pre; }
pre.code {
  overflow: auto;
  max-height: 620px;
  padding: 16px;
  border: 1px solid #bcb397;
  border-radius: 8px;
  background: #fffef8;
  color: #102010;
  font: .86rem/1.45 Consolas, 'Courier New', monospace;
}
details { margin: 16px 0; }
details > summary { cursor: pointer; color: var(--deep-green); font-weight: bold; font-size: 1.05rem; }
.site-footer { text-align: center; margin-top: 30px; color: #53604f; font-size: .86rem; }
@media (max-width: 720px) {
  .recipe-layout, .form-grid { grid-template-columns: 1fr; }
  .recipe-meta { grid-template-columns: 1fr; }
}
@media print {
  body { background: #fff; }
  .site-shell { width: 100%; margin: 0; }
  .paper { box-shadow: none; border: 0; padding: 0; }
  .navbar, .actions, .source-link, .site-footer { display: none !important; }
}


/* Contributor access and approval workflow */
.access-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 22px 0; }
.access-card, .review-card { padding: 18px; border: 1px solid var(--line); border-radius: 9px; background: #fff7d2; }
.access-card h2 { margin-top: 0; }
.success-box, .error-box, .contributor-banner { margin: 16px 0; padding: 13px 16px; border-radius: 7px; }
.success-box { border: 1px solid #78a87b; border-left: 5px solid #2f7a3d; background: #e9f7e7; color: #153a1c; }
.error-box { border: 1px solid #c58579; border-left: 5px solid #a33a29; background: #fff0ea; color: #6c1c12; }
.contributor-banner { border: 1px solid #89a9c7; border-left: 5px solid var(--blue); background: #edf6ff; color: #17304a; }
button.danger { background: #f2c3b8; border-color: #8e2e20; color: #4e170f; }
button.danger:hover { background: #e99f8e; }
.primary-actions button { font-size: 1rem; padding: 11px 18px; background: #cfe8bd; border-color: #47763a; }
.primary-actions button:hover { background: #b8dc9c; }
.break-word { overflow-wrap: anywhere; word-break: break-word; }
@media (max-width: 720px) { .access-grid { grid-template-columns: 1fr; } }

/* Optional background music player */
.cookbook-music-player {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 1000;
  width: min(310px, calc(100vw - 24px));
  padding: 10px 12px;
  border: 1px solid #c9ad67;
  border-radius: 10px;
  background: rgba(255, 249, 221, .96);
  box-shadow: 0 3px 14px rgba(55, 42, 10, .22);
  color: var(--ink);
  font-size: .78rem;
  line-height: 1.3;
}
.cookbook-music-title {
  color: var(--deep-green);
  font-weight: 700;
  font-size: .9rem;
}
.cookbook-music-credit {
  margin: 2px 0 7px;
  color: #62634f;
  font-size: .72rem;
}
.cookbook-music-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cookbook-music-toggle {
  flex: 0 0 auto;
  min-width: 64px;
  padding: 5px 9px;
  font-size: .78rem;
}
.cookbook-music-volume-label {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  font-weight: normal;
}
.cookbook-music-volume {
  min-width: 80px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
}
.cookbook-music-player.is-playing .cookbook-music-title::before {
  content: "♪ ";
}
@media (max-width: 520px) {
  .cookbook-music-player {
    right: 8px;
    bottom: 8px;
    width: min(280px, calc(100vw - 16px));
  }
  .cookbook-music-credit { display: none; }
}
@media print {
  .cookbook-music-player { display: none !important; }
}

