/* Fitness Moves resource pages: Start Here, the starter plan, the calculators, the shop banner.
   Same look as the rest of the site (see the shared site files): black, iron, signal red, chalk.
   Anton for big things, Barlow for words, square corners, clipped-corner buttons.
   The values after the commas are only a safety net if the shared colours are missing. */

.fm-resource, .fm-shop-empty {
  --r-black: var(--fm-black, #0a0a0a);
  --r-iron: var(--fm-iron, #2b2d2f);
  --r-red: var(--fm-red, #dc0600);
  --r-chalk: var(--fm-chalk, #f2f2ee);
  --r-steel: var(--fm-steel, #a3a6a9);
  --r-muted: var(--fm-muted, #55585b);
  --r-rule: var(--fm-rule, rgba(10, 10, 10, .28));
  --r-display: var(--fm-display, "Anton", "Arial Narrow", Impact, sans-serif);
  --r-body: var(--fm-body, "Barlow", system-ui, -apple-system, "Segoe UI", Arial, sans-serif);
  --r-ease: var(--fm-ease, cubic-bezier(.2, .8, .2, 1));
}
.fm-resource { color: var(--r-iron); }
body.fm-site .entry-content .fm-resource :is(section, .wp-block-heading)[id] { scroll-margin-top: 100px; }
body.fm-site .entry-content .fm-resource :is(p, ul, ol) { max-width: 72ch; }
body.fm-site .entry-content .fm-resource .fm-intro { max-width: 62ch; font-size: clamp(1.15rem, 1.8vw, 1.4rem); line-height: 1.5; }
body.fm-site .entry-content .fm-resource :focus-visible { outline: 3px solid var(--r-black); outline-offset: 3px; }

/* Black banner with a big headline and one button. */
body.fm-site .entry-content .fm-resource .fm-resource-banner, body.fm-site .fm-shop-empty .fm-resource-banner {
  --btn-fill: var(--r-chalk);
  --btn-fill-fg: var(--r-black);
  margin-block: clamp(28px, 4vw, 56px);
  padding: clamp(24px, 4vw, 56px);
  border-top: 8px solid var(--r-red);
  background: var(--r-black);
  color: var(--r-chalk);
}
body.fm-site .entry-content .fm-resource .fm-resource-banner :is(h2, h3), body.fm-site .fm-shop-empty .fm-resource-banner :is(h2, h3) {
  margin: 0 0 14px;
  color: var(--r-chalk);
  font: 400 clamp(2rem, 4.4vw, 3.6rem)/1 var(--r-display);
  letter-spacing: .005em;
  text-transform: uppercase;
}
body.fm-site .entry-content .fm-resource .fm-resource-banner p, body.fm-site .fm-shop-empty .fm-resource-banner p { max-width: 58ch; margin: 0 0 18px; color: var(--r-chalk); }
body.fm-site .entry-content .fm-resource .fm-resource-banner p a, body.fm-site .fm-shop-empty .fm-resource-banner p a { color: inherit; text-decoration-color: var(--r-red); }
body.fm-site .entry-content .fm-resource .fm-resource-banner :focus-visible, body.fm-site .fm-shop-empty .fm-resource-banner :focus-visible { outline-color: var(--r-chalk); }
body.fm-site .fm-shop-empty { margin-block: 1.5rem 2rem; }

/* Buttons that belong to these pages (the shared site buttons already style the block-editor ones). */
body.fm-site .entry-content .fm-resource .fm-calculator button,
body.fm-site .entry-content .fm-resource .fm-signup button:not(.wp-element-button) {
  box-shadow: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  margin-top: 22px;
  padding: 12px 30px;
  border: 0;
  border-radius: 0;
  background-color: var(--r-red);
  background-image: linear-gradient(var(--r-black), var(--r-black));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 0;
  color: var(--r-chalk);
  font: 700 1.1rem/1.1 var(--r-body);
  letter-spacing: .08em;
  text-transform: uppercase;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  cursor: pointer;
  transition: background-size .38s var(--r-ease), color .25s;
}
body.fm-site .entry-content .fm-resource .fm-calculator button:is(:hover, :focus-visible),
body.fm-site .entry-content .fm-resource .fm-signup button:not(.wp-element-button):is(:hover, :focus-visible) { background-size: 100% 100%; }
body.fm-site .entry-content .fm-resource .fm-calculator button:focus-visible,
body.fm-site .entry-content .fm-resource .fm-signup button:not(.wp-element-button):focus-visible { outline: 0; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
body.fm-site .entry-content .fm-resource .fm-signup button:not(.wp-element-button) { margin-top: 0; }

/* Cards and grids. */
body.fm-site .entry-content .fm-resource :is(.fm-resource-grid, .fm-calculator-grid, .fm-landing-grid) { display: grid; gap: clamp(20px, 3vw, 40px); margin-block: clamp(24px, 3vw, 40px); }
body.fm-site .entry-content .fm-resource .fm-resource-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body.fm-site .entry-content .fm-resource .fm-calculator-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.fm-site .entry-content .fm-resource .fm-landing-grid { grid-template-columns: minmax(210px, .75fr) minmax(0, 1.25fr); align-items: center; }
body.fm-site .entry-content .fm-resource :is(.fm-resource-grid, .fm-landing-grid) > .wp-block-group__inner-container { display: contents; }
body.fm-site .entry-content .fm-resource :is(.fm-resource-grid, .fm-landing-grid) > *,
body.fm-site .entry-content .fm-resource :is(.fm-resource-grid, .fm-landing-grid) > .wp-block-group__inner-container > * { min-width: 0; margin: 0; }
body.fm-site .entry-content .fm-resource .fm-resource-card { padding: 18px 0 0; border-top: 4px solid var(--r-black); }
body.fm-site .entry-content .fm-resource .fm-resource-card :is(h2, h3) { margin: 0 0 12px; color: var(--r-black); font: 400 clamp(1.5rem, 2.4vw, 2rem)/1.08 var(--r-display); letter-spacing: .005em; text-transform: uppercase; }
body.fm-site .entry-content .fm-resource .fm-resource-card p:last-child { margin-bottom: 0; }
body.fm-site .entry-content .fm-resource .fm-beginner-photo img { aspect-ratio: 3 / 2; object-fit: cover; filter: grayscale(1) contrast(1.05); }
body.fm-site .entry-content .fm-resource .fm-starter-cover img { aspect-ratio: 440 / 622; }
body.fm-site .entry-content .fm-resource .fm-landing-grid figure img { display: block; max-width: 100%; height: auto; }
body.fm-site .entry-content .fm-resource .fm-starter-cover img { width: auto; max-height: 455px; border: 2px solid var(--r-black); box-shadow: none; }

/* A row of links that jump down the page. */
body.fm-site .entry-content .fm-resource .fm-jump-links { display: flex; flex-wrap: wrap; gap: 4px clamp(18px, 3vw, 36px); max-width: none; margin-block: 1.25rem; padding: 6px 0; border-top: 4px solid var(--r-black); border-bottom: 1px solid var(--r-rule); list-style: none; }
body.fm-site .entry-content .fm-resource .fm-jump-links li { margin: 0; padding: 0; }
body.fm-site .entry-content .fm-resource .fm-jump-links a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  color: var(--r-black);
  font: 700 .95rem/1 var(--r-body);
  letter-spacing: .12em;
  text-decoration: none;
  text-transform: uppercase;
}
body.fm-site .entry-content .fm-resource .fm-jump-links a::before { content: ""; width: 10px; height: 10px; background: var(--r-red); }
body.fm-site .entry-content .fm-resource .fm-jump-links a:is(:hover, :focus-visible) { text-decoration: underline; text-decoration-color: var(--r-red); text-decoration-thickness: 3px; text-underline-offset: 6px; }

/* Calculator fields and answers. */
body.fm-site .entry-content .fm-resource .fm-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }
body.fm-site .entry-content .fm-resource .fm-field { display: grid; align-content: start; gap: 8px; min-width: 0; color: var(--r-black); font: 700 .85rem/1.25 var(--r-body); letter-spacing: .12em; text-transform: uppercase; }
body.fm-site .entry-content .fm-resource .fm-field-wide { grid-column: 1 / -1; }
body.fm-site .entry-content .fm-resource .fm-field :is(input, select) {
  box-sizing: border-box;
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  border: 2px solid var(--r-black);
  border-radius: 0;
  background-color: var(--r-chalk);
  color: var(--r-black);
  font: 500 1.1rem/1.3 var(--r-body);
  letter-spacing: 0;
  text-transform: none;
}
body.fm-site .entry-content .fm-resource .fm-field select {
  padding-right: 44px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10'%3E%3Cpath d='M1 1l7 7 7-7' fill='none' stroke='%230a0a0a' stroke-width='2.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 10px;
  -webkit-appearance: none;
  appearance: none;
}
body.fm-site .entry-content .fm-resource .fm-calculator output:not(:empty) {
  display: block;
  margin: 18px 0 0;
  padding: 14px 16px;
  border-left: 8px solid var(--r-red);
  background: var(--r-black);
  color: var(--r-chalk);
  font: 700 1.1rem/1.4 var(--r-body);
  overflow-wrap: anywhere;
}
body.fm-site .entry-content .fm-resource .fm-calculator output[data-error] { background: var(--r-red); border-left-color: var(--r-black); }
body.fm-site .entry-content .fm-resource .fm-source { margin: 1rem 0 0; color: var(--r-muted); font-size: .92rem; }

/* Questions that open, and the sign-up box. */
body.fm-site .entry-content .fm-resource .fm-resource-details { padding: 0; border-bottom: 1px solid var(--r-rule); }
body.fm-site .entry-content .fm-resource .fm-resource-details summary { box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 12px 0; color: var(--r-black); font: 700 1.1rem/1.3 var(--r-body); cursor: pointer; list-style: none; }
body.fm-site .entry-content .fm-resource .fm-resource-details summary::-webkit-details-marker { display: none; }
body.fm-site .entry-content .fm-resource .fm-resource-details summary::after { content: "+"; flex: none; color: var(--r-red); font: 700 1.9rem/1 var(--r-body); }
body.fm-site .entry-content .fm-resource .fm-resource-details[open] summary::after { content: "\2212"; }
body.fm-site .entry-content .fm-resource .fm-resource-details p { margin: 0 0 16px; }
body.fm-site .entry-content .fm-resource .fm-signup { padding: clamp(20px, 3vw, 36px) 0 0; border: 0; border-top: 4px solid var(--r-black); }
body.fm-site .entry-content .fm-resource .fm-signup h2 { margin: 0 0 .6rem; }
body.fm-site .entry-content .fm-resource .fm-signup :is(input[type=email], input[type=text]) {
  box-sizing: border-box;
  flex: 1 1 260px;
  width: min(100%, 440px);
  max-width: 440px;
  min-width: 0;
  min-height: 52px;
  margin: 0;
  padding: 10px 14px;
  border: 2px solid var(--r-black);
  border-radius: 0;
  background: var(--r-chalk);
  color: var(--r-black);
  font: 500 1.1rem/1.3 var(--r-body);
}
body.fm-site .entry-content .fm-resource .fm-signup input::placeholder { color: var(--r-muted); opacity: 1; }
body.fm-site .entry-content .fm-resource .fm-signup :is(p, div, form):has(> input:is([type=email], [type=text])) { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; }

@media (max-width: 740px) {
  body.fm-site .entry-content .fm-resource :is(.fm-resource-grid, .fm-calculator-grid, .fm-landing-grid) { grid-template-columns: minmax(0, 1fr); }
  body.fm-site .entry-content .fm-resource .fm-starter-cover { grid-row: 2; }
  body.fm-site .entry-content .fm-resource .fm-starter-cover img { max-height: 300px; }
}
@media (max-width: 480px) {
  body.fm-site .entry-content .fm-resource .fm-fields { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  body.fm-site .entry-content .fm-resource :is(.fm-calculator button, .fm-signup button) { transition: none; }
}
