/* ==========================================================================
   MIND OVER MUSCLE: tools (caloriecalculator, vetpercentage, overzicht)
   Page-specific layout only. Reuses styles.css + home.css (page-hero, chips,
   choice pills, .field, accordion, start-bar). Tokens only, no colours.
   ========================================================================== */

/* ---------- hero: copy + photo or meal prep mosaic ---------- */
.tool-hero { padding-bottom: clamp(32px, 4vw, 56px); }
.tool-hero__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); align-items: center; gap: clamp(28px, 5vw, 64px); }
/* "caloriebehoefte" is one long word: on phones the title follows the screen width so it never runs off */
.tool-hero h1 { font-size: clamp(30px, 8.4vw, 72px); }
@media (min-width: 901px) { .tool-hero h1 { font-size: clamp(40px, 4.6vw, 72px); } }
.tool-hero__copy { display: grid; gap: 16px; justify-items: start; min-width: 0; }
.tool-hero__copy .page-hero__lead { max-width: 54ch; }
.tool-hero__privacy { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.tool-hero__privacy .i { width: 15px; height: 15px; flex: none; }
.tool-hero__photo { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.tool-hero__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.food-mosaic { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.food-mosaic__tile { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); }
.food-mosaic__tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.food-mosaic__tile:nth-child(2), .food-mosaic__tile:nth-child(4) { transform: translateY(18px); }
@media (max-width: 900px) {
  .tool-hero__grid { grid-template-columns: minmax(0, 1fr); }
  .tool-hero__photo { aspect-ratio: 16 / 10; }
  .tool-hero__photo img { object-position: 50% 20%; }
  /* phones: the four meal preps become one short row, so the calculator is close */
  .food-mosaic { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .food-mosaic__tile { border-radius: 12px; }
  .food-mosaic__tile:nth-child(2), .food-mosaic__tile:nth-child(4) { transform: none; }
}

/* ---------- calculator layout: the form, the result beside it (below on phones) ---------- */
.calc-section { padding-top: clamp(24px, 3vw, 40px); }
.calc { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); align-items: start; gap: clamp(20px, 3vw, 36px); }
@media (max-width: 960px) { .calc { grid-template-columns: minmax(0, 1fr); } }
.calc-form { display: grid; gap: 16px; min-width: 0; }
.calc-step { min-width: 0; margin: 0; padding: clamp(20px, 2.6vw, 30px); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--card-shadow); }
.calc-step > * + * { margin-top: 18px; }
.calc-step__title { display: flex; align-items: center; gap: 12px; float: left; width: 100%; margin: 0 0 20px; padding: 0; font-family: var(--f-head); font-weight: 800; font-size: clamp(18px, 1.6vw, 21px); text-transform: uppercase; letter-spacing: 0.01em; }
.calc-step__title + * { clear: both; margin-top: 0; }
.calc-step__n { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 14px; }
.calc-step .choice-group > legend { margin-bottom: 10px; padding: 0; }
.calc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.calc-grid > .field { align-content: start; }
@media (max-width: 340px) { .calc-grid { grid-template-columns: minmax(0, 1fr); } }
.calc-hint { color: var(--muted); font-size: 14px; line-height: 1.5; }
.calc-hint a, .calc-navy a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.calc-optional { font-weight: 500; letter-spacing: 0.04em; text-transform: none; color: var(--faint); }

/* number inputs with a unit inside the field */
.unit { position: relative; }
.unit input { padding-right: 52px; }
.unit--wide input { padding-right: 88px; }
.unit span { position: absolute; top: 50%; right: 16px; transform: translateY(-50%); color: var(--faint); font-size: 15px; pointer-events: none; }
.field select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }

/* errors: monochrome like the rest of the site, made clear with an icon and a heavier border */
.calc-err { display: flex; align-items: flex-start; gap: 8px; margin: 0; color: var(--text); font-size: 14px; font-weight: 600; line-height: 1.4; }
.calc-err::before { content: "!"; display: grid; place-items: center; flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 800; }
.calc-err[hidden] { display: none; }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--text); box-shadow: 0 0 0 3px var(--accent-line); }
.calc-step .choice-group:has(> .calc-err:not([hidden])) .choice span { box-shadow: inset 0 0 0 1.5px var(--text); }

/* vetpercentage on sight: the row buttons fill in an estimate */
.oog-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
.oog-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.oog-table th, .oog-table td { padding: 10px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.oog-table tr:last-child th, .oog-table tr:last-child td { border-bottom: 0; }
.oog-table thead th { font-family: var(--f-head); font-weight: 700; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.oog-table tbody th { font-weight: 500; color: var(--text-2); }
.oog-table td { white-space: nowrap; color: var(--muted); }
.oog-pick { padding: 6px 12px; border-radius: var(--r-pill); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text); font-size: 13.5px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background-color var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.oog-pick:hover { box-shadow: inset 0 0 0 1px var(--text); }
.oog-pick.is-picked { background: var(--accent); color: var(--on-accent); box-shadow: none; }
/* only the column of the chosen sex is clickable */
[data-geslacht="man"] .oog-table td:nth-child(3) .oog-pick, [data-geslacht="vrouw"] .oog-table td:nth-child(2) .oog-pick { opacity: 0.35; pointer-events: none; }
.oog-wrap--page .oog-table { font-size: 15.5px; }
.oog-wrap--page .oog-table td { color: var(--text); font-weight: 600; }
@media (max-width: 520px) {
  .oog-table th, .oog-table td { padding: 9px 10px; }
  .oog-table tbody th { font-size: 13.5px; }
}
.calc-navy { color: var(--muted); font-size: 15px; }
.calc-navy b { color: var(--text); font-family: var(--f-head); font-size: 20px; }

/* activity level: four cards, prefilled from the steps */
.pal-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 520px) { .pal-list { grid-template-columns: minmax(0, 1fr); } }
.pal-opt { position: relative; display: block; cursor: pointer; }
.pal-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pal-opt span { display: grid; gap: 3px; height: 100%; padding: 12px 14px; border-radius: var(--r-sm); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-strong); transition: box-shadow var(--t) var(--ease), background-color var(--t) var(--ease); }
.pal-opt b { font-family: var(--f-head); font-weight: 700; font-size: 15px; }
.pal-opt small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.pal-opt:hover span { box-shadow: inset 0 0 0 1px var(--text); }
.pal-opt input:checked + span { box-shadow: inset 0 0 0 2px var(--text); background: var(--accent-soft); }
.pal-opt input:focus-visible + span { outline: 2.5px solid var(--text); outline-offset: 3px; }

/* extra sport rows */
.sport { display: grid; gap: 12px; }
.sport > .field-legend { margin: 0; }
.sport-list { display: grid; gap: 12px; }
.sport-list:empty { display: none; }
.sport-row { display: grid; grid-template-columns: minmax(0, 1fr) 92px 92px 44px; align-items: end; gap: 10px; padding: 12px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); }
.sport-row .field > label { font-size: 11px; }
.sport-row .field input, .sport-row .field select { padding: 12px 12px; }
.sport-row .unit input { padding-right: 40px; }
.sport-row .unit span { right: 12px; font-size: 13px; }
.sport-del { display: grid; place-items: center; width: 44px; height: 46px; border-radius: var(--r-sm); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-strong); transition: color var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.sport-del:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.sport-del .i { width: 18px; height: 18px; }
@media (max-width: 560px) {
  .sport-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; }
  .sport-row > .field:first-child { grid-column: 1 / -1; }
}
.sport-add { justify-self: start; }
.sport-add[hidden] { display: none; }
.calc-submit { width: 100%; }

/* ---------- result card ---------- */
.calc-result { position: sticky; top: calc(var(--header-h) + 16px); min-width: 0; max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto; overscroll-behavior: contain; border-radius: var(--r-lg); scrollbar-width: thin; }
@media (max-width: 960px) { .calc-result { position: static; max-height: none; overflow: visible; scroll-margin-top: calc(var(--header-h) + 12px); } }
.calc-result__card { display: grid; gap: 16px; padding: clamp(22px, 2.8vw, 32px); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--card-shadow); }
.calc-result__card > [data-state] { display: grid; gap: 16px; }
.calc-result__card > [data-state][hidden] { display: none; }
.calc-empty { color: var(--muted); font-size: 15.5px; line-height: 1.55; }
.calc-kcal { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; font-family: var(--f-head); font-weight: 800; font-size: clamp(48px, 5.4vw, 68px); line-height: 1; letter-spacing: -0.02em; }
.calc-kcal small { font-family: var(--f-body); font-weight: 600; font-size: 15px; letter-spacing: 0.02em; color: var(--muted); }
.calc-goal { color: var(--text-2); font-size: 15.5px; line-height: 1.5; }
.macros { display: grid; gap: 12px; }
.macro { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 6px 12px; }
.macro__name { font-weight: 600; }
.macro__g { font-family: var(--f-head); font-weight: 700; font-size: 20px; }
.macro__g small { margin-left: 6px; font-family: var(--f-body); font-weight: 500; font-size: 13px; color: var(--faint); }
.macro__bar { grid-column: 1 / -1; height: 8px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.macro__bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.macro:nth-child(2) .macro__bar span { opacity: 0.72; }
.macro:nth-child(3) .macro__bar span { opacity: 0.46; }
.calc-note { color: var(--muted); font-size: 14px; }
.calc-alert { margin: 0; padding: 14px 16px; border-radius: var(--r-sm); border-left: 4px solid var(--text); background: var(--accent-soft); color: var(--text); font-size: 14.5px; line-height: 1.5; font-weight: 500; }
.calc-alert[hidden] { display: none; }
.calc-more { border-top: 1px solid var(--line); padding-top: 12px; }
.calc-more[hidden] { display: none; }
.calc-more__sum { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; cursor: pointer; list-style: none; font-family: var(--f-head); font-weight: 700; font-size: 15px; }
.calc-more__sum::-webkit-details-marker { display: none; }
.calc-more__sum::after { content: "+"; font-size: 20px; font-weight: 400; transition: transform var(--t) var(--ease); }
.calc-more[open] > .calc-more__sum::after { transform: rotate(45deg); }
.calc-dl { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; margin: 8px 0 4px; font-size: 14.5px; }
.calc-dl dt { color: var(--muted); }
.calc-dl dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.calc-days { display: grid; gap: 10px; margin: 8px 0 4px; }
.calc-day { padding: 12px 14px; border-radius: var(--r-sm); background: var(--bg); border: 1px solid var(--line); }
.calc-day b { display: block; font-family: var(--f-head); font-size: 16px; }
.calc-day span { color: var(--muted); font-size: 14px; }
.calc-cta { display: grid; gap: 8px; justify-items: start; padding: 16px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); }
.calc-cta__title { font-family: var(--f-head); font-weight: 800; font-size: 17px; text-transform: uppercase; }
.calc-cta p:not(.calc-cta__title) { color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.calc-cta .btn { margin-top: 4px; }
.calc-next { justify-self: start; }
.calc-disclaimer { color: var(--faint); font-size: 12.5px; line-height: 1.55; }

/* ---------- how we calculate / how to measure ---------- */
.method-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.method-grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1080px) { .method-grid--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 980px) { .method-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .method-grid, .method-grid--5 { grid-template-columns: minmax(0, 1fr); } }
.method-card { display: grid; align-content: start; gap: 10px; padding: 22px 20px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.method-card__n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); font-family: var(--f-head); font-weight: 800; }
.method-card h3 { font-size: 18px; text-transform: uppercase; }
.method-card p { color: var(--muted); font-size: 15px; line-height: 1.55; }

/* ---------- "laat dit je startpunt zijn" (Vincent, 2026-10-23) ---------- */
.tool-cta { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); align-items: stretch; overflow: hidden; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--card-shadow); }
.tool-cta__media { position: relative; min-height: 320px; margin: 0; }
.tool-cta__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; }
.tool-cta__body { display: grid; align-content: center; justify-items: start; gap: 14px; padding: clamp(26px, 4vw, 52px); }
.tool-cta__body h2 { font-size: clamp(28px, 3vw, 44px); }
.tool-cta__body p:not(.eyebrow) { max-width: 56ch; color: var(--muted); font-size: 16px; line-height: 1.6; }
.tool-cta__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
@media (max-width: 760px) {
  .tool-cta { grid-template-columns: minmax(0, 1fr); }
  .tool-cta__media { min-height: 0; aspect-ratio: 16 / 11; }
  .tool-cta__actions, .tool-cta__actions .btn { width: 100%; }
}

/* ---------- tools overview: two cards ---------- */
.tool-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 28px); }
@media (max-width: 760px) { .tool-cards { grid-template-columns: minmax(0, 1fr); } }
.tool-card { display: grid; grid-template-rows: auto 1fr; overflow: hidden; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--card-shadow); color: var(--text); transition: border-color var(--t) var(--ease), transform var(--t) var(--ease); }
.tool-card:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.tool-card__media { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.tool-card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; transition: transform 600ms var(--ease); }
.tool-card:hover .tool-card__media img { transform: scale(1.03); }
.tool-card__body { display: grid; align-content: start; justify-items: start; gap: 10px; padding: clamp(20px, 2.4vw, 28px); }
.tool-card__tag { padding: 5px 11px; border-radius: var(--r-pill); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); font-size: 12.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.tool-card__title { font-family: var(--f-head); font-weight: 800; font-size: clamp(22px, 2.2vw, 28px); line-height: 1.15; text-transform: uppercase; }
.tool-card__text { color: var(--muted); font-size: 15.5px; line-height: 1.55; }
.tool-card .text-link { margin-top: 4px; }

@media (prefers-reduced-motion: reduce) {
  .tool-card, .tool-card__media img { transition: none; }
  .tool-card:hover, .tool-card:hover .tool-card__media img { transform: none; }
}
