/* The results page. It sits on the landing page's styles (landing.css) and adds only what is new here. */

.rs { --rs-impressions: #c2475a; --rs-reach: #4f8ef7; }

/* Hero: the landing hero, with one real campaign's report where the landing page has the phone */
.rs .rs-hero-more { margin-top: 12px !important; font-size: 17px; color: #a9a8a1; }
.rs-report { width: min(380px, 100%); border-radius: 22px; background: #fff; color: var(--ai-ink); box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 40px 80px -30px rgba(0, 0, 0, .8); overflow: hidden; }
.rs-report-bar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--ai-line); background: var(--ai-paper); }
.rs-report-bar span { width: 10px; height: 10px; border-radius: 50%; background: #dcd8cc; }
.rs .rs-report-bar p { margin: 0 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ai-muted); }
.rs-report-body { padding: 22px 24px 26px; }
.rs-report .rs-card-head { margin-bottom: 16px; }
.rs-report h3 { margin: 0 0 4px; font-size: 20px; font-weight: 800; line-height: 1.2; }
.rs-report .rs-figures { margin-bottom: 18px; }
.rs-report-chart { display: block; width: 100%; height: auto; border-radius: 10px; box-shadow: 0 0 0 1px var(--ai-line); }
.rs .ai-float-list { left: -40px; bottom: -24px; width: 230px; }
.rs .ai-float-toast { top: -36px; right: -36px; }

/* Donut: a circle whose circumference is 100, so each arc's dash length is its share */
.rs-ring-wrap { position: relative; width: 132px; flex: none; aspect-ratio: 1; }
.rs-ring { display: block; width: 100%; height: 100%; }
.rs-ring circle { fill: none; stroke-width: 6.5; }
.rs-ring-track { stroke: #efece3; }
.rs-ring-arc.is-a-plus { stroke: var(--ai-a-plus); }
.rs-ring-arc.is-a { stroke: var(--ai-a); }
.rs-ring-arc.is-b { stroke: var(--ai-b); }
.rs-ring-arc.is-c { stroke: var(--ai-c); }
.rs .rs-ring-total { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0; font-size: 12px; line-height: 1.2; color: var(--ai-muted); }
.rs-ring-total b { font-family: Montserrat, sans-serif; font-size: 28px; font-weight: 800; color: var(--ai-ink); font-variant-numeric: tabular-nums; }
.rs-legend { display: grid; gap: 8px; }
.rs-legend li { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.rs-legend b { font-variant-numeric: tabular-nums; }

/* How to read the results */
.rs .rs-key { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; max-width: 1040px; margin: 0 auto; padding: 0; }
.rs-key li:nth-child(n + 5) { grid-column: span 2; }
.rs-key li { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 22px 20px; border-radius: var(--ai-radius); background: var(--ai-paper); font-size: 15px; text-align: center; color: var(--ai-ink-soft); }
.rs-key li > :first-child { margin-bottom: 10px; }
.rs-key .ai-grade { width: 40px; min-width: 0; height: 40px; padding: 0; border-radius: 10px; font-size: 15px; }
.rs-key strong { font-family: Montserrat, sans-serif; font-size: 16px; color: var(--ai-ink); }
.rs-swatch { width: 32px; height: 8px; margin-block: 16px; border-radius: 4px; }
.rs-swatch.is-impressions { background: var(--rs-impressions); }
.rs-swatch.is-reach { background: var(--rs-reach); }

/* Filters: one radio per field; the matching :has() rules are written by the template from the list of fields */
.rs-filters { display: flex; gap: 8px; margin: 0 0 32px; padding: 0 0 4px; border: 0; overflow-x: auto; scrollbar-width: none; }
.rs-filters::-webkit-scrollbar { display: none; }
@media (hover: hover) { .rs-filters { scrollbar-width: thin; } }
/* Auto margins centre the row while it fits and let it scroll from the first pill once it does not */
.rs-filters label { flex: none; }
.rs-filters label:first-of-type { margin-left: auto; }
.rs-filters label:last-of-type { margin-right: auto; }
.rs-filters input { position: absolute; opacity: 0; pointer-events: none; }
.rs-filters label { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 9px 16px; border: 1px solid var(--ai-line); border-radius: 999px; background: #fff; font-size: 15px; font-weight: 700; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.rs-filters label:hover { border-color: var(--ai-ink); }
.rs-filters label span { min-width: 24px; padding: 1px 7px; border-radius: 999px; background: var(--ai-paper); font-size: 12px; text-align: center; }
.rs-filters input:checked + label { border-color: var(--ai-ink); background: var(--ai-ink); color: #fff; }
.rs-filters input:checked + label span { background: var(--ai-yellow); color: #111; }

/* Campaign cards */
.rs-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.rs-card { display: flex; flex-direction: column; padding: 24px; border: 1px solid var(--ai-line); border-radius: var(--ai-radius); background: #fff; }
.rs-card-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.rs-icon { display: grid; flex: none; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--ai-cream); color: #8a6a00; font-size: 17px; }
.rs-card h3 { margin: 0 0 4px; font-size: 18px; font-weight: 700; line-height: 1.25; text-wrap: balance; }
.rs .rs-duration { margin: 0; font-size: 13px; color: var(--ai-muted); font-variant-numeric: tabular-nums; }
.rs-duration i { margin-right: 4px; }
.rs-figures { display: flex; align-items: center; gap: 24px; margin-bottom: 20px; }
.rs-figures .rs-legend { flex: 1; }
.rs .rs-top { margin: auto 0 0; padding-top: 16px; border-top: 1px solid var(--ai-line); font-size: 15px; color: var(--ai-ink-soft); }
.rs-top b { font-family: Montserrat, sans-serif; font-size: 18px; color: var(--ai-ink); }
.rs-reach { margin-top: 12px; }
.rs-reach summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; cursor: pointer; font-size: 14px; font-weight: 700; list-style: none; }
.rs-reach summary::-webkit-details-marker { display: none; }
.rs-reach summary::after { content: "\f067"; font-family: "Font Awesome 5 Free"; font-size: 12px; font-weight: 900; color: var(--ai-yellow-deep); transition: transform .2s ease; }
.rs-reach[open] summary::after { transform: rotate(45deg); }
.rs-reach img { display: block; width: 100%; height: auto; margin-top: 4px; border-radius: 10px; box-shadow: 0 0 0 1px var(--ai-line); }
.rs .rs-reach-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 0; font-size: 13px; color: var(--ai-muted); }
.rs-reach-legend span::before { content: ""; display: inline-block; width: 18px; height: 4px; margin-right: 8px; border-radius: 2px; vertical-align: middle; }
.rs-reach-legend .is-impressions::before { background: var(--rs-impressions); }
.rs-reach-legend .is-reach::before { background: var(--rs-reach); }
.rs .rs-swipe-hint { display: none; }

/* Closing call to action */
.rs .rs-final-quote { margin-bottom: 0; font-family: Montserrat, sans-serif; font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; line-height: 1.35; color: #fff; text-wrap: balance; }
.rs-final-quote .fw-bold { color: var(--ai-yellow); }
.rs .rs-final-title { margin-top: 48px; font-size: clamp(24px, 2.6vw, 32px); }

@media (max-width: 1199.98px) {
    .rs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
    .rs .ai-float-toast { right: calc(50% - 250px); }
}
@media (max-width: 575.98px) {
    header.rs-hero { padding-bottom: 64px; }
    .rs .rs-key { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .rs-key li { padding: 18px 12px; font-size: 14px; }
    .rs-key li:nth-child(n + 5) { grid-column: auto; }
    /* On a phone the campaigns become a row to swipe through instead of eighteen cards to scroll past */
    .rs-grid { display: flex; align-items: flex-start; gap: 12px; margin: 0 -12px; padding: 0 12px 8px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 12px; scrollbar-width: none; }
    .rs-grid::-webkit-scrollbar { display: none; }
    .rs-card { flex: 0 0 86%; scroll-snap-align: start; }
    .rs .rs-swipe-hint { display: flex; align-items: center; justify-content: center; gap: 8px; margin: -8px 0 16px; font-size: 13px; color: var(--ai-muted); }
    .rs-filters { margin: 0 -12px 24px; padding: 0 12px 4px; }
    .rs-card { padding: 20px; }
    .rs-ring-wrap { width: 116px; }
}
