/* ═══════════════════════════════════════════════════════════════════════
   VGP – Haltestellensuche & Haltestellen-Detail
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Wrapper ────────────────────────────────────────────────────────── */
.vgp-hst-suche,
.vgp-hst-page {
    font-family: var(--vgp-font, 'Bricolage Grotesque', sans-serif);
    max-width: 820px;
    margin: 0 auto;
    color: #2d4a56;
}

/* ─── Intro ──────────────────────────────────────────────────────────── */
.vgp-hst-intro {
    margin-bottom: 1.5rem;
}
.vgp-hst-intro p {
    color: #4a5568;
    font-size: .97rem;
    margin: .4rem 0 0;
    line-height: 1.55;
}

/* ─── Search row ─────────────────────────────────────────────────────── */
.vgp-hst-search-wrap {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    margin-bottom: 1.75rem;
}
.vgp-hst-search-wrap .vgp-input-wrapper {
    flex: 1;
    min-width: 0;
}

/* ─── City buttons (Ortsübersicht) ───────────────────────────────────── */
.vgp-hst-cities h3 {
    font-size: .9rem;
    font-weight: 700;
    color: var(--vgp-primary, #487d90);
    margin: 0 0 .65rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.vgp-hst-city-btns {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .45rem;
    margin-bottom: 1.75rem;
}
.vgp-hst-city-btn {
    padding: .4rem .9rem;
    border: 1.5px solid var(--vgp-border, #c5d5dc);
    border-radius: 20px;
    background: #fff;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    color: #2d4a56;
    transition: background .15s, border-color .15s, color .15s;
    font-family: inherit;
}
.vgp-hst-city-btn:hover {
    background: #eaf3f7;
    border-color: var(--vgp-primary, #487d90);
}
.vgp-hst-city-btn.is-active {
    background: var(--vgp-primary, #487d90);
    border-color: var(--vgp-primary, #487d90);
    color: #fff;
}

/* ─── Stop list ──────────────────────────────────────────────────────── */
.vgp-hst-list-wrap {
    margin-bottom: 1.5rem;
}
.vgp-hst-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .6rem;
}
.vgp-hst-list-head h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--vgp-primary, #487d90);
    margin: 0;
}
.vgp-hst-back-btn {
    font-size: .82rem;
    color: var(--vgp-primary, #487d90);
    background: none;
    border: 1px solid var(--vgp-border, #c5d5dc);
    border-radius: 4px;
    cursor: pointer;
    padding: .25rem .65rem;
    font-family: inherit;
    transition: background .12s;
}
.vgp-hst-back-btn:hover {
    background: #eaf3f7;
}
.vgp-hst-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid var(--vgp-border, #c5d5dc);
    border-radius: var(--vgp-radius, 8px);
    overflow: hidden;
}
.vgp-hst-list li {
    border-bottom: 1px solid #e8eef2;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
.vgp-hst-list li::before {
    display: none !important;
    content: none !important;
}
.vgp-hst-list li:last-child {
    border-bottom: none;
}
.vgp-hst-list-item {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: .6rem 1rem;
    cursor: pointer;
    background: #fff;
    border: none;
    text-align: left;
    font-size: .95rem;
    font-family: inherit;
    color: #2d4a56;
    transition: background .1s;
    text-decoration: none !important;
    box-sizing: border-box;
}
.vgp-hst-list-item:hover,
.vgp-hst-list-item:focus-visible {
    background: #eaf3f7;
    outline: none;
    text-decoration: none !important;
    color: #2d4a56;
}
.vgp-hst-list-item-name {
    font-weight: 600;
}
.vgp-hst-list-item-arrow {
    color: #a0bcc8;
    font-size: 1.1rem;
    line-height: 1;
}

/* ─── Detail panel ───────────────────────────────────────────────────── */
.vgp-hst-detail {
    border: 1px solid var(--vgp-border, #c5d5dc);
    border-radius: var(--vgp-radius, 8px);
    overflow: hidden;
    background: #fff;
}
.vgp-hst-detail-head {
    background: var(--vgp-primary, #487d90);
    color: #fff;
    padding: .85rem 1.1rem;
    display: flex;
    align-items: center;
    gap: .9rem;
    flex-wrap: wrap;
}
.vgp-hst-detail-head h2 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 700;
    flex: 1;
    min-width: 0;
    color:#fff !important;
}
/* standalone page: no back button, bigger heading */
.vgp-hst-page .vgp-hst-detail-head {
    padding: 1rem 1.2rem;
}
.vgp-hst-page .vgp-hst-detail-head h2 {
    font-size: 1.2rem;
}
.vgp-hst-detail-back-btn {
    background: rgba(255,255,255,.18);
    border: none;
    color: #fff;
    border-radius: 4px;
    padding: .28rem .7rem;
    cursor: pointer;
    font-size: .82rem;
    font-family: inherit;
    white-space: nowrap;
    transition: background .12s;
}
.vgp-hst-detail-back-btn:hover {
    background: rgba(255,255,255,.3);
}

/* ─── Info row beneath header ────────────────────────────────────────── */
.vgp-hst-detail-info {
    padding: .7rem 1.1rem;
    border-bottom: 1px solid var(--vgp-border, #c5d5dc);
    display: flex;
    flex-wrap: wrap;
    gap: .3rem 1.5rem;
    font-size: .86rem;
    color: #4a5568;
    background: #f7fbfc;
}
.vgp-hst-detail-info span {
    display: flex;
    align-items: center;
    gap: .3rem;
}

/* ─── Sections inside detail ─────────────────────────────────────────── */
.vgp-hst-detail-section {
    padding: .95rem 1.1rem;
    border-bottom: 1px solid var(--vgp-border, #c5d5dc);
}
.vgp-hst-detail-section:last-child {
    border-bottom: none;
}
.vgp-hst-detail-section h3 {
    font-size: .88rem;
    font-weight: 700;
    color: var(--vgp-primary, #487d90);
    margin: 0 0 .65rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ─── Compact departure table ────────────────────────────────────────── */
.vgp-hst-dep-table {
    width: 100% !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    font-size: .875rem !important;
    margin: 0 0 .8rem !important;
    background: transparent !important;
    table-layout: fixed;
}
.vgp-hst-dep-table th {
    text-align: left !important;
    font-size: .75rem !important;
    font-weight: 700 !important;
    color: #445C6A !important;
    text-transform: uppercase !important;
    letter-spacing: .04em !important;
    padding: .3rem .5rem .3rem 0 !important;
    border: none !important;
    border-bottom: 1.5px solid #dde9ee !important;
    background: transparent !important;
    vertical-align: bottom !important;
}
.vgp-hst-dep-table td {
    padding: .45rem .5rem .45rem 0 !important;
    vertical-align: middle !important;
    border: none !important;
    border-bottom: 1px solid #f0f5f7 !important;
    background: transparent !important;
}
.vgp-hst-dep-table tr:last-child td {
    border-bottom: none !important;
}


.vgp-hst-dep-line {
    display: inline-block;
    background: var(--vgp-primary, #487d90);
    color: #fff;
    font-weight: 700;
    font-size: .78rem;
    border-radius: 3px;
    padding: .12rem .42rem;
    white-space: nowrap;
    min-width: 2.4rem;
    text-align: center;
    line-height: 1.4;
}
.vgp-hst-dep-dir {
    color: #2d4a56;
}
/* Time cell: stacks time value + badge vertically, right-aligned */
.vgp-hst-dep-time {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .05rem;
    font-variant-numeric: tabular-nums;
}
.vgp-hst-dep-time.is-delayed .vgp-hst-dep-time-val { color: #c0001a; font-weight: 700; }
.vgp-hst-dep-time.is-ontime  .vgp-hst-dep-time-val { color: #2a7a3e; font-weight: 700; }
.vgp-hst-dep-time-val {
    font-weight: 600;
    font-size: .9rem;
    white-space: nowrap;
    line-height: 1.3;
}
.vgp-hst-dep-cancelled,
.vgp-hst-dep-delay,
.vgp-hst-dep-ontime,
.vgp-hst-dep-nodata {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
    display: inline-block;
    padding: .12rem .38rem;
    border-radius: 3px;
}
.vgp-hst-dep-cancelled {
    color: #777;
    background: #efefef;
}
.vgp-hst-dep-delay {
    color: #c0001a;
    background: #fde8e8;
}
.vgp-hst-dep-ontime {
    color: #2a7a3e;
    background: #eaf7ee;
}
.vgp-hst-dep-nodata {
    color: #595959;
    background: transparent;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    padding: 0;
    font-size: .85rem;
}
.vgp-hst-city-filter {
    width: 100%;
    max-width: 22rem;
    margin: 0 0 .75rem;
    padding: .5rem .75rem;
    box-sizing: border-box;
}
.vgp-hst-city-btns {
    max-height: 16rem;
    overflow-y: auto;
}
.vgp-hst-city-btn[hidden] { display: none; }
#vgp-hst-suggestions {
    max-height: 20rem;
    overflow-y: auto;
}
.vgp-hst-city-count { opacity: .7; font-weight: 400; }
.vgp-suggestions .vgp-suggestion-more {
    font-weight: 600;
    cursor: pointer;
    border-top: 1px solid #d5e2e8;
}

/* Column widths */
.vgp-hst-dep-table thead th:first-of-type,
.vgp-hst-dep-table .vgp-hst-td-line { width: 4rem; }
.vgp-hst-dep-table thead th:nth-of-type(3) { width: 5rem; }
.vgp-hst-dep-table thead th:nth-of-type(4) { width: 6rem; white-space: nowrap; }
.vgp-hst-dep-table thead th:nth-of-type(5),
.vgp-hst-dep-table .vgp-hst-td-steig { width: 3.5rem; }

/* ─── Filter bar ─────────────────────────────────────────────────────── */
.vgp-hst-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem .55rem;
    margin-bottom: .75rem;
    padding: .5rem .65rem;
    background: #f7fbfc;
    border: 1px solid var(--vgp-border, #c5d5dc);
    border-radius: var(--vgp-radius, 8px);
}
.vgp-hst-filter-selects {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    flex: 1;
    min-width: 0;
}
.vgp-hst-filter {
    padding: .3rem .5rem;
    border: 1px solid var(--vgp-border, #c5d5dc);
    border-radius: 5px;
    background: #fff;
    font-size: .84rem;
    font-family: inherit;
    color: #2d4a56;
    cursor: pointer;
    min-width: 0;
    max-width: 100%;
}
.vgp-hst-filter:focus {
    outline: 2px solid var(--vgp-primary, #487d90);
    outline-offset: 1px;
}
.vgp-hst-filter-times {
    display: flex;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--vgp-border, #c5d5dc);
    flex-shrink: 0;
}
.vgp-hst-time-btn {
    padding: .28rem .62rem;
    border: none;
    border-right: 1px solid var(--vgp-border, #c5d5dc);
    background: #fff;
    font-size: .8rem;
    font-family: inherit;
    color: #4a6a78;
    cursor: pointer;
    transition: background .12s, color .12s;
    white-space: nowrap;
}
.vgp-hst-time-btn:last-child { border-right: none; }
.vgp-hst-time-btn:hover { background: #eaf3f7; color: var(--vgp-primary, #487d90); }
.vgp-hst-time-btn.is-active { background: var(--vgp-primary, #487d90); color: #fff; }
.vgp-hst-time-btn.is-active:hover { background: var(--vgp-primary-d, #3a6578); }

/* ─── "Later departures" button ──────────────────────────────────────── */
.vgp-hst-later-btn {
    display: inline-block;
    margin-top: .6rem;
    padding: .4rem 1rem;
    background: transparent;
    color: var(--vgp-primary, #487d90);
    border: 1.5px solid var(--vgp-border, #c5d5dc);
    border-radius: var(--vgp-radius, 8px);
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s, border-color .15s;
}
.vgp-hst-later-btn:hover {
    background: #eaf3f7;
    border-color: var(--vgp-primary, #487d90);
}
.vgp-hst-later-btn:disabled {
    opacity: .55;
    cursor: default;
}
.vgp-hst-later-btn + .vgp-hst-alle-btn {
    margin-left: .5rem;
}

/* ─── "All departures" button ────────────────────────────────────────── */
.vgp-hst-alle-btn {
    display: inline-block;
    margin-top: .6rem;
    padding: .45rem 1.1rem;
    background: var(--vgp-primary, #487d90);
    color: #fff;
    border-radius: var(--vgp-radius, 8px);
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s;
}
.vgp-hst-alle-btn:hover {
    background: var(--vgp-primary-d, #3a6578);
    color: #fff;
    text-decoration: none;
}

/* ─── Line badges ────────────────────────────────────────────────────── */
.vgp-hst-lines-list {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .45rem;
}
.vgp-hst-line-badge {
    display: inline-block;
    background: var(--vgp-primary, #487d90);
    color: #fff;
    font-weight: 700;
    font-size: .85rem;
    border-radius: 4px;
    padding: .22rem .65rem;
    text-decoration: none;
    transition: background .15s, box-shadow .15s;
    font-family: inherit;
    line-height: inherit;
}
/* Button-Reset für klickbare Badges */
button.vgp-hst-line-badge {
    border: none;
    cursor: pointer;
}
button.vgp-hst-line-badge:hover {
    background: var(--vgp-primary-d, #3a6578);
    color: #fff;
}
button.vgp-hst-line-badge.is-active {
    background: #fff;
    color: var(--vgp-primary, #487d90);
    box-shadow: inset 0 0 0 2px var(--vgp-primary, #487d90);
}
button.vgp-hst-line-badge.is-active:hover {
    background: #eaf3f7;
}
/* Nicht-klickbare Badges (standalone) */
span.vgp-hst-line-badge:hover {
    background: var(--vgp-primary-d, #3a6578);
    color: #fff;
    text-decoration: none;
}

/* ─── Notices ────────────────────────────────────────────────────────── */
.vgp-hst-notice {
    padding: .65rem .9rem;
    border-radius: var(--vgp-radius, 8px);
    font-size: .875rem;
    color: #6b3737;
    background: #fdf0f0;
    border: 1px solid #f0c5c5;
    margin: .4rem 0;
}
.vgp-hst-notice--info {
    color: #2d4a56;
    background: #eaf3f7;
    border-color: var(--vgp-border, #c5d5dc);
}

/* ─── Spinner ────────────────────────────────────────────────────────── */
.vgp-hst-spinner {
    text-align: center;
    padding: 1.4rem;
    color: #445C6A;
    font-size: .875rem;
}
.vgp-hst-spinner::before {
    content: '';
    display: inline-block;
    width: 17px;
    height: 17px;
    border: 2.5px solid #c5d5dc;
    border-top-color: var(--vgp-primary, #487d90);
    border-radius: 50%;
    animation: vgp-spin .7s linear infinite;
    vertical-align: middle;
    margin-right: .5rem;
}

/* ─── City list shortcode ────────────────────────────────────────────── */
.vgp-hst-ort {
    max-width: 480px;
}
.vgp-hst-ort h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--vgp-primary, #487d90);
    margin: 0 0 .65rem;
}

/* ─── Mobile ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    /* Status und Steig bleiben auch mobil sichtbar; die engen Spalten kompakt halten. */
    .vgp-hst-dep-table th,
    .vgp-hst-dep-table td { padding-right: .25rem !important; }
    .vgp-hst-dep-table thead th:first-of-type,
    .vgp-hst-dep-table .vgp-hst-td-line { width: 2.8rem; }
    .vgp-hst-dep-table thead th:nth-of-type(3) { width: 3.4rem; }
    .vgp-hst-dep-table thead th:nth-of-type(4) { width: 4.4rem; white-space: normal; }
    .vgp-hst-dep-table thead th:nth-of-type(5),
    .vgp-hst-dep-table .vgp-hst-td-steig { width: 2.5rem; }
    .vgp-hst-dep-table { font-size: .78rem !important; }
    .vgp-hst-dep-table .vgp-hst-dep-dir { overflow-wrap: anywhere; }
    .vgp-hst-dep-table .vgp-hst-dep-cancelled,
    .vgp-hst-dep-table .vgp-hst-dep-delay,
    .vgp-hst-dep-table .vgp-hst-dep-ontime { font-size: .62rem; padding: .1rem .2rem; }

    .vgp-hst-filters { padding: .4rem .5rem; }
    .vgp-hst-filter-selects { width: 100%; }
    .vgp-hst-filter { flex: 1; }

    .vgp-hst-detail-head {
        gap: .6rem;
    }
    .vgp-hst-detail-info {
        flex-direction: column;
        gap: .25rem;
    }
    .vgp-hst-dep-dir {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .vgp-hst-city-btns {
        gap: .35rem;
    }
}
