/*
 * Agent Library pages (UIUX-2346). Loaded on single agents only (inc/agents.php).
 * The pages are built from the site's own components (hero, dv, section-head, grid, card,
 * text-art, faq, CTA block). This file adds the few parts the site did not have:
 * two-column layout, icon rows, numbered steps, notes and the Agent Script code block.
 */

/* ---- Hero ---- */
.ag-hero.has-art .wrap {
  grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
  gap: 56px;
}
.ag-hero .eyebrow {
  margin-top: 20px;
}
.ag-hero .lede {
  max-width: none;
}
.ag-intro {
  margin-top: 20px;
}
.ag-hero-img {
  display: block;
  width: 100%;
  max-width: 360px;
  height: auto;
}

/* ---- Demo video: video first, light frame, YouTube loaded on click (fs-agent.js) ---- */
.ag-dv {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
.ag-dv .dv-frame {
  background: linear-gradient(147deg, #e6f4fb 0%, #d2ecf5 83%);
  box-shadow: 0 18px 40px rgba(22, 40, 74, .14);
}
.ag-dv .dv-play {
  background: none;
}
.ag-dv .dv-play img {
  box-sizing: content-box;
  padding: 29px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 14px 30px rgba(35, 56, 98, .1);
  transition: transform .2s;
}
.ag-dv .dv-play:hover img,
.ag-dv .dv-play:focus-visible img {
  transform: scale(1.08);
}
.ag-pills {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.ag-pills li {
  background: var(--mist);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--nile);
}

/* ---- Two columns: style="--l:380px" / "--r:560px" fixes one side, "--g" sets the gap ---- */
.ag-cols {
  display: grid;
  grid-template-columns: minmax(0, var(--l, 1fr)) minmax(0, var(--r, 1fr));
  gap: var(--g, 56px);
  align-items: start;
}
.ag-cols .section-head {
  margin-bottom: 0;
}
.ag-stack {
  display: grid;
  gap: 20px;
  min-width: 0;
}
.ag-stack > .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.ag-body {
  font-size: 18px;
  line-height: 1.7;
}
.btn-line {
  border-color: var(--nile);
  color: var(--nile);
}
.btn-line:hover {
  background: var(--nile);
  color: var(--white);
}

/* ---- Step number on a card ---- */
.ag-num {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--aqua);
  color: var(--blue-ink);
  font: 500 22px/1 var(--display);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

/* ---- Icon tile, icon rows (requirements, limitations) and notes ---- */
.ag-tile {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #46b8d3, #1c80b7);
  box-shadow: 0 10px 22px rgba(28, 128, 183, .3);
}
.ag-tile.t-teal {
  background: linear-gradient(135deg, #7fd6cf, #2a9d93);
  box-shadow: 0 10px 22px rgba(42, 157, 147, .3);
}
.ag-tile.t-coral {
  background: linear-gradient(135deg, #ffa98f, #ff7654);
  box-shadow: 0 10px 22px rgba(255, 118, 84, .3);
}
.ag-tile.t-nile {
  background: linear-gradient(135deg, #3d5c94, #233862);
  box-shadow: 0 10px 22px rgba(35, 56, 98, .3);
}
.ag-rows {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.card.ag-row {
  flex-direction: row;
  align-items: flex-start;
  gap: 20px;
  padding: 24px 28px;
}
.ag-row > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding-top: 2px;
}
.ag-row h3 {
  line-height: 1.25;
}
.ag-row p {
  color: var(--muted);
}
.ag-row.tint p {
  color: var(--nile);
}
.ag-note {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 36px;
  padding: 24px 28px;
  border-radius: var(--radius);
  background: var(--aqua);
  color: var(--nile);
}
.ag-note.top {
  align-items: flex-start;
  margin-top: 40px;
}
.ag-note > div {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.ag-link {
  justify-self: start;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--blue);
  text-decoration: none;
}
.ag-link:hover {
  color: var(--nile);
  text-decoration: underline;
}
.ag-callout {
  background: var(--white);
  border-left: 4px solid var(--blue);
  border-radius: 14px;
  padding: 20px 24px;
  font-size: 16px;
  color: var(--nile);
}

/* ---- Numbered steps ---- */
.ag-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 28px;
  counter-reset: ag;
}
.ag-steps li {
  counter-increment: ag;
  position: relative;
  min-height: 40px;
  padding: 7px 0 0 58px;
  display: grid;
  gap: 6px;
  align-content: start;
}
.ag-steps li::before {
  content: counter(ag);
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  font: 500 18px/1 var(--display);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ag-steps h3 {
  line-height: 1.25;
}
.ag-steps p {
  font-size: 16px;
}
.ag-steps b {
  color: var(--nile);
}
.card.ag-stepcard {
  padding: 30px;
  gap: 22px;
}
.ag-stepcard .ag-steps {
  gap: 22px;
}

/* ---- Example prompt ---- */
.card.ag-example {
  padding: 26px 28px;
  gap: 14px;
}
.ag-prompt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 14px;
  background: var(--aqua);
  color: var(--nile);
  font: 600 17px/1.3 var(--display);
}
.ag-prompt img {
  flex: none;
}

/* ---- Code: inline code, method cards and the Agent Script block ---- */
.ag-code,
.section code {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.section code {
  font-size: .88em;
  font-weight: 500;
  color: var(--blue-ink);
  overflow-wrap: anywhere;
}
.card.ag-method {
  padding: 22px 24px;
  border-radius: 14px;
  align-items: flex-start;
}
.ag-method code {
  background: var(--aqua);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 15px;
}
.ag-code {
  background: var(--nile);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--line);
  min-width: 0;
}
.ag-code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--white);
  font-size: 13px;
  font-weight: 500;
  color: var(--white);
}
.ag-code-bar span {
  overflow-wrap: anywhere;
  min-width: 0;
}
.ag-copy {
  flex: none;
  font: 700 12.5px/1.3 var(--body);
  color: var(--white);
  background: none;
  border: 1px solid var(--white);
  border-radius: 999px;
  padding: 5px 14px;
  cursor: pointer;
}
.ag-copy:hover,
.ag-copy:focus-visible {
  background: var(--white);
  color: var(--nile);
}
.ag-code pre {
  margin: 0;
  padding: 18px 22px 22px;
  font: inherit;
  font-size: 12.5px;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre;
  tab-size: 4;
}
.ag-code pre code {
  font: inherit;
  color: inherit;
}
.ag-code .k {
  color: var(--glory);
}
.ag-code .s {
  color: var(--white);
}

/* ---- Tablet and mobile ---- */
@media (max-width: 900px) {
  .ag-hero.has-art .wrap,
  .ag-dv,
  .ag-cols {
    grid-template-columns: minmax(0, 1fr);
  }
  .ag-cols {
    gap: 32px;
  }
  .ag-hero-img {
    max-width: 240px;
  }
}
@media (max-width: 600px) {
  .card.ag-row,
  .ag-note {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
  }
  .ag-note {
    margin-top: 24px;
  }
  .card.ag-stepcard,
  .card.ag-example {
    padding: 22px 20px;
  }
  .ag-steps li {
    padding-left: 52px;
  }
}
