/* ========================================
   NUTRITION FACTS — reusable label component
   Used by cocktails/*.html (inside .product-nutrition) and nutrition.html.

   The black-on-white panel deliberately follows the customer's FDA-style
   label (heavy bars, bold nutrient names, indented sub-rows, right-aligned
   % Daily Value). Everything around the panel uses the site's design tokens.
   ======================================== */

.nutrition-label {
  container-type: inline-size;   /* panel type + bars scale with the label width */
  width: 100%;
  max-width: 22.5rem;
  margin-inline: auto;
  text-align: left;
}

.nutrition-facts {
  --nf-ink: #000;
  --nf-paper: #fff;
  --nf-rule: 1px;                              /* hairline between rows */
  --nf-bar: clamp(4px, 1.5cqi, 6px);           /* medium bar (under Calories, above footnote) */
  --nf-bar-thick: clamp(9px, 3.6cqi, 13px);    /* heavy bar (under serving size, after Protein) */
  --nf-indent: 1em;

  font-family: 'Helvetica Neue', Helvetica, Arial, 'Liberation Sans', Roboto, sans-serif;
  font-size: clamp(0.875rem, 4.4cqi, 1rem);
  font-weight: 400;
  font-style: normal;
  line-height: 1.25;
  letter-spacing: normal;
  text-transform: none;
  color: var(--nf-ink);
  background: var(--nf-paper);
  border: 1px solid var(--nf-ink);
  padding: 0.2em 0.5em 0.5em;
  box-shadow: var(--shadow-md);
}

/* Keep site-wide element styles (weight, measure, wrapping) from leaking into the panel.
   Zero-specificity :where() so the component rules below always win. */
.nutrition-facts :where(h2, h3, p, table, caption, thead, tbody, tr, th, td, b, i, span) {
  font: inherit;
  letter-spacing: inherit;
  text-transform: none;
  text-align: inherit;
  color: inherit;
  max-width: none;
  margin: 0;
}

.nutrition-facts b {
  font-weight: 900;
}

.nutrition-facts i {
  font-style: italic;
}

.nutrition-facts__title {
  font-size: 11.2cqi;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.01em;
  white-space: nowrap;
  padding-bottom: 0.04em;
  border-bottom: var(--nf-rule) solid var(--nf-ink);
}

.nutrition-facts__servings {
  font-size: 1.2em;
  padding-top: 0.15em;
}

.nutrition-facts__size {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5em;
  font-size: 1.2em;
  font-weight: 900;
  padding-bottom: 0.1em;
  border-bottom: var(--nf-bar-thick) solid var(--nf-ink);
}

.nutrition-facts__amount {
  font-size: 0.9em;
  font-weight: 900;
  padding-top: 0.3em;
}

.nutrition-facts__calories {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5em;
  font-weight: 900;
  line-height: 1;
  padding-bottom: 0.08em;
  border-bottom: var(--nf-bar) solid var(--nf-ink);
}

.nutrition-facts__calories-label {
  font-size: 2.1em;
}

.nutrition-facts__calories-value {
  font-size: 3em;
  letter-spacing: -0.01em;
}

/* Nutrient table */
.nutrition-facts__table {
  width: 100%;
  border-collapse: separate;   /* per-cell borders: predictable rules, incl. the indented one */
  border-spacing: 0;
}

.nutrition-facts__table th,
.nutrition-facts__table td {
  padding: 0.2em 0;
  border-top: var(--nf-rule) solid var(--nf-ink);
  vertical-align: baseline;
}

.nutrition-facts__table th {
  text-align: left;
}

.nutrition-facts__table td {
  text-align: right;
  white-space: nowrap;
  padding-left: 0.5em;
  font-weight: 900;
}

/* "% Daily Value*" header row sits directly under the medium bar. It stays the real
   column header of the % column, but its text overhangs the empty cell to its left
   (as on the label) instead of widening the narrow % column on small phones. */
.nutrition-facts__table thead th,
.nutrition-facts__table thead td {
  border-top: 0;
  padding: 0;
  height: 1.55em;
  font-size: 0.9em;
  font-weight: 900;
  text-align: right;
}

.nutrition-facts__table thead th {
  position: relative;
}

.nutrition-facts__table thead th > span {
  position: absolute;
  right: 0;
  bottom: 0.15em;
  white-space: nowrap;
}

.nutrition-facts__table .nf-sub > th {
  padding-left: var(--nf-indent);
}

/* "Includes Xg Added Sugars": double indent, and its rule starts at the indent (as on the label) */
.nutrition-facts__table .nf-sub2 > th {
  position: relative;
  padding-left: calc(var(--nf-indent) * 2);
  border-top: 0;
}

.nutrition-facts__table .nf-sub2 > th::before {
  content: '';
  position: absolute;
  top: 0;
  left: calc(var(--nf-indent) * 2);
  right: 0;
  border-top: var(--nf-rule) solid var(--nf-ink);
}

/* Vitamins & minerals: heavy bar above, regular-weight %DV, medium bar below */
.nutrition-facts__minerals tr:first-child > * {
  border-top: var(--nf-bar-thick) solid var(--nf-ink);
}

.nutrition-facts__minerals td {
  font-weight: 400;
}

.nutrition-facts__minerals tr:last-child > * {
  border-bottom: var(--nf-bar) solid var(--nf-ink);
}

.nutrition-facts__note {
  font-size: max(0.75rem, 0.78em);
  line-height: 1.3;
  padding-top: 0.4em;
  padding-left: 0.7em;
  text-indent: -0.7em;
}

/* Ingredient statement + manufacturer line, below the panel as on the label */
.nutrition-label__ingredients {
  margin-top: var(--space-5);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: 1.6;
  letter-spacing: 0.04em;
  color: var(--color-text);
}

.nutrition-label__key {
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--color-primary);
}

.nutrition-label__mfr {
  margin-top: var(--space-3);
  font-family: var(--font-body);
  font-size: clamp(0.8125rem, 0.75rem + 0.2vw, 0.875rem);
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}

/* Shared text link (product hero jump link, "compare" links, nutrition page links).
   Matches the site's small-label system (cf. .instagram-section__handle). */
.nutrition-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding-block: var(--space-2);
  font-family: var(--font-body);
  font-size: clamp(0.8125rem, 0.75rem + 0.2vw, 0.9375rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.45em;
}

.nutrition-link:hover {
  color: var(--color-primary-hover);
}

.nutrition-link svg {
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
}

/* ========================================
   NUTRITION PAGE (nutrition.html)
   ======================================== */

.header__nav a[aria-current='page'],
.mobile-nav a[aria-current='page'] {
  color: var(--color-text);
}

.nutrition-hero {
  padding: calc(var(--space-32) + var(--space-4)) var(--space-6) clamp(var(--space-10), 6vw, var(--space-16));
  text-align: center;
}

.nutrition-hero__container {
  max-width: var(--content-narrow);
  margin-inline: auto;
}

.nutrition-hero__title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 500;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-6);
}

.nutrition-hero__text {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.8;
  max-width: 52ch;
  margin-inline: auto;
}

.nutrition-hero__jump {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-8);
}

.nutrition-hero__jump a {
  padding: var(--space-3) var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: clamp(0.8125rem, 0.75rem + 0.2vw, 0.875rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-text-muted);
}

.nutrition-hero__jump a:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.nutrition-lineup {
  padding: clamp(var(--space-12), 6vw, var(--space-20)) var(--space-6) clamp(var(--space-12), 8vw, var(--space-24));
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
}

.nutrition-lineup__grid {
  max-width: var(--content-wide);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-16);
}

.nutrition-product {
  display: flex;
  flex-direction: column;
  align-items: center;
  scroll-margin-top: var(--space-12);
}

.nutrition-product__head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  max-width: 22.5rem;
  margin-bottom: var(--space-6);
  text-decoration: none;
  color: inherit;
}

.nutrition-product__can {
  width: 64px;
  height: 96px;
  object-fit: cover;
  flex-shrink: 0;
}

.nutrition-product__name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.nutrition-product__meta {
  font-family: var(--font-body);
  font-size: clamp(0.8125rem, 0.75rem + 0.2vw, 0.875rem);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* tagline and ABV on their own lines, so all three headers line up at any width */
.nutrition-product__meta span {
  display: block;
}

.nutrition-product__more {
  width: 100%;
  max-width: 22.5rem;
  margin-top: var(--space-6);
}

@media (min-width: 960px) {
  .nutrition-lineup__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-8);
  }
}

@media (max-width: 768px) {
  .nutrition-hero {
    padding-top: calc(var(--space-24) + var(--space-4));
  }

  .nutrition-hero__jump a {
    padding-inline: var(--space-4);
  }
}

/* ========================================
   PRINT — so a printed nutrition sheet shows every panel
   ======================================== */

@media print {
  .header,
  .mobile-nav,
  .age-gate,
  .footer,
  .nutrition-hero__jump,
  .product-hero__link {
    display: none !important;
  }

  /* scroll-driven fade-ins never run on paper; show everything */
  .fade-in {
    opacity: 1 !important;
    animation: none !important;
  }

  .nutrition-hero {
    padding: 0 0 12pt;
  }

  .nutrition-lineup {
    background: none;
    border: 0;
    padding: 0;
  }

  .nutrition-product {
    break-inside: avoid;
  }

  .nutrition-facts {
    box-shadow: none;
  }
}
