/* The hero, receipt and one calculator in "How Much Does Food Delivery Really Cost a Year?".
 *
 * Everything is scoped to .post-page, and every colour, radius and shadow is a token from
 * styles.css, so the light, dark and Auto schemes follow the rest of the site. The receipt is
 * plain HTML and CSS: the only JavaScript on the page powers the calculator below it.
 */

.post-page .food-figure { margin: 26px 0; }
.post-page .food-figure img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--accent);
}

/* ---------------------------------------------------------------- The fictional receipt */

.post-page .food-receipt { max-width: 560px; padding: 20px; }
.post-page .food-receipt-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0 0 14px;
}
.post-page .food-receipt-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.post-page .food-receipt-title { margin: 0; font-weight: 700; line-height: 1.3; }
.post-page .food-receipt-paper {
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--accent);
}
.post-page .food-receipt-label {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.post-page .food-receipt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.post-page .food-receipt-table th,
.post-page .food-receipt-table td {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-weight: 400;
  vertical-align: baseline;
}
.post-page .food-receipt-table th { padding-right: 16px; color: var(--muted); }
.post-page .food-receipt-table td {
  text-align: right;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.post-page .food-receipt-table tbody tr:last-child th,
.post-page .food-receipt-table tbody tr:last-child td { border-bottom: 0; }
.post-page .food-receipt-table tfoot th,
.post-page .food-receipt-table tfoot td {
  padding-top: 10px;
  border-bottom: 0;
  color: var(--text);
  font-weight: 700;
}
.post-page .food-receipt-table tfoot th { font-size: 1rem; }
.post-page .food-receipt-table tfoot td { font-size: 1.12rem; }
.post-page .food-receipt-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.post-page .food-receipt-divider::before,
.post-page .food-receipt-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.post-page .food-receipt-extra {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
}
.post-page .food-receipt-extra span { font-weight: 600; }
.post-page .food-receipt-extra strong {
  font-size: 1.2rem;
  line-height: 1.1;
  color: var(--highlight);
  font-variant-numeric: tabular-nums;
}
.post-page .food-receipt-note {
  margin: 12px 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
}

/* A caption that tells a screen reader what a table holds without repeating the visible labels. */
.post-page .food-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------- The one calculator */

.post-page .food-calc { padding: 22px; }
.post-page .food-calc-head { margin: 0 0 16px; }
.post-page .food-calc-head h3 { margin: 0 0 4px; font-size: 1.15rem; line-height: 1.3; }
.post-page .food-calc-head p { margin: 0; font-size: 0.88rem; line-height: 1.5; color: var(--muted); }
.post-page .food-calc-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}
.post-page .food-calc-controls .field { margin-bottom: 14px; min-width: 0; }
.post-page .food-swap-field { grid-column: 1 / -1; }
.post-page .food-swap-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 6px;
  font-size: 0.9rem;
  font-weight: 600;
}
.post-page .food-swap-label output { font-weight: 700; color: var(--primary); }
.post-page .food-calc-note {
  margin: 0 0 16px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
}

.post-page .food-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.post-page .food-result {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--accent);
}
.post-page .food-result-primary { grid-column: 1 / -1; border-color: var(--primary); }
.post-page .food-result-secondary {
  background: var(--card);
  border-left: 4px solid var(--highlight);
}
.post-page .food-result-subtle {
  grid-column: 1 / -1;
  background: transparent;
  border-style: dashed;
}
.post-page .food-result-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.post-page .food-result-value {
  display: block;
  margin: 5px 0 2px;
  font-size: clamp(1.1rem, 2.6vw, 1.4rem);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.post-page .food-result-primary .food-result-value {
  font-size: clamp(1.7rem, 4.4vw, 2.2rem);
  color: var(--primary);
}
.post-page .food-result-subtle .food-result-value { color: var(--text); }
.post-page .food-result-note {
  display: block;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}
.post-page .food-summary {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--primary);
  border-radius: 0 10px 10px 0;
  background: var(--accent);
  font-size: 0.9rem;
  line-height: 1.55;
}
.post-page .food-calc-noscript {
  margin: 14px 0 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}
/* The reference article's two ways onward share one row with this exact gap. */
.post-page .post-more-actions { margin-top: 10px; }

@media (max-width: 760px) {
  .post-page .food-calc { padding: 18px; }
  .post-page .food-calc-controls { grid-template-columns: minmax(0, 1fr); }
  .post-page .food-results { grid-template-columns: minmax(0, 1fr); }
  .post-page .food-result-primary,
  .post-page .food-result-subtle { grid-column: auto; }
}

@media (max-width: 520px) {
  .post-page .food-receipt { padding: 16px; }
  .post-page .food-receipt-paper { padding: 14px; }
  .post-page .food-receipt-extra { align-items: flex-start; flex-direction: column; gap: 4px; }
  .post-page .food-result { padding: 13px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .post-page .food-calc *,
  .post-page .food-receipt * {
    animation: none !important;
    transition: none !important;
  }
}

