/*
 * statisch.css — Gebündelte Styles der statischen Seiten (ersetzt
 * home.css, hilfe.css und error.css).
 *
 * Abschnitte:
 *   1. Startseite (home.php) — Kachel-Navigation
 *   2. Hilfe (hilfe.php) — aufklappbare Hilfe-Bereiche
 *   3. Fehler- und Wartungsseite (error.php, wartung.php)
 *   4. Impressum / Datenschutz
 *   5. Lehrmaterial (iframe)
 *
 * Home (Abschnitt 1) ist über body.page-home scoped.
 * Die übrigen Seiten überschneiden sich nicht.
 */

/* ============================================================
   1. Startseite (home.php) — Kachel-Navigation.
   Layout nur per CSS-Grid (kein JS). Spaltenzahl richtet sich
   nach Kachelanzahl via :has() und nach der Viewport-Breite.
   ============================================================ */

.page-home .page-title {
  margin-bottom: 6px;
}

.page-home .home-lead {
  margin: 0 var(--space-page) 24px;
  font-size: var(--font-body);
  color: var(--color-text-muted);
}

.page-home .home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
  box-sizing: border-box;
  width: min(46rem, calc(100% - (var(--space-page) * 2)));
  margin: 0 var(--space-page) 32px;
  padding: 0;
}

/* Schul-Koordinator: 6–7 Kacheln, 3 Spalten */
.page-home .home-grid:has(> :nth-child(6)) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: min(60rem, calc(100% - (var(--space-page) * 2)));
}

/* Verbund / Admin: 8 Kacheln, 4 Spalten */
.page-home .home-grid:has(> :nth-child(8)) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(72rem, calc(100% - (var(--space-page) * 2)));
}

.page-home .home-tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  text-decoration: none;
  color: inherit;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.page-home .home-tile:hover {
  border-color: #DDDDE2;
  box-shadow: var(--shadow-md);
}

.page-home .home-tile__img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background-color: var(--color-hover);
}

.page-home .home-tile__label {
  display: block;
  margin-top: auto;
  padding: 14px 16px 16px;
  font-size: var(--font-subheader);
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--color-text);
  line-height: 1.3;
}

/* Mit Sidebar ist der Inhaltsbereich schmaler: 8 Kacheln lieber 3 statt 4 Spalten */
@media only screen and (max-width: 1200px) {
  .page-home .home-grid:has(> :nth-child(8)) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(60rem, calc(100% - (var(--space-page) * 2)));
  }
}

@media only screen and (max-width: 900px) {
  .page-home .home-grid,
  .page-home .home-grid:has(> :nth-child(6)),
  .page-home .home-grid:has(> :nth-child(8)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    width: calc(100% - (var(--space-page) * 2));
  }
}

@media only screen and (max-width: 360px) {
  .page-home .home-grid,
  .page-home .home-grid:has(> :nth-child(6)),
  .page-home .home-grid:has(> :nth-child(8)) {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ============================================================
   2. Hilfe (hilfe.php) — aufklappbare Hilfe-Bereiche.
   Die Seitenüberschrift nutzt .page-title aus components.css.
   Kästen sitzen links wie .form-box (margin an --space-page).
   ============================================================ */

.div_hilfe {
  display: block;
  width: var(--content-width);
  max-width: 800px;
  margin: 0 var(--space-page) 12px;
  padding: 28px 28px 24px;

  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;

  text-align: left;
  font-size: var(--font-body);

  cursor: pointer;
}

.div_hilfe video {
  display: block;
  max-width: 100%;
  height: auto;
  margin-top: 24px;
}

/* Hover-Hinweis, dass der Kasten aufklappt */
.div_hilfe:hover {
  border-color: #DDDDE2;
}

/* Auf-/Zuklapp-Pfeil */
.span_hilfe_triangles {
  display: inline-block;
  font-size: var(--font-title);
  margin: -4px 0 0 -4px;
  color: var(--color-text-muted);
}

/* Klickbare Bereichs-Überschrift (negative Margins vergrößern die Klickfläche) */
.h2_hilfe_divs {
  display: inline-block;
  margin: -28px;
  padding: 28px;

  font-size: var(--font-section);
  color: var(--color-text);

  -webkit-user-select: none; /* Safari */
  -ms-user-select: none; /* IE 10 und IE 11 */
  user-select: none; /* Standard-Syntax */
}

.h3_hilfe_divs {
  display: block;
  margin: 28px 0 6px 0;
  padding: 0;

  font-size: var(--font-subheader);
  color: var(--color-text);
}

.p_hilfe_divs {
  display: block;
  margin: 0;
  padding: 0;

  font-weight: normal;
  font-size: var(--font-body);
  color: var(--color-text);
}

.p_hilfe_divs a {
  color: var(--color-accent);
}

@media only screen and (max-width: 500px) {
  .div_hilfe {
    padding: 22px 18px 24px;
  }
  .h2_hilfe_divs {
    font-size: var(--font-section);
    margin: -22px -18px;
    padding: 22px 18px;
  }
}

@media only screen and (max-width: 455px) {
  .div_hilfe {
    overflow-x: auto;
  }
}

/* ============================================================
   3. Fehler- und Wartungsseite (error.php, wartung.php):
   Detail-Kasten. Knöpfe nutzen .btn aus components.css.
   Überschriften nutzen .status-title/.status-subtitle aus components.css.
   ============================================================ */

#div_details {
  text-align: center;
}

#div_details p {
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 12px 16px;
  display: inline-block;
  text-align: left;
  font-size: var(--font-meta);
  color: var(--color-text-muted);
}

/* ============================================================
   4. Impressum / Datenschutz (öffentliche Seiten, header_fake).
   Lesbare Spalte, Titel 22px, Fließtext 15px.
   ============================================================ */

.legal-page {
  box-sizing: border-box;
  width: min(800px, calc(100% - (var(--space-page) * 2)));
  margin: 32px auto 48px;
  padding: 0;
  text-align: left;
  font-size: var(--font-body);
  color: var(--color-text);
  line-height: 1.5;
}

.legal-page h1 {
  margin: 0 0 20px;
  font-size: var(--font-title);
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.legal-page h2 {
  margin: 28px 0 10px;
  font-size: var(--font-section);
  font-weight: 650;
  letter-spacing: -0.02em;
}

.legal-page h3 {
  margin: 20px 0 8px;
  font-size: var(--font-subheader);
  font-weight: 650;
}

.legal-page h4 {
  margin: 16px 0 6px;
  font-size: var(--font-body);
  font-weight: 650;
}

.legal-page p,
.legal-page li {
  font-size: var(--font-body);
}

.legal-page ul {
  padding-left: 1.2em;
}

.legal-page a {
  color: var(--color-accent);
}

/* ============================================================
   5. Lehrmaterial (lehrmaterial.php) — eingebetteter Chatbot.
   ============================================================ */

.lehrmaterial-frame {
  display: block;
  margin-top: 20px;
  border: 0;
  width: 100%;
  height: calc(100vh - 140px);
}
