/*
 * EntoHub Route Layer (0.7.0). Cards, map pins and panel on Discover, the route
 * page, and route rows on My trip. Drawn with the theme's tokens, with
 * fallbacks so a different theme still gets a working page.
 */

/* ── Shared ──────────────────────────────────────────────────────────── */

.ento-route-swatch {
    display: inline-block;
    width: 18px;
    height: 4px;
    margin-right: 8px;
    border-radius: 2px;
    background: var(--route, var(--accent, #C7552E));
    vertical-align: middle;
    flex: none;
}

/* Start and finish markers. */
.ento-route-end { background: none; border: 0; }
.ento-route-end span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--paper, #FFFCED);
    color: var(--navy, #1A2E45);
    border: 3px solid var(--navy, #1A2E45);
    font: 800 12px/1 var(--sans, sans-serif);
    box-shadow: 0 4px 10px rgba(26, 46, 69, .35);
}

/* A route's pin is its start: a ring rather than a dot. */
.ento-marker--route .ento-marker-dot {
    background: var(--paper, #FFFCED);
    box-shadow: inset 0 0 0 4px var(--navy, #1A2E45), 0 0 0 2px var(--paper, #FFFCED), 0 4px 8px rgba(26, 46, 69, .35);
}
.ento-marker--route.is-active .ento-marker-dot {
    background: var(--paper, #FFFCED);
    box-shadow: inset 0 0 0 6px var(--ink, #1F2328), 0 0 0 4px var(--paper, #FFFCED), 0 0 0 9px var(--ring, rgba(26, 46, 69, .22));
}


/* ── Discover: cards and panel ───────────────────────────────────────── */

.ento-card-route,
.ento-map-panel-route {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px 0;
    margin: 4px 0 6px;
    color: var(--ink, #1F2328);
    font-weight: 700;
    font-size: 14px;
}
.ento-map-panel-waymark {
    flex-basis: 100%;
    color: var(--sub, #46515C);
    font-weight: 600;
    font-size: 13px;
}
.ento-map-panel-gpx { align-self: center; }

.ento-eyebrow--private {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.ento-eyebrow--private::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent, #C7552E);
}


/* ── Route page ──────────────────────────────────────────────────────── */

.ento-route-view {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    margin-top: 24px;
    margin-bottom: 8px;
}
@media (min-width: 960px) {
    .ento-route-view.has-aside { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); }
}
/* A day walk with nothing to say beside the map gets the full width. */
.ento-route-view:not(.has-aside) .ento-route-map { height: clamp(320px, 60vh, 660px); }

.ento-route-mapcol { min-width: 0; }
.ento-route-map {
    height: clamp(320px, 56vh, 620px);
    border-radius: var(--r-md, 16px);
    overflow: hidden;
    box-shadow: var(--shadow-card, 0 1px 3px rgba(0, 0, 0, .1));
    position: relative;
    z-index: 0;
}
.ento-route-source {
    margin: 8px 2px 0;
    color: var(--sub, #46515C);
    font-size: 13px;
}
.ento-route-source a { color: inherit; }

.ento-route-stages {
    min-width: 0;
    background: var(--paper, #FFFCED);
    border-radius: var(--r-md, 16px);
    box-shadow: var(--shadow-card, 0 1px 3px rgba(0, 0, 0, .1));
    padding: 18px;
    align-self: start;
}
@media (min-width: 960px) {
    .ento-route-view.is-multi .ento-route-stages { max-height: clamp(320px, 56vh, 620px); overflow: auto; }
}
.ento-route-stages-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.ento-route-stages-head .ento-h3 {
    margin: 0;
    font: 700 20px/1.2 var(--serif, Georgia, serif);
    color: var(--navy, #1A2E45);
}
.ento-route-whole {
    border: 1.5px solid var(--navy, #1A2E45);
    background: transparent;
    color: var(--navy, #1A2E45);
    border-radius: var(--pill, 999px);
    padding: 6px 14px;
    font: 600 13px/1 var(--sans, sans-serif);
    cursor: pointer;
}
.ento-route-whole[aria-pressed="true"] { background: var(--navy, #1A2E45); color: var(--paper, #FFFCED); }

.ento-stage-list { list-style: none; margin: 0; padding: 0; }
.ento-stage + .ento-stage { border-top: 1px solid var(--line, rgba(26, 46, 69, .14)); }
.ento-stage-head {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 2px;
    background: none;
    border: 0;
    text-align: left;
    color: var(--ink, #1F2328);
    font: 600 14.5px/1.35 var(--sans, sans-serif);
    cursor: pointer;
}
.ento-stage-head:hover .ento-stage-name { text-decoration: underline; }
.ento-stage-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--mist, #E0E9EE);
    color: var(--navy, #1A2E45);
    font-weight: 800;
    font-size: 12.5px;
}
.ento-stage.is-open .ento-stage-num { background: var(--navy, #1A2E45); color: var(--paper, #FFFCED); }
.ento-stage-km { color: var(--sub, #46515C); font-weight: 600; white-space: nowrap; }
.ento-stage-alert-badge {
    grid-column: 2 / -1;
    justify-self: start;
    padding: 2px 8px;
    border-radius: var(--pill, 999px);
    background: #FBE4D8;
    color: var(--rust, #9A3B1C);
    font-size: 12px;
    font-weight: 700;
}

.ento-stage-body { padding: 4px 0 14px; }
.ento-route-view.is-multi .ento-stage-body { padding-left: 40px; }
.ento-stage-alert {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-left: 4px solid var(--rust, #9A3B1C);
    border-radius: 8px;
    background: #FBE4D8;
    color: var(--ink, #1F2328);
    font-size: 14px;
}
.ento-stage-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    margin: 0 0 10px;
}
.ento-stage-stats div { display: flex; flex-direction: column; }
.ento-stage-stats dt { color: var(--sub, #46515C); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ento-stage-stats dd { margin: 0; color: var(--ink, #1F2328); font-weight: 700; }
.ento-stage-transport { margin: 0 0 10px; font-size: 14px; color: var(--body, #3A4046); }
.ento-stage-places-h { margin: 6px 0 6px; font: 700 14px/1.3 var(--sans, sans-serif); color: var(--navy, #1A2E45); }
.ento-stage-places ul { list-style: none; margin: 0 0 10px; padding: 0; }
.ento-stage-place { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 0; }
.ento-stage-place small { color: var(--sub, #46515C); }
.ento-stage-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* On the cream stage panel the default cream button disappears: outlined, as in the map panel. */
.ento-route-stages .ento-trip-save { background: #fff; box-shadow: inset 0 0 0 1.5px rgba(26, 46, 69, .35); min-height: 40px; }
.ento-route-stages .ento-trip-save.is-saved { background: var(--navy, #1A2E45); color: var(--paper, #FFFCED); box-shadow: none; }

/* At a glance, route facts. */
.ento-facts dd .ento-route-swatch { align-self: center; margin-right: 2px; }
.ento-facts-start { flex-direction: column; align-items: flex-start !important; gap: 2px !important; }
.ento-facts-start small { color: var(--sub, #46515C); font-weight: 600; }
.ento-route-gpx { margin-top: 8px; }


/* ── My trip ─────────────────────────────────────────────────────────── */

.ento-trip-item-route { display: flex; align-items: center; color: var(--ink, #1F2328); font-weight: 700; font-size: 13.5px; margin: 2px 0; }
