/* =========================================================
   BetterLife Farm (farm.php). Builds on about.css and programmes.css (hero, eyebrows, buttons, gallery,
   closing panel); this file adds the farm's own sections.
   ========================================================= */
.fm section[id] { scroll-margin-top: 96px; }

/* ---------- Food security first ---------- */
.ab .fm-intro { background: #fff; }
.fm-intro-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(36px, 6vw, 96px); align-items: center; }
.fm-intro h2 { margin-bottom: 20px; max-width: 18ch; }
/* Who does what: the organisation and the farm company side by side */
.fm-orgs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; margin-top: 28px; }
.fm-org { align-self: stretch; padding: 16px 18px 17px; border-radius: 18px; background: var(--ab-cream); border: 1px solid var(--ab-line); }
.fm-org.is-ltd { background: var(--ab-deep); border-color: transparent; }
.fm-org-tag { display: block; font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ab-green); }
.fm-org strong { display: block; margin-top: 7px; font-family: var(--ab-serif); font-weight: 600; font-size: 18px; line-height: 1.25; color: var(--ab-deep); }
.fm-org > span:last-child { display: block; margin-top: 6px; font-size: 13.5px; line-height: 1.45; color: var(--ab-soft); }
.fm-org.is-ltd .fm-org-tag { color: #9fd6b2; }
.fm-org.is-ltd strong { color: #fff; }
.fm-org.is-ltd > span:last-child { color: rgba(255, 255, 255, .8); }
.fm-org-join { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ab-green); color: #fff; font-weight: 700; font-size: 19px; line-height: 1; }
.fm-intro-photo { position: relative; margin: 0 0 0 auto; max-width: 460px; width: 100%; }
.fm-intro-img { aspect-ratio: 4 / 5; border-radius: 999px 999px var(--ab-radius) var(--ab-radius); box-shadow: 0 30px 60px rgba(11, 61, 46, .14); }
.fm-intro-img img, .fm-intro-inset img { object-position: var(--pos, 50% 40%); }
.fm-intro-inset { position: absolute; left: -12%; bottom: 8%; width: 40%; aspect-ratio: 1; border-radius: 50%; border: 6px solid #fff; box-shadow: 0 18px 36px rgba(11, 61, 46, .2); }

/* ---------- Seedlings ---------- */
.ab .fm-seed { background: var(--ab-cream); }
.fm-seed-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.fm-seed-card { display: flex; flex-direction: column; border-radius: var(--ab-radius); background: #fff; border: 1px solid var(--ab-line); overflow: hidden; transition-delay: calc(var(--i) * 80ms); }
.fm-seed-photo { aspect-ratio: 4 / 3; overflow: hidden; background: var(--ab-sand); }
.fm-seed-card:first-child .fm-seed-photo { border-radius: 0 0 90px 0; }
.fm-seed-card:nth-child(2) .fm-seed-photo { border-radius: 0 0 0 90px; }
.fm-seed-card:nth-child(3) .fm-seed-photo { border-radius: 0 0 90px 0; }
.fm-seed-photo img { width: 100%; height: 100% !important; object-fit: cover; transition: transform .7s ease; }
.fm-seed-card:hover .fm-seed-photo img { transform: scale(1.05); }
.fm-seed-body { padding: 18px 20px 22px; }
.ab .fm-seed-card h3 { margin: 0 0 8px; font-family: var(--ab-serif); font-weight: 600; font-size: clamp(21px, 1.8vw, 24px); color: var(--ab-deep); }
.ab .fm-seed-card p { margin: 0; font-size: 15px; line-height: 1.55; }
.fm-seed-card.is-plus { justify-content: flex-end; padding: 24px 22px; background: var(--ab-deep); border-color: transparent; }
.fm-plus { display: flex; align-items: center; justify-content: center; width: 54px; height: 54px; margin-bottom: auto; border-radius: 50%; background: var(--ab-green); color: #fff; font-family: var(--ab-serif); font-size: 34px; line-height: 1; }
.ab .fm-seed-card.is-plus h3 { margin-top: 28px; color: #fff; }
.ab .fm-seed-card.is-plus p { color: rgba(255, 255, 255, .84); }

/* ---------- From support to supplier ---------- */
.ab .fm-model { background: #fff; }
.fm-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.fm-step { position: relative; transition-delay: calc(var(--i) * 110ms); }
.fm-step-photo { aspect-ratio: 4 / 3.2; border-radius: 120px 22px 120px 22px; overflow: hidden; background: var(--ab-sand); }
.fm-step:nth-child(2) .fm-step-photo { border-radius: 22px 120px 22px 120px; }
.fm-step-photo img { width: 100%; height: 100% !important; object-fit: cover; }
.fm-step-no { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin: -26px 0 0 22px; border-radius: 50%; border: 4px solid #fff; background: var(--ab-green); color: #fff; font-family: var(--ab-serif); font-weight: 600; font-size: 18px; font-variant-numeric: lining-nums; }
/* An arrow from each step to the next on wider screens */
.fm-step:not(:last-child)::after { content: ''; position: absolute; z-index: 1; top: 34%; right: calc(-1 * clamp(20px, 3vw, 40px) / 2 - 11px); width: 22px; height: 22px; border-top: 3px solid var(--ab-green); border-right: 3px solid var(--ab-green); transform: rotate(45deg); opacity: .55; }
.ab .fm-step h3 { margin: 14px 0 8px; font-family: var(--ab-serif); font-weight: 600; font-size: clamp(21px, 1.8vw, 24px); color: var(--ab-deep); }
.ab .fm-step p { margin: 0; font-size: 15.5px; line-height: 1.6; }
.ab .fm-pull { max-width: 30ch; margin: clamp(44px, 5.6vw, 72px) auto 0; text-align: center; font-family: var(--ab-serif); font-weight: 500; font-size: var(--fs-quote); line-height: 1.35; color: var(--ab-deep); }
.fm-pull .ab-mark path { fill: #9fd6b2; }

/* ---------- Nothing on the farm works alone ---------- */
.ab .fm-cycle { overflow: hidden; color: #fff; background: radial-gradient(900px 520px at 100% 0%, rgba(0, 124, 173, .28), transparent 62%), radial-gradient(800px 520px at 0% 100%, rgba(8, 114, 45, .4), transparent 60%), var(--ab-deep); }
.fm-cycle h2 { color: #fff; }
.fm-cycle .ab-eyebrow { color: #9fd6b2; }
.fm-cycle .ab-eyebrow::before { background: #9fd6b2; }
.ab .fm-cycle-copy > p { color: rgba(255, 255, 255, .84); margin: 18px 0 0; max-width: 46ch; }
.fm-cycle-grid { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: clamp(36px, 5vw, 80px); align-items: center; }
.fm-cycle-panels { margin-top: 28px; display: grid; gap: 12px; }
/* Panels share one cell, so the block keeps the height of the longest and nothing below it jumps as the ring turns */
.ab-js .fm-cycle-panels > .fm-cycle-panel { grid-area: 1 / 1; }
.fm-cycle-panel { padding: 24px 26px; border-radius: 18px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); border-left: 4px solid #9fd6b2; outline: none; }
.ab-js .fm-cycle-panel:not(.is-active) { visibility: hidden; }
.ab-js .fm-cycle-panel.is-active { animation: fmPanel .5s ease; }
@keyframes fmPanel { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fm-cycle-no { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 800; letter-spacing: .12em; color: #9fd6b2; font-variant-numeric: lining-nums tabular-nums; }
.ab .fm-cycle-panel h3 { margin: 0 0 8px; font-family: var(--ab-serif); font-weight: 600; font-size: clamp(24px, 2.2vw, 28px); color: #fff; }
.ab .fm-cycle-panel p { margin: 0; font-size: 16.5px; color: rgba(255, 255, 255, .88); }
.fm-ring { width: 100%; max-width: 600px; margin: 0 auto; }
.fm-ring-stage { position: relative; aspect-ratio: 1; }
.fm-ring-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; animation: fmTurn 60s linear infinite; }
.fm-ring-line circle { fill: none; stroke: rgba(159, 214, 178, .55); stroke-width: .5; stroke-dasharray: 1.4 1.6; }
@keyframes fmTurn { to { transform: rotate(360deg); } }
.fm-ring-core { position: absolute; left: 50%; top: 50%; width: 48%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; overflow: hidden; background: rgba(255, 255, 255, .08); box-shadow: 0 0 0 10px rgba(159, 214, 178, .14), 0 30px 60px rgba(0, 0, 0, .35); }
.fm-ring-photo { position: absolute; inset: 0; opacity: 0; transform: scale(1.06); transition: opacity .7s ease, transform 1.2s ease; }
.fm-ring-photo.is-on { opacity: 1; transform: none; }
.fm-ring-photo img { width: 100%; height: 100% !important; object-fit: cover; }
.fm-node { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0; border: 0; background: none; color: #fff; cursor: pointer; }
.fm-node-img { display: block; width: clamp(58px, 6.8vw, 92px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 3px solid rgba(255, 255, 255, .55); box-shadow: 0 10px 22px rgba(0, 0, 0, .3); transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease; }
.fm-node-img img { width: 100%; height: 100% !important; object-fit: cover; }
.fm-node-label { padding: 5px 11px; border-radius: 999px; background: rgba(6, 22, 15, .6); font-size: 13px; font-weight: 700; line-height: 1.2; white-space: nowrap; transition: background .25s ease; }
.fm-node:hover .fm-node-img { transform: scale(1.06); }
.fm-node[aria-selected="true"] .fm-node-img { border-color: #9fd6b2; transform: scale(1.12); box-shadow: 0 0 0 5px rgba(159, 214, 178, .3), 0 12px 26px rgba(0, 0, 0, .35); }
.fm-node[aria-selected="true"] .fm-node-label { background: var(--ab-green); }
.fm-node:focus-visible { outline: none; }
.fm-node:focus-visible .fm-node-img { outline: 3px solid #fff; outline-offset: 3px; }

/* ---------- Value addition: comes in, the farm, goes out ---------- */
.ab .fm-value { background: var(--ab-cream); }
.fm-flow { position: relative; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, .75fr) minmax(0, 1.3fr); gap: clamp(48px, 6.5vw, 104px); align-items: center; padding: clamp(28px, 3.4vw, 44px); border-radius: 28px; background: #fff; border: 1px solid var(--ab-line); box-shadow: 0 30px 60px rgba(11, 61, 46, .06); }
/* Lines between the columns, drawn by farm.js; dots travel along them towards the shop */
.fm-flow-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.fm-flow-lines path { fill: none; stroke-linecap: round; transition: opacity .3s ease; }
.fm-flow-lines .fm-line { stroke: rgba(8, 114, 45, .2); stroke-width: 2; }
.fm-flow-lines .fm-dots { stroke: var(--ab-green); stroke-width: 4.5; stroke-dasharray: 0 18; animation: fmFlow 1.5s linear infinite; }
@keyframes fmFlow { to { stroke-dashoffset: -18; } }
.fm-flow.is-dim .fm-flow-lines path:not(.is-on) { opacity: .1; }
.fm-flow-col, .fm-flow-hub { position: relative; z-index: 1; }
.ab .fm-flow-label { margin: 0 0 16px; font-family: var(--font-body); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ab-soft); }
.fm-flow-col:first-of-type .fm-flow-label { text-align: right; }
.fm-flow-in, .fm-flow-out { list-style: none; margin: 0; padding: 0; display: grid; }
.fm-flow-in { gap: 26px; }
.fm-flow-out { gap: 10px; }
.fm-in, .fm-out { transition: opacity .3s ease; }
.fm-flow.is-dim .fm-in:not(.is-on), .fm-flow.is-dim .fm-out:not(.is-on) { opacity: .4; }
.fm-in { display: flex; align-items: center; justify-content: flex-end; gap: 14px; text-align: right; }
.fm-in-text strong { display: block; font-family: var(--ab-serif); font-weight: 600; font-size: 19px; line-height: 1.2; color: var(--ab-deep); }
.fm-in-text small { display: block; margin-top: 4px; font-size: 13px; line-height: 1.4; color: var(--ab-soft); }
.fm-in-ico { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; width: 60px; height: 60px; border-radius: 50%; background: var(--ab-cream); border: 2px solid rgba(8, 114, 45, .28); color: var(--ab-green); transition: background .25s ease, color .25s ease; }
.fm-in-ico svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.fm-in.is-on .fm-in-ico { background: var(--ab-green); border-color: var(--ab-green); color: #fff; }
.fm-flow-hub { text-align: center; }
.fm-hub-photo { width: min(100%, 250px); aspect-ratio: 1; margin: 0 auto; border-radius: 50%; overflow: hidden; border: 8px solid #fff; box-shadow: 0 0 0 2px rgba(8, 114, 45, .28), 0 24px 50px rgba(11, 61, 46, .2); }
.fm-hub-photo img { width: 100%; height: 100% !important; object-fit: cover; }
.ab .fm-hub-text { margin: 18px 0 0; }
.fm-hub-text strong { display: block; font-family: var(--ab-serif); font-weight: 600; font-size: 19px; line-height: 1.25; color: var(--ab-deep); }
.fm-hub-text span { display: block; margin-top: 8px; font-size: 12px; font-weight: 800; line-height: 1.45; letter-spacing: .1em; text-transform: uppercase; color: var(--ab-green); }
.fm-out-card { display: flex; align-items: center; gap: 14px; padding: 8px 14px 8px 8px; border-radius: 16px; background: var(--ab-cream); border: 1px solid var(--ab-line); color: inherit; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
a.fm-out-card:hover, .fm-out.is-on .fm-out-card { border-color: rgba(8, 114, 45, .4); box-shadow: 0 12px 26px rgba(11, 61, 46, .1); }
a.fm-out-card:hover { transform: translateX(4px); color: inherit; }
.fm-out-img { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 12px; overflow: hidden; background: #fff; }
.fm-out-img img { width: 100%; height: 100% !important; object-fit: cover; }
.fm-out-text { flex: 1; min-width: 0; }
.fm-out-text strong { display: block; font-family: var(--ab-serif); font-weight: 600; font-size: 16.5px; line-height: 1.25; color: var(--ab-deep); }
.fm-out-text small { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.35; color: var(--ab-soft); }
.fm-out-price { flex: 0 0 auto; text-align: right; font-weight: 800; font-size: 14.5px; color: var(--ab-green); white-space: nowrap; }
.fm-out-price small { display: block; font-weight: 600; font-size: 11.5px; color: var(--ab-soft); }
.fm-flow-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; margin-top: 28px; }
.ab .fm-flow-foot p { display: flex; align-items: center; gap: 14px; margin: 0; max-width: 66ch; font-size: 15.5px; line-height: 1.55; color: var(--ab-ink); }
.fm-flow-back { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--ab-green); color: #fff; }
.fm-flow-back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Around the farm ---------- */
.ab .fm-strip { background: #fff; overflow: hidden; }

/* ---------- Visit ---------- */
.ab .fm-visit { background: var(--ab-cream); }
.fm-visit-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(36px, 6vw, 96px); align-items: center; }
.fm-visit-photo { margin: 0; max-width: 420px; }
.fm-visit-img { aspect-ratio: 3 / 4; border-radius: 999px 999px var(--ab-radius) var(--ab-radius); box-shadow: 0 30px 60px rgba(11, 61, 46, .14); }
.fm-visit h2 { margin-bottom: 18px; }
.fm-see { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fm-see li { padding: 14px 16px; border-radius: 16px; background: #fff; border: 1px solid var(--ab-line); }
.fm-see strong { display: block; font-family: var(--ab-serif); font-weight: 600; font-size: 17px; color: var(--ab-deep); }
.fm-see span { display: block; margin-top: 4px; font-size: 14px; line-height: 1.5; color: var(--ab-soft); }
.fm-visit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin-top: 26px; }
.fm-link { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-weight: 700; color: var(--ab-green); }

/* ---------- Closing panel ---------- */
.fm-close .pg-hero-actions { margin-top: 28px; }

/* ---------- Narrower screens ---------- */
@media (max-width: 1100px) {
  .fm-seed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fm-flow { grid-template-columns: minmax(0, .8fr) minmax(0, .7fr) minmax(0, 1.3fr); gap: 68px; }
  .fm-in-text small { display: none; }
}
@media (max-width: 900px) {
  .fm-intro-grid, .fm-cycle-grid, .fm-visit-grid { grid-template-columns: 1fr; }
  .fm-intro-photo { margin: 0 auto; max-width: 380px; }
  .fm-intro-inset { left: -4%; }
  .fm-steps { grid-template-columns: 1fr; gap: 30px; max-width: 520px; }
  .fm-step:not(:last-child)::after { display: none; }
  .fm-visit-photo { max-width: 340px; margin: 0 auto; }
  /* The flow reads top to bottom: what comes in, the farm, what goes out, joined by dotted stems */
  .fm-flow { grid-template-columns: 1fr; gap: 0; padding: 24px 18px; }
  .fm-flow-lines { display: none; }
  .fm-flow-col:first-of-type .fm-flow-label { text-align: left; }
  .fm-flow-in { gap: 12px; }
  .fm-in { flex-direction: row-reverse; justify-content: flex-end; text-align: left; }
  .fm-in-text small { display: block; }
  .fm-in-ico { width: 48px; height: 48px; }
  .fm-in-ico svg { width: 24px; height: 24px; }
  .fm-flow-hub { display: flex; align-items: center; gap: 16px; margin: 22px 0; padding: 36px 0; text-align: left; }
  .fm-flow-hub::before, .fm-flow-hub::after { content: ''; position: absolute; left: 63px; width: 3px; height: 28px; background: radial-gradient(circle, var(--ab-green) 1.5px, transparent 2px) 0 0 / 3px 7px repeat-y; }
  .fm-flow-hub::before { top: 0; }
  .fm-flow-hub::after { bottom: 0; }
  .fm-hub-photo { flex: 0 0 auto; width: 104px; margin: 0 0 0 12px; border-width: 5px; }
  .ab .fm-hub-text { margin: 0; }
  .fm-hub-text strong { font-size: 17px; }
}
@media (max-width: 720px) {
  .fm-hero .pg-hero-media img { object-position: 80% 40% !important; }
  .fm-orgs { grid-template-columns: 1fr; gap: 0; }
  .fm-org-join { position: relative; z-index: 1; justify-self: center; margin: -9px 0; width: 30px; height: 30px; font-size: 17px; border: 3px solid #fff; }
  .fm-seed-grid { grid-template-columns: 1fr; gap: 12px; }
  .fm-seed-card { flex-direction: row; }
  .fm-seed-photo { flex: 0 0 38%; aspect-ratio: auto; border-radius: 0 !important; }
  .fm-seed-body { padding: 14px 16px; }
  .ab .fm-seed-card p { font-size: 14px; }
  .fm-seed-card.is-plus { flex-direction: column; padding: 18px 18px 20px; }
  .fm-plus { width: 42px; height: 42px; font-size: 26px; }
  .ab .fm-seed-card.is-plus h3 { margin-top: 14px; }
  .fm-step-photo { aspect-ratio: 16 / 10; border-radius: 80px 18px 80px 18px !important; }
  .fm-node-label { padding: 4px 8px; font-size: 12px; }
  .fm-ring-core { width: 42%; }
  .fm-cycle-panel { padding: 20px 20px; }
  .fm-see { grid-template-columns: 1fr; }
  /* Price moves under the name, so long names keep the full width */
  .fm-out-card { display: grid; grid-template-columns: 52px minmax(0, 1fr); column-gap: 12px; row-gap: 4px; padding-right: 12px; }
  .fm-out-img { grid-row: span 2; width: 52px; height: 52px; }
  .fm-out-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; text-align: left; font-size: 14px; }
  .fm-out-price small { display: inline; }
  .fm-out-text strong { font-size: 15.5px; }
  .fm-flow-foot { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .fm-ring-line, .fm-flow-lines .fm-dots { animation: none; }
  .fm-ring-photo, .fm-seed-photo img, .fm-node-img { transition: none; }
  .ab-js .fm-cycle-panel.is-active { animation: none; }
}
