/* =================================================================
   Myrvann Cacao - product page section styling
   DELTA over the theme base (see .claude/theme.md -> "Build on the base").
   The theme already gives: Roca headings, new-spirit body, muted-brown
   palette, core drop-caps. We add only what it doesn't: uppercase-sans
   chrome, accent colours, borders/dividers, the hero mask, spacing.
   No font-family re-declared where the base already cascades it.
   No widths - Gutenberg align handles content width.
   Faces come from type slots and routes (plugins/docs/type-slots/spec.md),
   through the same fallback chains as Ousia's type() mixin; the literal at
   the end of each chain is today's value, so the page looks the same until
   a slot is filled (a Font Lab preset, or phase 4 of the spec).
   ================================================================= */


/* --- Slot fills, on the variant wrappers only (spec 2 rule 6) -----
   The voice is the theme's (css/type.css, preset "Juice contrast": the hand
   that writes quotes, terroir terms and the Q&A). This page used to fill it
   with New Spirit Condensed, from when the theme left voice unfilled. */
.variant {
  /* label route re-pointed at ui: these labels have always been Mendl caps, not the mark default */
  --font-family-label: var(--font-family-ui);
}


/* --- Editorial chrome: uppercase sans over the serif base ---------
   Base renders these as sentence-case new-spirit; the delta is the
   uppercase label treatment + accent. Label route. ----------------------- */

.variant-label,
.kicker,
.family-kicker,
.note-label {
  font-family: var(--font-family-label, var(--font-family-mark, var(--font-family-heading, var(--font-family-system))));
  font-weight: var(--font-weight-label, var(--font-weight-mark, var(--font-weight-heading, 500)));
  text-transform: var(--text-transform-label, var(--text-transform-mark, var(--text-transform-heading, uppercase)));
  color: var(--text-color-muted);
}

.variant-label {
  display: inline-block;
  /* exception: tracking of a label set by class (labels were not unified in this pass) */
  letter-spacing: 0.2em;
  opacity: 0.7;
  margin: 0 0 2em;
  padding: 0.5em 0 0.5em 0.9em;
  border-left: 2px solid var(--color-terracotta-light);
}

.kicker {
  /* exception: tracking of a label set by class (labels were not unified in this pass) */
  letter-spacing: 0.24em;
  margin: 0 0 0.8em;
}

/* Subhead: Voice block style (is-style-voice) gives the face; the page adds
   italic, and keeps the light weight it inherited before (Voice says 500) */
.variant .subhead {
  font-weight: var(--font-weight-voice, var(--font-weight-heading, 100));
  font-style: var(--font-style-voice, var(--font-style-heading, italic));
  color: var(--color-terracotta-dark);
  margin: 0.4em 0 2em;
}

/* Display headings - colour delta only; heading slot comes from the base. Sizes come
   from the scale (kaupang-docs#32): "Flyt" picks step 6 on its block, the two
   section headings take the theme's h2 role (step 4). */
.variant-hero-b .display {
  /* exception: the display word's own tight cut */
  letter-spacing: -0.03em;
  color: var(--color-brown-800);
  margin: 0 0 var(--air-line); /* one line to the lede it opens (the subhead that sat between them is gone) */
}

.variant-ing-b .display {
  color: var(--color-brown-800);
  margin: 0.1em 0 0.6em;
}

.variant-kj-c .display {
  color: var(--color-brown-900);
  margin: 0 0 var(--air-group);
}

/* Drop-cap: deliberate override of core's inherited serif -> heading strong + accent */
.variant-hero-b .lede.has-drop-cap::first-letter,
.variant-kj-c .main-text .lede.has-drop-cap::first-letter {
  font-family: var(--font-family-heading, var(--font-family-system));
  font-weight: var(--font-weight-heading-strong, 700);
  float: left;
  /* exception: a drop cap, sized and seated against its own paragraph */
  font-size: 4em;
  line-height: 0.85; /* exception: a drop cap, sized and seated against its own paragraph */
  margin: 0.05em 0.12em -0.05em 0;
  color: var(--color-terracotta);
}


/* --- Section 01 - Hero --------------------------------------------- */

/* block padding is the theme's (the air ladder); the page keeps the side gutter */
.variant-hero-b .wp-block-media-text__content { padding-inline: 3rem; }

.variant-hero-b .lede.has-drop-cap {
  margin-bottom: 1.4em;
}


/* --- Section 02 - Ingredienser (to familier) ---------------------- */

.variant-ing-b.families .wp-block-media-text__content { padding-inline: 3rem; }

/* width: the media-text content column shrinks the grid to fit-content, which
   left each column too narrow for "Grunnlaget" on one line; fill the box instead */
.variant-ing-b .families-grid { gap: var(--air-group); margin-top: var(--air-line); width: 100%; }

.variant-ing-b .family {
  padding: 1.4rem 0 0;
  border-top: 2px solid var(--border-color);
}

.variant-ing-b .family-sopp   { border-top-color: var(--color-sage-dark); }
.variant-ing-b .family-bearer { border-top-color: var(--color-terracotta-dark); }

.variant-ing-b .family-kicker {
  /* exception: tracking of a label set by class (labels were not unified in this pass) */
  letter-spacing: 0.24em;
  margin: 0 0 0.4em;
}

/* family-name is an h3 -> heading slot from base; it picks step 2 on its block; colour delta only */
.variant-ing-b .family-name { margin: 0.1em 0 0.9em; }
.variant-ing-b .family-sopp   .family-name { color: var(--color-sage-dark); }
.variant-ing-b .family-bearer .family-name { color: var(--color-terracotta-dark); }

/* list -> ledger rows */
.variant-ing-b .family ul.wp-block-list { list-style: none; margin: 0; padding: 0; }
.variant-ing-b .family li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border-color-light);
}
.variant-ing-b .family li:last-child { border-bottom: 0; }
.variant-ing-b .family li strong { font-weight: 500; color: var(--color-brown-800); }


/* --- Section 03 - For kjennere (field notes) ---------------------- */

/* Two sections on the page's own ground, which the theme cannot see: each
   takes the shared-ground step as its space-before (the air ladder, Ousia
   _var.scss). The second is the mushroom part, opening on its «Sopp» heading. */
.variant-kj-c,
.variant-kj-c + h2 { margin-block-start: var(--air-shared); }

.variant-kj-c .field-notes-grid { gap: var(--air-group); align-items: flex-start; }

.variant-kj-c .main-text .lede.has-drop-cap { margin-bottom: 1.4em; }
.variant-kj-c .main-text > p { margin-bottom: 1.2em; }

/* pullquote -> left terracotta bar, left-aligned (override core's centred frame) */
.variant-kj-c .pull {
  border-left: 3px solid var(--color-terracotta);
  padding: 0.4rem 0 0.4rem 1.5rem;
  margin: var(--air-line) 0;
  background: transparent;
}
.variant-kj-c .main-text > :last-child { margin-block-end: 0; }
.variant-kj-c .pull blockquote { border: 0; margin: 0; padding: 0; }
/* quote route (-> voice) */
.variant-kj-c .pull blockquote p {
  font-family: var(--font-family-quote, var(--font-family-voice, var(--font-family-heading, var(--font-family-system))));
  font-style: var(--font-style-quote, var(--font-style-voice, var(--font-style-heading, italic)));
  color: var(--color-terracotta-dark);
  text-align: left;
  margin: 0;
}

/* margin column */
.variant-kj-c .margin-notes {
  padding: 0.6rem 0 0.6rem 2rem;
  border-left: 1px solid var(--border-color-light);
}
.variant-kj-c .note-label {
  /* exception: tracking of a label set by class (labels were not unified in this pass) */
  letter-spacing: 0.24em;
  margin: 0 0 1.4em;
}
.variant-kj-c .note {
  margin: 0 0 1.3em;
  padding-bottom: 1em;
  border-bottom: 1px dashed var(--border-color-light);
}
.variant-kj-c .note:last-of-type { border-bottom: 0; }
/* the section's edge is its last note's text: no trailing space of its own */
.variant-kj-c .margin-notes > :last-child { margin-bottom: 0; padding-bottom: 0; }
/* terroir terms: voice at strong, italic */
.variant-kj-c .note strong {
  font-family: var(--font-family-voice, var(--font-family-heading, var(--font-family-system)));
  font-weight: var(--font-weight-voice-strong, var(--font-weight-heading-strong, 500));
  font-style: var(--font-style-voice, var(--font-style-heading, italic));
  color: var(--color-terracotta-dark);
}
.variant-kj-c .note.marginalia {
  font-style: italic;
  color: var(--text-color-muted);
  border-bottom: 0;
  margin-top: 0.4em;
  padding-top: 0.6em;
}


/* --- Mobile collapse (winners only) ------------------------------- */

/* 781px = WP's column-stacking breakpoint (columns collapse to 1-up here).
   Side gutter is handled by the theme's --wide-width token, not here. */
@media (max-width: 781px) {
  .variant-hero-b .wp-block-media-text__content,
  .variant-ing-b.families .wp-block-media-text__content { padding-inline: 1.5rem; }

  .variant-kj-c .margin-notes {
    border-left: 0;
    border-top: 1px solid var(--border-color-light);
    padding: var(--air-line) 0 0;
  }
}
