/*
 * Route tile: a photo-free route card that looks like a travel ticket.
 * Used on area and point pages (resources/views/components/route-tile.blade.php).
 * Solid brand colours only, no gradients (.cursor/rules/no-gradients.mdc).
 *   green #306B34, teal #1C5253, white #FFFFFF, light grey #F5F8F7.
 */

/* ---------- The card ---------- */
/* Flex column + height: all cards in a row are as tall as the tallest one. */
.route-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    height: calc(100% - 30px);
    margin-bottom: 30px;
    padding: 26px 24px 20px;
    background: #FFFFFF;
    border: 1px solid #E3EAE7;
    border-radius: 16px;
    overflow: hidden; /* Cuts the ticket notches below in half. */
    color: #1C5253;
    text-decoration: none;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

/* Short green bar at the top. It grows to the full width on hover. */
.route-tile::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 56px;
    height: 4px;
    background: #306B34;
    transition: width 0.3s;
}

.route-tile:hover,
.route-tile:focus-visible {
    color: #1C5253;
    border-color: #306B34;
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(28, 82, 83, 0.12);
}
.route-tile:hover::before,
.route-tile:focus-visible::before { width: 100%; }
.route-tile:focus-visible { outline: 3px solid rgba(48, 107, 52, 0.35); outline-offset: 2px; }

/* ---------- From -> To with a dashed line between the two stops ---------- */
.route-tile__path { position: relative; padding-left: 28px; margin-bottom: 18px; }

/* The dashed line, from the first dot down to the last dot. */
.route-tile__path::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 12px;
    bottom: 22px;
    border-left: 2px dashed #C9D6D1;
}

.route-tile__stop { position: relative; }
.route-tile__stop + .route-tile__stop { margin-top: 14px; }

/* Start dot: green ring. */
.route-tile__stop::before {
    content: "";
    position: absolute;
    left: -28px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 3px solid #306B34;
}

/* End dot: solid teal, a bit bigger, like a map pin. */
.route-tile__stop--end::before {
    left: -29px;
    width: 16px;
    height: 16px;
    background: #1C5253;
    border-color: #1C5253;
    box-shadow: 0 0 0 4px #F5F8F7;
}

.route-tile__stop small {
    display: block;
    font-size: 11px;
    line-height: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7A8B86;
}

.route-tile__place {
    display: block;
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
    color: #1C5253;
}

/* The destination is what people look for: make it the biggest text. */
.route-tile__place--end {
    margin: 2px 0 0;
    padding: 0;
    font-size: 20px;
    line-height: 26px;
    font-weight: 700;
    text-transform: none;
    color: #1C5253;
}

/* ---------- Distance and time chips ---------- */
.route-tile__facts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.route-tile__facts span {
    padding: 4px 12px;
    font-size: 13px;
    line-height: 20px;
    color: #1C5253;
    background: #F5F8F7;
    border-radius: 20px;
}
.route-tile__facts i { margin-right: 4px; color: #306B34; }

/* ---------- Bottom row: price + arrow, under a dashed "tear here" line ---------- */
.route-tile__foot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto; /* Pushes the price to the bottom of the card. */
    padding-top: 16px;
    border-top: 1px dashed #D5E0DC;
}

/*
 * Ticket notches: two circles on the dashed line, half outside the card.
 * The card's overflow: hidden cuts them, so they look like bites in the edge.
 * Left offset = card padding (24) + border (1) + half the circle (9).
 */
.route-tile__foot::before,
.route-tile__foot::after {
    content: "";
    position: absolute;
    top: -10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 1px solid #E3EAE7;
    transition: border-color 0.25s;
}
.route-tile__foot::before { left: -34px; }
.route-tile__foot::after { right: -34px; }
.route-tile:hover .route-tile__foot::before,
.route-tile:hover .route-tile__foot::after { border-color: #306B34; }

.route-tile__price { font-size: 26px; line-height: 30px; font-weight: 700; color: #306B34; }
.route-tile__price small { font-size: 13px; font-weight: 400; color: #7A8B86; }
.route-tile__price--ask { font-size: 16px; }

/* Round arrow button. Turns green and slides right on hover. */
.route-tile__go {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #1C5253;
    background: #F5F8F7;
    transition: background 0.25s, color 0.25s, transform 0.25s;
}
.route-tile:hover .route-tile__go { color: #FFFFFF; background: #306B34; transform: translateX(4px); }

/* People who turn off motion in their system settings get no movement. */
@media (prefers-reduced-motion: reduce) {
    .route-tile,
    .route-tile::before,
    .route-tile__go { transition: none; }
    .route-tile:hover,
    .route-tile:hover .route-tile__go { transform: none; }
}
