/* Asili Coffee, direction t-b "Cobalt on sand": the page's own CSS.
   Only what the kit has no class for: the labelled placeholder frames (the user's decision: no stand-in
   photographs), the product hero's head row and stage around a placeholder (layout.css 3b keys them on an img),
   the FR / NL / EN switcher, the logo as the close's wordmark, and the frames of each section.
   Colours and spacing come from the kit's tokens (--p-*, --s-*) and the custom properties below. */

:root {
  --ph-field: var(--p-surface);     /* the placeholder's flat field: one step off the sand */
  --ph-rule: var(--p-ink);          /* its 1px rule and its label: the logo's cobalt-navy */
  --ph-ink: var(--p-ink);
  --ph-pad: var(--s-4);
  --tap: 44px;                      /* the switcher's tap target */
  --logo-h: 26px;
}
.ground-inverse {
  --ph-field: var(--p-inv-surface); /* on the cobalt band: one step off the navy, the rule and label in sand */
  --ph-rule: var(--p-inv-ink);
  --ph-ink: var(--p-inv-ink);
}
@media (min-width: 1024px) { :root { --ph-pad: var(--s-5); } }
@media (max-width: 639px) { :root { --logo-h: 22px; } }
/* a phone sets the display face narrower on Archivo's own width axis (110% on a desktop), so a headline of 40
   characters, and the longer French and Dutch ones, hold in two lines on 342px */
@media (max-width: 639px) { :root { --display-stretch: 85%; } }

/* ------------------------------------------------ the placeholder frame
   A flat field, a 1px rule, square corners, one translated label at the top-left in the text face. */
.ph {
  position: relative; display: block; min-width: 0; overflow: clip;
  background: var(--ph-field); color: var(--ph-ink);
  border: 1px solid var(--ph-rule); border-radius: 0;
}
.ph__label {
  position: absolute; top: var(--ph-pad); left: var(--ph-pad); right: var(--ph-pad); max-width: 40ch;
  font: 500 var(--t-small)/1.4 var(--font-text); letter-spacing: 0; color: var(--ph-ink); text-wrap: pretty;
}

/* ------------------------------------------------ the logo */
.nav__logo { color: var(--p-ink); }
.nav__logo svg.logo { height: var(--logo-h); width: auto; }

/* ------------------------------------------------ nav-centre with the switcher
   1024-1279: the words sit between the logo and the actions, so the switcher and a longer French or Dutch
   button never reach them */
@media (min-width: 1024px) and (max-width: 1279px) {
  .nav--centre .nav__bar { grid-template-columns: auto minmax(0, 1fr) auto; }
}
.lang { display: flex; align-items: center; }
.lang__btn {
  position: relative; display: inline-grid; place-items: center; min-width: var(--tap); height: var(--tap);
  padding: 0 var(--s-2); border: 0; border-radius: var(--r-sm); background: none; cursor: pointer;
  color: var(--muted); font: 500 15px/1 var(--font-text);
  transition: color var(--dur) var(--ease);
}
.lang__btn::after {
  content: ""; position: absolute; left: var(--s-3); right: var(--s-3); bottom: var(--s-2); height: 2px;
  background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform var(--dur) var(--ease);
}
.lang__btn:hover, .lang__btn[aria-pressed="true"] { color: var(--ink); }
.lang__btn:hover::after, .lang__btn:focus-visible::after { transform: scaleX(1); transform-origin: left; }
.lang__btn[aria-pressed="true"]::after { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) { .lang__btn::after { transition: none; } }
/* a tablet keeps the switcher in the bar beside the main button; a phone has it in the sheet, over the button */
@media (min-width: 640px) and (max-width: 1023px) { .nav:not(.is-open) .nav__actions > .lang { display: flex; } }
@media (max-width: 1023px) { .nav.is-open .nav__actions > .lang { justify-content: center; } }

/* ------------------------------------------------ the product hero: the stage holds an img (a flat placeholder
   file until the photograph lands), so layout.css 3b sets the head row and runs it edge to edge to the fold; the
   translated label lies on it, on the page's left line */
.ph-stage > .ph__label { left: calc((100% - min(100% - 2 * var(--gut), var(--container, 1280px))) / 2); right: auto; }
/* a phone: the stage takes what the words leave, down to the fold */
@media (max-width: 639px) {
  .hero--product > .wrap .hero__stage.ph-stage { flex: 1 1 auto; aspect-ratio: auto; min-height: 200px; margin-bottom: calc(0px - var(--hpadb, 24px)); }
}

/* ------------------------------------------------ #coffees: the spec sheet (comparison-table). The head beside one
   photograph of the line-up, then one table across the .wrap: the coffees as rows, six columns on the column
   lines (span-2 each), each row closed by a hairline */
.spec-top { align-items: start; }
#coffees .spec-top > .section-head { margin-bottom: 0; }
.spec-top > .ph { aspect-ratio: 5 / 3; }
.spec { position: relative; margin-top: var(--s-8); }
.spec__row {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); column-gap: var(--gutter); align-items: start;
  padding-block: var(--s-4); border-bottom: 1px solid var(--line);
}
/* one 26px line for the names (20px) and the values (16px): every cell of a row starts on one top line */
.spec__row:not(.spec__head) > .spec__cell { line-height: 26px; }
.spec__head { padding-top: 0; border-bottom: 0; }
.spec__label { display: none; }
.spec__head > .spec__cell { font: 500 var(--t-label)/1.4 var(--font-text); color: var(--muted); }
.spec__name { font: 500 var(--t-lead)/1.3 var(--font-text); }
@media (min-width: 1024px) and (max-width: 1279px) {
  .spec-top > .ph { aspect-ratio: 2 / 1; }
  .spec { margin-top: var(--s-7); }
  .spec__name { font-size: var(--t-body); }
}
/* a tablet: the three coffees side by side as blocks, each field a line with its name (data-label, translated);
   a phone stacks them. The header row stays for screen readers (the cells keep their column names) and leaves the
   layout */
@media (max-width: 1023px) {
  .spec-top { row-gap: var(--head-gap); }
  .spec-top > .ph { aspect-ratio: 3 / 1; }
  .spec { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: var(--s-7); margin-top: var(--s-7); }
  .spec__head { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .spec__row { grid-template-columns: minmax(0, 1fr); align-content: start; padding-block: 0; border-bottom: 0; }
  .spec__cell { padding-block: var(--s-3); border-bottom: 1px solid var(--line); }
  .spec__cell.spec__name { padding-top: 0; border-bottom: 0; }
  .spec__cell:not(.spec__name) { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); }
  .spec__label { display: block; min-width: 0; font-weight: 500; }
  .spec__value { flex: none; text-align: right; }
}
@media (max-width: 639px) {
  .spec-top > .ph { aspect-ratio: 6 / 5; }
  .spec { grid-template-columns: minmax(0, 1fr); row-gap: var(--s-6); margin-top: var(--s-6); }
}
/* ------------------------------------------------ #grind: the pair, two frames down to the screen's foot */
#grind .pair { grid-template-rows: minmax(0, 1fr); }
/* a tablet: two 4:5 frames side by side; the screen's foot stays air, as in the sections round it */
@media (min-width: 640px) and (max-width: 1023px) { #grind .pair { flex: none; grid-template-rows: auto; } #grind .pair > .ph { grid-column: auto / span 6; aspect-ratio: 4 / 5; } }
@media (max-width: 639px) { #grind .pair { grid-template-rows: repeat(2, minmax(160px, 1fr)); } }

/* ------------------------------------------------ #asili: the statement (word-highlight) */
#asili > .wrap { gap: var(--head-gap); }
#asili .mo-wh__text { font-stretch: var(--display-stretch); }

/* ------------------------------------------------ #origin: the cobalt band, the Rwanda frame across the .wrap;
   the same space inside its foot as outside it, so the band's two edges read as one gap */
#origin { padding-bottom: max(var(--padt), calc(var(--padb) + var(--bar))); }
#origin .ph.fill { min-height: 240px; }

/* ------------------------------------------------ #subscribe: the split (split-text-left): the words and the steps
   left, the 5:4 frame right, top-aligned */
#subscribe .split > .ph { aspect-ratio: 5 / 4; align-self: start; }
#subscribe .split-col > .section-head { margin-bottom: 0; }
#subscribe .split-col { gap: var(--s-7); }
.steps > li {
  display: grid; grid-template-columns: var(--s-7) minmax(0, 1fr); align-items: baseline; gap: var(--s-3);
  padding-block: var(--s-4); border-bottom: 1px solid var(--line);
  font: 500 var(--t-lead)/1.4 var(--font-text);
}
.steps > li:first-child { padding-top: 0; }
.steps__n { font: var(--display-weight) var(--t-lead)/1.4 var(--font-display); font-stretch: var(--display-stretch); font-variant-numeric: tabular-nums; color: var(--muted); }
@media (max-width: 1023px) {
  #subscribe .split { display: flex; flex-direction: column; gap: var(--s-7); }
  #subscribe .split-col { gap: var(--s-6); }
  #subscribe .split > .ph { aspect-ratio: auto; align-self: stretch; flex: 1 1 0; min-height: 200px; }
}
@media (min-width: 640px) and (max-width: 1023px) { #subscribe .split { flex: none; } #subscribe .split > .ph { flex: none; aspect-ratio: 16 / 9; } }

/* a phone: a section grows with what it holds (system.css), so the frames that take the rest of the screen grow
   from their content up and never shrink under it: nothing runs into the next section */
@media (max-width: 639px) { #grind .pair, #subscribe .split { flex: 1 0 auto; } }
@media (max-width: 1023px) { #origin .ph.fill { flex: 1 0 auto; } }

/* ------------------------------------------------ #faq: two groups (two screens on a phone, g2m), one list on
   the right from 640 up */
.faq-head { display: grid; gap: var(--s-4); align-content: start; justify-items: start; }
.faq-head > p { font-size: var(--t-lead); line-height: 1.5; }
@media (max-width: 1023px) { .faq-head { margin-bottom: var(--head-gap); } .faq-a { align-content: start; } }
/* a phone: each of the two screens holds its group from top to foot, the answers spread down it, so the gap to
   the band below is the page's one gap */
@media (max-width: 639px) {
  #faq .faq-a, #faq .faq-b { display: flex; flex-direction: column; }
  #faq .faq-a > .faq, #faq .faq-b > .faq { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: space-between; }
}
@media (min-width: 640px) { .faq-b .faq > .faq__item:first-child { padding-top: var(--s-5); } }
/* a small laptop: the answers' rows a step closer, so the five fit one 768px screen */
@media (min-width: 1024px) and (max-width: 1279px) {
  #faq .faq > .faq__item { padding-block: var(--s-4); }
  #faq .faq-a .faq > .faq__item:first-child { padding-top: 0; }
  #faq .faq-b .faq > .faq__item:first-child { padding-top: var(--s-4); }
}

/* ------------------------------------------------ footer.closing: close-word with the logo across the .wrap */
.close__word { flex: 1 1 auto; min-height: 0; display: flex; align-items: flex-end; line-height: 0; color: var(--p-ink); }
.close__word > svg { display: block; width: 100%; height: auto; max-height: 100%; }
/* a small laptop's short screen: the wordmark a little lower, so the close and the links keep one screen */
@media (min-width: 1024px) and (max-width: 1279px) { .close__word > svg { max-height: 20svh; } }
.footer__lede { font-stretch: var(--display-stretch); }
/* a phone keeps the close and the links on one screen, so the phone bar steps away for the close's button: the
   company line goes (the wordmark above names the company) and the two rows sit a step closer */
@media (max-width: 639px) {
  .closing__links .grid > .span-4:has(> .footer__lede) { display: none; }
  footer.closing > .wrap { row-gap: var(--s-6); }
}
/* a phone keeps the close and the links on one screen (so the phone bar steps away for the close's button): the
   company line goes, since the wordmark above already names it, and the rows sit a step closer */
@media (max-width: 639px) {
  .closing__links .grid > .span-4:has(> .footer__lede) { display: none; }
  footer.closing > .wrap { row-gap: var(--s-6); }
}
