.route-template-page {
    padding-bottom: 72px;
}

.route-template-index,
.route-template-detail {
    padding-top: 42px;
}

.route-template-section-heading,
.route-template-detail-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 26px;
}

.route-template-section-heading > p {
    max-width: 620px;
    margin: 0;
    color: var(--muted);
}

.route-template-section-heading h2,
.route-template-detail-heading h2 {
    margin-bottom: 0;
}

.route-template-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.route-template-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: 0 16px 42px rgb(var(--ink-rgb) / .08);
}

.route-template-card__media,
.route-template-stop__media {
    position: relative;
    margin: 0;
    overflow: hidden;
    background: rgb(var(--ink-rgb) / .05);
}

.route-template-card__media {
    height: 260px;
}

.route-template-card__image-link {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.route-template-card__image-link:focus-visible {
    outline: 4px solid var(--sun);
    outline-offset: -5px;
}

.route-template-card__media img,
.route-template-stop__media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: var(--route-image-position, center center);
}

.route-template-card__image-link img {
    transition: transform .24s ease;
}

.route-template-card__image-link:hover img,
.route-template-card__image-link:focus-visible img {
    transform: scale(1.018);
}

.route-template-card .photo-credit,
.route-template-stop .photo-credit {
    position: absolute;
    right: 10px;
    bottom: 10px;
    max-width: calc(100% - 20px);
    padding: 5px 8px;
    border-radius: 8px;
    background: rgb(var(--ink-rgb) / .78);
    color: var(--white);
    font-size: 10px;
    line-height: 1.25;
}

.route-template-card .photo-credit a,
.route-template-stop .photo-credit a {
    color: inherit;
}

.route-template-card__body {
    padding: 24px;
}

.route-template-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.route-template-card__meta span,
.route-template-night-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgb(var(--brand-green-rgb) / .10);
    color: var(--forest);
    font-size: 12px;
    font-weight: 800;
}

.route-template-card h3 {
    margin: 0 0 8px;
    font-size: clamp(1.35rem, 2.2vw, 1.75rem);
}

.route-template-card h3 a {
    color: inherit;
    text-decoration: none;
}

.route-template-card h3 a:hover,
.route-template-card h3 a:focus-visible,
.route-template-destination-link:hover,
.route-template-destination-link:focus-visible {
    color: var(--brand-green);
}

.route-template-card__body > p {
    margin: 0 0 16px;
    color: var(--muted);
}

.route-template-sequence {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin: 18px 0;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
}

.route-template-sequence span {
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--white);
}

.route-template-sequence b {
    color: var(--brand-green);
}

.route-template-best {
    font-size: 13px;
}

.route-template-card__link,
.route-template-destination-link {
    color: var(--forest);
    font-weight: 800;
    text-decoration: none;
}

.route-template-card__link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 40px;
    padding: 9px 13px;
    border: 1px solid rgb(var(--brand-green-rgb) / .20);
    border-radius: 10px;
    background: rgb(var(--brand-green-rgb) / .08);
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.route-template-card__link:hover,
.route-template-card__link:focus-visible {
    border-color: rgb(var(--brand-green-rgb) / .38);
    background: rgb(var(--brand-green-rgb) / .13);
    color: var(--brand-green);
    transform: translateY(-1px);
}

.route-template-detail-hero .page-intro {
    max-width: 820px;
}

.route-template-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.route-template-detail-meta span {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    padding: 9px 13px;
    border: 1px solid rgb(var(--brand-green-rgb) / .22);
    border-radius: 999px;
    background: rgb(var(--white-rgb) / .68);
    color: var(--forest);
    font-size: 13px;
}

.route-template-detail-meta strong {
    font-size: 16px;
}

.route-template-best--hero {
    margin: 16px 0 0;
    color: var(--muted);
}

.route-template-itinerary {
    margin: 0;
}

.route-template-stop {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 18px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: 0 14px 36px rgb(var(--ink-rgb) / .06);
}

.route-template-stop--photo {
    grid-template-columns: 56px minmax(160px, 205px) minmax(0, 1fr);
}

.route-template-stop__number {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--brand-green);
    color: var(--white);
    font-weight: 800;
}

.route-template-stop__media {
    align-self: start;
    height: 155px;
    border-radius: 15px;
}

.route-template-stop__body {
    align-self: center;
    min-width: 0;
}

.route-template-stop__title-row {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 18px;
}

.route-template-stop__title-row h3 {
    margin: 0 0 4px;
    font-size: 1.35rem;
}

.route-template-stop__title-row p {
    margin: 0 0 14px;
    color: var(--muted);
}

.route-template-night-badge {
    flex: 0 0 auto;
}

.route-template-leg {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 58px;
    color: var(--muted);
    font-size: 12px;
}

.route-template-leg::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 42px;
    width: 2px;
    background: rgb(var(--brand-green-rgb) / .25);
}

.route-template-leg span,
.route-template-leg strong {
    position: relative;
    z-index: 1;
    padding: 3px 7px;
    background: var(--cream);
}

.route-template-leg strong {
    color: var(--ink);
}

.route-template-leg .route-template-transfer-mode {
    color: var(--forest);
    font-weight: 850;
}

.route-template-planning-note {
    max-width: 820px;
    margin: 26px 0 0;
    padding: 14px 16px;
    border-left: 3px solid var(--brand-green);
    background: rgb(var(--brand-green-rgb) / .07);
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 820px) {
    .route-template-grid {
        grid-template-columns: 1fr;
    }

    .route-template-card__media {
        height: 300px;
    }

    .route-template-section-heading,
    .route-template-detail-heading {
        align-items: start;
        flex-direction: column;
    }

    .route-template-stop--photo {
        grid-template-columns: 48px minmax(150px, 190px) minmax(0, 1fr);
    }
}

@media (max-width: 650px) {
    .route-template-index,
    .route-template-detail {
        padding-top: 28px;
    }

    .route-template-card__media {
        height: 230px;
    }

    .route-template-card__body {
        padding: 20px;
    }

    .route-template-stop,
    .route-template-stop--photo {
        grid-template-columns: 46px minmax(0, 1fr);
        gap: 12px;
        padding: 16px;
    }

    .route-template-stop__number {
        width: 38px;
        height: 38px;
    }

    .route-template-stop__media,
    .route-template-stop__body {
        grid-column: 2;
    }

    .route-template-stop__media {
        width: 100%;
        height: 190px;
    }

    .route-template-stop__title-row {
        flex-direction: column;
        gap: 8px;
    }

    .route-template-leg::before {
        left: 34px;
    }
}

@media (max-width: 440px) {
    .route-template-card__media,
    .route-template-stop__media {
        height: 200px;
    }

    .route-template-detail-meta {
        gap: 7px;
    }
}
