/* ═══════════════════════════════════════════════════════════
   PUBLIC GRANTS · SEO guide/article layer
   Loaded after pg-styles.css. Benchmarks guide.html (Daylight).
   ═══════════════════════════════════════════════════════════ */

/* reading progress */
.ag-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--lime-3), var(--lime)); z-index: 60; transition: width .08s linear; }

/* ── Hero ──────────────────────────────────── */
.ag-hero {
  padding: 46px 0 36px;
  position: relative;
  background:
    radial-gradient(42rem 30rem at 100% -10%, rgba(196, 242, 99, 0.20) 0%, transparent 55%),
    radial-gradient(34rem 26rem at -6% 0%, rgba(234, 246, 238, 0.85) 0%, transparent 60%),
    linear-gradient(180deg, var(--mint) 0%, var(--paper) 92%);
  border-bottom: 1px solid var(--rule-soft);
}
.ag-hero-inner { max-width: 880px; }
.ag-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.03em; color: var(--ink-3); margin-bottom: 22px; }
.ag-breadcrumb a { color: var(--ink-3); text-decoration: none; transition: color .15s; }
.ag-breadcrumb a:hover { color: var(--ink); }
.ag-breadcrumb .sep { color: var(--ink-4); }
.ag-breadcrumb .cur { color: var(--ink); }
.ag-hero h1 {
  font-family: var(--disp); font-weight: 800;
  font-size: clamp(31px, 4.5vw, 55px); line-height: 1.03; letter-spacing: -0.045em;
  margin: 0 0 18px; text-wrap: balance; max-width: 17ch;
}
.ag-hero h1 .yr { color: var(--ink-4); font-weight: 700; }
.ag-lead { font-size: clamp(16px, 1.7vw, 19px); line-height: 1.62; color: var(--ink-2); max-width: 730px; margin: 0; }
.ag-lead b { color: var(--ink); font-weight: 600; }
.ag-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.ag-chip { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 12px; color: var(--ink-2); background: var(--paper); border: 1px solid var(--rule); padding: 7px 13px; border-radius: 999px; }
.ag-chip b { color: var(--ink); font-weight: 600; }
.ag-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--lime-3); }

/* repères clés */
.ag-reperes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 30px; }
@media (max-width: 760px) { .ag-reperes { grid-template-columns: 1fr 1fr; } }
.ag-repere { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 17px 19px; }
.ag-repere .n { font-family: var(--disp); font-weight: 800; font-size: clamp(21px, 2.5vw, 27px); letter-spacing: -0.04em; line-height: 1; color: var(--ink); }
.ag-repere .n .u { color: var(--lime-3); }
.ag-repere .l { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); margin-top: 9px; line-height: 1.4; }

/* ── Body grid: sticky TOC + prose ─────────── */
.ag-body { background: var(--paper); padding: 42px 0 var(--gut-sec); }
.ag-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(28px, 5vw, 70px); align-items: start; }
@media (max-width: 980px) { .ag-grid { grid-template-columns: 1fr; gap: 6px; } }

.ag-toc { position: sticky; top: 86px; align-self: start; }
@media (max-width: 980px) { .ag-toc { position: static; border: 1px solid var(--rule); border-radius: var(--r-md); padding: 6px; margin-bottom: 20px; } .ag-toc.collapsed .ag-toc-list { display: none; } }
.ag-toc-label { display: flex; align-items: center; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); padding: 8px 10px; }
.ag-toc-label .chev { display: none; }
@media (max-width: 980px) { .ag-toc-label { cursor: pointer; } .ag-toc-label .chev { display: inline; transition: transform .2s; } .ag-toc.collapsed .ag-toc-label .chev { transform: rotate(-90deg); } }
.ag-toc-list { display: grid; gap: 1px; counter-reset: toc; }
.ag-toc-list a { display: flex; gap: 11px; font-size: 13px; line-height: 1.35; color: var(--ink-3); text-decoration: none; padding: 8px 10px; border-radius: 8px; border-left: 2px solid transparent; transition: background .14s, color .14s, border-color .14s; }
.ag-toc-list a::before { counter-increment: toc; content: counter(toc, decimal-leading-zero); font-family: var(--mono); font-size: 10.5px; color: var(--ink-4); padding-top: 1px; flex-shrink: 0; }
.ag-toc-list a:hover { background: var(--mint); color: var(--ink); }
.ag-toc-list a.active { color: var(--ink); background: var(--mint); border-left-color: var(--lime-3); font-weight: 500; }
.ag-toc-list a.active::before { color: var(--lime-3); }
.ag-toc-aside { margin-top: 16px; padding: 16px; border: 1px solid var(--rule); border-radius: var(--r-md); background: linear-gradient(160deg, var(--mint), var(--light)); }
@media (max-width: 980px) { .ag-toc-aside { display: none; } }
.ag-toc-aside p { font-size: 13px; line-height: 1.5; color: var(--ink-2); margin: 0 0 12px; }
.ag-toc-aside .btn { width: 100%; justify-content: center; }

/* ── Prose ─────────────────────────────────── */
.ag-prose { max-width: 770px; min-width: 0; }
.ag-prose > *:first-child { margin-top: 0; }
.ag-prose h2 {
  font-family: var(--disp); font-weight: 700;
  font-size: clamp(23px, 2.7vw, 32px); line-height: 1.13; letter-spacing: -0.03em;
  margin: 50px 0 0; padding-top: 28px; border-top: 1px solid var(--rule);
  scroll-margin-top: 92px; text-wrap: balance;
}
.ag-prose h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.ag-prose h2::before { content: ""; display: block; width: 30px; height: 4px; border-radius: 2px; background: var(--lime-3); margin-bottom: 18px; }
.ag-prose h3 { font-family: var(--disp); font-weight: 600; font-size: 19px; letter-spacing: -0.02em; color: var(--ink); margin: 30px 0 0; }
.ag-prose p { font-size: 16.5px; line-height: 1.72; color: var(--ink-2); margin: 16px 0 0; }
.ag-prose h2 + p { font-size: 18.5px; line-height: 1.62; color: var(--ink); margin-top: 20px; }
.ag-prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--lime-3); text-decoration-thickness: 2px; text-underline-offset: 2px; transition: color .15s, text-decoration-color .15s; }
.ag-prose a:hover { color: var(--lime-3); }
.ag-prose strong, .ag-prose b { color: var(--ink); font-weight: 600; }
.ag-prose code { font-family: var(--mono); font-size: 0.88em; background: var(--mint); padding: 1px 6px; border-radius: 5px; color: var(--ink); }
.ag-prose ul, .ag-prose ol { margin: 18px 0 0; padding-left: 0; display: grid; gap: 11px; list-style: none; }
.ag-prose li { position: relative; padding-left: 28px; font-size: 16px; line-height: 1.62; color: var(--ink-2); }
.ag-prose li b { color: var(--ink); }
.ag-prose ul li::before { content: ""; position: absolute; left: 5px; top: 10px; width: 7px; height: 7px; border-radius: 2px; background: var(--lime-3); }
.ag-prose ol { counter-reset: li; }
.ag-prose ol li { counter-increment: li; padding-left: 34px; }
.ag-prose ol li::before { content: counter(li); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 6px; background: var(--ink); color: var(--lime); font-family: var(--mono); font-size: 11px; font-weight: 700; display: grid; place-items: center; }

/* source citation */
.ag-source { display: flex; gap: 11px; align-items: flex-start; margin: 20px 0 0; padding: 11px 15px; background: var(--light); border: 1px solid var(--rule-soft); border-left: 2px solid var(--lime-3); border-radius: 0 10px 10px 0; font-family: var(--mono); font-size: 12px; line-height: 1.55; color: var(--ink-3); }
.ag-source .lbl { color: var(--lime-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; flex-shrink: 0; }
.ag-source b { color: var(--ink-2); font-weight: 600; }

/* tables */
.ag-table { margin: 26px 0 0; border: 1px solid var(--rule); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-card); }
.ag-table-scroll { overflow-x: auto; }
.ag-table table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 600px; }
.ag-table thead th { background: var(--ink); color: var(--paper); text-align: left; font-family: var(--disp); font-weight: 600; font-size: 13.5px; letter-spacing: -0.01em; padding: 14px 16px; }
.ag-table tbody td { padding: 13px 16px; border-top: 1px solid var(--rule-soft); vertical-align: top; line-height: 1.5; color: var(--ink-2); }
.ag-table tbody tr:nth-child(even) { background: var(--light); }
.ag-table tbody td:first-child { color: var(--ink); font-weight: 600; }
.ag-table tbody strong, .ag-table tbody b { color: var(--ink); font-weight: 600; }
.ag-table a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--lime-3); text-decoration-thickness: 2px; text-underline-offset: 2px; font-weight: 600; white-space: nowrap; }
.ag-table a:hover { color: var(--lime-3); }
.ag-table-cap { font-family: var(--mono); font-size: 11.5px; color: var(--ink-4); margin: 10px 0 0; line-height: 1.5; }

/* inline programme chips */
.ag-progs { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; }
.ag-prog { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 500; color: var(--ink); text-decoration: none; background: var(--paper); border: 1px solid var(--rule); padding: 8px 14px; border-radius: 999px; transition: background .15s, border-color .15s, transform .15s; }
.ag-prog:hover { background: var(--mint); border-color: var(--lime-3); transform: translateY(-1px); }
.ag-prog .arrow { color: var(--lime-3); font-weight: 700; }

/* callout */
.ag-callout { display: flex; gap: 14px; margin: 24px 0 0; padding: 18px 20px; background: var(--mint); border: 1px solid var(--rule-soft); border-radius: var(--r-md); }
.ag-callout.butter { background: var(--butter); }
.ag-callout .ic { flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: var(--lime); display: grid; place-items: center; font-family: var(--disp); font-weight: 800; font-size: 16px; }
.ag-callout p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.ag-callout p b { color: var(--ink); }

/* FAQ */
.ag-faq { margin-top: 54px; padding-top: 32px; border-top: 1px solid var(--rule); scroll-margin-top: 92px; }
.ag-faq > h2 { font-family: var(--disp); font-weight: 700; font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.03em; margin: 0 0 4px; }
.ag-faq > .sub { font-size: 14.5px; color: var(--ink-3); margin: 0 0 10px; }
.ag-faq details { border-bottom: 1px solid var(--rule); }
.ag-faq summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; cursor: pointer; list-style: none; padding: 19px 0; font-family: var(--disp); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; color: var(--ink); }
.ag-faq summary::-webkit-details-marker { display: none; }
.ag-faq summary .ic { flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--rule); display: grid; place-items: center; color: var(--ink-3); transition: background .2s, color .2s, border-color .2s; }
.ag-faq summary .ic::before { content: "+"; font-size: 17px; line-height: 1; }
.ag-faq details[open] summary .ic { background: var(--ink); color: var(--lime); border-color: var(--ink); }
.ag-faq details[open] summary .ic::before { content: "\2212"; }
.ag-faq .ans { padding: 0 0 21px; font-size: 15.5px; line-height: 1.66; color: var(--ink-3); max-width: 700px; }
.ag-faq .ans a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--lime-3); text-decoration-thickness: 2px; text-underline-offset: 2px; }

/* related */
.ag-related { margin-top: 48px; }
.ag-related .eyebrow { margin-bottom: 16px; }
.ag-related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 620px) { .ag-related-grid { grid-template-columns: 1fr; } }
.ag-rel { display: flex; flex-direction: column; gap: 7px; padding: 19px 21px; border: 1px solid var(--rule); border-radius: var(--r-md); text-decoration: none; color: var(--ink); background: var(--paper); transition: transform .2s, box-shadow .2s, border-color .2s; }
.ag-rel:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); border-color: var(--lime-3); }
.ag-rel .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-4); }
.ag-rel .t { font-family: var(--disp); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; line-height: 1.28; }
.ag-rel .t .arrow { color: var(--lime-3); font-weight: 700; }

/* CTA band */
.ag-cta { margin-top: 46px; background: var(--ink); border-radius: var(--r-lg); padding: clamp(28px, 4vw, 46px); position: relative; overflow: hidden; }
.ag-cta::before { content: ""; position: absolute; width: 380px; height: 380px; border-radius: 50%; background: var(--lime); filter: blur(130px); opacity: 0.16; right: -120px; top: -160px; pointer-events: none; }
.ag-cta-in { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.ag-cta .txt { max-width: 560px; }
.ag-cta h3 { font-family: var(--disp); font-weight: 700; font-size: clamp(22px, 2.6vw, 29px); letter-spacing: -0.03em; color: var(--paper); margin: 0; text-wrap: balance; }
.ag-cta h3 .stamp { transform: rotate(-2deg); }
.ag-cta p { margin: 12px 0 0; font-size: 14.5px; line-height: 1.55; color: rgba(250, 253, 249, 0.66); }
.ag-cta .btn-lime { flex-shrink: 0; }

/* reveal (decorative only — prose stays visible without JS) */
.ag-reperes[data-reveal], .ag-related-grid[data-reveal], .ag-cta[data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1); }
.ag-reperes.vis, .ag-related-grid.vis, .ag-cta.vis { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .ag-reperes[data-reveal], .ag-related-grid[data-reveal], .ag-cta[data-reveal] { opacity: 1; transform: none; transition: none; } }
