/* Studenten und ihre Lehreinrichtungen -- gemeinsames Stylesheet */

:root {
  --bg: #f4f2ee;
  --panel: #ffffff;
  --ink: #1e1c1a;
  --muted: #6c6660;
  --line: #ddd8d1;
  --accent: #7a2e2e;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 8px 24px rgba(0, 0, 0, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.5 "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  color: var(--ink);
  background: var(--bg);
}

h1, h2, h3 { font-weight: 600; letter-spacing: -.01em; }

/* Kopfzeile ------------------------------------------------------------ */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 20px;
  background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 500;
}
.brand h1 { margin: 0; font-size: 19px; }
.brand p  { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.topbar nav { display: flex; align-items: center; gap: 14px; }
.statline { font-size: 13px; color: var(--muted); }

/* Sprachumschalter. Zwei Knoepfe statt einer Auswahlliste: beide Sprachen
   sind zu sehen, die gewaehlte ist markiert, ein Klick genuegt. */
.langswitch { display: flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.langswitch button {
  font: inherit; font-size: 12px; letter-spacing: .04em; font-weight: 600;
  padding: 5px 9px; border: 0; background: #fff; color: var(--muted); cursor: pointer;
}
.langswitch button + button { border-left: 1px solid var(--line); }
.langswitch button:hover { background: #f7f4f0; color: var(--ink); }
.langswitch button.active { background: var(--accent); color: #fff; }

/* Trefferlisten -------------------------------------------------------- */

.muted { color: var(--muted); font-size: 13px; }

/* Breite Tabellen scrollen in ihrem Kasten, nicht die ganze Seite. */
.table-wrap { overflow-x: auto; }

/* Buttons -------------------------------------------------------------- */

.btn {
  font: inherit; font-size: 13px; padding: 6px 12px; border-radius: var(--radius);
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  cursor: pointer; text-decoration: none; display: inline-block;
}
.btn:hover { background: #f7f4f0; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #8f3838; }
.btn-ghost { background: transparent; }
.hidden { display: none !important; }

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

.leaflet-popup-content { font-family: inherit; margin: 10px 12px; }

/* Uebersichtskarte der Landing-Page. Die Kreisflaeche traegt die
   Studentenzahl; der Groessenschluessel darunter macht sie lesbar. */
.map-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin: 0 0 10px;
}
.map-head h2 { margin: 0; font-size: 17px; }
.map-head p { margin: 0; }

#overviewMap {
  height: 420px;
  border: 1px solid var(--line); border-radius: var(--radius);
}

.map-legend {
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap; margin: 10px 0 0;
}
.map-scale { display: flex; align-items: center; gap: 14px; }
.scale-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--muted);
}
.scale-item svg { display: block; }

/* Landing-Page / Personensuche ----------------------------------------- */

.search-wrap { max-width: 1100px; margin: 0 auto; padding: 22px 20px 40px; }

/* Fusszeile. Das Impressum muss von jeder Seite aus erreichbar sein, steht
   also auf allen dreien -- Landing-Page, Einrichtung, Nicht-gefunden. */
.sitefoot {
  max-width: 1200px; margin: 0 auto; padding: 0 20px 28px;
  font-size: 13px; color: var(--muted);
}
.sitefoot a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.sitefoot a:hover { color: var(--accent); }
.search-card h2 { margin: 0 0 4px; font-size: 17px; }

.field-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px; margin-bottom: 14px;
}
.field-grid label { display: block; font-size: 13px; color: var(--muted); }
.field-grid input[type=search],
.field-grid input[type=number],
.field-grid select {
  width: 100%; padding: 8px 10px; font: inherit; font-size: 14px; margin-top: 4px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  color: var(--ink);
}
.field-grid input:focus, .field-grid select:focus {
  outline: none; border-color: var(--accent);
}
.range { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.range input { width: 100%; margin-top: 0 !important; }

.cov { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); }

.ranges { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 2px; margin: 0 0 14px; }
.ranges legend { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 0 6px; }

.form-actions { display: flex; align-items: center; gap: 12px; }

table.results td { vertical-align: top; }
table.results td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.results .desc { display: block; color: var(--muted); font-size: 12px; }

/* Sortierbare Spaltenkoepfe */
th button.sort {
  font: inherit; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  font-weight: 600; color: var(--muted); background: none; border: 0; padding: 0;
  cursor: pointer; white-space: nowrap;
}
th button.sort:hover { color: var(--ink); }
th button.sort.active { color: var(--accent); }

/* Verweise in der Trefferliste -- der Name fuehrt zum FactGrid-Item, die
   Einrichtung zu ihrer Unterseite. Zurueckhaltend unterstrichen: in jeder Zeile
   ein blau unterstrichener Name machte die Liste unruhig. */
table.results a {
  color: inherit; text-decoration: underline;
  text-decoration-color: var(--line); text-underline-offset: 2px;
}
table.results a:hover { color: var(--accent); text-decoration-color: currentColor; }

/* Unterseite je Einrichtung -------------------------------------------- */

.inst-page {
  max-width: 1200px; margin: 0 auto; padding: 22px 20px 40px;
  display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start;
}
.back-link { margin: 0 0 12px; }
.inst-profile h2 { margin: 0 0 4px; font-size: 18px; line-height: 1.25; }
.inst-profile .muted { margin: 0; }

#instMap {
  height: 240px; margin: 12px 0 6px;
  border: 1px solid var(--line); border-radius: var(--radius);
}
#instMap.hidden { display: none; }
.geo-note { font-size: 12px; margin: 0 0 10px; }

.inst-facts {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 14px;
  margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 13px;
}
.inst-facts dt { color: var(--muted); }
.inst-facts dd { margin: 0; font-variant-numeric: tabular-nums; }

.inst-search h2 { margin: 0 0 4px; font-size: 16px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-bottom: 14px; }
.two-col label { display: block; font-size: 13px; color: var(--muted); }
.two-col input[type=search],
.two-col input[type=number],
.two-col select {
  width: 100%; padding: 8px 10px; font: inherit; font-size: 14px; margin-top: 4px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink);
}
.two-col input:focus, .two-col select:focus { outline: none; border-color: var(--accent); }
.two-col .range { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.two-col .range input { margin-top: 0; }

.inst-results { grid-column: 1 / -1; }

@media (max-width: 900px) {
  .inst-page { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
}

/* Karten und Tabellen -------------------------------------------------- */

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 18px;
}
.card h2 { margin: 0 0 4px; font-size: 16px; }
.card .hint { margin: 0 0 14px; font-size: 13px; color: var(--muted); }

table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); border-bottom: 1px solid var(--line); padding: 7px 8px; position: sticky;
  top: 0; background: var(--panel); font-weight: 600;
}
table.grid td { padding: 6px 8px; border-bottom: 1px solid #f0ece7; }
