/* ==========================================================================
   Mike's Recipe's — Decus Design System v4 (Personal Lane, Deutsch)
   Sharp 0px geometry · Navy frame · Gold primary CTA · Light gold step icons
   ========================================================================== */

:root {
  --bg: #ffffff;
  --surface: #faf9f7;
  --surface-raised: #ffffff;
  --surface-subtle: #f4f1ec;
  --frame: #061529;
  --nav-active-bg: #0a1f44;
  --nav-active-bar: #B8912A;
  --nav-active-text: #faf9f7;
  --nav-text: #c8d4e4;
  --frame-divider: rgba(255, 255, 255, 0.12);

  --text: #1c1c1e;
  --text-muted: #5a6270;
  --text-gold: #B8912A;
  --gold-light: #E8C974;

  --border: #e2dfd9;
  --border-tile: #b9c1cd;
  --border-strong: #6b7280;
  --border-popover: #8a919c;

  --btn-primary-bg: #B8912A;
  --btn-primary-bg-hover: #C6A246;
  --btn-primary-text: #ffffff;

  --btn-secondary-bg: #3d5a80;
  --btn-secondary-bg-hover: #2f4966;
  --btn-secondary-text: #ffffff;

  --seg-on-bg: #0a1f44;
  --seg-on-text: #faf9f7;

  --badge-error-bg: #f6e8e4;
  --badge-error-text: #8a3028;
  --badge-error-border: #b26057;

  --input-bg: #ffffff;
  --row-selected-bg: #fbf6e9;

  --toast-bg: #061529;
  --toast-text: #f4f1ec;

  --shadow-sm: 0 1px 3px rgba(10, 31, 68, 0.08);
  --shadow-md: 0 4px 16px rgba(10, 31, 68, 0.12);
  --shadow-lg: 0 12px 40px rgba(10, 31, 68, 0.18);

  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, Menlo, monospace;

  --radius: 0px;
  --max-w: 1180px;
}

/* Automatic Dark Mode driven by OS / time schedule (Decus v4 Dark tokens) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #061529;
    --surface: #15335c;
    --surface-raised: #1c3e6c;
    --surface-subtle: #051220;
    --frame: #030a14;

    --text: #e4e2dc;
    --text-muted: #9aa3ae;
    --text-gold: #E8C974;
    --gold-light: #F0D584;

    --border: rgba(200, 212, 228, 0.14);
    --border-tile: #2a3d5a;
    --border-strong: #8b95a0;
    --border-popover: #3a5072;

    --btn-secondary-bg: #4a6a94;
    --btn-secondary-bg-hover: #5878a3;

    --seg-on-bg: #c8d4e4;
    --seg-on-text: #030a14;

    --badge-error-bg: #2b1312;
    --badge-error-text: #e6b3ad;
    --badge-error-border: #966561;

    --input-bg: #020810;
    --row-selected-bg: rgba(184, 145, 42, 0.16);

    --toast-bg: #1c3e6c;
    --toast-text: #f4f1ec;

    --shadow-sm: inset 0 1px 0 rgba(200, 212, 228, 0.08), 0 1px 3px rgba(0, 0, 0, 0.45);
    --shadow-md: inset 0 1px 0 rgba(200, 212, 228, 0.08), 0 4px 16px rgba(0, 0, 0, 0.55);
    --shadow-lg: inset 0 1px 0 rgba(200, 212, 228, 0.08), 0 12px 40px rgba(0, 0, 0, 0.65);
  }
}

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

body {
  font-family: var(--font-body);
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Top Application Frame (Clean single-title navy header) */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--frame);
  color: var(--nav-active-text);
  border-bottom: 1px solid var(--frame-divider);
}

.topbar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
}

.brand-wrap {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-bar {
  width: 3px;
  height: 22px;
  background: var(--nav-active-bar);
  display: inline-block;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--nav-active-text);
}

/* Buttons (Strict 0px radius) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}

.btn-primary:hover:not(:disabled) {
  background: var(--btn-primary-bg-hover);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-tile);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-lg {
  height: 44px;
  padding: 0 20px;
  font-size: 14px;
}

/* Container */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 36px 24px 88px;
}

/* Eyebrow & Expressive Typography */
.eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-gold);
  margin-bottom: 10px;
  display: inline-block;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin-bottom: 14px;
}

.subtitle {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 68ch;
}

/* Recipe Request Row (index.html) */
.request-bar {
  background: var(--surface);
  border: 1px solid var(--border-tile);
  border-left: 3px solid var(--nav-active-bar);
  padding: 14px 16px;
  margin-bottom: 24px;
}

.request-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.request-form input {
  flex: 1;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border-tile);
  background: var(--input-bg);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  outline: none;
}

.request-form input:focus {
  border-color: var(--btn-primary-bg);
}

.request-queue {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  display: none;
}

.request-queue.has-items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.request-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
}

.request-chip .dot {
  width: 6px;
  height: 6px;
  background: var(--nav-active-bar);
}

.request-chip .dot.pulsing {
  animation: pulse-gold 1.2s ease-in-out infinite;
}

@keyframes pulse-gold {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* Search & Category Bar (Equal 40px heights) */
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
}

.search-box {
  flex: 1 1 260px;
  max-width: 400px;
}

.search-box input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border-tile);
  background: var(--input-bg);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease;
}

.search-box input:focus {
  border-color: var(--btn-primary-bg);
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border-tile);
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.pill.active {
  background: var(--seg-on-bg);
  border-color: var(--seg-on-bg);
  color: var(--seg-on-text);
}

/* Recipe Card Grid */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.recipe-card {
  background: var(--surface);
  border: 1px solid var(--border-tile);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.recipe-card:hover {
  border-color: var(--btn-primary-bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.recipe-card:hover .card-media img {
  transform: scale(1.03);
}

.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--frame);
  color: var(--nav-active-text);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 4px 9px;
  border-left: 2px solid var(--nav-active-bar);
}

.card-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Playfair stops below 24px per Decus v4: card titles use Inter 20px */
.card-title {
  font-family: var(--font-body);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 8px;
  color: var(--text);
}

.card-excerpt {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex: 1;
}

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

.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--surface);
  display: none;
}

/* Recipe Page Header */
.recipe-header {
  max-width: 820px;
  margin-bottom: 24px;
}

/* KPI / Metadata Strip */
.meta-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--surface);
  border: 1px solid var(--border-tile);
  margin-bottom: 28px;
}

.meta-item {
  padding: 15px 18px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.meta-item:last-child {
  border-right: none;
}

.meta-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  font-weight: 600;
}

.meta-value {
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* 3-Photo Architectural Gallery */
.gallery {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  grid-template-rows: 250px 250px;
  gap: 12px;
  margin-bottom: 44px;
}

.photo-card {
  position: relative;
  overflow: hidden;
  background: var(--surface-subtle);
  border: 1px solid var(--border-tile);
  cursor: zoom-in;
}

.photo-card.hero {
  grid-row: 1 / span 2;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.photo-card:hover img {
  transform: scale(1.025);
}

.photo-caption {
  position: absolute;
  left: 0;
  bottom: 0;
  background: rgba(6, 21, 41, 0.84);
  color: #faf9f7;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-top: 2px solid var(--nav-active-bar);
}

/* Main 2-Column Recipe Layout */
.recipe-body {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 48px;
  align-items: start;
}

/* Ingredients + Bring! Selection Panel */
.ingredients-panel {
  position: sticky;
  top: 76px;
  background: var(--surface);
  border: 1px solid var(--border-tile);
  box-shadow: var(--shadow-sm);
}

.panel-header {
  padding: 18px 22px;
  background: var(--frame);
  color: var(--nav-active-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-header h2 {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--nav-active-text);
}

.scaler-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.scaler-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--nav-text);
}

.scaler {
  display: inline-flex;
  border: 1px solid var(--frame-divider);
}

.scaler button {
  border: none;
  background: transparent;
  min-width: 30px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--nav-text);
  cursor: pointer;
}

.scaler button.active {
  background: var(--nav-active-bar);
  color: #ffffff;
}

.selection-bar {
  padding: 11px 22px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.selection-actions {
  display: flex;
  gap: 12px;
}

.text-btn {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-gold);
  cursor: pointer;
  padding: 0;
}

.text-btn:hover {
  text-decoration: underline;
}

.ingredients-scroll {
  padding: 20px 22px;
}

.ingredient-group {
  margin-bottom: 20px;
}

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

.ingredient-group h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.ingredient-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ingredient-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 10px;
  margin: 0 -10px;
  border-left: 3px solid transparent;
  font-size: 14px;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.ingredient-list li.selected {
  background: var(--row-selected-bg);
  border-left-color: var(--nav-active-bar);
}

.ingredient-list input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--btn-primary-bg);
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.ingredient-list label {
  cursor: pointer;
  flex: 1;
}

.qty {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* Bring! Action Footer inside Ingredients Panel */
.bring-panel {
  padding: 16px 22px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bring-panel .btn-primary {
  width: 100%;
}

.bring-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.bring-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--border-strong);
  margin-right: 6px;
}

.bring-status-dot.connected {
  background: #2e7d54;
}

/* Instructions Column */
.instructions-section h2 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.steps {
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 18px;
  align-items: start;
}

/* Step icon: single digit "1" (no leading zero) in lighter gold */
.steps li::before {
  content: counter(step);
  width: 36px;
  height: 36px;
  background: var(--frame);
  color: var(--gold-light);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-content strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.step-content p {
  color: var(--text-muted);
  font-size: 15px;
}

/* Inline Chef Recommendation Attribution in Gold */
.chef-ref {
  color: var(--text-gold);
  font-weight: 500;
}

.chef-ref a {
  color: var(--text-gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chef-ref a:hover {
  color: var(--btn-primary-bg-hover);
}

/* Footer */
.recipe-footer,
.site-footer {
  margin-top: 60px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Modal (Bring! Connect) & Lightbox */
.modal-backdrop,
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 10, 20, 0.78);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open,
.lightbox.open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface-raised);
  border: 1px solid var(--border-popover);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 18px 22px;
  background: var(--frame);
  color: var(--nav-active-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--nav-text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.modal-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-body p {
  font-size: 13px;
  color: var(--text-muted);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.field input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-tile);
  background: var(--input-bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
}

.field input:focus {
  outline: none;
  border-color: var(--btn-primary-bg);
}

.modal-error {
  padding: 10px 12px;
  background: var(--badge-error-bg);
  color: var(--badge-error-text);
  border: 1px solid var(--badge-error-border);
  font-size: 13px;
  display: none;
}

.modal-footer {
  padding: 14px 22px;
  background: var(--surface-subtle);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Lightbox */
.lightbox-content {
  max-width: 980px;
  width: 100%;
  text-align: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 82vh;
  border: 1px solid var(--border-popover);
  box-shadow: var(--shadow-lg);
}

.lightbox-caption {
  color: #faf9f7;
  font-size: 13px;
  margin-top: 12px;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: var(--frame);
  color: #faf9f7;
  border: 1px solid var(--frame-divider);
  width: 40px;
  height: 40px;
  font-size: 22px;
  cursor: pointer;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  left: 20px;
  margin-left: auto;
  z-index: 120;
  background: var(--toast-bg);
  color: var(--toast-text);
  border: 1px solid var(--border-popover);
  border-left: 3px solid var(--nav-active-bar);
  padding: 14px 18px;
  box-shadow: var(--shadow-md);
  font-size: 13px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: 440px;
}

.toast.open {
  display: flex;
}

.toast a {
  color: var(--gold-light);
  font-weight: 600;
  text-decoration: underline;
  white-space: nowrap;
}

/* Responsive Tablet & Mobile */
@media (max-width: 900px) {
  .meta-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  .meta-item {
    border-bottom: 1px solid var(--border);
  }
  .gallery {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 240px 160px;
  }
  .photo-card.hero {
    grid-column: 1 / span 2;
    grid-row: 1;
  }
  .recipe-body {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .ingredients-panel {
    position: static;
  }
}

/* Mobile Compact Tiles */
@media (max-width: 640px) {
  .container {
    padding: 20px 14px 64px;
  }
  .topbar-inner {
    padding: 0 14px;
    height: 52px;
  }
  .request-form {
    flex-direction: column;
    align-items: stretch;
  }
  .recipe-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .card-media {
    aspect-ratio: 4 / 3;
  }
  .card-badge {
    top: 6px;
    left: 6px;
    font-size: 9px;
    padding: 2px 6px;
  }
  .card-body {
    padding: 10px 11px 12px;
  }
  .card-title {
    font-size: 14px;
    line-height: 1.25;
    margin-bottom: 6px;
  }
  .card-excerpt {
    display: none;
  }
  .card-meta {
    font-size: 11px;
    padding-top: 8px;
  }
  .gallery {
    grid-template-rows: 200px 130px;
    gap: 8px;
    margin-bottom: 28px;
  }
  .steps li {
    grid-template-columns: 30px 1fr;
    gap: 12px;
  }
  .steps li::before {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }
}
