/* ==========================================================================
   Site pages on the tf- shell: contact.htm and sitemap.htm
   Layered over tyres-for.css. Everything new here carries .sp-.
   ========================================================================== */

/* --- Shared: two-column body, main + side ---------------------------------- */

.sp-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
}

@media screen and (min-width: 900px) {
    .sp-grid {
        grid-template-columns: minmax(0, 1fr) 340px;
        gap: 56px;
        align-items: start;
    }
}

.sp-main { min-width: 0; }

.sp-side {
    min-width: 0;
    padding: 22px 22px 8px;
    background: var(--tf-mist, #f2f5f7);
    border-radius: 8px;
}

.tf-sec--mist .sp-side { background: #fff; border: 1px solid var(--tf-line, #dfe4e9); }

.sp-side__title {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--tf-text, #1a2027);
}

.sp-side__lede {
    margin: 0 0 14px;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--tf-muted, #5d6a75);
}

.sp-routes {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sp-routes li { border-top: 1px solid var(--tf-line, #dfe4e9); }
.sp-routes li:first-child { border-top: 0; }

a.sp-route,
a.sp-route:link,
a.sp-route:visited {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 13px 0;
    color: var(--tf-text, #1a2027);
    text-decoration: none;
}

a.sp-route .fa {
    flex-shrink: 0;
    width: 22px;
    margin-top: 2px;
    text-align: center;
    font-size: 1.05rem;
    color: var(--tf-cyan, #0db1e7);
}

.sp-route__text { display: block; min-width: 0; }
.sp-route__title { display: block; font-weight: 700; line-height: 1.3; }
a.sp-route:hover .sp-route__title { color: var(--tf-cyan, #0db1e7); }

.sp-route__desc {
    display: block;
    margin-top: 2px;
    font-size: 0.84rem;
    line-height: 1.5;
    color: var(--tf-muted, #5d6a75);
}

/* --- Contact form ------------------------------------------------------------ */

.sp-form { max-width: 640px; margin-top: 22px; }

.sp-field { margin: 0 0 18px; }

.sp-field label {
    display: block;
    margin: 0 0 6px;
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--tf-text, #1a2027);
}

.sp-field input[type="text"],
.sp-field input[type="email"],
.sp-field textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 11px 13px;
    font: inherit;
    font-size: 1rem;
    line-height: 1.4;
    color: var(--tf-text, #1a2027);
    background: #fff;
    border: 1px solid #c3ccd4;
    border-radius: 5px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.sp-field textarea { resize: vertical; min-height: 160px; }

.sp-field input:focus,
.sp-field textarea:focus {
    outline: 0;
    border-color: var(--tf-cyan, #0db1e7);
    box-shadow: 0 0 0 3px rgba(13, 177, 231, 0.18);
}

/* The human check: the word image and its field sit on one line where there
   is room; at phone width the field drops below the image. */
.sp-human {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
}

.sp-human img {
    flex-shrink: 0;
    height: 40px;
    width: auto;
    border: 1px solid var(--tf-line, #dfe4e9);
    border-radius: 4px;
    background: #fff;
}

.sp-human input[type="text"] { flex: 1 1 180px; width: auto; }

.sp-actions { margin: 24px 0 0; }

/* tyres-for.css styles a.tf-btn only; the submit is a button. */
.sp button.tf-btn {
    display: inline-block;
    padding: 13px 26px;
    border: 0;
    border-radius: 4px;
    background: var(--tf-cyan, #0db1e7);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.sp button.tf-btn:hover,
.sp button.tf-btn:focus { background: #0a9bcc; }

.sp a.tf-btn--ghost,
.sp a.tf-btn--ghost:link,
.sp a.tf-btn--ghost:visited {
    background: transparent;
    color: var(--tf-text, #1a2027);
    border: 1px solid #c3ccd4;
    padding: 11px 22px;
}

.sp a.tf-btn--ghost:hover { background: #fff; border-color: var(--tf-cyan, #0db1e7); color: var(--tf-cyan, #0db1e7); }

/* --- Notices: sent / failed -------------------------------------------------- */

.sp-notice {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin: 0 0 26px;
    padding: 18px 20px;
    border-radius: 8px;
    border: 1px solid var(--tf-line, #dfe4e9);
    background: #fff;
    max-width: 640px;
}

.sp-notice > .fa { flex-shrink: 0; margin-top: 3px; font-size: 1.4rem; }
.sp-notice p { margin: 0 0 8px; line-height: 1.55; }
.sp-notice p:last-child { margin-bottom: 0; }
.sp-notice__title { font-weight: 700; font-size: 1.05rem; }

.sp-notice--ok { border-color: rgba(28, 158, 92, 0.35); background: #f2faf5; }
.sp-notice--ok > .fa { color: var(--tf-good, #1c9e5c); }
.sp-notice--error { border-color: rgba(212, 88, 56, 0.4); background: #fdf5f2; }
.sp-notice--error > .fa { color: var(--tf-poor, #d45838); }

/* --- Site map ---------------------------------------------------------------- */

/* The contents strip under the hero: one chip per section. */
.sp-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.sp-toc li { margin: 0; padding: 0; }

a.sp-toc__link,
a.sp-toc__link:link,
a.sp-toc__link:visited {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--tf-line, #dfe4e9);
    border-radius: 999px;
    background: #fff;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--tf-text, #1a2027);
    text-decoration: none;
}

a.sp-toc__link:hover { border-color: var(--tf-cyan, #0db1e7); color: var(--tf-cyan, #0db1e7); }

.sp-toc__n {
    font-family: var(--tf-mono);
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--tf-muted, #5d6a75);
}

/* A group inside a section: a heading with its count, then a column list. */
.sp-group { margin: 0 0 26px; }
.sp .tf-sec__lede + .sp-group,
.sp .tf-sec__lede + .tsz-collapse { margin-top: 20px; }
.sp-group:last-child { margin-bottom: 0; }

.sp-group__title {
    margin: 0 0 10px;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--tf-text, #1a2027);
}

.sp-group__title a,
.sp-group__title a:link,
.sp-group__title a:visited { color: inherit; text-decoration: none; }
.sp-group__title a:hover { color: var(--tf-cyan, #0db1e7); }

.sp-group__n {
    margin-left: 8px;
    font-family: var(--tf-mono);
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--tf-muted, #5d6a75);
    vertical-align: middle;
}

/* The link lists: compact, multi-column once wide enough. Each li is a
   plain link; the sub-links (a test's results grid and charts) trail it. */
.sp-links {
    list-style: none;
    margin: 0;
    padding: 0;
    columns: 1;
    column-gap: 28px;
}

.sp-links li {
    break-inside: avoid;
    padding: 4px 0;
    font-size: 0.92rem;
    line-height: 1.4;
}

.sp-links a,
.sp-links a:link,
.sp-links a:visited { color: var(--tf-text, #1a2027); text-decoration: none; }
.sp-links a:hover { color: var(--tf-cyan, #0db1e7); text-decoration: underline; }

.sp-links__n {
    margin-left: 5px;
    font-family: var(--tf-mono);
    font-size: 0.74rem;
    color: var(--tf-muted, #5d6a75);
}

.sp-links__sub {
    display: inline;
    margin-left: 4px;
    font-size: 0.78rem;
    color: var(--tf-muted, #5d6a75);
}

.sp-links__sub a,
.sp-links__sub a:link,
.sp-links__sub a:visited { color: var(--tf-muted, #5d6a75); }
.sp-links__sub a:hover { color: var(--tf-cyan, #0db1e7); }

@media screen and (min-width: 560px) { .sp-links { columns: 2; } }
@media screen and (min-width: 900px) { .sp-links { columns: 3; } .sp-links--wide { columns: 2; } }
@media screen and (min-width: 1100px) { .sp-links { columns: 4; } .sp-links--wide { columns: 2; } .sp-links--mid { columns: 3; } }

/* Long lists fold: tyres-for.css folds table rows only, so the fold for a
   list item lives here. The items are in the HTML either way. */
.sp .tsz-collapse li.tsz-more,
.sp .tsz-collapse .sp-group.tsz-more { display: none; }
.sp .tsz-collapse.is-open li.tsz-more { display: list-item; }
.sp .tsz-collapse.is-open .sp-group.tsz-more { display: block; }

/* A group's own fold button sits tighter than a section's. */
.sp-group .tsz-showall { margin-top: 8px; }

/* Year headings inside the tests section run as a row of anchors. */
.sp-years {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}

a.sp-years__link,
a.sp-years__link:link,
a.sp-years__link:visited {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    background: #fff;
    border: 1px solid var(--tf-line, #dfe4e9);
    font-family: var(--tf-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--tf-text, #1a2027);
    text-decoration: none;
}

a.sp-years__link:hover { border-color: var(--tf-cyan, #0db1e7); color: var(--tf-cyan, #0db1e7); }

/* The section counter beside a section title. */
.sp-count {
    margin-left: 8px;
    font-family: var(--tf-mono);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--tf-muted, #5d6a75);
    vertical-align: middle;
}
