/*
 * Shared "route card" component — used identically on the homepage
 * (injected via custom.js, since the homepage is a compiled Vue SPA
 * with no editable source) and on routes.php/offers.php/blogs.php
 * (server-rendered).
 * Keeping this in one file is what makes the two actually match rather
 * than drifting into two similar-but-different designs.
 */

section.rc-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 20px 60px;
}
.rc-section-head {
    text-align: center;
    max-width: 620px;
    margin: 0 auto 32px;
}
.rc-section-head .rc-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #eaf4fa;
    color: #17608a;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 14px;
}
.rc-section-head h2 {
    font-size: 1.7rem;
    font-weight: 700;
    color: #1c2b3a;
    margin: 0 0 10px;
}
.rc-section-head p {
    color: #55636e;
    margin: 0;
    line-height: 1.6;
}

.rc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.route-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e7edf1;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 6px 18px rgba(20, 40, 60, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.route-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(20, 40, 60, 0.14);
    border-color: #2182bb;
    color: inherit;
    text-decoration: none;
}
.route-card .rc-img {
    width: 100%;
    aspect-ratio: 2 / 1;
    object-fit: cover;
    background: #eef2f4;
    display: block;
}
.route-card .rc-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.route-card .rc-route {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #2182bb;
}
.route-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1c2b3a;
    margin: 0;
    line-height: 1.35;
}
.route-card .rc-cta {
    margin-top: auto;
    padding-top: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #17608a;
    display: flex;
    align-items: center;
    gap: 6px;
}
.route-card .rc-cta i {
    font-size: 0.7rem;
    transition: transform 0.15s ease;
}
.route-card:hover .rc-cta i {
    transform: translateX(3px);
}

.rc-section-foot {
    text-align: center;
    margin-top: 34px;
}
.rc-view-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #2182bb;
    color: #fff;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 12px 26px;
    border-radius: 999px;
    text-decoration: none;
    transition: background 0.15s ease;
}
.rc-view-all:hover {
    background: #17608a;
    color: #fff;
    text-decoration: none;
}

/*
 * Everything below this line is shared by offers.php / blogs.php /
 * routes.php (server-rendered list/route directory pages). It is kept
 * here rather than duplicated per page so the three stay in sync.
 * None of it is used by the homepage's .rc-section/.rc-grid injection
 * above — additive only, the base .rc-grid/.route-card rules above are
 * untouched.
 */

.route-card .rc-excerpt {
    color: var(--afp-body, #55636e);
    font-size: 0.86rem;
    line-height: 1.55;
    margin: 6px 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card-grid layout: opt in with .rc-list instead of .rc-grid. Cards
   themselves stay vertical (image on top, content below — the same
   shape as the base .route-card/.rc-grid cards, no row/flex-direction
   override needed here), only the container differs: auto-fit/minmax
   gives two cards per row once there's room for two ≥420px columns
   (desktop), and folds to one column as soon as there isn't — no
   separate "desktop" breakpoint needed; the ≤640px query below still
   forces a single column explicitly as a safety net for narrow
   phones. */
.rc-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 18px;
}
/* The base .rc-img rule forces every image into a fixed 2:1 box and
   crops (object-fit:cover) to fill it — fine for photos, but the
   offer images are pre-made promo graphics with their own baked-in
   text/layout, so cropping was cutting pieces of that off. Show them
   at their real aspect ratio instead: full width, natural height, no
   cropping. Scoped to .rc-list so the homepage's grid cards (real
   photos) keep the cover-cropped 2:1 treatment. */
.rc-list .route-card .rc-img {
    aspect-ratio: auto;
    height: auto;
}

/* Offer/tag badge, sitting right above the title in the body (not
   pinned on the image) — reuses the existing .rc-route markup/text
   already on offers.php and routes.php cards, just styled as a small
   pill instead of the base plain uppercase text. Scoped to .rc-list
   only, so the homepage's grid cards (which show .rc-route as plain
   text) are untouched. Color defaults to the blue theme; offers.php
   overrides it to gold inline. */
.rc-list .route-card .rc-route {
    align-self: flex-start;
    background: var(--afp-blue, #2182bb);
    color: #fff;
    padding: 4px 10px;
    border-radius: 999px;
}

/* Hero banner (routes-hero) — gradient/eyebrow color are set per page
   via --hero-gradient / --hero-eyebrow-color custom properties */
.routes-hero {
    background: var(--hero-gradient, linear-gradient(135deg, #164d70 0%, #1c6ea4 45%, #2182bb 100%));
    padding: 52px 24px 44px;
    text-align: center;
    color: #fff;
    position: relative;
}
.routes-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(600px circle at 12% -20%, rgba(255, 255, 255, 0.14), transparent 60%);
    pointer-events: none;
}
.routes-hero > * {
    position: relative;
    z-index: 1;
}
.routes-hero .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--hero-eyebrow-color, #eaf6ff);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding: 7px 16px;
    border-radius: 999px;
    margin-bottom: 20px;
}
.routes-hero .eyebrow i { font-size: 0.78rem; }
.routes-hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0 0 14px;
    line-height: 1.22;
    letter-spacing: -0.01em;
}
.routes-hero p {
    color: rgba(255, 255, 255, 0.92);
    max-width: 640px;
    margin: 0 auto;
    font-size: 1.02rem;
    line-height: 1.65;
}
.routes-hero p a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }

.routes-wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 32px 20px 70px;
    position: relative;
    z-index: 2;
}

.cards-panel {
    background: #fff;
    border-radius: var(--afp-radius, 14px);
    box-shadow: 0 10px 30px rgba(20, 40, 60, 0.06);
    padding: 22px 24px 20px;
}

/* Routes-page search box */
.routes-search-wrap {
    max-width: 560px;
    margin: 28px auto 20px;
    position: relative;
}
.routes-search-wrap .fa-search {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa9b4;
}
#route-search {
    width: 100%;
    border: none;
    border-radius: 999px;
    padding: 15px 48px 15px 46px;
    font-size: 0.98rem;
    font-family: inherit;
    color: var(--afp-ink, #1c2b3a);
    box-shadow: 0 12px 30px rgba(10, 40, 60, 0.28);
}
#route-search:focus {
    outline: none;
    box-shadow: 0 12px 30px rgba(10, 40, 60, 0.28), 0 0 0 3px rgba(255, 255, 255, 0.5);
}
#route-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #eef2f4;
    color: #7a8892;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}
#route-search-clear:hover { background: #e2e8ec; }

.routes-stats {
    margin: 16px 0 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
}

/* Quick-jump city chips */
.city-jump {
    background: #fff;
    border-radius: var(--afp-radius, 14px);
    box-shadow: 0 10px 30px rgba(20, 40, 60, 0.08);
    border: 1px solid var(--afp-border, #e7edf1);
    padding: 14px 16px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.city-jump .label {
    flex: 0 0 auto;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8b98a3;
    padding-right: 10px;
    border-right: 1px solid var(--afp-border, #e7edf1);
}
.city-jump-list {
    list-style: none;
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0 2px;
    overflow-x: auto;
    scrollbar-width: thin;
}
.city-jump-list li { flex: 0 0 auto; }
.city-jump-list a {
    display: inline-block;
    white-space: nowrap;
    background: var(--afp-blue-light, #eaf4fa);
    color: var(--afp-blue-dark, #17608a);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: 999px;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.city-jump-list a:hover {
    background: var(--afp-blue, #2182bb);
    color: #fff;
}

/* City cards */
.city-group {
    background: #fff;
    border: 1px solid var(--afp-border, #e7edf1);
    border-radius: var(--afp-radius, 14px);
    box-shadow: 0 10px 30px rgba(20, 40, 60, 0.06);
    padding: 26px 28px 22px;
    margin-bottom: 22px;
    scroll-margin-top: 90px;
}
.city-group-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 16px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--afp-border, #e7edf1);
}
.city-icon {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--afp-blue-light, #eaf4fa);
    color: var(--afp-blue, #2182bb);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
}
.city-group h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    color: var(--afp-ink, #1c2b3a);
    flex: 1 1 auto;
}
.city-group h2 .from-label {
    font-weight: 400;
    color: #93a0aa;
    font-size: 0.95rem;
}
.route-count {
    flex: 0 0 auto;
    background: #f2f5f7;
    color: #7a8892;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 11px;
    border-radius: 999px;
}

/* Empty states */
.cards-empty {
    text-align: center;
    background: #fff;
    border: 1px dashed var(--afp-border, #e7edf1);
    border-radius: var(--afp-radius, 14px);
    padding: 50px 20px;
    color: #7a8892;
}
.cards-empty i { font-size: 1.6rem; color: #c3cdd4; margin-bottom: 10px; display: block; }
.cards-empty a { color: var(--afp-blue, #2182bb); font-weight: 600; text-decoration: none; }
.cards-empty a:hover { text-decoration: underline; }

/* routes.php's JS-toggled variant — always in the DOM, hidden by
   default, shown by the inline <script> when a search has 0 matches */
.routes-empty { display: none; }

body.searching .city-jump { display: none; }

@media (max-width: 640px) {
    section.rc-section { padding: 36px 16px 44px; }
    .rc-section-head h2 { font-size: 1.4rem; }
    .rc-grid { grid-template-columns: 1fr; gap: 14px; }

    .routes-hero { padding: 40px 18px 34px; }
    .routes-hero h1 { font-size: 1.6rem; }
    .routes-wrap { margin-top: 0; padding: 24px 14px 50px; }

    .city-group { padding: 20px 18px 16px; }
    .city-jump { padding: 12px; }
    .city-jump .label { display: none; }

    .rc-list { grid-template-columns: 1fr; gap: 12px; }
}
