@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --cream:   #faf8f4;
  --cream2:  #f0ebe1;
  --brown:   #2c2416;
  --amber:   #8b6f3a;
  --gold:    #c9a96e;
  --border:  #e0d5c0;
  --text:    #2c2416;
  --dim:     #7a6548;
  --surface: #ffffff;
  --radius:  6px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

/* ── Site header ── */
.site-header {
  background: var(--brown);
  padding: 18px 0;
  border-bottom: 3px solid var(--amber);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-title {
  font-family: 'Playfair Display', serif;
  color: var(--cream);
  font-size: 26px;
  font-weight: 700;
  text-decoration: none;
  line-height: 1;
}

.site-title em { color: var(--gold); font-style: italic; }

.site-tagline {
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 4px;
  opacity: 0.8;
}

.header-nav a {
  color: var(--cream);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: var(--amber);
  padding: 8px 18px;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: background 0.15s;
}

.header-nav a:hover { background: var(--gold); color: var(--brown); }

/* ── Layout ── */
.wrap { max-width: 960px; margin: 0 auto; padding: 0 24px; }

.page-content { padding: 48px 0; }

/* ── Section heading ── */
.section-hd {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.section-hd-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--amber);
  white-space: nowrap;
}

.section-hd-line { flex: 1; height: 1px; background: var(--border); }

/* ── Recipe grid (index) ── */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

.recipe-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.recipe-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(44,36,22,0.1);
  border-color: var(--amber);
}

.card-category {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 7px;
}

.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 21px;
  color: var(--brown);
  margin-bottom: 8px;
  line-height: 1.2;
}

.card-desc {
  font-size: 14px;
  color: var(--dim);
  line-height: 1.55;
  margin-bottom: 16px;
}

.card-meta {
  font-size: 12px;
  color: var(--dim);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.comment-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--amber);
  color: var(--cream);
  font-size: 11px;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  line-height: 1;
  box-shadow: 0 0 0 2px rgba(201,169,110,0.35), 0 0 8px rgba(201,169,110,0.5);
}

/* ── Recipe detail header ── */
.recipe-header {
  background: var(--brown);
  padding: 48px 0 40px;
}

.recipe-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
  opacity: 0.8;
}

.recipe-title {
  font-family: 'Playfair Display', serif;
  font-size: 48px;
  font-weight: 700;
  color: var(--cream);
  line-height: 1.05;
  margin-bottom: 10px;
}

.recipe-tagline {
  font-size: 15px;
  color: var(--gold);
  font-style: italic;
}

.recipe-meta {
  display: flex;
  gap: 20px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.recipe-meta-item {
  font-size: 12px;
  color: rgba(250,248,244,0.6);
  display: flex;
  align-items: center;
  gap: 5px;
}

.recipe-meta-item strong { color: rgba(250,248,244,0.88); }

/* ── Recipe body ── */
.recipe-body { padding: 48px 0; }

.recipe-columns {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 680px) {
  .recipe-columns  { grid-template-columns: 1fr; }
  .recipe-title    { font-size: 34px; }
}

/* ── Ingredients panel ── */
.ingredients-panel {
  background: var(--brown);
  color: var(--cream);
  border-radius: var(--radius);
  padding: 22px 20px;
}

.panel-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(201,169,110,0.2);
}

.ingredient {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 13px;
}

.ingredient:last-child { margin-bottom: 0; }

.ing-name {
  font-size: 14px;
  font-weight: 300;
  color: #e8dcc8;
  flex: 1;
}

.ing-dots {
  flex-shrink: 0;
  width: 24px;
  border-bottom: 1px dotted rgba(201,169,110,0.25);
  margin-bottom: 3px;
}

.ing-amount {
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
  text-align: right;
}

.tips-box {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(201,169,110,0.12);
  border-radius: 4px;
  padding: 14px;
  margin-top: 20px;
}

.tips-box .panel-title { color: rgba(201,169,110,0.65); margin-bottom: 12px; }

.tip-line {
  font-size: 13px;
  color: #c8b898;
  margin-bottom: 8px;
  padding-left: 16px;
  position: relative;
  line-height: 1.5;
}

.tip-line::before { content: '→'; position: absolute; left: 0; color: var(--amber); }
.tip-line:last-child { margin-bottom: 0; }

/* ── Steps ── */
.steps-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 22px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.step {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
  align-items: flex-start;
}

.step:last-child { margin-bottom: 0; }

.step-num {
  width: 28px;
  height: 28px;
  background: var(--amber);
  color: var(--cream);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.step-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--brown);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.step-desc {
  font-size: 15px;
  color: #4a3d2a;
  line-height: 1.7;
}

/* ── Comments ── */
.comments-section {
  background: var(--cream2);
  border-top: 1px solid var(--border);
  padding: 48px 0;
}

.comment {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  gap: 12px;
}

.comment-author { font-weight: 700; font-size: 14px; color: var(--brown); }
.comment-date   { font-size: 12px; color: var(--dim); }
.comment-body   { font-size: 15px; color: var(--text); line-height: 1.6; }

/* ── Forms ── */
.form-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
}

.form-group { margin-bottom: 20px; }
.form-group:last-child { margin-bottom: 0; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 7px;
}

input[type=text],
input[type=email],
input[type=password],
textarea,
select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--cream);
  outline: none;
  transition: border-color 0.15s;
}

input[type=text]:focus,
input[type=email]:focus,
input[type=password]:focus,
textarea:focus,
select:focus { border-color: var(--amber); }

textarea { resize: vertical; min-height: 180px; line-height: 1.6; }

.form-hint {
  font-size: 12px;
  color: var(--dim);
  margin-top: 5px;
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 11px 26px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  letter-spacing: 0.3px;
  font-family: inherit;
  transition: all 0.15s;
}

.btn-primary { background: var(--amber); color: var(--cream); }
.btn-primary:hover { background: var(--brown); }

.btn-secondary {
  background: transparent;
  color: var(--amber);
  border: 1px solid var(--amber);
}

.btn-secondary:hover { background: var(--amber); color: var(--cream); }

.btn-danger { background: #8b1a1a; color: #fff; }
.btn-danger:hover { background: #6a1010; }

.btn-sm { padding: 7px 16px; font-size: 13px; }

.btn-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ── Alerts ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
}

.alert-error   { background: #fef0f0; border: 1px solid #f8c0c0; color: #7a1a1a; }
.alert-success { background: #f0f7f0; border: 1px solid #b8d8b8; color: #1a5c1a; }

/* ── Page header (non-recipe pages) ── */
.page-hd {
  background: var(--brown);
  padding: 40px 0;
  border-bottom: 3px solid var(--amber);
}

.page-hd-title {
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  color: var(--cream);
  margin-bottom: 6px;
}

.page-hd-sub {
  font-size: 14px;
  color: var(--gold);
  font-style: italic;
}

/* ── Back link ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--amber);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 28px;
}

.back-link:hover { color: var(--brown); }

/* ── Submit preview ── */
.preview-block {
  background: var(--cream2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
}

.preview-block-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.preview-recipe-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  color: var(--brown);
  margin-bottom: 4px;
}

.preview-recipe-desc {
  font-size: 14px;
  color: var(--dim);
  font-style: italic;
  margin-bottom: 12px;
}

.preview-meta { font-size: 13px; color: var(--dim); }
.preview-meta strong { color: var(--brown); }

.preview-list { list-style: none; }

.preview-list li {
  display: flex;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.preview-list li:last-child { border-bottom: none; }
.preview-list .pl-name   { flex: 1; color: var(--text); }
.preview-list .pl-amount { color: var(--amber); font-weight: 700; white-space: nowrap; }

.step-preview {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.6;
}

.step-preview:last-child { border-bottom: none; }
.step-preview-title { font-weight: 700; color: var(--brown); text-transform: uppercase; font-size: 12px; letter-spacing: 0.5px; margin-bottom: 2px; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-state h3 {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  color: var(--brown);
  margin-bottom: 8px;
}

.empty-state p { font-size: 15px; color: var(--dim); }
.empty-state a { color: var(--amber); }

/* ── Published banner ── */
.published-banner {
  background: #2a4a2a;
  color: rgba(255,255,255,0.88);
  font-size: 14px;
  padding: 12px 0;
  text-align: center;
  border-bottom: 1px solid #3a6a3a;
}

/* ── Edit request panel ── */
.edit-request-wrap {
  background: var(--cream2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.edit-request-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  color: var(--dim);
  cursor: pointer;
  letter-spacing: 0.3px;
}

.edit-request-btn:hover { color: var(--amber); }

.edit-confirm {
  font-size: 13px;
  color: #2a6a2a;
}

/* ── Delete zone ── */
.delete-zone {
  margin-top: 40px;
  padding: 20px 24px;
  border: 1px solid #f8c0c0;
  border-radius: var(--radius);
  background: #fef8f8;
}

.delete-zone-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #8b1a1a;
  margin-bottom: 8px;
}

.delete-zone p {
  font-size: 14px;
  color: #7a1a1a;
  margin-bottom: 14px;
}

code {
  font-family: monospace;
  font-size: 13px;
  background: var(--cream2);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--brown);
}

/* ── Drop zone (submit page) ── */
.drop-zone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: 4px;
  transition: border-color 0.15s, background 0.15s;
}

.drop-zone.drag-over {
  border-color: var(--amber);
  background: rgba(139,111,58,0.05);
}

.drop-zone.has-image textarea {
  display: none;
}

.drop-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  border-radius: 4px;
  background: rgba(139,111,58,0.08);
  font-size: 15px;
  font-weight: 600;
  color: var(--amber);
  gap: 8px;
}

.drop-zone.drag-over .drop-overlay { opacity: 1; }

.drop-zone textarea {
  border: none;
  background: transparent;
}

.drop-zone textarea:focus { outline: none; box-shadow: none; border: none; }

.img-preview-wrap {
  display: none;
  padding: 14px;
  align-items: flex-start;
  gap: 14px;
}

.drop-zone.has-image .img-preview-wrap { display: flex; }

.img-preview {
  max-width: 160px;
  max-height: 120px;
  border-radius: 4px;
  border: 1px solid var(--border);
  object-fit: cover;
  flex-shrink: 0;
}

.img-preview-info {
  flex: 1;
  min-width: 0;
}

.img-preview-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--brown);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.img-remove-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--dim);
  cursor: pointer;
  font-family: inherit;
  margin-top: 8px;
  transition: all 0.15s;
}

.img-remove-btn:hover { border-color: #8b1a1a; color: #8b1a1a; }

/* ── Recipe toolbar (back + print) ── */
.recipe-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.recipe-toolbar .back-link { margin-bottom: 0; }

.print-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 16px;
  font-size: 13px;
  font-family: inherit;
  color: var(--dim);
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: all 0.15s;
}

.print-btn:hover { border-color: var(--amber); color: var(--amber); }

/* ── Print styles ── */
@media print {
  /* Hide everything that's not the recipe */
  .site-header,
  .site-footer,
  .published-banner,
  .recipe-toolbar,
  .edit-request-wrap,
  .comments-section { display: none !important; }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  /* Recipe masthead: dark bg → white with border */
  .recipe-header {
    background: #fff !important;
    color: #000 !important;
    border-bottom: 2pt solid #000;
    padding: 18pt 0 12pt;
  }

  .recipe-eyebrow {
    color: #555 !important;
    font-size: 8pt;
  }

  .recipe-title {
    color: #000 !important;
    font-size: 28pt;
    margin-bottom: 6pt;
  }

  .recipe-tagline {
    color: #333 !important;
    font-size: 11pt;
  }

  .recipe-meta-item { color: #555 !important; font-size: 9pt; }
  .recipe-meta-item strong { color: #000 !important; }

  /* Body */
  .recipe-body { padding: 16pt 0 0; }

  .wrap { max-width: 100%; padding: 0 18pt; }

  .recipe-columns {
    grid-template-columns: 200pt 1fr;
    gap: 20pt;
  }

  /* Ingredients panel: dark brown → outlined box */
  .ingredients-panel {
    background: #fff !important;
    color: #000 !important;
    border: 1pt solid #ccc;
    border-radius: 0;
  }

  .panel-title {
    color: #000 !important;
    border-bottom-color: #ccc !important;
    font-size: 8pt;
  }

  .ing-name   { color: #000 !important; font-size: 10pt; }
  .ing-amount { color: #000 !important; font-size: 10pt; }
  .ing-dots   { border-bottom-color: #bbb !important; }

  .tips-box {
    background: #f8f8f8 !important;
    border-color: #ccc !important;
  }

  .tips-box .panel-title { color: #555 !important; }
  .tip-line { color: #333 !important; font-size: 9pt; }
  .tip-line::before { color: #555 !important; }

  /* Steps */
  .steps-title {
    color: #000 !important;
    border-bottom-color: #ccc !important;
    font-size: 8pt;
  }

  .step-num {
    background: #000 !important;
    color: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .step-title { color: #000 !important; }
  .step-desc  { color: #222 !important; font-size: 10pt; }

  /* Branding line at bottom of print */
  .recipe-body::after {
    content: 'Chesty Recipes — recipes.jnet.us';
    display: block;
    margin-top: 20pt;
    padding-top: 8pt;
    border-top: 0.5pt solid #ccc;
    font-size: 8pt;
    color: #999;
    text-align: right;
  }

  /* Keep ingredients + steps together; avoid breaking mid-step */
  .step { page-break-inside: avoid; }
  .ingredients-panel { page-break-inside: avoid; }
}

/* ── Footer ── */
.site-footer {
  background: var(--brown);
  color: rgba(250,248,244,0.45);
  text-align: center;
  padding: 18px 24px;
  font-size: 12px;
  letter-spacing: 0.5px;
}
