/* =============================================================
   route-page.css — redesigned Red/Blue route subpages
   Uses --rp-c (route accent) set per page on .route-page
   ============================================================= */

.route-page {
    --rp-c: #e31e25;
    --rp-c-dark: #7b0f0f;
    --rp-soft: rgba(227, 30, 37, .10);
}
.route-page--blue {
    --rp-c: #1565c0;
    --rp-c-dark: #0d2f6e;
    --rp-soft: rgba(21, 101, 192, .10);
}

/* ---------- HERO ---------- */
.rp-hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    padding: 120px 5% 90px;
    background:
        radial-gradient(ellipse at 75% 20%, rgba(255, 255, 255, .12) 0%, transparent 55%),
        linear-gradient(135deg, var(--rp-c) 0%, var(--rp-c-dark) 100%);
}
.rp-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 12% 80%, rgba(255, 255, 255, .10) 0 2px, transparent 3px),
        radial-gradient(circle at 90% 60%, rgba(255, 255, 255, .08) 0 2px, transparent 3px);
    pointer-events: none;
}
.rp-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}
.rp-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .16);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, .28);
    color: #fff;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-size: .72rem;
    padding: 7px 16px;
    border-radius: 100px;
}
.rp-badge::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, .3);
}
.rp-hero h1 {
    font-size: clamp(2rem, 5vw, 3.3rem);
    line-height: 1.1;
    margin: 20px 0 16px;
}
.rp-hero-sub {
    font-size: 1.08rem;
    line-height: 1.7;
    opacity: .9;
    margin: 0 auto 30px;
    max-width: 620px;
}
.rp-hero-cta {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}
.rp-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 30px;
    border-radius: 100px;
    font-weight: 700;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease;
}
.rp-btn:hover { transform: translateY(-2px); }
.rp-btn--solid {
    background: #fff;
    color: var(--rp-c-dark);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
}
.rp-btn--ghost {
    background: rgba(255, 255, 255, .10);
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, .55);
}

/* ---------- STATS + LIVE STRIP ---------- */
.rp-stats {
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, .06);
    border-top: 4px solid var(--rp-c);
    padding: 22px 5%;
}
.rp-stats-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px 34px;
    flex-wrap: wrap;
}
.rp-stat { text-align: center; }
.rp-stat-num {
    display: block;
    font-family: "Bricolage Grotesque", "Poppins", sans-serif;
    font-weight: 700;
    font-size: 1.7rem;
    color: var(--rp-c-dark);
    line-height: 1;
}
.rp-stat-label {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #8a8a8a;
}
.rp-stat-divider {
    width: 1px;
    align-self: stretch;
    background: rgba(0, 0, 0, .08);
}
.rp-live {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: var(--rp-soft);
    color: var(--rp-c-dark);
    border-radius: 100px;
    padding: 9px 18px;
    font-size: .9rem;
    font-weight: 600;
}
.rp-live-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #bdbdbd;
}
.rp-live.has-buses .rp-live-dot {
    background: var(--color-live, #4CAF50);
    animation: rp-pulse 1.6s ease-out infinite;
}
@keyframes rp-pulse {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, .55); }
    100% { box-shadow: 0 0 0 10px rgba(76, 175, 80, 0); }
}

/* ---------- MAP ---------- */
.rp-map-section { padding: 60px 5%; background: var(--bg-warm-gray, #FAF7F2); }
.rp-section-head { text-align: center; max-width: 640px; margin: 0 auto 34px; }
.rp-section-head h2 {
    font-size: clamp(1.5rem, 3.5vw, 2.1rem);
    margin: 0 0 10px;
    color: var(--text-dark, #2D1B2E);
}
.rp-section-head p { color: #6b6b6b; margin: 0; }
.rp-map-shell {
    max-width: 1100px;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 14px 40px rgba(0, 0, 0, .12);
    border: 1px solid rgba(0, 0, 0, .05);
}
#route-map {
    width: 100%;
    height: 480px;
    background: #e9e4dc;
}

/* Leaflet markers */
.rp-marker {
    width: 30px;
    height: 30px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: var(--rp-c);
    border: 2.5px solid #fff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .3);
    display: flex;
    align-items: center;
    justify-content: center;
}
.rp-marker span {
    transform: rotate(45deg);
    color: #fff;
    font-weight: 700;
    font-size: .8rem;
}
.rp-bus { position: relative; width: 40px; height: 40px; }
.rp-bus-dot {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 2px solid var(--rp-c);
    border-radius: 50%;
    font-size: 18px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .28);
}
.rp-bus-arrow {
    position: absolute;
    top: -7px;
    left: 50%;
    margin-left: -6px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 9px solid var(--rp-c);
    transform-origin: 50% 27px;
}

/* Leaflet popup */
.rp-popup { min-width: 170px; }
.rp-popup-badge {
    display: inline-block;
    color: #fff;
    font-weight: 700;
    font-size: .7rem;
    padding: 2px 9px;
    border-radius: 5px;
    margin-bottom: 6px;
}
.rp-popup h4 { margin: 0 0 4px; font-size: 1rem; }
.rp-popup-eta { margin: 0 0 8px; font-size: .85rem; color: #555; }
.rp-popup-link { font-weight: 600; color: var(--rp-c, #c62828); text-decoration: none; }

/* ---------- STOPS ---------- */
.rp-stops-section { padding: 64px 5%; background: #fff; }
.rp-stops-grid {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 22px;
}
.stop-card {
    position: relative;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .07);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .05);
    transition: transform .2s ease, box-shadow .2s ease;
    display: flex;
    flex-direction: column;
}
.stop-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0, 0, 0, .10); }
.stop-card.is-active { outline: 2px solid var(--rp-c); outline-offset: 2px; }
.stop-card-media {
    position: relative;
    height: 150px;
    background: linear-gradient(135deg, var(--rp-c) 0%, var(--rp-c-dark) 100%);
}
.stop-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.stop-card-num {
    position: absolute;
    left: 14px;
    bottom: -18px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--rp-c);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .22);
}
.stop-card-eta {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, .95);
    color: var(--rp-c-dark);
    font-weight: 700;
    font-size: .78rem;
    padding: 5px 11px;
    border-radius: 100px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.stop-card-eta::before {
    content: "";
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--color-live, #4CAF50);
}
.stop-card-eta.is-idle { color: #999; }
.stop-card-eta.is-idle::before { background: #ccc; }
.stop-card-body { padding: 26px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.stop-card-title { margin: 0 0 2px; font-size: 1.12rem; }
.stop-card-title a { color: var(--text-dark, #1a1a1a); text-decoration: none; }
.stop-card-title a:hover { color: var(--rp-c); }
.stop-card-code {
    font-size: .7rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #b0a99f;
}
.stop-card-desc {
    color: #5f5f5f;
    font-size: .9rem;
    line-height: 1.6;
    margin: 10px 0 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.stop-card-meta { margin-top: auto; border-top: 1px solid #f2ede7; padding-top: 12px; }
.stop-meta-row { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.stop-meta-row:last-child { margin-bottom: 0; }
.stop-meta-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #a59d94;
    width: 100%;
}
.stop-chip {
    background: var(--rp-soft);
    color: var(--rp-c-dark);
    border-radius: 6px;
    padding: 2px 9px;
    font-size: .8rem;
    font-weight: 600;
}
.stop-chip--muted { background: #f4f1ec; color: #6d665e; font-weight: 500; }
.stop-card-actions { display: flex; gap: 8px; margin-top: 14px; }
.stop-locate-btn {
    flex: 1;
    background: var(--rp-soft);
    color: var(--rp-c-dark);
    border: none;
    border-radius: 10px;
    padding: 9px;
    font-weight: 600;
    font-size: .85rem;
    cursor: pointer;
    transition: background .2s;
}
.stop-locate-btn:hover { background: var(--rp-c); color: #fff; }
.stop-detail-btn {
    flex: 1;
    text-align: center;
    background: transparent;
    color: var(--rp-c-dark);
    border: 1.5px solid var(--rp-soft);
    border-radius: 10px;
    padding: 9px;
    font-weight: 600;
    font-size: .85rem;
    text-decoration: none;
}
.stop-detail-btn:hover { border-color: var(--rp-c); }

/* ---------- OTHER ROUTE + FINAL CTA ---------- */
.rp-cta-band {
    padding: 64px 5%;
    text-align: center;
    background: linear-gradient(135deg, var(--rp-c) 0%, var(--rp-c-dark) 100%);
    color: #fff;
}
.rp-cta-band h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); margin: 0 0 12px; }
.rp-cta-band p { opacity: .9; margin: 0 auto 26px; max-width: 520px; }
.rp-cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.rp-other {
    padding: 48px 5%;
    text-align: center;
    background: var(--bg-warm-gray, #FAF7F2);
}
.rp-other p { color: #6b6b6b; margin: 0 0 18px; }
.rp-other-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    text-decoration: none;
    padding: 12px 26px;
    border-radius: 100px;
    border: 2px solid;
}
.rp-other-link--red { color: #e31e25; border-color: #e31e25; }
.rp-other-link--red:hover { background: #e31e25; color: #fff; }
.rp-other-link--blue { color: #1565c0; border-color: #1565c0; }
.rp-other-link--blue:hover { background: #1565c0; color: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
    .rp-hero { padding: 96px 5% 64px; }
    #route-map { height: 360px; }
    .rp-stops-grid { grid-template-columns: 1fr; }
    .rp-stat-divider { display: none; }
}
