/* Slash & Gain films, drawn live in the Reuben Mowle brand (paper, ink, red pencil).
   Everything is sized in container units, so a film scales with its frame like a video.
   Without JavaScript, or with Reduce Motion on, each film shows its finished state. */

.agf {
  --p: #FAFAF7; --sheet: #F2EDE3; --ink: #1d1b17; --muted: #6B6B68; --rule: #E2DDD2; --pencil: #B4432F; --night: #161613;
  --d: var(--wp--preset--font-family--display, Fraunces, Georgia, serif);
  --s: var(--wp--preset--font-family--body, Inter, Arial, sans-serif);
  --m: var(--wp--preset--font-family--mono, "JetBrains Mono", monospace);
  container-type: inline-size; position: absolute; inset: 0; overflow: hidden;
  background: var(--p); color: var(--ink); font-family: var(--s); line-height: 1.25;
}
.agf * { box-sizing: border-box; margin: 0; padding: 0; }
.agf ul, .agf ol { list-style: none; }
.agf svg { overflow: visible; }
.agf-scene { position: absolute; inset: 0; padding: 4.5cqw 5cqw; display: flex; flex-direction: column; }
.agf-title { font-family: var(--d); font-weight: 300; font-size: 5.2cqw; letter-spacing: -0.02em; line-height: 1.05; }
.agf-title span { color: var(--pencil); }
.agf-k { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--m); font-size: 1.5cqw; color: var(--muted); margin-bottom: 1.2cqw; }
.agf-k span:first-child { color: var(--pencil); }
.agf-k b { font-family: var(--d); font-weight: 400; font-size: 2.6cqw; color: var(--ink); }
.agf-k1 { display: block; font-family: var(--m); font-size: 1.35cqw; color: var(--muted); margin-top: 1.4cqw; }
.agf-foot { margin-top: auto; font-family: var(--m); font-size: 1.3cqw; color: var(--muted); }
.agf-end { position: absolute; inset: 0; background: var(--night); color: #FAF8F3; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 6cqw; gap: 1.6cqw; opacity: 0; visibility: hidden; }
.agf-end-k { font-family: var(--m); font-size: 1.5cqw; color: rgba(250,248,243,.6); }
.agf-end-big { font-family: var(--d); font-weight: 300; font-size: 6cqw; line-height: 1.05; letter-spacing: -0.02em; }
.agf-end-big span { color: #E07A62; }
.agf-end-sub { font-size: 1.8cqw; color: rgba(250,248,243,.75); max-width: 60ch; }

/* Slash */
.agf-cols { display: grid; grid-template-columns: 1.15fr 1fr; gap: 4cqw; margin-top: 3.5cqw; }
.agf-subs li { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1cqw; padding: 1.15cqw 0; border-bottom: 1px solid var(--rule); font-size: 1.75cqw; }
.agf-sub-own { display: none; }
.agf-sub-price { font-family: var(--m); font-size: 1.6cqw; }
.agf-subs svg { position: absolute; left: -1%; top: 50%; width: 102%; height: 1.2cqw; transform: translateY(-50%); fill: none; stroke: var(--pencil); stroke-width: 2; stroke-linecap: round; }
.agf-subs li.is-cut .agf-sub-name { color: var(--muted); }
.agf-subs li.is-cut .agf-sub-price { color: var(--pencil); }
.agf-chips { display: grid; grid-template-columns: 1fr 1fr; gap: .9cqw; }
.agf-chips li { font-size: 1.6cqw; padding: .9cqw 1.1cqw; border: 1px solid var(--rule); background: #fff; position: relative; }
.agf-chips li::before { content: ""; display: inline-block; width: 1.2cqw; height: .7cqw; margin-right: .8cqw; border-left: 2px solid var(--pencil); border-bottom: 2px solid var(--pencil); transform: rotate(-45deg) translateY(-.2cqw); }
.agf-chart { margin-top: 1.8cqw; padding: 1.4cqw; background: var(--sheet); }
.agf-chart span { font-family: var(--m); font-size: 1.25cqw; color: var(--muted); }
.agf-chart svg { display: block; width: 100%; height: 11cqw; margin-top: .8cqw; fill: none; stroke-linecap: round; }
.agf-axis { stroke: var(--rule); stroke-width: 1.5; }
.agf-rise { stroke: var(--pencil); stroke-width: 2.5; }

/* Engine */
.agf-panels { position: relative; flex: 1; }
.agf-panels > section { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 2.4cqw; opacity: 0; visibility: hidden; }
.agf-panels > section[data-panel="0"] { opacity: 1; visibility: visible; }
.agf-h { font-family: var(--d); font-weight: 300; font-size: 3.6cqw; letter-spacing: -0.015em; line-height: 1.1; }
.agf-photo { display: block; width: 34cqw; aspect-ratio: 16 / 10; object-fit: cover; box-shadow: 0 1.2cqw 2.6cqw -1.6cqw rgba(30,20,10,.45); }
.agf-photo--big { width: 46cqw; }
.agf-grid { display: grid; grid-template-columns: repeat(4, 12cqw); gap: .9cqw; }
.agf-grid img, .agf-grid i { display: block; width: 12cqw; aspect-ratio: 16 / 10; object-fit: cover; background: var(--sheet); }
.agf-row { display: flex; align-items: center; gap: 3cqw; }
.agf-meta b { display: block; font-family: var(--d); font-weight: 400; font-size: 2.3cqw; min-height: 2.8cqw; }
.agf-meta em { display: block; font-style: normal; font-family: var(--m); font-size: 1.4cqw; color: var(--ink); min-height: 2cqw; max-width: 34cqw; }
.agf-fan { width: 10cqw; height: 16cqw; fill: none; stroke: var(--pencil); stroke-width: 2; stroke-linecap: round; }
.agf-dest { display: grid; gap: 4cqw; font-size: 1.8cqw; }
.agf-dest li, .agf-sales li, .agf-ticks li { opacity: 0; }
.agf-sales { display: grid; gap: 1cqw; min-width: 30cqw; }
.agf-sales li { display: flex; justify-content: space-between; gap: 2cqw; padding: 1.1cqw 1.3cqw; background: #fff; border: 1px solid var(--rule); font-size: 1.6cqw; }
.agf-sales b { font-family: var(--m); font-weight: 400; }
.agf-ticks { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4cqw 3cqw; font-size: 1.8cqw; max-width: 80cqw; }
.agf-ticks li::before { content: ""; display: inline-block; width: 1.4cqw; height: .8cqw; margin-right: 1cqw; border-left: 2px solid var(--pencil); border-bottom: 2px solid var(--pencil); transform: rotate(-45deg) translateY(-.25cqw); }
.agf-regions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2cqw; }
.agf-regions div { display: grid; grid-template-columns: 1fr 1fr; gap: .6cqw; padding: 1cqw; background: #fff; border: 1px solid var(--rule); }
.agf-regions i { aspect-ratio: 16 / 11; background: var(--sheet); }
.agf-regions div:first-child i { background: url("../home/stock-2.webp") center / cover; }
.agf-regions div:nth-child(2) i { background: url("../home/stock-3.webp") center / cover; }
.agf-regions div:nth-child(3) i { background: url("../home/stock-4.webp") center / cover; }
.agf-regions span { grid-column: 1 / -1; font-family: var(--m); font-size: 1.25cqw; color: var(--muted); margin-top: .4cqw; }
.agf-rail { display: grid; grid-template-columns: repeat(7, 1fr); margin-top: 2cqw; position: relative; z-index: 1; }
.agf-rail li { display: flex; flex-direction: column; align-items: center; gap: .8cqw; font-family: var(--m); font-size: 1.3cqw; color: var(--muted); }
.agf-rail i { width: 1.5cqw; height: 1.5cqw; border-radius: 50%; border: 2px solid var(--muted); background: var(--p); transition: background .3s, border-color .3s; }
.agf-rail li.is-on { color: var(--ink); }
.agf-rail li.is-on i { background: var(--pencil); border-color: var(--pencil); }
.agf-railline { position: absolute; left: 12%; right: 12%; bottom: calc(4.5cqw + 3.1cqw); width: 76%; height: 1cqw; fill: none; stroke: var(--pencil); stroke-width: 2; stroke-linecap: round; }

/* AI drafts */
.agf-cards { display: grid; grid-template-columns: 1.05fr 1fr; gap: 2.4cqw; margin-top: 3cqw; align-items: start; }
.agf-card { background: #fff; border: 1px solid var(--rule); box-shadow: 0 1.4cqw 3cqw -2cqw rgba(30,20,10,.35); }
.agf-card--photo img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.agf-card--photo p { padding: 1.3cqw; font-size: 1.4cqw; display: grid; gap: .3cqw; }
.agf-card--photo p span { font-family: var(--m); font-size: 1.15cqw; color: var(--muted); }
.agf-card--draft { padding: 1.8cqw; }
.agf-status { display: flex; align-items: center; gap: .8cqw; font-family: var(--m); font-size: 1.3cqw; color: var(--muted); }
.agf-status i { width: 1cqw; height: 1cqw; border-radius: 50%; background: var(--muted); }
.agf--ai.is-approved .agf-status { color: var(--pencil); }
.agf--ai.is-approved .agf-status i { background: var(--pencil); }
.agf-card--draft b { display: block; font-family: var(--d); font-weight: 400; font-size: 2.2cqw; line-height: 1.15; min-height: 2.6cqw; }
.agf-card--draft em { display: block; font-style: normal; font-size: 1.35cqw; line-height: 1.4; color: var(--ink); min-height: 3.8cqw; }
.agf-kw { display: flex; flex-wrap: wrap; gap: .6cqw; margin-top: .6cqw; }
.agf-kw li { font-family: var(--m); font-size: 1.15cqw; padding: .4cqw .8cqw; background: var(--sheet); opacity: 0; }
.agf-actions { display: flex; justify-content: flex-end; align-items: center; gap: 2cqw; margin-top: 1.8cqw; font-size: 1.4cqw; }
.agf-approve { padding: .8cqw 1.6cqw; background: var(--ink); color: #FAF8F3; }
.agf--ai.is-approved .agf-approve { background: var(--pencil); }

/* Finished state when nothing animates */
.agf.is-static .agf-subs li { }
.agf.is-static .agf-dest li, .agf.is-static .agf-sales li, .agf.is-static .agf-ticks li, .agf.is-static .agf-kw li { opacity: 1; }
.agf-cols > *, .agf-cards > *, .agf-row > * { min-width: 0; }
.agf-card--draft b, .agf-card--draft em { overflow-wrap: anywhere; }

/* Phones: a taller frame and bigger type, so the films read like they do on a laptop */
@media (max-width: 700px) {
  .rm-ag .ag-frame:has(.agf) { aspect-ratio: 4 / 5; }
}
@container (max-width: 560px) {
  .agf-scene { padding: 6cqw; }
  .agf-title { font-size: 8.4cqw; }
  .agf-k { font-size: 2.8cqw; } .agf-k b { font-size: 4.4cqw; }
  .agf-k1 { font-size: 2.6cqw; }
  .agf-foot { font-size: 2.5cqw; }
  .agf-cols { grid-template-columns: 1fr; gap: 4cqw; margin-top: 4cqw; }
  .agf-subs li { font-size: 3.2cqw; padding: 1.4cqw 0; } .agf-sub-price { font-size: 3cqw; }
  .agf-subs svg { height: 2cqw; }
  .agf-chips li { font-size: 3cqw; padding: 1.4cqw; } .agf-chart { display: none; }
  .agf-end-big { font-size: 10cqw; } .agf-end-sub, .agf-end-k { font-size: 3.4cqw; }
  .agf-h { font-size: 6.4cqw; }
  .agf-photo, .agf-photo--big { width: 100%; }
  .agf-row { flex-direction: column; align-items: flex-start; gap: 3cqw; }
  .agf-meta b { font-size: 4.4cqw; } .agf-meta em { font-size: 2.8cqw; max-width: none; }
  .agf-fan { display: none; } .agf-dest { gap: 2cqw; font-size: 3.4cqw; }
  .agf-sales { min-width: 0; width: 100%; } .agf-sales li { font-size: 3cqw; padding: 2cqw; }
  .agf-ticks { grid-template-columns: 1fr; font-size: 3.6cqw; }
  .agf-grid { grid-template-columns: repeat(4, 1fr); } .agf-grid img, .agf-grid i { width: 100%; }
  .agf-regions { grid-template-columns: 1fr; } .agf-regions span { font-size: 2.6cqw; }
  .agf-rail li { font-size: 0; } .agf-rail i { width: 3cqw; height: 3cqw; }
  .agf-railline { bottom: calc(6cqw + 1.5cqw); }
  .agf-cards { grid-template-columns: 1fr; gap: 3cqw; }
  .agf-card--photo { display: none; }
  .agf-card--draft { padding: 4cqw; } .agf-status { font-size: 2.6cqw; } .agf-status i { width: 2cqw; height: 2cqw; }
  .agf-card--draft b { font-size: 5cqw; min-height: 6cqw; } .agf-card--draft em { font-size: 3.2cqw; min-height: 9cqw; }
  .agf-kw li { font-size: 2.6cqw; padding: 1cqw 1.6cqw; } .agf-actions { font-size: 3cqw; } .agf-approve { padding: 1.6cqw 3cqw; }
}

/* Bring the rest of the agencies page in line with the site: no pills, no spaced capitals */
body .rm-ag .ag-pills { gap: .4rem 1.4rem; }
body .rm-ag .ag-pill { height: auto; padding: 0; border: 0; border-radius: 0; text-transform: none; letter-spacing: 0; font-family: var(--wp--preset--font-family--display, Fraunces, serif); font-style: italic; font-size: 1.1rem; color: #B4432F; }
body .rm-ag .ag-label { text-transform: none; letter-spacing: 0; font-size: .85rem; }
body .rm-ag .ag-btn { border-radius: 2px; text-transform: none; letter-spacing: 0; font-family: var(--wp--preset--font-family--display, Fraunces, serif); font-size: 1.1rem; }
