/* ============================================================
   Server-rendered public pages: pretrained classifiers, detectors and search, solutions.
   Page openings, buttons, cards, pills, chips, banners, sections and code blocks come from the
   website's core.css (loaded by _SiteHead); this file holds only the layout these pages add, and
   reads brand.css for every colour, font, radius, shadow and spacing step.
   ============================================================ */

/* ── Hero extras (the hero itself is core.css's .hero / .hero-in) ── */
.fn-h1-accent { color: var(--blue); }
.fn-meta-row { display: flex; flex-wrap: wrap; gap: var(--s-6); color: var(--muted); font-size: 13px; }
.fn-meta-row > span { display: inline-flex; align-items: center; gap: var(--s-2); }

/* Hero visual: a mock API response card */
.fn-hero-card { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s); box-shadow: 0 18px 38px rgba(4, 10, 20, 0.10); }
.fn-hero-card-chrome { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-3) var(--s-4); background: var(--bg-2); border-bottom: 1px solid var(--line); }
.fn-hero-card-chrome span { width: 10px; height: 10px; border-radius: 50%; }
.fn-hero-card-chrome span:nth-child(1) { background: #ff5f57; }
.fn-hero-card-chrome span:nth-child(2) { background: #febc2e; }
.fn-hero-card-chrome span:nth-child(3) { background: #28c840; }
.fn-hero-card-chrome em { margin-left: var(--s-3); font-style: normal; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.fn-hero-card-body { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--s-4); align-items: center; padding: var(--s-5); }
.fn-hero-card-image { width: 100%; aspect-ratio: 4 / 3; border-radius: var(--r-xs); border: 1px solid var(--line); background: var(--bg-2) center / cover no-repeat; }
.fn-pred { display: flex; flex-direction: column; gap: var(--s-3); }
.fn-pred-row { display: grid; grid-template-columns: 1fr auto; gap: var(--s-2) var(--s-3); align-items: center; font-size: 13px; }
.fn-pred-label { color: var(--ink); font-weight: 500; }
.fn-pred-score { color: var(--muted); font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.fn-pred-bar { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--bg-3); overflow: hidden; }
.fn-pred-bar > i { display: block; height: 100%; border-radius: 999px; background: var(--blue); }
.fn-pred-top .fn-pred-label { color: var(--blue); font-weight: 600; }
.fn-pred-top .fn-pred-bar > i { background: linear-gradient(90deg, var(--blue), var(--sky)); }

/* ── Section headings (left-aligned, unlike core's centred .sec-head) ── */
.fn-h2 { margin: 0 0 var(--s-2); }
.fn-section-sub { margin: 0 0 var(--s-8); max-width: 680px; }

/* ── Try-it ─────────────────────────────────────────────── */
.fn-try-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--s-4); margin-bottom: var(--s-4); }
.fn-try-head p { color: var(--ink-2); font-size: 14px; }
/* The widget is injected by /assets/js/*embed*.js inside .fn-embed-host */
.fn-embed-host #invoke-container .upload-area {
  border-radius: var(--r-s) !important;
  border: 2px dashed var(--blue) !important;
  background-color: var(--blue-soft) !important;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.fn-embed-host #invoke-container .upload-area:hover { background-color: var(--blue-line) !important; }
.fn-embed-host #invoke-container .upload-instructions { font-family: var(--font) !important; color: var(--ink) !important; }
.fn-embed-host #invoke-container #prediction,
.fn-embed-host #invoke-container #no-prediction,
.fn-embed-host #invoke-container #error { font-family: var(--font) !important; }

/* ── Labels, specs, notes ───────────────────────────────── */
.fn-labels-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--s-3); }
.fn-labels-more { margin-top: var(--s-4); }
.fn-spec-label { font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.fn-spec-value { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.fn-note { margin-top: var(--s-4); }

/* ── Code samples and the API quick start ───────────────── */
.fn-code-label { margin: 0 0 var(--s-2); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.fn-code-block { margin: 0 0 var(--s-4); }
.fn-code-block code { white-space: pre; }
/* Pretrained/_ApiQuickStart.cshtml: a tabbed code box that is "locked" (blurred placeholders + floating CTA)
   until provisioning flips it to .fn-qs--live. html.nyk-authed comes from the site header's auth script. */
html.nyk-authed .fn-qs [data-auth="anon"] { display: none !important; }
html:not(.nyk-authed) .fn-qs [data-auth="user"] { display: none !important; }
.fn-qs { overflow: hidden; background: var(--n-bg); border: 1px solid var(--n-line); border-radius: var(--r-s); box-shadow: var(--shadow-2); }
.fn-qs-head { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--n-line); }
.fn-qs-title { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--n-muted); white-space: nowrap; }
.fn-qs-tabs { display: flex; gap: var(--s-1); margin-left: auto; }
.fn-qs-tab { padding: var(--s-1) var(--s-3); border: 1px solid transparent; border-radius: var(--r-xs); background: none; font-family: var(--mono); font-size: 12px; color: var(--n-muted); cursor: pointer; }
.fn-qs-tab:hover { color: var(--n-ink); }
.fn-qs-tab[aria-selected="true"] { color: var(--n-ink); background: var(--n-bg-3); border-color: var(--n-line); }
.fn-qs-copy { display: inline-flex; align-items: center; gap: var(--s-2); padding: var(--s-1) var(--s-3); border: 1px solid var(--n-line); border-radius: var(--r-xs); background: none; font-size: 12px; color: var(--n-muted); cursor: pointer; }
.fn-qs-copy:hover { color: var(--n-ink); border-color: var(--n-muted); }
.fn-qs-body { position: relative; }
.fn-qs-code { margin: 0; min-height: 132px; padding: var(--s-4); overflow-x: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: var(--n-ink); }
.fn-qs-code code { font-family: inherit; white-space: pre; }
/* Locked: the placeholder snippet stays real text in the DOM (readable by crawlers, screen readers, agents); the blur is visual only. */
.fn-qs:not(.fn-qs--live) .fn-qs-code { filter: blur(1.8px); user-select: none; pointer-events: none; }
.fn-qs:not(.fn-qs--live) .fn-qs-copy,
.fn-qs:not(.fn-qs--live) .fn-qs-foot,
.fn-qs--live .fn-qs-overlay { display: none; }
.fn-qs-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-3); }
.fn-qs-overlay-error { padding: var(--s-1) var(--s-3); border-radius: var(--r-xs); background: rgba(4, 10, 20, 0.9); font-size: 12.5px; color: var(--amber); }
.fn-qs-cta { display: inline-block; padding: var(--s-3) var(--s-5); border: 1px solid var(--line-2); border-radius: 999px; background: var(--card); color: var(--ink) !important; font-size: 14px; font-weight: 600; text-decoration: none !important; box-shadow: 0 18px 38px rgba(4, 10, 20, 0.10); }
.fn-qs-cta:hover { background: var(--bg-2); }
.fn-qs-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-top: 1px solid var(--n-line); }
.fn-qs-doclink { font-size: 13px; color: var(--sky) !important; }
.fn-qs-note { flex: 1 1 200px; font-size: 12.5px; line-height: 1.5; color: var(--n-muted); }
.fn-qs-note--error { color: var(--amber); }
.fn-qs-refresh { display: inline-block; padding: var(--s-2) var(--s-4); border: 1px solid var(--line-2); border-radius: 999px; background: var(--card); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.fn-qs-refresh:hover { background: var(--bg-2); }

/* ── FAQ: always open on these pages (the answers are also in the FAQ JSON-LD) ── */
.fn-faq-item { padding: var(--s-4) 0; border-bottom: 1px solid var(--line); }
.fn-faq-item h3 { margin: 0 0 var(--s-2); }
.fn-faq-item p { color: var(--ink-2); font-size: 14px; line-height: 1.6; }

/* ── Closing call to action ─────────────────────────────── */
.fn-final-cta { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--s-8); align-items: center; padding: var(--s-12) var(--s-10); border-radius: var(--r-s); background: linear-gradient(135deg, var(--blue) 0%, var(--blue-ink) 100%); color: var(--on-blue); }
.fn-final-cta h2 { margin: 0 0 var(--s-3); color: var(--on-blue); }
.fn-final-cta p { color: rgba(255, 255, 255, 0.85); font-size: 15px; line-height: 1.6; }
.fn-final-cta-actions { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-3); }
.fn-final-cta .btn-primary { background: var(--card); color: var(--blue); }
.fn-final-cta .btn-primary:hover { background: var(--bg-2); color: var(--blue-hover); }
.fn-final-cta .btn-outline { background: transparent; border-color: rgba(255, 255, 255, 0.35); color: var(--on-blue); }
.fn-final-cta .btn-outline:hover { background: rgba(255, 255, 255, 0.10); border-color: var(--on-blue); color: var(--on-blue); }

/* ── Pretrained classifier index (Pretrained/Index.cshtml) ── */
.pcx-search { align-self: center; width: 100%; max-width: 480px; padding: var(--s-3) var(--s-4); border: 1px solid var(--line-2); border-radius: var(--r-xs); background: var(--card); font-size: 15px; }
.pcx-letter { margin: var(--s-6) 0 var(--s-3); padding-bottom: var(--s-1); border-bottom: 1px solid var(--line); font-size: 16px; font-weight: 600; color: var(--blue); }
.pcx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s-1) var(--s-5); }
.pcx-grid a { display: block; overflow: hidden; padding: var(--s-1) 2px; border-radius: 4px; font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.pcx-grid a:hover { background: var(--bg-2); }
.pcx-type { margin-left: var(--s-1); font-size: 11px; color: var(--muted); }

/* ── Pretrained detector index (Detectors/Index.cshtml) ── */
.pdx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s-5); }
.pdx-card { display: block; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.pdx-card:hover { border-color: var(--blue-line); box-shadow: var(--shadow-2); text-decoration: none; }
.pdx-card-image { height: 150px; background-size: cover; background-position: center; }
.pdx-card-body { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-4) var(--s-5) var(--s-5); }
.pdx-card h2 { font-size: 1.0625rem; letter-spacing: -0.01em; }
.pdx-card p { color: var(--ink-2); font-size: 13.5px; }

/* ── Solution pages (Solutions/Solution.cshtml) ── */
.sol-pipeline { display: grid; gap: var(--s-4); margin-top: var(--s-2); }
.sol-step { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: var(--s-5); padding: var(--s-5) var(--s-6); background: var(--card); border: 1px solid var(--line); border-radius: var(--r); transition: border-color .15s, box-shadow .15s; }
.sol-step:hover { border-color: var(--blue-line); box-shadow: var(--shadow-2); }
.sol-step .pill { margin-bottom: var(--s-2); }
.sol-step h3 { margin: 0 0 var(--s-1); }
.sol-step h3 a { color: var(--ink); }
.sol-step p { max-width: 560px; color: var(--ink-2); font-size: 14.5px; }
.sol-step-actions { display: flex; flex-direction: column; gap: var(--s-2); text-align: right; white-space: nowrap; }
.sol-connector { width: 2px; height: 14px; margin: 0 auto; background: var(--line-2); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .fn-hero-card-body { grid-template-columns: 1fr; }
  .fn-final-cta { grid-template-columns: 1fr; padding: var(--s-8) var(--s-6); }
  .fn-final-cta-actions { flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 720px) {
  .fn-qs-head { flex-wrap: wrap; }
  .fn-qs-tabs { margin-left: 0; }
  .sol-step { grid-template-columns: 40px 1fr; }
  .sol-step-actions { grid-column: 1 / -1; flex-direction: row; text-align: left; margin-top: var(--s-2); }
}
