/* ============================================================
   SITE SHELL — reusable components: buttons, fields, the
   dose table, FAQ accordion, toast and the scroll-reveal animation. See css/shared/site-shell.css
   for tokens/layout primitives. The bare `.btn`
   base lives in css/shared/header.css since the header needs it
   too; this file adds the variants only pages with .site-shell use.
   ============================================================ */

.btn--ghost {
  background: transparent;
  border-color: var(--text, var(--ink));
  color: var(--text, var(--ink));
}

.btn--ghost:hover {
  background: var(--text, var(--ink));
  color: var(--white, #fff);
}

/* Sand secondary button (mist, hover hairline, spruce text): the secondary button next to the spruce primary. */
.btn--sky {
  background: var(--mist, #ebe6e1);
  border-color: var(--mist, #ebe6e1);
  color: var(--ink-text);
  font-weight: 600;
}

.btn--sky:hover {
  background: var(--line, #ddd3cb);
  border-color: var(--line, #ddd3cb);
}

.btn--light {
  background: var(--white, #fff);
  border-color: var(--white, #fff);
  color: var(--ink-text);
}

.btn--light:hover {
  background: var(--mist, #ebe6e1);
  border-color: var(--mist, #ebe6e1);
}

.btn--lg {
  height: 54px;
  padding: 12px 22px;
  font-size: 0.9375rem;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Underlined inline link: the contact email, "Full product details". */
.site-shell .text-link {
  color: var(--text);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  overflow-wrap: anywhere;
}

.site-shell .text-link:hover {
  text-decoration-thickness: 2px;
}

/* ---------- Inputs / fields ---------- */

.field label {
  display: block;
  margin-bottom: 10px;
  font: 500 0.875rem/1.2 var(--font-sans, inherit);
}

.field__row {
  display: flex;
  gap: 8px;
}

.input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 10px 14px;
  border-radius: 0;
  border: 1px solid var(--text-2, #6e6258);
  background: var(--white, #fff);
  color: var(--text, inherit);
  font: 400 1rem/1.4 var(--font-sans, inherit);
}

.input:focus {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.field__msg {
  margin: 8px 0 0;
  min-height: 1.2em;
  font: 400 0.875rem/1.3 var(--font-sans, inherit);
}

.field__msg--error {
  color: var(--error, #a3172b);
}

/* Plain text input used outside the .field/.input convention (checkout
   form fields, profile password fields) — same visual treatment. */
.z-input {
  height: 46px;
  padding: 10px 14px;
  border-radius: 0;
  border: 1px solid var(--text-2, #6e6258);
  background: var(--white, #fff);
  color: var(--text, inherit);
  font: 400 1rem/1.4 var(--font-sans, inherit);
}

.z-input:focus {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.z-input:disabled,
.z-input[readonly] {
  color: var(--text-2, #6e6258);
  background: var(--mist, #ebe6e1);
}

.field-err {
  display: none;
  font: 400 0.8125rem/1.3 var(--font-sans, inherit);
  color: var(--error, #a3172b);
}

@media (max-width: 560px) {
  .field__row {
    flex-direction: column;
  }
}

/* ---------- Formula / dose table ----------
   Shared by the home page and the product page's formula section. */

.site-shell .formula {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--grid-gap);
}

.site-shell .formula--light {
  background: var(--mist);
}

.site-shell .formula__intro {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start;
}

.site-shell .formula__table {
  grid-column: span 8;
  border-top: 1px solid var(--ink-line);
}

.site-shell .formula--light .formula__table {
  border-color: var(--line);
}

.site-shell .dose {
  display: grid;
  /* Fixed amount column so every row's note starts at the same x, whatever the figure's width. */
  grid-template-columns: minmax(120px, 1.1fr) 2.2fr 7.5rem;
  gap: 8px 32px;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px solid var(--ink-line);
  position: relative;
}

.site-shell .formula--light .dose {
  border-color: var(--line);
}

.site-shell .formula__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  justify-content: space-between;
  padding-top: 18px;
}

.site-shell .formula__foot .note {
  max-width: 68ch;
}

@media (max-width: 1020px) {
  .site-shell .formula__intro,
  .site-shell .formula__table {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .site-shell .dose {
    grid-template-columns: 1fr auto;
  }

  .site-shell .dose__why {
    grid-column: 1 / -1;
  }

  /* Keep the amount on the name's row instead of dropping below the note. */
  .site-shell .dose__amt {
    grid-row: 1;
    grid-column: 2;
  }
}

/* ---------- Dose table ---------- */

.site-shell .dose__name {
  font: 600 1.125rem/1.3 var(--font-sans);
}

.site-shell .dose__name small {
  display: block;
  font: 400 0.8125rem/1.3 var(--font-sans);
  color: var(--text-2);
  font-weight: 400;
}

.site-shell .dose__why {
  font: 400 1rem/1.5 var(--font-sans);
  color: var(--text-2);
  max-width: 52ch;
}

.site-shell .dose__amt {
  font: 400 clamp(1.75rem, 2.6vw, 2.5rem)/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.site-shell .dose__amt span {
  font-size: 50%;
  color: var(--text-2);
  margin-left: 4px;
}

.site-shell .dose__bar {
  grid-column: 1 / -1;
  height: 2px;
  background: var(--line);
  margin-top: 6px;
}

.site-shell .dose__bar i {
  display: block;
  height: 100%;
  width: var(--w, 100%);
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
}

.site-shell .formula.is-in .dose__bar i {
  transform: scaleX(1);
}

.site-shell .formula--light .dose__bar {
  background: var(--line);
}

/* ---------- Dose strip ----------
   The four amounts in one row of mono figures. Used in the home hero (on ink)
   and in the product page buy box (on paper). */

.site-shell .dose-strip {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  /* One equal column per mineral, however many the formula has. */
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.site-shell .dose-strip li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 12px;
}

.site-shell .dose-strip li + li {
  border-left: 1px solid var(--line);
}

.site-shell .dose-strip__amt {
  font: 400 1.5rem/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.site-shell .dose-strip__amt small {
  margin-left: 2px;
  font-size: 0.75rem;
  color: var(--text-2);
}

.site-shell .dose-strip__name {
  font: 500 0.8125rem/1.2 var(--font-sans);
  color: var(--text-2);
}

@media (max-width: 420px) {
  .site-shell .dose-strip li {
    padding: 12px 8px;
  }

  .site-shell .dose-strip__amt {
    font-size: 1.25rem;
  }
}

.site-shell .dose-strip--ink,
.site-shell .dose-strip--ink li + li {
  border-color: var(--ink-line);
}

.site-shell .dose-strip--ink .dose-strip__amt {
  color: var(--on-ink);
}

.site-shell .dose-strip--ink .dose-strip__amt small,
.site-shell .dose-strip--ink .dose-strip__name {
  color: var(--on-ink-2);
}

/* ---------- FAQ ---------- */

.site-shell .faq {
  display: grid;
  grid-template-columns: 4fr 8fr;
  gap: var(--grid-gap);
}

.site-shell .faq__head {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (max-width: 1020px) {
  .site-shell .faq {
    grid-template-columns: 1fr;
  }
}

.site-shell .faq__list details {
  border-top: 1px solid var(--line);
}

.site-shell .faq__list details:last-child {
  border-bottom: 1px solid var(--line);
}

.site-shell .faq__list summary {
  list-style: none;
  cursor: pointer;
  padding: 22px 32px 22px 0;
  font: 600 1.0625rem/1.3 var(--font-sans);
  position: relative;
}

.site-shell .faq__list summary::-webkit-details-marker {
  display: none;
}

.site-shell .faq__list summary::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 50%;
  width: 14px;
  height: 1.5px;
  background: var(--text);
  transform: translateY(-50%);
}

.site-shell .faq__list summary::before {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 1.5px;
  height: 14px;
  background: var(--text);
  transform: translateY(-50%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.site-shell .faq__list details[open] summary::before {
  transform: translateY(-50%) rotate(90deg);
}

.site-shell .faq__list details p {
  max-width: 68ch;
  padding: 0 32px 22px 0;
  color: var(--text-2);
  font: 400 1rem/1.5 var(--font-sans);
}

/* ---------- Toast ---------- */

/* Centred with auto margins, not translateX(-50%): a half-pixel offset on an
   odd-width toast renders its text blurry. */
.site-shell .toast {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 32px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  transform: translateY(12px);
  background: var(--field);
  color: var(--on-field);
  border-radius: 0;
  padding: 12px 18px;
  font: 400 0.875rem/1.3 var(--font-sans);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 300;
}

.site-shell .toast.show {
  opacity: 1;
  transform: none;
}

/* Error variant: red so it never reads as a success message. */
.site-shell .toast.toast--error {
  background: var(--error);
  color: #fff;
  border-color: var(--error);
}

/* ---------- Scroll reveal ----------
   Matches the site-wide .reveal / .reveal.in convention (see
   css/products/base.css's older variant) so motion behaves the
   same everywhere. */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

.site-shell .dose__bar i {
  transition: transform 1.4s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--i, 0) * 120ms);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .site-shell .dose__bar i {
    transform: scaleX(1);
    transition: none;
  }
}
