/* Street Grader for Agents (/agents/): the page's own pieces, on top of site.css (its .dev-* layout, cards, plans and
 * FAQ). Colours come from site.css tokens only, so light and dark follow it. Run `python3 server/tools/site.py`
 * after editing (asset hashes). */

/* Hero: an example street facts block, as an agent would copy it into a listing */
.sga-sample { margin: 0; padding: 1.1rem 1.2rem; max-width: 28rem; width: 100%; justify-self: center; display: grid; gap: 0.9rem; }
.sga-sample-head { display: flex; align-items: center; gap: 0.75rem; }
.sga-sample-head > div { display: grid; min-width: 0; flex: 1; }
.sga-sample-head b { font-family: var(--font-display); font-size: 1.12rem; line-height: 1.25; }
.sga-sample-head span:not(.chip):not(.tag) { color: var(--muted); font-size: 0.9rem; }
.sga-tag-muted { flex: none; color: var(--muted); background: var(--element); }
.sga-sample-rows { margin: 0; display: grid; border-radius: var(--radius-sm); background: var(--element); padding: 0.2rem 0; }
.sga-sample-rows > div { display: grid; grid-template-columns: minmax(7.5rem, 9rem) 1fr; gap: 0.15rem 0.75rem; padding: 0.5rem 0.85rem; font-size: 0.93rem; }
.sga-sample-rows > div + div { border-top: 1px solid var(--glass-line); }
.sga-sample-rows dt { font-weight: 700; }
.sga-sample-rows dd { margin: 0; color: var(--muted); }
.sga-sample-src { margin: 0; font-size: 0.82rem; color: var(--muted); }
.sga-sample figcaption { padding-top: 0.75rem; border-top: 1px solid var(--glass-line); }
@media (max-width: 24rem) {
  .sga-sample { padding: 1rem 0.85rem; }
  .sga-sample-rows > div { grid-template-columns: 1fr; padding: 0.5rem 0.75rem; }
}

/* What's free: two lists side by side from tablet width */
.sga-lists { display: grid; gap: 1rem; grid-template-columns: 1fr; max-width: 56rem; }
@media (min-width: 44rem) { .sga-lists { grid-template-columns: repeat(2, 1fr); } }
.sga-lists .h-list { font-size: 0.97rem; }

/* A free page for every postcode, with a postcode box that opens it */
.sga-page { margin-top: 1rem; max-width: 56rem; display: grid; gap: 1rem 2rem; align-items: end; }
@media (min-width: 52rem) { .sga-page { grid-template-columns: 1fr 19rem; } }
.sga-page h3 { margin-top: 0; }
.sga-page p { margin-bottom: 0; }
.sga-try { display: grid; gap: 0.4rem; }
.sga-try label { font-weight: 600; font-size: 0.95rem; }
.sga-try-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sga-try input {
  flex: 1 1 8rem; min-width: 0; font: inherit; color: var(--text); background: var(--glass-strong);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.5rem 0.75rem; text-transform: uppercase;
}
.sga-try input::placeholder { text-transform: none; color: var(--muted); }
.sga-try input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.sga-try-error { font-size: 0.9rem; }
.sga-try-error[hidden] { display: none; }

/* Material information */
.sga-note { max-width: 50rem; }
.sga-note p:last-child { margin-bottom: 0; }

/* How agents use it: four cards, two by two on wider screens */
.dev .sga-use { grid-template-columns: 1fr; max-width: 56rem; }
@media (min-width: 44rem) { .dev .sga-use { grid-template-columns: repeat(2, 1fr); } }
.sga-use p { color: var(--muted); }

/* See the packs: page 1 of each example on paper, page 2 peeking out behind it; a click opens both in a dialog */
.sga-packs { display: grid; gap: 1rem; grid-template-columns: 1fr; max-width: 56rem; }
@media (min-width: 44rem) { .sga-packs { grid-template-columns: repeat(2, 1fr); } }
.sga-pack { margin: 0; display: grid; align-content: start; gap: 1.1rem; }
.sga-pack figcaption h3 { margin: 0.55rem 0 0.35rem; }
.sga-pack figcaption p { color: var(--muted); font-size: 0.97rem; }
.sga-pack figcaption p.small { margin-top: 0.5rem; font-size: 0.88rem; }
.sga-pack-pages {
  position: relative; display: block; width: 88%; margin: 0.4rem auto 0.9rem 4%; color: var(--text); text-decoration: none;
  border-radius: 4px; -webkit-tap-highlight-color: transparent;
}
.sga-pack-pages img { display: block; width: 100%; height: auto; aspect-ratio: 1000 / 1414; border-radius: 4px; background: #fff; }
.sga-page-front { position: relative; box-shadow: 0 1px 2px rgba(17, 24, 28, 0.12), 0 14px 30px -12px rgba(11, 55, 30, 0.38); }
.sga-pack-pages .sga-page-back {
  position: absolute; inset: 0; transform: translate(7%, 3.5%) rotate(2.5deg); transform-origin: 50% 100%;
  box-shadow: 0 1px 2px rgba(17, 24, 28, 0.1), 0 8px 22px -12px rgba(11, 55, 30, 0.3);
}
.sga-pack-open {
  position: absolute; right: 0.6rem; bottom: 0.6rem; z-index: 1; font-size: 0.82rem; font-weight: 700;
  padding: 0.35rem 0.75rem; border-radius: 999px; color: var(--tint-text); background: var(--tint-strong);
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.35);
}
.sga-pack-pages:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
@media (prefers-reduced-motion: no-preference) {
  .sga-page-front, .sga-pack-pages .sga-page-back { transition: transform 0.25s ease; }
  .sga-pack-pages:hover .sga-page-front { transform: translateY(-4px); }
  .sga-pack-pages:hover .sga-page-back { transform: translate(9%, 3%) rotate(4deg); }
}
@media (prefers-color-scheme: dark) {
  .sga-pack-pages img { filter: brightness(0.92); }
  .sga-page-front { box-shadow: 0 16px 34px -12px rgba(0, 0, 0, 0.8); }
}

.sga-viewer {
  width: min(52rem, calc(100vw - 1.5rem)); max-width: none; max-height: calc(100dvh - 1.5rem); padding: 0; overflow: hidden;
  color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
}
.sga-viewer[open] { display: flex; flex-direction: column; }
.sga-viewer::backdrop { background: rgba(8, 12, 10, 0.72); }
.sga-viewer-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.7rem 0.8rem 0.7rem 1.1rem;
  border-bottom: 1px solid var(--border);
}
.sga-viewer-bar h3 { margin: 0; font-size: 1.05rem; min-width: 0; }
.sga-viewer-close { flex: none; }
.sga-viewer-pages { overflow-y: auto; overscroll-behavior: contain; padding: 1rem; display: grid; gap: 1rem; background: var(--element); }
.sga-viewer-pages img { display: block; width: 100%; height: auto; border-radius: 4px; background: #fff; box-shadow: 0 6px 18px -10px rgba(0, 0, 0, 0.45); }
@media (max-width: 30rem) { .sga-viewer-pages { padding: 0.6rem; gap: 0.6rem; } }
.sga-viewer-pages[hidden] { display: none; }

/* Prices */
.sga-plans { max-width: 56rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.sga-founding {
  max-width: 56rem; margin-top: 0.4rem; border-color: color-mix(in srgb, var(--tint) 45%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--g-a) 16%, var(--glass)), var(--glass));
}
.sga-founding h3 { margin: 0 0 0.4rem; font-size: 1.3rem; }
.sga-founding p { max-width: 40rem; }
.sga-founding .cta { margin-top: 1rem; }
.sga-founding .cta .btn { white-space: normal; text-align: center; }
.sga-founding + p { margin-top: 0.9rem; }
/* A referral link's "<agency> referred you" line (agents page script) */
.sga-ref {
  margin: 0.9rem 0 0; padding: 0.6rem 0.85rem; border-radius: var(--radius); font-weight: 600;
  background: color-mix(in srgb, var(--tint) 12%, transparent); border: 1px solid color-mix(in srgb, var(--tint) 35%, transparent);
}
.sga-ref[hidden] { display: none; }

/* How we keep it fair: the rules as a two-column list on wide screens */
.sga-rules {
  list-style: none; padding: 1.1rem 1.3rem; margin: 0 0 1rem; max-width: 56rem; display: grid; gap: 0.9rem 2rem;
  border-radius: var(--radius); background: var(--glass); border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--glass-hi), var(--glass-shadow);
}
@media (min-width: 46rem) { .sga-rules { grid-template-columns: repeat(2, 1fr); } }
.sga-rules li { padding-left: 1.6rem; position: relative; color: var(--muted); font-size: 0.97rem; }
.sga-rules li::before { content: "✓"; position: absolute; left: 0; color: var(--tint); font-weight: 800; }
.sga-rules b { display: block; color: var(--text); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .sga-rules { background: var(--glass-strong); } }
@media (max-width: 26rem) { .sga-rules { padding: 1rem 0.9rem; } }
