/*
 * Referenzen: Startseiten-Kacheln, Uebersicht und Detailseiten.
 *
 * Bewusst eine eigene Datei statt eines Anhangs an style.css. Die grosse
 * Datei haengt an einem Cache-Stempel (?v=...), der in jeder einzelnen
 * Seite steht; sie zu erweitern hiesse, acht Seiten anzufassen. Diese
 * Datei bringt ihren eigenen Stempel mit und laesst die andere in Ruhe.
 *
 * Es werden ausschliesslich die vorhandenen Farbmarken benutzt
 * (--text, --accent, --card-bg, --card-border). Damit stimmt das helle
 * wie das dunkle Schema, ohne dass hier eine einzige Farbe doppelt
 * gepflegt werden muss.
 */

/* ---------- Raster, geteilt von Startseite und Uebersicht ---------- */

.ref-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
}

.ref-karte {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card-bg, rgba(255, 255, 255, 0.03));
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ref-karte:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
  border-color: var(--accent);
}

/*
 * Die Logos kommen von den Kunden und sind fuer hellen Grund gezeichnet.
 * Auf dem dunklen Schema waere ein schwarzer Schriftzug unsichtbar, darum
 * bekommt jedes Logo seine eigene weisse Flaeche.
 */
.ref-karte-logo {
  margin: 0;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  padding: 1.75rem;
  border-bottom: 1px solid var(--card-border);
}

.ref-karte-logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.ref-karte-body {
  padding: 1.25rem 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.ref-karte-body h3 {
  font-size: 1.05rem;
  margin: 0 0 0.15rem;
}

.ref-karte-domain {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.6rem;
  word-break: break-word;
}

.ref-karte-body p {
  font-size: 0.92rem;
  line-height: 1.6;
  opacity: 0.75;
  margin: 0 0 1rem;
}

.ref-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.ref-tag {
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 500;
  background: var(--card-border);
  color: var(--text);
  opacity: 0.85;
}

.ref-tag-stark {
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  opacity: 1;
}

.ref-karte-mehr {
  margin-top: 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* ---------- Detailseite ---------- */

.ref-detail {
  margin: 2rem 0 3rem;
}

.ref-zurueck {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--text);
  opacity: 0.7;
  text-decoration: none;
  margin-bottom: 1.75rem;
}

.ref-zurueck:hover {
  opacity: 1;
  color: var(--accent);
}

.ref-kopf {
  display: flex;
  gap: 2rem;
  align-items: center;
  flex-wrap: wrap;
  border: 1px solid var(--card-border);
  border-radius: var(--radius, 16px);
  background: var(--card-bg, rgba(255, 255, 255, 0.03));
  padding: 2rem;
}

.ref-kopf-logo {
  flex: 0 0 220px;
  height: 130px;
  background: #ffffff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.ref-kopf-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.ref-kopf-text {
  flex: 1 1 320px;
  min-width: 0;
}

.ref-kopf-text h1 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  margin: 0 0 0.4rem;
  line-height: 1.2;
}

.ref-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  font-size: 0.9rem;
  opacity: 0.75;
  margin-bottom: 1rem;
}

.ref-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.ref-kopf-text p {
  line-height: 1.7;
  margin: 0 0 1.4rem;
  opacity: 0.85;
}

.ref-aktionen {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ref-block {
  margin-top: 2.5rem;
}

.ref-block h2 {
  font-size: 1.35rem;
  margin: 0 0 1.2rem;
}

.ref-leistungen {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem 2rem;
}

.ref-leistungen li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  line-height: 1.6;
  opacity: 0.9;
}

.ref-leistungen li svg {
  flex: 0 0 auto;
  margin-top: 0.2rem;
  color: #10b981;
  width: 18px;
  height: 18px;
}

/* ---------- Schmale Bildschirme ---------- */

@media (max-width: 900px) {
  .ref-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .ref-leistungen { grid-template-columns: 1fr; }
  .ref-kopf { padding: 1.5rem; gap: 1.5rem; }
  .ref-kopf-logo { flex: 1 1 100%; height: 110px; }
  .ref-aktionen .btn { width: 100%; justify-content: center; }
}
