/* The label is an estimate for home cooks, with its basis disclosed alongside it. */
.nutrition-section {
  display: grid;
  grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
  align-items: start;
  gap: 1.25rem 2rem;
  margin: 2.5rem 0;
  padding-top: 2rem;
  border-top: 2px solid currentColor;
  min-width: 0;
}

.nutrition-section > h2,
.nutrition-section > .nutrition-controls,
.nutrition-section > [data-nutrition-status] {
  grid-column: 1 / -1;
  margin: 0;
}

.nutrition-section > h2 {
  font-size: clamp(1.8rem, 4vw, 2.25rem);
  line-height: 1.2;
}

.nutrition-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem .75rem;
  font-size: 1.05rem;
}

.nutrition-controls label { font-weight: 700; }

.nutrition-controls select {
  width: auto;
  max-width: 100%;
  min-height: 2.75rem;
  padding: .5rem 2rem .5rem .75rem;
  border: 1px solid #544331;
  border-radius: .25rem;
  background-color: #fff;
  color: #171717;
  font: inherit;
}

.nutrition-controls select:focus-visible {
  outline: 3px solid #805016;
  outline-offset: 3px;
}

.nutrition-panels,
.nutrition-panel,
.nutrition-notes { min-width: 0; }

.nutrition-label {
  box-sizing: border-box;
  width: 100%;
  max-width: 22rem;
  padding: .7rem .8rem .65rem;
  border: 2px solid #111;
  background: #fff;
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
  font-size: .95rem;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.nutrition-label h3 {
  margin: 0;
  padding: 0 0 .25rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(1.8rem, 5.5vw, 2.4rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.04em;
}

.nutrition-label p { margin: 0; }

.nutrition-estimate {
  padding: .1rem 0 .45rem;
  font-size: .8rem;
}

.nutrition-serving {
  margin-top: .15rem !important;
  font-weight: 700;
}

.nutrition-batch { padding: .2rem 0 .4rem; }

.nutrition-calories {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  padding: .2rem 0 .3rem;
  border-top: .55rem solid #111;
  border-bottom: .3rem solid #111;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.15;
}

.nutrition-calories strong { font-size: 2.05rem; }

.nutrition-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  table-layout: auto;
  color: inherit;
  font: inherit;
}

.nutrition-table th,
.nutrition-table td {
  padding: .3rem 0;
  border-bottom: 1px solid #111;
  vertical-align: top;
}

.nutrition-table th {
  text-align: left;
  font-weight: 700;
}

.nutrition-table thead th,
.nutrition-table thead td {
  padding-top: .3rem;
  font-size: .8rem;
  text-align: right;
}

.nutrition-table td {
  padding-left: .35rem;
  text-align: right;
  white-space: nowrap;
  font-weight: 700;
}

.nutrition-table [data-nutrient-value] { font-weight: 400; }
.nutrition-table .nutrition-sub th { padding-left: .85rem; font-weight: 400; }
.nutrition-table .nutrition-rule > * { border-top: .3rem solid #111; }
.nutrition-table .nutrition-protein > * { border-bottom: .45rem solid #111; }
.nutrition-table tbody tr:last-child > * { border-bottom: 0; }

.nutrition-daily-note {
  margin-top: .4rem !important;
  padding-top: .4rem;
  border-top: .3rem solid #111;
  font-size: .75rem;
  line-height: 1.35;
}

.nutrition-notes { font-size: 1.05rem; line-height: 1.5; }
.nutrition-notes p { margin: 0 0 .8rem; }
.nutrition-notes a { text-decoration: underline; text-underline-offset: .15em; }
.nutrition-notes details { margin-top: 1rem; }
.nutrition-notes summary { cursor: pointer; font-weight: 700; }
.nutrition-notes summary:focus-visible { outline: 3px solid #805016; outline-offset: 3px; }
.nutrition-notes details[open] summary { margin-bottom: .65rem; }

.nutrition-ingredients {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: .92rem;
  line-height: 1.35;
}

.nutrition-ingredients th,
.nutrition-ingredients td {
  padding: .5rem .4rem;
  border-bottom: 1px solid #c5b9a6;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.nutrition-ingredients th:first-child,
.nutrition-ingredients td:first-child { padding-left: 0; }
.nutrition-ingredients th:last-child,
.nutrition-ingredients td:last-child { padding-right: 0; }
.nutrition-ingredients th:nth-child(1) { width: 43%; }
.nutrition-ingredients th:nth-child(2) { width: 27%; }
.nutrition-ingredients th:nth-child(3) { width: 30%; }

.nutrition-section [hidden] { display: none !important; }

@media (max-width: 47.99rem) {
  .nutrition-section {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }
  .nutrition-label { max-width: 24rem; }
  .nutrition-notes { grid-column: 1; }
}

@media print {
  .nutrition-section { display: none !important; }
}
