/*
 * Startseite – Darstellung
 * Farben nur über die Variablen aus farben.css, Schrift über schrift.css.
 * Eine neue Kachel ist nur ein neuer <li>-Block in index.html, hier ist nichts zu ändern.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  /* wächst auf großen Bildschirmen und digitalen Tafeln mit, bleibt am Handy bei 16 px */
  font-size: clamp(16px, 1.1vw, 32px);
  -webkit-text-size-adjust: 100%;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--farbe-hintergrund);
  color: var(--farbe-text);
  font-family: var(--schrift-familie);
  font-weight: 400;
  line-height: 1.5;
}

h1,
h2,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

.seite {
  /* nutzt immer den ganzen Bildschirm: volle Breite, volle Höhe */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(1rem, 3vw, 2.5rem);
  padding-bottom: clamp(0.5rem, 1vw, 0.75rem); /* Fußzeile nah am unteren Rand */
}

/* ---------- Kopf mit Logo ---------- */

.kopf {
  /* Titel links, Logo rechts oben in der Ecke */
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-bottom: clamp(1rem, 3vw, 2rem);
}

.logo {
  display: block;
  flex: none;
  height: clamp(2.75rem, 6vw, 4.25rem);
  width: auto;
}

h1 {
  font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
}

/* ---------- Kacheln: Raster über die volle Breite ----------
 * Jede Kachel behält ihre Größe, auf breiten Bildschirmen passen mehr nebeneinander.
 * Eine Spalte am Handy.
 */

.kacheln {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: clamp(0.75rem, 1.5vw, 1.5rem);
}

.kachel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  min-height: 9rem;
  padding: 1.5rem 3.5rem 1.5rem 1.5rem; /* rechts Platz für den Pfeil */
  background: var(--farbe-flaeche);
  border: 1px solid var(--farbe-linie);
  border-radius: 0.75rem;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}

/* Pfeil aus Rahmenlinien, keine Schriftzeichen und keine Bilder */
.kachel::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 1.5rem;
  width: 0.75rem;
  height: 0.75rem;
  border-style: solid;
  border-color: var(--farbe-akzent);
  border-width: 0.2rem 0.2rem 0 0;
  transform: translateY(-50%) rotate(45deg);
}

.kachel:active {
  background: var(--farbe-hintergrund);
  border-color: var(--farbe-akzent);
}

/* Hover nur mit Maus, damit er am Touchscreen nicht hängen bleibt */
@media (hover: hover) {
  .kachel:hover {
    background: var(--farbe-hintergrund);
    border-color: var(--farbe-akzent);
  }
}

.kachel:focus-visible {
  outline: 3px solid var(--farbe-akzent);
  outline-offset: 3px;
}

.kachel-name {
  font-size: 1.375rem;
  font-weight: 500;
  line-height: 1.25;
}

.kachel-text {
  margin-top: 0.5rem;
  color: var(--farbe-text-zweitrangig);
}

/* ---------- Fußzeile: klein, immer am unteren Rand ---------- */

.fuss {
  margin-top: auto;
  padding-top: clamp(1.5rem, 4vw, 3rem);
  color: var(--farbe-text-zweitrangig);
  font-size: 0.7rem;
  text-align: right; /* bündig mit dem rechten Rand des Logos */
}

@media (prefers-reduced-motion: reduce) {
  .kachel {
    transition: none;
  }
}
