/* Search results (templates/pages/search.html). Only what site.css and search-box.css don't have. */

/* static/js/search.js shows and hides groups with `hidden`; flex rules mustn't override it. */
#results [hidden], .hero [hidden], #browse[hidden], #results[hidden] { display: none !important; }

.hero .search-top { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 16px; padding-top: 32px; padding-bottom: 24px; }
.results-for { margin: 0; font-size: 18px; font-weight: 800; color: var(--lede); }
.results-for .d { font-size: 26px; color: var(--paper); text-transform: uppercase; }

/* The result tabs: chips on navy */
.hero .tabs .chip { background: var(--navy-3); color: var(--paper); border-color: var(--rim-2); box-shadow: 0 3px 0 #050A12; }
.hero .tabs .chip[aria-pressed="true"] { background: var(--paper); color: var(--ink); border-color: var(--paper); box-shadow: none; transform: translateY(3px); }
.hero .tabs .chip--none { background: transparent; color: var(--muted-ink); border-style: dashed; box-shadow: none; }
.tabs .chip .n { opacity: 0.75; }

/* Best match */
.best-wrap { padding-top: 32px; padding-bottom: 8px; }
.best { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: center; text-decoration: none; color: var(--ink); background: var(--panel); border: 2px solid var(--ink); border-radius: 20px; box-shadow: 0 6px 0 var(--ink); padding: 22px 24px; }
.best-plate { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.station-plate { display: inline-flex; align-items: stretch; border: 3px solid var(--ink-deep); border-radius: 12px; overflow: hidden; box-shadow: 0 4px 0 var(--ink-deep); }
.station-plate .icon { background: var(--ink); display: flex; align-items: center; padding: 0 12px; }
.station-plate .name { background: var(--paper); padding: 6px 18px; font-size: 40px; line-height: 1; letter-spacing: 0.02em; }
.best-text { flex: 1 1 360px; display: flex; flex-direction: column; gap: 6px; }
.best-text .line { font-size: 17px; font-weight: 900; }
.best-text .about { font-size: 15px; font-weight: 700; line-height: 1.5; color: var(--body-2); }
.best-action { flex: 0 0 auto; font-size: 15px; font-weight: 900; text-decoration: underline; }

/* Result groups */
.results { padding-top: 24px; padding-bottom: 36px; }
.results > .main { flex: 1.5 1 560px; }
.results > .side { flex: 1 1 320px; gap: 14px; }
.group-head { display: flex; align-items: baseline; gap: 12px; }
.group-head .aside { font-size: 15px; font-weight: 800; color: var(--muted); }
.group + .group, .group + .nothing { margin-top: 10px; }
.loco-cards, .result-list { list-style: none; margin: 0; padding: 0; }
.result-list { display: flex; flex-direction: column; gap: 14px; }
.loco-cards > li { display: flex; }
.loco-cards > li > .card { flex: 1; }
.art-slot { display: block; }

.results .table td { padding-top: 12px; padding-bottom: 12px; }
.results .code-cell, .results .nowrap { white-space: nowrap; }
.results .code { font-size: 18px; text-decoration: none; }
.results .no-code { font-size: 13px; color: var(--muted); }
.results .route { font-weight: 800; color: var(--ink); text-decoration: none; }
.results .cargo { display: block; font-size: 13px; font-weight: 700; color: var(--muted); }

.loco-cards { gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }   /* one match stays one card wide */
.loco-cards .card { display: flex; flex-direction: column; gap: 10px; border-radius: 18px; box-shadow: 0 5px 0 var(--ink); padding: 16px; }
.loco-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.loco-head .num { font-size: 30px; }
.loco-head .cls { font-size: 15px; font-weight: 800; color: var(--body-2); }
.loco-name { font-size: 16px; font-weight: 900; }
.loco-op { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--body-2); }

/* A loco's status: a plate in the tag's shape, not a how-sure tag */
.status--in-service { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.status--stored { background: var(--rim); color: var(--paper); border-color: var(--rim); }

.checking-note { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; background: var(--rim); color: var(--paper); border-radius: 14px; font-size: 14px; font-weight: 700; line-height: 1.45; }
.checking-note > span:last-child { flex: 1 1 300px; }
.checking-note .tag--checking { background: var(--paper); color: var(--ink); border-color: var(--paper); }

.station-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--ink); color: var(--paper); border-radius: 16px; box-shadow: 0 4px 0 var(--ink-deep); text-decoration: none; }
.station-card:hover { color: var(--paper); }
.station-card .d { font-size: 26px; }
.station-card .where { font-size: 14px; font-weight: 700; color: var(--lede); }
.near { font-size: 14px; font-weight: 700; color: var(--muted); }

a.change-card, a.record-card { display: flex; flex-direction: column; gap: 4px; }
.change-card .when, .record-card .when { font-size: 13px; font-weight: 900; color: var(--muted); }
.change-card .what, .record-card .what { font-size: 15px; font-weight: 800; line-height: 1.4; }

.nothing { display: flex; flex-direction: column; gap: 6px; padding: 16px; background: var(--band); border-radius: 16px; font-size: 15px; font-weight: 700; line-height: 1.5; color: var(--body-2); }
.nothing h2 { color: var(--ink); }

/* With no search: the lists to browse (the page without script) */
.browse { gap: 12px; }

/* Tips */
.tips { padding-top: 28px; padding-bottom: 28px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.tips > div { display: flex; flex-direction: column; gap: 4px; }
.tips .q { font-size: 18px; color: var(--ink); }
.tips .what { font-size: 15px; font-weight: 700; line-height: 1.45; color: var(--body-2); }

@media (max-width: 520px) {
  .hero .search-top { padding-top: 24px; }
  .station-plate .name { font-size: 32px; padding: 6px 14px; }
  .best { padding: 18px; }
  .results .table { min-width: 560px; }   /* scroll sideways in its panel rather than squeeze */
}
