/* Grundlage aus /plattform/css/basis.css und komponenten.css, die vor dieser Datei geladen werden.
   Hier nur die Seiten des Hubs, nach dem Prototyp „OPTIHub Startseite". */

/* Identität des Hubs: Grün und Büro-Muster (DESIGN.html, Kapitel 9). Das Grün steht auch als
   Vorgabe in basis.css; der Hub setzt es trotzdem selbst wie jede App. */
:root {
  --color-accent: #6fb52c;
  --color-accent-hover: #64a327;
  --color-accent-text: #276b29;
  --color-accent-tint: #e4f0d8;
  --pattern: url("/images/muster-buero.svg") center top / 560px 560px repeat;
}

/* Verwaltung und Profil stehen auf dem Blatt aus basis.css. Die Startseite nicht: Dort liegen die
   Kacheln einzeln auf dem Grund (die Fehlerseiten regelt komponenten.css). */
.app-main:has(> .startseite) {
  margin-top: 3rem;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
}

.hub-kopf h1 {
  margin-bottom: 0;
}

.hub-kopf p {
  margin: 0.25rem 0 0;
  font-size: 0.9375rem;
  color: var(--color-muted);
}

.kacheln {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

/* Die ganze Kachel ist der Link. */
.kachel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
  padding: 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  box-shadow: var(--shadow-karte);
  text-decoration: none;
  color: var(--color-text);
  transition: border-color 0.15s;
}

.kachel:hover {
  border-color: var(--color-accent);
  color: var(--color-text);
}

.kachel:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.kachel-logo {
  display: block;
  align-self: flex-start;
  width: auto;
  height: 56px;
}

.kachel-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.kachel-text strong {
  font-size: 1.125rem;
  line-height: 1.3;
  font-weight: 600;
}

.kachel-text span {
  font-size: 0.9375rem;
  color: var(--color-muted);
}

.kachel-oeffnen {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: auto;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-accent-text);
}

.kachel-oeffnen svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pfeil-kurz {
  display: none;
}

/* Ohne freigeschaltete Anwendung statt der Kacheln. */
.hub-kopf ~ .leerkarte {
  margin-top: 1.5rem;
}

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

@media (max-width: 48rem) {
  .kacheln {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Am Handy: eine Kachel je Zeile, Logo links, Pfeil rechts. */
@media (max-width: 30rem) {
  .app-main:has(> .startseite) {
    width: calc(100% - 2rem);
    margin-top: 2rem;
  }

  .kacheln {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
    margin-top: 1.25rem;
  }

  .kachel {
    flex-direction: row;
    align-items: center;
    padding: 1rem;
  }

  .kachel-logo {
    flex-shrink: 0;
    align-self: center;
    height: 44px;
  }

  .kachel-text {
    flex-grow: 1;
    min-width: 0;
    gap: 0.125rem;
  }

  .kachel-text strong {
    font-size: 1.0625rem;
  }

  .kachel-text span {
    font-size: 0.875rem;
  }

  .kachel-oeffnen {
    margin-top: 0;
  }

  /* Der Text bleibt für Vorlesewerkzeuge, sichtbar ist nur der Pfeil. */
  .kachel-oeffnen-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .pfeil-lang {
    display: none;
  }

  .kachel-oeffnen .pfeil-kurz {
    display: block;
    width: 18px;
    height: 18px;
  }
}
