/* ==========================================================================
   Dine with Junn V2 — Clean Modern Food Diary Stylesheet
   ========================================================================== */

.month-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* --- Month Navigation Header (3-way transition) --- */
.month-nav-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  box-shadow: var(--card-shadow);
}

.month-nav-prev {
  text-align: left;
}

.month-nav-hub {
  text-align: center;
}

.month-nav-next {
  text-align: right;
}

.nav-month-btn, .nav-hub-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.nav-month-btn:hover, .nav-hub-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.nav-hub-btn {
  background: var(--bg-card-muted);
  border: 1px solid var(--border-subtle);
}

/* --- Header Card --- */
.month-header-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: var(--card-shadow);
}

.month-header-badge {
  align-self: flex-start;
  background: var(--accent-warm-subtle);
  color: var(--accent-warm);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.month-main-title {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.month-meta-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--bg-card-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1.25rem;
}

.nom-nom-stat {
  font-size: 0.95rem;
}

.nom-nom-stat .stat-label {
  color: var(--text-muted);
}

.nom-nom-stat .stat-value {
  color: var(--text-primary);
  font-weight: 700;
  margin-left: 0.3rem;
}

.reasons-box strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.reasons-list {
  list-style: none;
  list-style-type: none;
  padding-left: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.intro-prose-box {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.25rem;
}

.intro-prose-box h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-warm);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.intro-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
}

.intro-text p,
.outro-prose-col p,
.meal-description p {
  margin-bottom: 0.95rem;
}

.intro-text p:last-child,
.outro-prose-col p:last-child,
.meal-description p:last-child {
  margin-bottom: 0;
}

/* --- Daily Meal Stream --- */
.daily-stream {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.day-group {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  scroll-margin-top: 5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.day-group:target,
.day-group.highlight-glow {
  scroll-margin-top: 5rem;
  animation: day-target-glow 2.5s ease-out;
}

@keyframes day-target-glow {
  0% {
    outline: 2px solid var(--accent-warm);
    background: var(--accent-warm-subtle);
  }
  70% {
    outline: 2px solid var(--accent-warm-subtle);
    background: var(--accent-warm-subtle);
  }
  100% {
    outline: 2px solid transparent;
    background: transparent;
  }
}

.day-heading {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent-warm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.meals-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.meal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  display: flex;
  gap: 1.5rem;
  box-shadow: var(--card-shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.meal-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--card-shadow-hover);
}

.meal-media {
  flex-shrink: 0;
  width: 250px;
  height: 250px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card-muted);
  border: 1px solid var(--border-subtle);
}

.meal-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.meal-details {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.meal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.meal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.dish-name {
  color: var(--text-primary);
}

.vendor-tag {
  color: var(--accent-warm);
  font-weight: 600;
  font-size: 0.95rem;
  margin-left: 0.3rem;
}

.meal-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-green);
  flex-shrink: 0;
}

.meal-price s {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-right: 0.25rem;
}

.meal-type-badge {
  align-self: flex-start;
  background: var(--bg-card-muted);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
}

.meal-description-wrapper {
  margin-top: 0.2rem;
}

.meal-description {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.65;
}

.meal-description small,
.intro-text small,
.outro-prose small {
  font-size: 0.84em;
  color: var(--text-muted);
  display: inline;
}

.itemized-bullets {
  list-style: none;
  list-style-type: none;
  padding-left: 1.5rem;
  margin: 0.45rem 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

/* --- Date Lore & Inline Links --- */
.date-lore-link,
.inline-link {
  color: var(--accent-blue, #0284c7);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  font-weight: 500;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.date-lore-link:hover,
.inline-link:hover {
  color: var(--accent-warm, #ea580c);
  text-decoration-thickness: 2px;
}

/* --- Collapsible Long Reviews --- */
.meal-description.is-collapsible {
  position: relative;
  max-height: 185px;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.meal-description.is-collapsible::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(transparent, var(--bg-surface));
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.meal-description.is-expanded {
  max-height: none;
  overflow: visible;
}

.meal-description.is-expanded::after {
  opacity: 0;
}

.description-toggle {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.25rem 0.65rem;
  background: var(--bg-card-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.description-toggle:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* --- Outro Retrospective & Spending Summary (2-Row Layout) --- */
.outro-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.outro-top-row {
  display: flex;
  gap: 1.5rem;
  align-items: stretch;
}

.outro-media {
  flex-shrink: 0;
  width: 300px;
  height: 300px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card-muted);
  border: 1px solid var(--border-subtle);
}

.outro-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.outro-prose-col {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.outro-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.description-scrollbox {
  height: 245px;
  max-height: 245px;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-card-muted);
  line-height: 1.7;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.description-scrollbox::-webkit-scrollbar {
  width: 6px;
}

.description-scrollbox::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

/* Spending Summary Box - Full Width Bottom Row */
.spending-summary-box {
  width: 100%;
  background: var(--bg-card-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
}

.spending-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 0.85rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.spending-header-row h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.cash-damage-badge {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.25);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.damage-label {
  font-size: 0.75rem;
  color: #dc2626;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.damage-amount {
  font-size: 1.15rem;
  font-weight: 800;
  color: #dc2626;
}

.spending-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.stat-pure-food {
  color: var(--accent-warm);
  font-size: 1rem;
}

.stat-avg-day {
  color: var(--text-primary);
  font-weight: 500;
}

.avg-note {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-left: 0.25rem;
}

.etc-nested-list {
  list-style-type: disc;
  padding-left: 1.25rem;
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

/* --- Chart Section --- */
.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: var(--card-shadow);
}

.chart-header {
  margin-bottom: 1.25rem;
}

.chart-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.chart-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

/* --- Responsive Breakpoints --- */
@media (max-width: 768px) {
  .month-nav-header { grid-template-columns: 1fr; text-align: center; }
  .month-nav-prev, .month-nav-next { text-align: center; }
  .meal-card { flex-direction: column; }
  .meal-media { width: 100%; height: 200px; }
  .outro-top-row { flex-direction: column; }
  .outro-media { width: 100%; height: 220px; }
  .month-header-card { padding: 1.25rem; }
  .month-main-title { font-size: 1.65rem; }
  .day-group, .day-group:target { scroll-margin-top: 4.25rem; }
}
