/* ============================================================
   RecipeMemoir — Animated Nutrition Rings (shared styles)
   Bright/light only. Ring color is themed via the SVG stroke
   set in JS (theme accent). Track is a light neutral. No sticky
   or fixed positioning. Responsive, zero horizontal overflow.
   ============================================================ */

.rm-nutrition {
  margin: 2.25rem 0;
  padding: 1.5rem clamp(1rem, 3vw, 1.75rem);
  background: rgba(0, 0, 0, 0.018);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  max-width: 100%;
  box-sizing: border-box;
}

.rm-nutrition-head {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: .01em;
  margin: 0 0 .15rem;
}

.rm-nutrition-sub {
  font-size: .78rem;
  opacity: .62;
  margin: 0 0 1.25rem;
  line-height: 1.45;
}

.rm-rings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 104px), 1fr));
  gap: clamp(.6rem, 2vw, 1.1rem);
  align-items: start;
}

.rm-ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}

.rm-ring-graphic {
  position: relative;
  width: clamp(74px, 18vw, 96px);
  aspect-ratio: 1 / 1;
}

.rm-ring-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.rm-ring-track {
  fill: none;
  stroke: rgba(0, 0, 0, 0.10);
  stroke-width: 6;
}

.rm-ring-arc {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  /* dashoffset is animated inline by JS via requestAnimationFrame */
  transition: stroke-dashoffset 0s;
}

.rm-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.rm-ring-amt {
  font-size: clamp(.82rem, 2.4vw, .98rem);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.rm-ring-label {
  margin-top: .5rem;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .82;
}

.rm-ring-dv {
  margin-top: .1rem;
  font-size: .72rem;
  opacity: .58;
  font-variant-numeric: tabular-nums;
}

/* Trust gate: caveat notes + suppression line. Muted/secondary,
   informative not shouting. */
.rm-nutrition-note {
  margin-top: 1rem;
  font-size: .76rem;
  opacity: .6;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.rm-nutrition-note::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .5;
}
.rm-nutrition-note--rough {
  opacity: .72;
  font-weight: 600;
}
/* Rough estimate: slightly mute the whole ring set so it reads
   as approximate, not precise. */
.rm-nutrition--rough .rm-rings {
  opacity: .82;
}
.rm-nutrition-unavailable {
  margin: .5rem 0 0;
  font-size: .86rem;
  opacity: .6;
  line-height: 1.5;
}

@media (max-width: 420px) {
  .rm-rings {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Phones: same ten nutrients, roughly a third less scroll.

   This block sits between the recipe and the directions you are trying to reach,
   so on a phone it should state its numbers and get out of the way. Every value
   stays visible: the rows just stop being finger-sized list items, which they
   never needed to be since nothing here is tappable.

   Two columns was the obvious idea and it is measurably wrong: at 390px each
   column is ~129px, too narrow for "Vitamin B12 / 0.1mcg / 4% DV" on one line, so
   every row wrapped to three lines and the block grew from 480px to 900px. One
   tight column beats two cramped ones. */
@media (max-width: 640px) {
  .rm-micros {
    margin-top: 1rem;
    padding: .85rem 1rem;
    border-radius: 13px;
  }

  .rm-micros-head { font-size: .9rem; }

  .rm-micros-sub {
    font-size: .7rem;
    margin-bottom: .3rem;
    line-height: 1.35;
  }

  .rm-micros-table { font-size: .78rem; }

  .rm-micros-table th,
  .rm-micros-table td {
    padding: .2rem .25rem;
    line-height: 1.35;
  }

  .rm-micros-dv { font-size: .72rem; }
}

@media (prefers-reduced-motion: reduce) {
  .rm-ring-arc { transition: none; }
}

/* ============================================================
   Micronutrients table (pass 2). Compact two-column table under
   the rings. Bright/light, matches the rings card styling, no
   new hex codes (opacity-modulated currentColor / theme accent).
   ============================================================ */
.rm-micros {
  margin: 1.25rem 0 0;
  padding: 1.25rem clamp(1rem, 3vw, 1.5rem);
  background: rgba(0, 0, 0, 0.018);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  max-width: 100%;
  box-sizing: border-box;
}

.rm-micros-head {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: .01em;
  margin: 0 0 .15rem;
}

/* The head is a <summary>: it opens the panel, so it needs to look openable.
   The default disclosure triangle is replaced with one on the right, which reads
   as a control rather than as bullet punctuation next to the title. */
summary.rm-micros-head {
  display: flex;
  align-items: center;
  gap: .45rem;
  cursor: pointer;
  list-style: none;
}

summary.rm-micros-head::-webkit-details-marker { display: none; }

summary.rm-micros-head::after {
  content: '\25B8';
  margin-left: auto;
  opacity: .45;
  font-weight: 400;
  transition: transform .15s ease;
}

.rm-micros-details[open] > summary.rm-micros-head::after { transform: rotate(90deg); }

/* Count rides on the summary so a collapsed panel still says what is inside. */
.rm-micros-count {
  font-size: .7rem;
  font-weight: 700;
  opacity: .5;
  font-variant-numeric: tabular-nums;
}

.rm-micros-sub {
  font-size: .78rem;
  opacity: .62;
  margin: 0 0 1rem;
  line-height: 1.45;
}

.rm-micros-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

.rm-micros-table tr {
  border-top: 1px solid rgba(0, 0, 0, 0.07);
}

.rm-micros-table tr:first-child {
  border-top: none;
}

.rm-micros-table th,
.rm-micros-table td {
  padding: .45rem .25rem;
  text-align: left;
  font-weight: 400;
}

.rm-micros-table th {
  font-weight: 600;
}

.rm-micros-amt {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.rm-micros-dv {
  font-variant-numeric: tabular-nums;
  text-align: right;
  opacity: .62;
  white-space: nowrap;
}

@media print {
  .rm-micros { display: none; }
}
