/* ============================================================
   CADRIQUE - agriculture.html only (loaded after main.css)
   Rewritten 2026-11 (uplift). One idea organises the page: the seam between the
   home (green) and world (charcoal) panels is the page axis. Section intros, the
   photo gutter, the role descriptions and the standards columns all sit on it.
   ============================================================ */

.p-agriculture{
  --ag-g:clamp(14px,1.6vw,24px);                 /* gutter that straddles the axis */
  --ag-pad:clamp(40px,6vw,120px);                /* text offset from the seam inside the panels */
  --ag-edge:max(var(--gutter), calc(100% - var(--w-max) / 2 + var(--gutter)));   /* page gutter, measured inside a half-width panel */
}

/* ---------- section intros: headline left, sentence right of the axis ---------- */
.ag-head{ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); align-items:end; }
.ag-head .d2{ max-width:14ch; }
.ag-head > .body-m{ padding-left:calc(var(--ag-g) / 2); padding-bottom:.35em; max-width:calc(58ch + var(--ag-g)); }
.ag-head--axis > .body-m{ padding-left:var(--ag-pad); max-width:calc(52ch + var(--ag-pad)); }
.p-agriculture .ag-h2{ max-width:16ch; }
.ag-dual-head{ padding-block:clamp(56px,7vw,104px) clamp(48px,6vw,88px); }
@media (max-width:1023px){
  .ag-head{ grid-template-columns:1fr; }
  .ag-head > .body-m, .ag-head--axis > .body-m{ padding:0; margin-top:20px; max-width:58ch; }
}

/* ---------- two markets (signature) ---------- */
.ag-dual{ display:grid; grid-template-columns:1fr 1fr; }
.ag-dir{
  position:relative; overflow:hidden; display:flex; flex-direction:column;
  padding-block:clamp(56px,6.5vw,104px);
  color:var(--paper); --fg:#F3F0EA; --fg-soft:rgba(243,240,234,.76); --line:rgba(243,240,234,.16); --line-strong:rgba(243,240,234,.24);
}
.ag-dir--home{ background-color:var(--green); padding-left:var(--ag-edge); padding-right:var(--ag-pad); }
.ag-dir--world{ background-color:var(--charcoal); padding-left:var(--ag-pad); padding-right:var(--ag-edge); }
.ag-dir-in{ position:relative; z-index:1; width:100%; flex:1; display:flex; flex-direction:column; }
.ag-dir .eyebrow{ color:rgba(243,240,234,.74); }
.ag-dir h3{ font-size:clamp(2rem,3.4vw,3.6rem); font-weight:var(--w-display); letter-spacing:-.024em; line-height:1.04; max-width:11ch; min-height:2.08em; }

/* direction arrows: a 1px shaft that draws from its tail, the head riding the tip */
.ag-dir .arrow{
  --aw:clamp(120px,14vw,220px);
  display:block; position:relative; width:var(--aw); height:9px; margin-top:clamp(20px,2.4vw,32px);
}
.ag-dir .arrow.reveal{ opacity:1; transform:none; transition:none; }
.ag-dir .arrow::before{
  content:""; position:absolute; left:0; right:0; top:4px; height:1px; background:var(--red);
  transition:transform 1.3s var(--ease-out) .3s;
}
.ag-dir .arrow::after{
  content:""; position:absolute; top:4.5px; width:8px; height:8px; border-top:1px solid var(--red); border-right:1px solid var(--red);
  transition:transform 1.3s var(--ease-out) .3s, opacity .3s linear .3s;
}
.ag-dir .arrow--out::before{ transform-origin:0 50%; }
.ag-dir .arrow--in::before{ transform-origin:100% 50%; }
.ag-dir .arrow--out::after{ right:1px; transform:translate(0,-50%) rotate(45deg); }
.ag-dir .arrow--in::after{ left:1px; transform:translate(0,-50%) rotate(-135deg); }
.ag-dir .arrow.reveal:not(.in)::before{ transform:scaleX(0); }
.ag-dir .arrow.reveal:not(.in)::after{ opacity:0; }
.ag-dir .arrow--out.reveal:not(.in)::after{ transform:translate(calc(var(--aw) * -1 + 10px),-50%) rotate(45deg); }
.ag-dir .arrow--in.reveal:not(.in)::after{ transform:translate(calc(var(--aw) - 10px),-50%) rotate(-135deg); }
html.no-js .ag-dir .arrow::before{ transform:none !important; }
html.no-js .ag-dir .arrow::after{ opacity:1 !important; }
html.no-js .ag-dir .arrow--out::after{ transform:translate(0,-50%) rotate(45deg) !important; }
html.no-js .ag-dir .arrow--in::after{ transform:translate(0,-50%) rotate(-135deg) !important; }

.ag-dir p:not(.eyebrow){ margin-top:clamp(20px,2.4vw,32px); margin-bottom:clamp(40px,4.4vw,64px); color:var(--fg-soft); line-height:1.7; max-width:46ch; }
.ag-dir dl{
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:clamp(14px,2vw,28px);
  margin:auto 0 0; padding-top:clamp(20px,2vw,28px); border-top:1px solid var(--line-strong);
}
.ag-dir dl > div{ min-width:0; }
.ag-dir dt{ font-size:clamp(1.5rem,1.9vw,2rem); font-weight:var(--w-title); letter-spacing:-.022em; line-height:1; font-variant-numeric:lining-nums; }
.ag-dir dd{ margin:10px 0 0; font-size:.9375rem; color:var(--fg-soft); line-height:1.45; max-width:19ch; text-wrap:balance; }
@media (min-width:1024px){
  .ag-dir dd{ min-height:calc(1.45em * 3); }
}
@media (max-width:1023px){
  .ag-dual{ grid-template-columns:1fr; }
  .ag-dir--home, .ag-dir--world{ padding-inline:var(--gutter); }
  .ag-dir h3{ min-height:0; max-width:none; }
  .ag-dir p:not(.eyebrow){ max-width:58ch; }
}
@media (max-width:560px){
  .ag-dir{ padding-block:64px; }
  .ag-dir dl{ grid-template-columns:1fr; gap:18px; }
  .ag-dir dl > div{ display:grid; grid-template-columns:7.6rem minmax(0,1fr); column-gap:16px; align-items:baseline; }
  .ag-dir dd{ margin:0; max-width:none; font-size:1rem; text-wrap:pretty; }
}

/* ---------- infrastructure: four photographs, one grade, gutter on the axis ---------- */
.ag-fields{ display:grid; grid-template-columns:1fr 1fr; gap:var(--ag-g); margin-top:clamp(36px,4.4vw,64px); }
.ag-field{ position:relative; overflow:hidden; aspect-ratio:3/2; display:block; color:var(--paper); }
.ag-field-ph{ position:absolute; inset:0; overflow:hidden; background:#152A20; isolation:isolate; }
.ag-field-ph img{
  position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block;
  filter:saturate(var(--ph-sat,.56)) sepia(.2) contrast(1.08) brightness(.92); mix-blend-mode:lighten;
  transform:scale(1.08); transition:transform 1.8s var(--ease-out) var(--d,0s);
}
.ag-field.in .ag-field-ph img, html.no-js .ag-field-ph img{ transform:scale(1); }
.ag-field.in:hover .ag-field-ph img{ transform:scale(1.035); transition-delay:0s; }
/* silos: one notch quieter and cropped past the maker's mark at the top left */
.ag-field-ph img[src*="south-africa-silos"]{ --ph-sat:.4; inset:auto 0 0 auto; width:114%; height:114%; }
.ag-field-ph img[src*="manzini-irrigation"]{ object-position:50% 62%; }
.ag-field-ph::after{ content:""; position:absolute; inset:0; background:linear-gradient(to top, rgba(12,16,13,.88) 0%, rgba(12,16,13,.46) 36%, rgba(12,16,13,0) 66%); }
.ag-field-in{ position:absolute; left:0; right:0; bottom:0; z-index:1; padding:clamp(22px,2.6vw,40px); }
.ag-field h3{ font-size:clamp(1.5rem,2.3vw,2.4rem); font-weight:var(--w-title); letter-spacing:-.016em; line-height:1.14; max-width:20ch; color:var(--paper); }
.ag-field p{ margin-top:10px; color:rgba(243,240,234,.82); font-size:1rem; line-height:1.55; max-width:42ch; }
@media (max-width:1023px){
  .ag-field{ aspect-ratio:4/3; }
}
@media (max-width:767px){
  /* one lead photograph, then three compact rows: never photograph after photograph on a phone */
  .ag-fields{ grid-template-columns:1fr; gap:28px; }
  .ag-field:not(:first-child){ aspect-ratio:auto; display:grid; grid-template-columns:104px minmax(0,1fr); column-gap:18px; align-items:start; color:var(--ink); overflow:visible; }
  .ag-field:not(:first-child) .ag-field-ph{ position:relative; inset:auto; aspect-ratio:1; }
  .ag-field:not(:first-child) .ag-field-ph::after{ content:none; }
  .ag-field:not(:first-child) .ag-field-ph img{ filter:saturate(var(--ph-sat,.56)) sepia(.2) contrast(1.08) brightness(.98); }
  .ag-field:not(:first-child) .ag-field-in{ position:static; padding:0; margin-top:-.2em; }
  .ag-field:not(:first-child) h3{ font-size:1.3rem; line-height:1.2; color:var(--ink); max-width:none; }
  .ag-field:not(:first-child) p{ margin-top:8px; color:var(--fg-soft); max-width:none; }
  .ag-field:first-child{ margin-bottom:4px; }
  /* the compact rows rise in like text; only the lead photograph unmasks */
  .ag-field.reveal-clip:not(:first-child){ clip-path:none; opacity:0; transform:translateY(18px); transition:opacity .9s var(--ease-out) var(--d,0s), transform 1.1s var(--ease-out) var(--d,0s); }
  .ag-field.reveal-clip.in:not(:first-child), html.no-js .ag-field.reveal-clip:not(:first-child){ opacity:1; transform:none; }
}

/* ---------- roles: three link rows, descriptions start on the axis ---------- */
.ag-roles{ display:grid; grid-template-columns:calc(50% + var(--ag-g) / 2) minmax(0,1fr) max-content; margin-top:clamp(36px,4.4vw,64px); border-top:1px solid var(--line-strong); }
.ag-role{ position:relative; grid-column:1 / -1; display:grid; grid-template-columns:subgrid; align-items:center; padding:clamp(28px,3vw,46px) 0; color:inherit; }
@supports not (grid-template-columns:subgrid){
  .ag-role{ grid-template-columns:calc(50% + var(--ag-g) / 2) minmax(0,1fr) 17rem; }
}
.ag-role::after{
  content:""; position:absolute; left:0; right:0; bottom:0; height:1px; background:var(--line);
  transform:scaleX(0); transform-origin:0 50%; transition:transform 1.3s var(--ease-out) calc(var(--d,0s) + .15s);
}
.ag-role.in::after, html.no-js .ag-role::after{ transform:scaleX(1); }
.ag-role h3{ font-size:clamp(1.5rem,2.4vw,2.5rem); font-weight:var(--w-title); letter-spacing:-.016em; line-height:1.16; max-width:15ch; padding-right:24px; transition:color var(--dur-1) var(--ease); }
.ag-role p{ color:var(--fg-soft); line-height:1.62; max-width:46ch; }
.ag-role .more{ justify-self:end; display:inline-flex; align-items:center; gap:14px; padding-left:clamp(24px,3vw,56px); font-size:var(--label-size); font-weight:600; letter-spacing:var(--label-track); text-transform:uppercase; color:var(--ink); white-space:nowrap; transition:color var(--dur-1) var(--ease); }
.ag-role .more .arr{ width:20px; height:10px; position:relative; flex:none; transition:transform var(--dur-2) var(--ease-out); }
.ag-role .more .arr::before{ content:""; position:absolute; left:0; right:4px; top:50%; height:1.5px; margin-top:-.75px; background:currentColor; }
.ag-role .more .arr::after{ content:""; position:absolute; right:2px; top:50%; width:7px; height:7px; border-top:1.5px solid currentColor; border-right:1.5px solid currentColor; transform:translateY(-50%) rotate(45deg); }
.ag-role:hover h3, .ag-role:hover .more, .ag-role:focus-visible h3, .ag-role:focus-visible .more{ color:var(--red); }
.ag-role:hover .more .arr, .ag-role:focus-visible .more .arr{ transform:translateX(5px); }
@media (max-width:1023px){
  .ag-roles{ grid-template-columns:minmax(0,1fr) minmax(0,1.25fr); column-gap:clamp(20px,4vw,40px); }
  .ag-role{ align-items:start; }
  .ag-role h3{ grid-row:1 / span 2; padding-right:0; }
  .ag-role p{ grid-column:2; }
  .ag-role .more{ grid-column:2; justify-self:start; padding-left:0; margin-top:18px; }
}
@media (max-width:767px){
  .ag-roles{ grid-template-columns:1fr; }
  .ag-role{ grid-template-columns:1fr; padding:30px 0; }
  .ag-role h3{ grid-row:auto; max-width:none; }
  .ag-role p{ grid-column:1; margin-top:12px; }
  .ag-role .more{ grid-column:1; }
}

/* ---------- standards: four columns under one drawn rule, third column on the axis ---------- */
.ag-std{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); column-gap:var(--ag-g); margin-top:clamp(36px,4.4vw,64px); padding-top:clamp(28px,3vw,44px); border-top:1px solid var(--line-strong); }
.ag-std > div{ padding-right:clamp(8px,1.6vw,32px); }
.ag-std b{ display:block; font-size:clamp(1.15rem,1.45vw,1.35rem); font-weight:var(--w-title); letter-spacing:-.012em; line-height:1.25; min-height:2.5em; margin-bottom:14px; text-wrap:balance; }
.ag-std p{ color:var(--fg-soft); font-size:1rem; line-height:1.6; max-width:32ch; }
@media (max-width:1023px){
  .ag-std{ grid-template-columns:1fr 1fr; row-gap:clamp(32px,5vw,48px); }
  .ag-std b{ min-height:0; }
}
@media (max-width:560px){
  .ag-std{ grid-template-columns:1fr; row-gap:30px; }
  .ag-std > div{ padding-right:0; }
  .ag-std b{ margin-bottom:8px; }
  .ag-std p{ max-width:none; }
}

@media (prefers-reduced-motion:reduce){
  .ag-dir .arrow::before, .ag-dir .arrow::after, .ag-role::after, .ag-field-ph img{ transition:none !important; }
  .ag-field-ph img{ transform:none !important; }
  .ag-role::after{ transform:none; }
  .ag-field.reveal-clip:not(:first-child){ opacity:1 !important; transform:none !important; transition:none !important; }
}
