/*
 * The route page and the place pages (body.responsive): the layout of the approved design
 * (Route Page Redesign artifact), on top of main.css / route.css / map.css. Desktop keeps today's
 * look; under 700px the page becomes one column with a menu button (route_builder.html.twig).
 */

/* ---------- Shared ---------- */

body.responsive .route_breadcrumb {
    padding: 12px 30px 0;
    font-size: 12px;
    color: #777;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

body.responsive .route_breadcrumb span[aria-hidden] {
    color: #999;
}

body.responsive #content .content {
    padding: 0;
}

body.responsive .menu_toggle,
body.responsive .mobile_menu {
    display: none;
}

/* ---------- Route page header and trip details ---------- */

.route_head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 30px 14px;
}

.route_head_main {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 999 1 560px;
    min-width: 0;
}

#content .route_head h1 {
    margin: 0;
    max-width: none;
}

.trip_grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 20px;
    font-size: 12px;
    line-height: 20px;
    color: #555;
}

.trip_grid .likes,
.trip_grid div > div {
    display: inline;
}

#container .route_head .framePanel {
    float: none;
    margin: 0;
    flex: 0 0 auto;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

body.responsive #canvas_holder,
body.responsive #map_canvas,
body.responsive #map_canvas_os,
body.responsive #map_canvas_osmaps {
    width: 100%;
}

body.responsive #canvas_holder {
    display: block;
}

/* ---------- Text sections ---------- */

.route_text {
    background: #f5f5f5;
    padding: 18px 30px 26px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.route_text h2,
.route_box h2,
.route_box .widget h2,
.place_sub h2 {
    margin: 0;
    font: normal 18px Arial, sans-serif;
    color: #cc6600;
}

.route_text p,
.route_about {
    margin: 0;
    line-height: 20px;
}

.route_note,
.route_box li span,
.route_list li span,
.route_columns li span {
    font-size: 12px;
    color: #777;
}

.route_along {
    font-size: 12px;
    color: #555;
}

/* ---------- Routes nearby, more like this, search, destinations ---------- */

.route_more {
    background: #f5f5f5;
    border-top: 1px solid #e6e6e6;
    padding: 18px 30px 30px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 40px;
    clear: both;
}

.route_box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.route_nearby,
.route_destinations,
.route_list,
.route_columns {
    list-style: none;
    margin: 0;
    padding: 0;
    line-height: 18px;
}

.route_nearby li,
.route_destinations li,
.route_list li,
.route_columns li {
    margin: 0 0 6px;
}

#container .route_more_link {
    font-weight: bold;
}

.route_destinations,
.route_columns {
    column-count: 2;
    column-gap: 24px;
}

.route_destinations li,
.route_columns li {
    break-inside: avoid;
}

/* The search widget inside its box: no panel of its own. */
.route_box_search .widget {
    background: none;
    padding: 0;
    display: block;
}

.route_box_search .widget h2 {
    margin: 0 0 10px;
}

.route_box_search .widget #search {
    margin: 0;
}

#container .route_more p.data_credits,
.data_credits {
    margin: 0;
    font-size: 11px;
    line-height: 16px;
    color: #666;
}

/* ---------- Place pages ---------- */

#content h1.place_title {
    margin: 10px 30px 0;
    color: #cc6600;
}

.place_intro {
    margin: 6px 30px 14px;
    color: #555;
}

.place_sub {
    margin: 0 30px 16px;
}

.place_sub h2 {
    margin-bottom: 8px;
}

.route_list {
    margin: 0 30px 20px;
}

.place_pages {
    margin: 0 30px 24px;
}

/* ---------- Phones ---------- */

/* Bootstrap pads the page by 20px a side under 768px: full width here, as the design. */
@media (max-width: 767px) {
    body.responsive {
        padding-left: 0;
        padding-right: 0;
    }
}

@media (max-width: 700px) {
    body.responsive #container {
        width: 100%;
        display: block;
        box-shadow: none;
    }

    /* Top row of links: moves into the menu button's list. */
    body.responsive nav.main_menu,
    body.responsive header .logo2,
    body.responsive #login_form,
    body.responsive .login_widget,
    body.responsive #container nav.routeBuilder li:first-child {
        display: none;
    }

    body.responsive header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: auto;
        min-height: 44px;
        padding: 6px 12px 6px 0;
        box-sizing: border-box;
    }

    body.responsive header .logo {
        margin: 0 0 0 14px;
    }

    body.responsive .menu_toggle {
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        border: 1px solid rgba(0, 0, 0, 0.25);
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.45);
        cursor: pointer;
        padding: 0;
    }

    body.responsive .mobile_menu.open {
        display: block;
        background: linear-gradient(#fbe988, #f9df4a);
        border-bottom: 1px solid #666;
    }

    body.responsive .mobile_menu ul {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    #container body.responsive .mobile_menu a,
    body.responsive #container .mobile_menu a {
        display: block;
        padding: 13px 16px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.12);
        color: #333;
        font: bold 16px Arial, sans-serif;
        text-decoration: none;
    }

    body.responsive #container .mobile_menu a.account {
        color: #4d7300;
    }

    body.responsive #container nav.routeBuilder {
        float: none;
        height: auto;
        margin: 4px 0 0 4px;
        overflow: hidden;
    }

    body.responsive #container nav.routeBuilder ul {
        padding-left: 10px;
    }

    body.responsive #container nav.userbar {
        float: none;
        clear: both;
    }

    body.responsive .route_breadcrumb,
    body.responsive .route_head,
    body.responsive .route_text,
    body.responsive .route_more {
        padding-left: 14px;
        padding-right: 14px;
    }

    body.responsive .trip_grid {
        grid-template-columns: minmax(0, 1fr);
    }

    body.responsive #canvas_holder,
    body.responsive #map_canvas,
    body.responsive #map_canvas_os,
    body.responsive #map_canvas_osmaps {
        height: 320px;
    }

    /* Elevation profile: as tall as on desktop (250px), so twice as tall for its width. */
    body.responsive .chart {
        height: 250px;
    }

    body.responsive .route_more {
        grid-template-columns: minmax(0, 1fr);
    }

    body.responsive .route_destinations,
    body.responsive .route_columns {
        column-count: 1;
    }

    /* Search routes comes after Destinations nearby. */
    body.responsive .route_box_search {
        order: 10;
    }

    body.responsive #content h1.place_title,
    body.responsive .place_intro,
    body.responsive .place_sub,
    body.responsive .route_list,
    body.responsive .place_pages {
        margin-left: 14px;
        margin-right: 14px;
    }

    body.responsive footer {
        padding: 15px 14px;
    }
}
