/*
 * uFolien – Katalog-Startseite
 * Ruhiges, neutrales Layout auf heller Fläche.
 */

:root {
  --grund: #f6f5f2;
  --flaeche: #ffffff;
  --text: #1d2026;
  --text-leise: #4f5560;   /* Kontrast auf Weiß ca. 7:1 */
  --linie: #e1ded7;
  --akzent: #285a78;       /* Kontrast auf Weiß ca. 7:1 */
  --akzent-hell: #e8f0f4;
  --fokus: #1f6fd1;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font: 400 1.0625rem/1.55 "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
}

a {
  color: var(--akzent);
}

a:focus-visible {
  outline: 3px solid var(--fokus);
  outline-offset: 2px;
  border-radius: 2px;
}

code,
kbd {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.9em;
}

kbd {
  padding: 0 0.35em;
  border: 1px solid var(--linie);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--flaeche);
}

.ufolien-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Kopf ---------- */

.kopf {
  border-bottom: 1px solid var(--linie);
  background: var(--flaeche);
}

.kopf-innen,
.inhalt,
.fuss {
  width: min(1200px, 100% - 2.5rem);
  margin-inline: auto;
}

.kopf-innen {
  padding: 2.5rem 0 2rem;
}

.marke {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.75rem;
  color: var(--akzent);
}

.marke-zeichen {
  width: 2.5rem;
  height: 2.5rem;
}

.marke-name {
  color: var(--text);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.kopf-text {
  max-width: 46rem;
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.kopf-hinweis {
  margin: 0;
  color: var(--text-leise);
}

/* ---------- Raster ---------- */

.inhalt {
  padding: 2.5rem 0 3rem;
}

.katalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.katalog[hidden],
.ersatz[hidden],
.katalog-fehler[hidden] {
  display: none;
}

/* ---------- Kachel ---------- */

.kachel {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--linie);
  border-radius: 14px;
  background: var(--flaeche);
  box-shadow: 0 1px 2px rgba(20, 22, 26, 0.04);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.kachel:hover {
  box-shadow: 0 10px 28px rgba(20, 22, 26, 0.12);
  transform: translateY(-2px);
}

.kachel:focus-within {
  outline: 3px solid var(--fokus);
  outline-offset: 3px;
}

.kachel-vorschau {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--linie);
  background: #14161a;
}

/* Die Engine passt die Folie im iframe selbst auf dessen Größe ein */
.kachel-vorschau iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
}

.kachel-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.1rem 1.25rem 1.25rem;
}

.kachel-titel {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
}

.kachel-link {
  color: var(--text);
  text-decoration: none;
}

/* Die ganze Kachel ist klickbar */
.kachel-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.kachel-link:focus-visible {
  outline: none;
}

.kachel-beschreibung {
  margin: 0;
}

.merkmale {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.1rem 0 0;
  padding: 0;
  list-style: none;
}

.merkmale li {
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: var(--akzent-hell);
  color: #1d4258;
  font-size: 0.875rem;
  font-weight: 600;
}

.kachel-meta,
.kachel-quelle {
  margin: 0;
  color: var(--text-leise);
  font-size: 0.95rem;
}

.kachel-aktion {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.4rem;
  color: var(--akzent);
  font-weight: 600;
}

.kachel:hover .kachel-aktion {
  text-decoration: underline;
}

/* ---------- Fehlerfall und Ersatzliste ---------- */

.katalog-fehler {
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid #e3c98f;
  border-radius: 10px;
  background: #fdf6e6;
}

.katalog-fehler p {
  margin: 0 0 0.4rem;
}

.katalog-fehler p:last-child {
  margin-bottom: 0;
}

.ersatz h2 {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
}

.ersatz ul {
  margin: 0;
  padding-left: 1.25rem;
}

.ersatz li {
  margin-bottom: 0.4rem;
}

.ersatz a {
  font-weight: 600;
}

/* ---------- Fußzeile ---------- */

.fuss {
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--linie);
  color: var(--text-leise);
  font-size: 0.95rem;
}

.fuss p {
  margin: 0 0 0.4rem;
}

/* ---------- Telefon ---------- */

@media (max-width: 600px) {
  .kopf-innen {
    padding: 1.75rem 0 1.5rem;
  }

  .kopf-text {
    font-size: 1.08rem;
  }

  .inhalt {
    padding-top: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kachel {
    transition: none;
  }

  .kachel:hover {
    transform: none;
  }
}
