/* ═══════════════════════════════════════════════════════════
   Terracotta & Sage — Rich Layout CSS
   Only active when #layout-rich is visible
   ═══════════════════════════════════════════════════════════ */

/* Background orbs */
.tc-orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(100px);
}
.tc-orb-tr {
  width: 520px; height: 520px;
  background: #faeadb;
  top: -140px; right: -120px;
  opacity: 0.45;
}
.tc-orb-bl {
  width: 420px; height: 420px;
  background: #c8dfc9;
  bottom: -100px; left: -100px;
  opacity: 0.45;
}

#layout-rich {
  position: relative;
  padding: 8px 0 48px;
  font-family: 'Inter', sans-serif;
}

/* ── Header ── */
.tc-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 28px;
}

.tc-logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.tc-chef-icon {
  width: 40px; height: 40px;
  background: #d97b36;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.tc-eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8070;
}

.tc-title {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: #1e1b18;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0 0 6px 0;
}

.tc-subtitle {
  font-size: 0.95rem;
  color: #8a8070;
  margin: 0;
}

.tc-header-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.tc-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid #e2ddd4;
  background: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  color: #524b41;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}
.tc-btn-outline:hover {
  background: #f9f7f2;
  border-color: #c9c2b5;
  color: #1e1b18;
}

.tc-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 10px;
  border: none;
  background: #d97b36;
  font-size: 0.85rem;
  font-weight: 600;
  color: white;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(217,123,54,0.25);
}
.tc-btn-primary:hover {
  background: #c46528;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(217,123,54,0.3);
}

/* ── Category pills ── */
.tc-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 16px;
}

.tc-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  border: 1px solid #e2ddd4;
  background: #fff;
  color: #524b41;
  cursor: default;
}

.tc-pill-active {
  background: #d97b36;
  color: white;
  border-color: #d97b36;
}

/* ── Shortfall banner (B53: partial menu generation notice) ── */
.tc-shortfall-banner {
  background: #fdf1e4;
  color: #8a5a2b;
  border: 1px solid #ecb488;
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
}

.tc-shortfall-banner button {
  color: #a34e23;
}

/* ── Day navigation ── */
.tc-day-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 28px;
  scrollbar-width: none;
}
.tc-day-nav::-webkit-scrollbar { display: none; }

.tc-day-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 58px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 2px solid transparent;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.tc-day-btn:hover {
  border-color: #e2ddd4;
  background: #fdf5f0;
}
.tc-day-active {
  background: #fdf5f0;
  border-color: #ecb488 !important;
}
.tc-day-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #a69d8e;
  display: block;
}
.tc-day-active .tc-day-label { color: #c46528; }
.tc-day-num {
  font-size: 1.1rem;
  font-weight: 700;
  color: #524b41;
  display: block;
}
.tc-day-active .tc-day-num { color: #a34e23; }

/* ── Cards grid ── */
.tc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

@media (min-width: 768px)  { .tc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .tc-grid { grid-template-columns: repeat(3, 1fr); } }

/* Card animations */
@keyframes tcFadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tc-card-anim { animation: tcFadeUp 0.55s ease-out both; }
.tc-card-delay-1 { animation-delay: 0.00s; }
.tc-card-delay-2 { animation-delay: 0.08s; }
.tc-card-delay-3 { animation-delay: 0.16s; }
.tc-card-delay-4 { animation-delay: 0.24s; }
.tc-card-delay-5 { animation-delay: 0.32s; }
.tc-card-delay-6 { animation-delay: 0.40s; }

.tc-card {
  background: #fff;
  border-radius: 20px;
  border: 1px solid #ede8e1;
  box-shadow: 0 4px 6px -1px rgba(30,27,24,0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), box-shadow 0.35s cubic-bezier(0.4,0,0.2,1);
}
.tc-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -12px rgba(30,27,24,0.12);
}
.tc-card:hover .tc-card-img {
  transform: scale(1.05);
}

/* Card image */
.tc-card-img-wrap {
  position: relative;
  height: 176px;
  overflow: hidden;
  background: linear-gradient(135deg, #f4d0b5 0%, #c7d7c8 100%);
  flex-shrink: 0;
}

.tc-card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4,0,0.2,1);
}

.tc-card-img-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tc-placeholder-icon {
  font-size: 3.5rem;
  opacity: 0.5;
}

.tc-card-img-overlay {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px;
  pointer-events: none;
}

.tc-day-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(4px);
  font-size: 0.75rem;
  font-weight: 600;
  color: #1e1b18;
}

.tc-time-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(82,127,87,0.9);
  backdrop-filter: blur(4px);
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
}

/* Card body */
.tc-card-body {
  padding: 18px 20px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tc-card-title {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #1e1b18;
  line-height: 1.45;
  margin: 0;
  letter-spacing: -0.01em;
}

.tc-card-desc {
  font-size: 0.83rem;
  color: #8a8070;
  line-height: 1.6;
  margin: 0;
  flex: 1;
}

.tc-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #f0ece6;
  margin-top: auto;
}

.tc-card-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.tc-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  background: #fdf5f0;
  color: #a34e23;
}

.tc-recipe-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.83rem;
  font-weight: 600;
  color: #d97b36;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}
.tc-recipe-link:hover {
  color: #a34e23;
}
.tc-arrow {
  transition: transform 0.2s;
  display: inline-block;
}
.tc-recipe-link:hover .tc-arrow {
  transform: translateX(4px);
}

/* ── Weekly summary ── */
.tc-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background: #fff;
  border: 1px solid #ede8e1;
  border-radius: 20px;
  padding: 24px 28px;
  margin-bottom: 16px;
  box-shadow: 0 2px 6px rgba(30,27,24,0.04);
}

.tc-summary-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e1b18;
  margin: 0 0 4px 0;
}
.tc-summary-sub {
  font-size: 0.83rem;
  color: #8a8070;
  margin: 0;
}

.tc-summary-stats {
  display: flex;
  align-items: center;
  gap: 20px;
}

.tc-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.tc-stat-icon { font-size: 1rem; }
.tc-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e1b18;
  line-height: 1;
}
.tc-stat-label {
  font-size: 0.7rem;
  color: #a69d8e;
}
.tc-stat-divider {
  width: 1px; height: 36px;
  background: #e2ddd4;
}

/* ── Shopping CTA ── */
.tc-cta {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(135deg, #c46528 0%, #d97b36 100%);
  padding: 28px 32px;
  margin-top: 4px;
}

.tc-cta-orb {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  pointer-events: none;
}
.tc-cta-orb-tr { width: 140px; height: 140px; top: -40px; right: -20px; }
.tc-cta-orb-bl { width: 110px; height: 110px; bottom: -30px; left: -20px; }

.tc-cta-inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.tc-cta-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: white;
  margin: 0 0 4px 0;
}
.tc-cta-sub {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.8);
  margin: 0;
}

.tc-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 12px;
  background: white;
  color: #a34e23;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(100,40,0,0.15);
}
.tc-cta-btn:hover {
  background: #fdf5f0;
  color: #a34e23;
  transform: translateY(-1px);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .tc-header { flex-direction: column; align-items: flex-start; }
  .tc-header-actions { width: 100%; }
  .tc-btn-outline, .tc-btn-primary { flex: 1; justify-content: center; }
  .tc-summary { flex-direction: column; align-items: flex-start; }
  .tc-cta { padding: 22px 20px; }
  /* B47: .tc-grid's base minmax(300px, 1fr) forces every card to at least
     300px wide even on phones narrower than that (320-375px is common),
     causing the grid - and the whole page - to overflow horizontally.
     Drop to a single, fully flexible column below 640px, matching how
     .menu-grid already behaves in the standard layout. */
  .tc-grid { grid-template-columns: 1fr; }
}
