/* ==========================================================================
   site.css – gemeinsame Komponenten (nach styles.css und aircraft.css laden)
   ========================================================================== */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

a { color: var(--cyan); }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.right { text-align: right; }
.wrap { white-space: normal !important; min-width: 180px; }

.flag {
  display: inline-block; width: 20px; height: 15px; object-fit: cover;
  vertical-align: -2px; margin-right: 6px; border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(127, 127, 127, .3);
}

/* ---------- Header: kompakte Suche ---------- */

.topbar { gap: 28px; }
.main-nav { gap: 22px; }

.top-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  width: 290px;
  padding: 0 4px 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.top-search > svg { color: var(--muted); flex: none; }
.top-search input {
  flex: 1; min-width: 0; background: none; border: 0; outline: 0;
  color: var(--text); font: inherit; font-size: 13px;
}
.top-search input::placeholder { color: #6f7f94; }
.top-search button {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  border: 0; border-radius: 9px; background: #14243a; color: var(--cyan); cursor: pointer;
}
.top-search:focus-within { border-color: rgba(57, 217, 245, .55); }

.drawer-search { padding: 14px 12px 0; }
.drawer-search .top-search { width: 100%; }

@media (max-width: 1380px) {
  .topbar > .top-search { width: 210px; }
}
@media (max-width: 1240px) {
  .topbar > .top-search { display: none; }
}
@media (max-width: 1050px) {
  .topbar > .top-search { display: flex; width: auto; flex: 1; max-width: 360px; margin-left: auto; }
  .hamburger { margin-left: 0; }
}
@media (max-width: 650px) {
  .topbar > .top-search { display: none; }
  .hamburger { margin-left: auto; }
}

/* ---------- Suchvorschläge ---------- */

.has-suggest { position: relative; }
.suggest-list {
  position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 6px);
  margin: 0; padding: 6px; list-style: none;
  border: 1px solid var(--line); border-radius: 12px; background: #0b1726;
  box-shadow: var(--shadow); text-align: left;
}
.suggest-list a {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px;
  padding: 9px 10px; border-radius: 8px; color: var(--text); text-decoration: none;
}
.suggest-list li.active a, .suggest-list a:hover { background: #14243a; }
.suggest-list strong { font-size: 14px; }
.suggest-list small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-kind { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); align-self: center; }
.global-search.has-suggest .suggest-list { top: calc(100% + 8px); }

/* ---------- Abschnitte & Panels ---------- */

.section { margin-top: 20px; }
.panel + .panel, .panel + .section, .stats-grid + .panel { margin-top: 20px; }
.panel-body { padding: 18px 21px; }
.panel-head .head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.panel-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.two-col > .panel { margin-top: 0; }
@media (max-width: 1050px) { .two-col { grid-template-columns: 1fr; } }

.link-arrow {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--cyan); text-decoration: none; font-size: 13px; font-weight: 600;
}
.link-arrow:hover { text-decoration: underline; }

.ghost-button {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
  border: 1px solid #2b3c52; border-radius: 10px; background: #101e30;
  color: #c3cfdc; font-size: 13px; font-weight: 600; text-decoration: none;
}
.ghost-button:hover { border-color: var(--cyan); color: var(--cyan); }

/* ---------- Tabellen-Ergänzungen ---------- */

.data-table a { color: var(--cyan); text-decoration: none; }
.data-table a strong { color: var(--text); }
.data-table a:hover strong { color: var(--cyan); }
.data-table.compact td { padding: 8px 14px; }
.row-interesting td:first-child { box-shadow: inset 3px 0 0 #fbbf24; }
.star { width: 14px; height: 14px; color: #fbbf24; fill: #fbbf24; vertical-align: -2px; }

.chip {
  display: inline-block; padding: 2px 7px; margin-left: 2px;
  border: 1px solid #2b3c52; border-radius: 6px; background: #101e30;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--cyan) !important;
}

.badge {
  display: inline-block; padding: 3px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
}
.badge-danger { background: rgba(255, 93, 108, .15); color: #ff8a95; border: 1px solid rgba(255, 93, 108, .45); }
.badge-warn { background: rgba(251, 191, 36, .12); color: #fbd36a; border: 1px solid rgba(251, 191, 36, .4); }
.badge-ok { background: rgba(45, 224, 160, .1); color: var(--green); border: 1px solid rgba(45, 224, 160, .35); }

.silhouette img { mix-blend-mode: multiply; }

/* ---------- Pagination ---------- */

.pager {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  padding: 16px 21px; border-top: 1px solid var(--line);
}
.pager-item {
  min-width: 36px; height: 36px; padding: 0 10px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 9px; background: #0f1c2d;
  color: #b9c6d5; text-decoration: none; font-size: 13px; font-weight: 600;
}
a.pager-item:hover { border-color: var(--cyan); color: var(--cyan); }
.pager-item.current { background: var(--cyan); border-color: var(--cyan); color: #04101c; }
.pager-item.disabled, .pager-item.gap { opacity: .4; }
.pager-item.gap { border: 0; background: none; min-width: 20px; }

/* ---------- Karten ---------- */

.map {
  height: 380px; width: 100%; background: #0a1727;
  border-top: 1px solid var(--line);
}
@media (max-width: 650px) { .map { height: 300px; } }

/* dunkle Karte aus OSM-Kacheln */
.leaflet-container { background: #0a1727; font: inherit; }
.leaflet-tile-pane { filter: invert(1) hue-rotate(185deg) brightness(.85) saturate(.55) contrast(.9); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #0d1929; color: var(--text); border: 1px solid var(--line); }
.leaflet-popup-content a { color: var(--cyan); font-weight: 700; }
.leaflet-control-attribution { background: rgba(7, 17, 31, .8) !important; color: #8d9caf; }
.leaflet-control-attribution a { color: #b9c6d5; }
.leaflet-bar a { background: #0d1929; color: #fff; border-color: var(--line); }

/* ---------- Detailliste (flight.php) ---------- */

.spec-list.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1050px) { .spec-list.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 650px) { .spec-list.three { grid-template-columns: 1fr; } }
.spec-list dd small { color: var(--muted); font-weight: 400; }

/* ---------- Suche ---------- */

.page-head .global-search { max-width: 720px; }
.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.result-grid > .panel { margin-top: 0; }
.result-grid .wide { grid-column: 1 / -1; }
@media (max-width: 1050px) { .result-grid { grid-template-columns: 1fr; } }

.link-list { list-style: none; margin: 0; padding: 6px; }
.link-list a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px; border-radius: 10px; color: var(--text); text-decoration: none;
}
.link-list a:hover { background: #14243a; }
.link-list small { color: var(--muted); text-align: right; }

.tips { color: #bbc6d4; line-height: 1.7; margin: 0; padding-left: 18px; }
.tips code { color: var(--cyan); }

/* ---------- Startseite ---------- */

.features a { color: inherit; text-decoration: none; }
.features a article { height: 100%; transition: border-color .15s; }
.features a:hover article { border-color: rgba(57, 217, 245, .5); }

/* ---------- Diagramme ---------- */

.bar-list { list-style: none; margin: 0; padding: 12px 21px 18px; display: grid; gap: 10px; }
.bar-list li { display: grid; grid-template-columns: minmax(110px, 38%) 1fr auto; gap: 12px; align-items: center; font-size: 13px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-label a { color: var(--text); text-decoration: none; }
.bar-label a:hover { color: var(--cyan); }
.bar-label .chip { margin: 0 6px 0 0; }
.bar-track { height: 10px; border-radius: 4px; background: #142236; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--cyan); }
.bar-value { color: #c3cfdc; font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }

.column-chart { margin: 0; padding: 18px 21px 8px; position: relative; }
.column-chart .cols {
  height: 200px; display: flex; align-items: stretch; gap: 2px;
  border-bottom: 1px solid #2b3c52;
  background: repeating-linear-gradient(to top, transparent 0 49px, rgba(255,255,255,.04) 49px 50px);
}
.column-chart .col { flex: 1; position: relative; display: flex; flex-direction: column; justify-content: flex-end; outline: 0; }
.column-chart .col-bar { display: block; background: var(--cyan); border-radius: 4px 4px 0 0; min-height: 0; opacity: .85; }
.column-chart .col:hover .col-bar, .column-chart .col:focus .col-bar { opacity: 1; background: #7ae8fb; }
.column-chart .col-label {
  position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--muted); white-space: nowrap;
}
.column-chart .col:hover::after, .column-chart .col:focus::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  padding: 6px 9px; border-radius: 8px; background: #0b1726; border: 1px solid var(--line);
  color: var(--text); font-size: 12px; white-space: nowrap; z-index: 5; pointer-events: none;
  box-shadow: var(--shadow);
}
.column-chart .col:first-child:hover::after, .column-chart .col:first-child:focus::after { left: 0; transform: none; }
.column-chart .col:last-child:hover::after, .column-chart .col:last-child:focus::after { left: auto; right: 0; transform: none; }
.column-chart .col-max { margin-top: 26px; font-size: 11px; color: var(--muted); }

.table-view { padding: 0 21px 16px; }
.table-view summary { cursor: pointer; color: var(--muted); font-size: 12px; padding: 4px 0 10px; }
.table-view table { max-width: 420px; }

/* ---------- FAQ & Textseiten ---------- */

.faq { display: grid; gap: 12px; }
.faq details { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 22px; font-weight: 700;
  display: flex; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--cyan); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding: 0 22px 20px; color: #bbc6d4; line-height: 1.65; }

.prose { max-width: 820px; color: #c3cfdc; line-height: 1.7; }
.prose h2 { color: var(--text); font-size: 21px; margin: 34px 0 10px; letter-spacing: -.02em; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 20px; }
.prose .placeholder { background: rgba(251, 191, 36, .12); color: #fbd36a; padding: 1px 6px; border-radius: 5px; }

/* ---------- Filter-Formular ---------- */

.filter-form { display: flex; gap: 10px; flex-wrap: wrap; padding: 16px 21px; border-bottom: 1px solid var(--line); }
.filter-form input, .filter-form select {
  height: 40px; padding: 0 12px; border: 1px solid #2b3c52; border-radius: 10px;
  background: #0f1c2d; color: var(--text); font: inherit; font-size: 14px;
}
.filter-form input { flex: 1; min-width: 180px; }
.filter-form button {
  height: 40px; padding: 0 18px; border: 0; border-radius: 10px;
  background: linear-gradient(135deg, var(--cyan), #159bd0); color: #04101c; font-weight: 800; cursor: pointer;
}

footer div { flex-wrap: wrap; }

.panel-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Panels in Rastern nicht zusätzlich verschieben */
.aircraft-layout > .panel, .two-col > .panel, .result-grid > .panel { margin-top: 0; }
.aircraft-layout + .panel { margin-top: 0; }
.stat-card strong a { color: inherit; text-decoration: none; }
.stat-card strong a:hover { color: var(--cyan); }
.stat-card em a { color: var(--cyan); text-decoration: none; }
