/* Off Road Map
   Colours come from trail gear: pine timber, map paper, the blaze-orange
   of a whip flag, and the brown contour lines on a topo map.
   Type is Barlow, drawn from highway and trailhead signage. */

:root {
    --pine: #1d3a2b;
    --pine-deep: #13271d;
    --paper: #ecefe3;
    --sheet: #f8f9f3;
    --ink: #17201b;
    --muted: #55625a;
    --line: #c6ccb8;
    --blaze: #f2681c;
    --blaze-dark: #c44d0c;
    --contour: #8a6540;
    --water: #245f80;
    --danger: #a8241c;

    --display: "Barlow Condensed", "Arial Narrow", sans-serif;
    --body: "Barlow", system-ui, sans-serif;
    --radius: 6px;
    --wrap: 72rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--paper);
    color: var(--ink);
    font: 400 1.0625rem/1.55 var(--body);
}

main {
    flex: 1;
}

img,
iframe {
    display: block;
    max-width: 100%;
}

h1,
h2 {
    margin: 0;
    font-family: var(--display);
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.005em;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
}

h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

p {
    margin: 0 0 1rem;
    max-width: 62ch;
}

a {
    color: var(--water);
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--ink);
}

:focus-visible {
    outline: 3px solid var(--blaze);
    outline-offset: 2px;
}

.wrap {
    width: min(100% - 2.5rem, var(--wrap));
    margin-inline: auto;
}

.section {
    padding-block: 2.5rem 4rem;
}

.block {
    margin-top: 3rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 10;
    padding: 0.5rem 1rem;
    background: var(--blaze);
    color: var(--ink);
    font-weight: 600;
}

.skip-link:focus {
    top: 0.5rem;
}

/* ---------- top bar ---------- */
.topbar {
    background: var(--pine);
    color: #fff;
}

.topbar__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 2rem;
    padding-block: 0.85rem;
}

.topbar a,
.topbar .linklike {
    color: #fff;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font: 700 1.6rem/1 var(--display);
    text-decoration: none;
}

/* A trail blaze: the painted diamond that marks the way. */
.wordmark__blaze {
    width: 0.8rem;
    height: 0.8rem;
    background: var(--blaze);
    transform: rotate(45deg);
}

.topbar__nav {
    display: flex;
    gap: 1.5rem;
    margin-right: auto;
}

.topbar__nav a {
    padding-block: 0.25rem;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 3px solid transparent;
}

.topbar__nav a:hover,
.topbar__nav a[aria-current],
.topbar__account a[aria-current] {
    border-bottom-color: var(--blaze);
}

.topbar__account {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.linklike {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 0.18em;
    cursor: pointer;
}

/* ---------- buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.9rem;
    padding: 0.55rem 1.3rem;
    border: 2px solid transparent;
    border-radius: var(--radius);
    font: 600 1.0625rem/1.2 var(--body);
    text-decoration: none;
    cursor: pointer;
}

.btn--small {
    min-height: 2.3rem;
    padding: 0.3rem 0.9rem;
    font-size: 1rem;
}

.btn--blaze,
.topbar a.btn--blaze {
    background: var(--blaze);
    color: var(--ink);
}

.btn--blaze:hover {
    background: #ff8236;
    color: var(--ink);
}

.btn--line {
    border-color: var(--ink);
    background: transparent;
    color: var(--ink);
}

.btn--line:hover {
    background: var(--ink);
    color: var(--paper);
}

.btn--light {
    background: var(--sheet);
    color: var(--ink);
}

.btn--light:hover {
    background: #fff;
}

.btn--ghost {
    border-color: rgb(255 255 255 / 0.7);
    color: #fff;
}

.btn--ghost:hover {
    background: #fff;
    color: var(--ink);
}

.btn--danger {
    border-color: var(--danger);
    background: transparent;
    color: var(--danger);
}

.btn--danger:hover {
    background: var(--danger);
    color: #fff;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.75rem;
}

/* ---------- notices ---------- */
.notices {
    margin-top: 1.25rem;
}

.notice {
    max-width: none;
    margin: 0 0 0.5rem;
    padding: 0.7rem 1rem;
    border-left: 6px solid var(--pine);
    border-radius: var(--radius);
    background: var(--sheet);
    font-weight: 500;
}

.notice--error {
    border-left-color: var(--danger);
    color: var(--danger);
}

/* ---------- landing hero ---------- */
.hero {
    display: grid;
    align-items: end;
    min-height: min(74vh, 40rem);
    background: var(--pine-deep) url("../image/contours.svg") center / cover no-repeat;
    color: #fff;
}

.hero__inner {
    padding-block: 5rem 3rem;
}

.hero__title {
    max-width: 15ch;
    font-size: clamp(3rem, 8.5vw, 6rem);
    line-height: 0.92;
    text-wrap: balance;
}

.hero__text {
    max-width: 46ch;
    margin: 1.25rem 0 0;
    font-size: 1.2rem;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.75rem;
}

.hero__small {
    margin: 1rem 0 0;
    color: #b9cbbd;
    font-size: 0.9375rem;
}

/* ---------- sales page ---------- */
.features {
    display: grid;
    gap: 5rem;
    padding-block: 5rem;
}

.feature {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    gap: 3rem;
    align-items: center;
}

.feature--flip .feature__text {
    order: 2;
}

.feature--flip {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
}

.feature h2 {
    font-size: clamp(2rem, 3.4vw, 2.75rem);
}

.feature__shot {
    width: 100%;
    height: auto;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    background: var(--sheet);
}

.feature__shot--narrow {
    max-width: 24rem;
    justify-self: center;
}

.band {
    background: var(--pine);
    color: #fff;
}

.band h2 {
    font-size: clamp(2rem, 3.4vw, 2.75rem);
    margin-bottom: 0.5rem;
}

.band h3 {
    margin: 0 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #b9cbbd;
    font: 600 1.35rem/1.1 var(--display);
}

.coverage {
    margin-top: 2rem;
}

.coverage ul {
    margin: 0;
    padding-left: 1.25rem;
}

.coverage li {
    margin-bottom: 0.5rem;
    max-width: 48ch;
}

.early {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 3rem;
    align-items: start;
    padding-block: 5rem;
}

.early h2 {
    font-size: clamp(2rem, 3.4vw, 2.75rem);
}

.faq {
    margin: 0;
    border-top: 2px solid var(--ink);
}

.faq > div {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line);
}

.faq dt {
    font-weight: 600;
}

.faq dd {
    margin: 0.2rem 0 0;
    max-width: 60ch;
}

.shared {
    padding-top: 0;
}

.split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
    gap: 3rem;
}

/* ---------- page heading ---------- */
.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.back {
    margin-bottom: 1.25rem;
}

/* ---------- the route line: start, dashed trail, destination ---------- */
.route {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
    font-family: var(--display);
    font-weight: 600;
    line-height: 1.05;
}

.route__place {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.45em;
    overflow-wrap: anywhere;
}

.route__place::before {
    content: "";
    flex: none;
    width: 0.5em;
    height: 0.5em;
    margin-top: 0.3em;
}

.route__place--from::before {
    border: 0.14em solid currentColor;
    border-radius: 50%;
}

.route__place--to::before {
    background: var(--blaze);
    transform: rotate(45deg);
}

.route__line {
    flex: 1 1 2rem;
    min-width: 2rem;
    max-width: 9rem;
    border-top: 0.14em dashed var(--contour);
}

/* Stacked: start above destination, joined by a vertical dashed trail. */
.route--stacked {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.12em;
}

.route--stacked .route__line {
    flex: none;
    width: 0;
    min-width: 0;
    height: 0.75em;
    margin-left: calc(0.25em - 0.07em);
    border-top: 0;
    border-left: 0.14em dashed var(--contour);
}

/* ---------- ride lists ---------- */
.rides {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 2px solid var(--ink);
}

.ride {
    border-bottom: 1px solid var(--line);
}

.ride__link {
    display: grid;
    grid-template-columns: 5.5rem 1fr;
    gap: 1.25rem;
    align-items: center;
    padding: 1rem 0.5rem;
    color: inherit;
    text-decoration: none;
}

.ride__link:hover {
    background: var(--sheet);
}

.ride__date {
    display: grid;
    justify-items: start;
    line-height: 1;
}

.ride__day {
    font: 700 2.6rem/0.9 var(--display);
}

.ride__month {
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.9375rem;
}

.ride__body {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.ride .route {
    font-size: 1.6rem;
}

.ride__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1rem;
    color: var(--muted);
    font-size: 0.9375rem;
}

.ride--past .ride__day,
.ride--past .route {
    color: var(--muted);
}

.ride--past .route__place--to::before {
    background: var(--muted);
}

.tag {
    display: inline-block;
    padding: 0.05rem 0.5rem 0.1rem;
    border-radius: 3px;
    background: var(--pine);
    color: #fff;
    font: 600 0.95rem/1.3 var(--display);
    letter-spacing: 0.04em;
    vertical-align: 0.1em;
}

.tag--atv {
    background: var(--contour);
}

.tag--both {
    background: var(--ink);
}

.filter {
    display: flex;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    overflow: hidden;
}

.filter a {
    padding: 0.4rem 1.1rem;
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

.filter a + a {
    border-left: 2px solid var(--ink);
}

.filter a:hover {
    background: var(--sheet);
}

.filter a[aria-current] {
    background: var(--ink);
    color: var(--paper);
}

/* ---------- next ride on the dashboard ---------- */
.next {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--pine);
    color: #fff;
}

.next__info {
    padding: 2rem;
}

.next h2 {
    margin-bottom: 1.5rem;
    color: #b9cbbd;
    font-size: 1.25rem;
    font-weight: 600;
}

.next__when {
    margin: 0;
    font: 700 clamp(3rem, 6vw, 4.5rem) / 0.9 var(--display);
}

.next__date {
    margin: 0.6rem 0 1.5rem;
    color: #dbe5d9;
}

.next .route {
    font-size: 2rem;
}

.next .route__line {
    border-color: #b9cbbd;
}

.next .tag {
    background: #fff;
    color: var(--pine);
}

.next__notes {
    margin: 1.25rem 0 0;
    color: #dbe5d9;
    white-space: pre-line;
}

.next .map,
.next .map iframe {
    height: 100%;
    min-height: 20rem;
    border-radius: 0;
    border: 0;
}

/* ---------- maps ---------- */
.map {
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--sheet);
}

.map iframe {
    width: 100%;
    height: 26rem;
    border: 0;
}

.map__empty {
    display: grid;
    place-content: center;
    justify-items: start;
    gap: 0.5rem;
    min-height: 16rem;
    padding: 2rem;
    color: var(--ink);
}

.map-note {
    margin: 0.6rem 0 0;
    color: var(--muted);
    font-size: 0.9375rem;
}

/* ---------- trail map ---------- */
.trailmap {
    height: 26rem;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    background: var(--sheet);
    font-family: var(--body);
    z-index: 0;
}

.trailmap--tall {
    height: min(70vh, 44rem);
}

.maptools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.page-head__note {
    margin: 0;
}

.map-pin i {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--blaze);
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--ink);
    transform: rotate(45deg);
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.5rem;
    margin: 0.75rem 0 1.5rem;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: 0.9375rem;
}

.legend li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend__line {
    width: 2rem;
    border-top: 4px solid;
}

.legend__line--narrow { border-color: #e2500a; }
.legend__line--wide { border-color: #7a4a1c; }
.legend__line--moto { border-color: #245f80; }
.legend__line--unknown { border-color: #3f4a43; border-top-style: dashed; border-top-width: 2px; }
.legend__line--track { border-color: #c2185b; }

.trail-popup h3 {
    margin: 0 0 0.25rem;
    font: 700 1.25rem/1.1 var(--display);
}

.trail-popup p {
    margin: 0 0 0.5rem;
    font-size: 0.9375rem;
}

.trail-popup ul {
    margin: 0 0 0.5rem;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--line);
}

.trail-popup li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.9375rem;
}

.trail-popup__source {
    color: var(--muted);
    font-size: 0.8125rem !important;
}

.place-search {
    margin-bottom: 1.5rem;
}

.place-search label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
}

.place-search__results {
    display: grid;
    justify-items: start;
    gap: 0.35rem;
    text-align: left;
}

.place-search__results .linklike {
    color: var(--water);
    text-align: left;
}

.riders a {
    color: var(--water);
}

/* ---------- ride detail and ride form ---------- */
.detail {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 3rem;
    align-items: start;
}

.detail h1 {
    margin-bottom: 1.75rem;
}

.detail h1 .route {
    font-weight: 700;
}

.facts {
    margin: 0;
    border-top: 2px solid var(--ink);
}

.facts > div {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: 1rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--line);
}

.facts dt {
    color: var(--muted);
}

.facts dd {
    margin: 0;
    font-weight: 500;
}

.facts__notes {
    white-space: pre-line;
}

/* ---------- group rides ---------- */
.btn--ink {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--paper);
}

.answer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.invited-by {
    margin-bottom: 0.75rem;
    color: var(--contour);
    font: 600 1.35rem/1.1 var(--display);
}

.riders {
    margin: 0 0 1.5rem;
    padding: 0;
    list-style: none;
    border-top: 2px solid var(--ink);
}

.riders li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--line);
    font-weight: 500;
}

.riders__status {
    margin-right: auto;
    color: var(--muted);
    font-weight: 400;
}

.riders--out > span:first-child {
    color: var(--muted);
    text-decoration: line-through;
}

.invite label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
}

.invite__row {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.invite__row input {
    flex: 1;
    min-width: 0;
    padding: 0.55rem 0.75rem;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    font: inherit;
}

/* ---------- forms ---------- */
form {
    margin: 0;
}

.field {
    min-width: 0;
    margin: 0 0 1.25rem;
    padding: 0;
    border: 0;
}

.field label,
.field legend {
    display: block;
    margin-bottom: 0.3rem;
    padding: 0;
    font-weight: 600;
}

.optional {
    color: var(--muted);
    font-weight: 400;
}

.field__hint {
    margin: -0.15rem 0 0.4rem;
    color: var(--muted);
    font-size: 0.9375rem;
}

.field input:not([type="radio"]),
.field textarea {
    width: 100%;
    min-height: 2.9rem;
    padding: 0.55rem 0.75rem;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    font: inherit;
}

.field textarea {
    resize: vertical;
}

.field--error input:not([type="radio"]),
.field--error textarea {
    border-color: var(--danger);
}

.field__error {
    margin: 0.35rem 0 0;
    color: var(--danger);
    font-size: 0.9375rem;
    font-weight: 500;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ATV / UTV switch */
.choice {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
}

.choice--three {
    grid-template-columns: repeat(3, 1fr);
}

.choice input {
    position: absolute;
    opacity: 0;
}

.field .choice label {
    display: grid;
    place-items: center;
    min-height: calc(2.9rem - 4px);
    margin: 0;
    cursor: pointer;
}

.choice label + input + label {
    border-left: 2px solid var(--ink);
}

.choice input:checked + label {
    background: var(--ink);
    color: var(--paper);
}

.choice input:focus-visible + label {
    outline: 3px solid var(--blaze);
    outline-offset: -5px;
}

/* ---------- sign in / register ---------- */
.auth {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: calc(100vh - 8rem);
}

.auth__form {
    width: min(100% - 2.5rem, 27rem);
    margin-inline: auto;
    padding-block: 3.5rem;
}

.auth__form h1 {
    margin-bottom: 1.75rem;
}

.auth__form .btn {
    width: 100%;
    margin-top: 0.5rem;
}

.auth__switch {
    margin-top: 1.5rem;
}

.auth__art {
    background: var(--pine-deep) url("../image/contours.svg") center / cover no-repeat;
}

/* Google button */
.social {
    display: grid;
    gap: 0.75rem;
}

.auth__form .social__btn {
    gap: 0.7rem;
    margin-top: 0;
    background: #fff;
}

.auth__form .social__btn:hover {
    background: var(--sheet);
    color: var(--ink);
}

.social__or {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: none;
    margin: 1.5rem 0;
    color: var(--muted);
    font-size: 0.9375rem;
}

.social__or::before,
.social__or::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--line);
}

/* ---------- empty states ---------- */
.empty {
    display: grid;
    justify-items: start;
    gap: 0.5rem;
    padding: 2rem;
    border: 2px dashed var(--contour);
    border-radius: var(--radius);
}

.empty h1,
.empty h2 {
    margin: 0;
}

/* ---------- text pages: account, privacy, terms ---------- */
.prose {
    max-width: 44rem;
}

.prose h1 {
    margin-bottom: 1.5rem;
}

.prose h2 {
    margin: 2.25rem 0 0.75rem;
}

.prose ul {
    max-width: 62ch;
    margin: 0 0 1rem;
    padding-left: 1.25rem;
}

.prose li {
    margin-bottom: 0.4rem;
}

/* ---------- footer ---------- */
.footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.9375rem;
}

.footer__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.25rem 2rem;
    padding-block: 1.25rem;
}

.footer p {
    margin: 0;
}

.footer__links {
    display: flex;
    gap: 1.25rem;
}

.footer a {
    color: inherit;
}

/* ---------- small screens ---------- */
@media (max-width: 52rem) {
    .next,
    .detail,
    .feature,
    .feature--flip,
    .early,
    .auth {
        grid-template-columns: minmax(0, 1fr);
    }

    .auth {
        min-height: 0;
    }

    .feature--flip .feature__text {
        order: 0;
    }

    .features {
        gap: 3.5rem;
        padding-block: 3rem;
    }

    .feature,
    .early {
        gap: 1.5rem;
    }

    .auth__art {
        display: none;
    }

    .detail {
        gap: 2rem;
    }

    .map iframe {
        height: 19rem;
    }
}

@media (max-width: 34rem) {
    .topbar__nav {
        order: 3;
        width: 100%;
        margin-right: 0;
    }

    .topbar__account {
        margin-left: auto;
    }

    .topbar__account .linklike {
        font-size: 0.9375rem;
    }

    .ride__link {
        grid-template-columns: 4rem 1fr;
        gap: 0.75rem;
    }

    .ride .route {
        font-size: 1.35rem;
    }

    .route__line {
        max-width: 3rem;
    }

    .field-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}
