/*
 * Gemeinsames Aussehen der Schul- und Mathematik-Seiten (schule.paul-matthies.de):
 * Farben, Schrift, der rote Rahmen, Pfadleiste, Überschriften, Filter, Meldungen, Bild-Großansicht.
 * Seitenspezifisches steht in /Schule/schule.css bzw. /Schule/Mathematik/style.css.
 */
:root {
  --rot: #980000;
  --rot-dunkel: #580000;      /* besuchte Links, Hover */
  --rot-hell: #f6e7e7;        /* zarte Flächen, z. B. Icons */
  --grund: #f9f8f8;           /* Seitenhintergrund */
  --flaeche: #ffffff;         /* Eingabefelder, Bildflächen */
  --karte: #f9f8f8;
  --text: #000000;
  --grau: #5c5c5c;            /* Nebentexte */
  --linie: #cccccc;           /* Trennlinien unter Überschriften */
  --rahmen: silver;           /* Rahmen von Karten und Feldern */
  --schatten: 4px 4px 4px silver;
  --radius: 10px;
  --breite: 1200px;           /* größte Breite des Rahmens */
  --schrift: LiberationSans, Verdana, Arial, Helvetica, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  font-family: var(--schrift);
  font-size: 15px;
  line-height: 1.4;
  background-color: var(--grund);
  color: var(--text);
  margin: 0;
  padding: 26px 20px 10px;
}

a:link { color: var(--rot); text-decoration: none; }
a:visited { color: var(--rot-dunkel); text-decoration: none; }
a:hover, a:active, a:focus-visible { text-decoration: underline; }

h1, h2, h3 { color: var(--rot); font-weight: bold; }
h1 {
  font-size: 2em;
  margin: 0;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--linie);
  line-height: 1.2;
}
h2 {
  font-size: 16px;
  margin: 20px 0 5px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--linie);
}
h3 { font-size: 14px; margin: 15px 0 0; padding-bottom: 5px; }

/* Zeile über dem Rahmen: Pfad links, Impressum/Kontakt rechts */
.seitenkopf, .main, .fuss { max-width: var(--breite); margin-left: auto; margin-right: auto; }
.seitenkopf {
  display: flex;
  justify-content: space-between;
  gap: 4px 1em;
  flex-wrap: wrap;
  padding: 0 30px 3px;
  font-size: 11px;
}
.seitenkopf a, .seitenkopf .navigation a { margin: 0 0.3em; }
.seitenkopf .trenner { color: var(--text); }
.seitenkopf .navigation { margin-left: auto; }

/* Der rote Rahmen */
.main {
  border: 3px solid var(--rot);
  border-radius: 30px;
  padding: 28px 32px 32px;
  min-height: 60vh;
}
.unterzeile { margin: 6px 0 0; color: var(--grau); font-size: 13px; }
.aufwaerts { font-size: 12px; margin: 6px 0 0; }

.fuss { padding: 14px 30px; font-size: x-small; }

/* Filter (Suchfeld und Schlagwörter) */
.filter { margin: 14px 0 6px; font-size: 13px; }
.filter input[type="search"] {
  font: inherit;
  width: min(100%, 28em);
  padding: 5px 10px;
  border: 1px solid var(--rahmen);
  border-radius: var(--radius);
  background: var(--flaeche);
  color: inherit;
}
.filter input[type="search"]:focus-visible { outline: 2px solid var(--rot); outline-offset: 1px; }
.tag-klappe { display: inline-block; margin-left: 10px; vertical-align: top; }
.tag-klappe[open] { display: block; margin: 8px 0 0; }
.tag-klappe summary { cursor: pointer; color: var(--rot); padding: 4px 0; width: max-content; }
.tag-auswahl { font-weight: bold; }
.tags, .filter-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.tag-knopf {
  font: inherit;
  font-size: 12px;
  color: var(--rot);
  background: var(--flaeche);
  border: 1px solid var(--rahmen);
  border-radius: var(--radius);
  padding: 2px 9px;
  cursor: pointer;
}
.tag-knopf:hover { border-color: var(--rot); }
.tag-knopf[aria-pressed="true"] { background: var(--rot); border-color: var(--rot); color: #fff; }
.tag-knopf.ohne { opacity: 0.4; }
.tag-knopf .anzahl { margin-left: 3px; font-size: 10px; opacity: 0.75; font-variant-numeric: tabular-nums; }
.filter-info { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; font-size: 11px; color: var(--grau); min-height: 1.6em; }
#filter-weg {
  font: inherit;
  color: var(--rot);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}
.keine, .leer-hinweis { margin: 20px 0; color: var(--grau); }

/* Hinweise */
.meldung { margin: 20px 0; padding: 8px 12px; border: 1px solid #d08000; border-radius: var(--radius); background: #fff8e8; color: #6b4500; }

/* Bild-Großansicht */
.grossbild {
  border: none;
  border-radius: var(--radius);
  padding: 15px 15px 10px;
  max-width: 94vw;
  max-height: 94vh;
  overflow: visible;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.5);
}
.grossbild::backdrop { background: rgba(0, 0, 0, 0.8); }
.grossbild figure { margin: 0; text-align: center; }
.grossbild img {
  display: block;
  margin: 0 auto;
  max-width: calc(94vw - 30px);
  max-height: calc(94vh - 70px);
  min-width: 200px;
  border: 1px solid #000;
  background: #fff;
}
.grossbild figcaption { margin-top: 8px; font-size: 13px; }
.grossbild button {
  position: absolute;
  border: none;
  background: var(--rot);
  color: #fff;
  font: bold 22px/1 Verdana, sans-serif;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.grossbild button:hover, .grossbild button:focus-visible { background: var(--rot-dunkel); }
.grossbild .schliessen { top: -14px; right: -14px; }
.grossbild .zurueck, .grossbild .weiter { top: calc(50% - 18px); }
.grossbild .zurueck { left: -18px; }
.grossbild .weiter { right: -18px; }
.grossbild.einzeln .zurueck, .grossbild.einzeln .weiter { display: none; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 600px) {
  body { padding: 22px 6px 6px; }
  .seitenkopf { padding: 0 8px 3px; }
  .main { padding: 14px 12px 18px; border-radius: 18px; min-height: 0; }
  h1 { font-size: 1.6em; }
  .tag-klappe { display: block; margin: 8px 0 0; }
  .grossbild .zurueck { left: 4px; }
  .grossbild .weiter { right: 4px; }
  .grossbild .schliessen { right: 4px; top: 4px; }
  .fuss { padding: 10px 8px; }
}

@media print {
  .filter, .grossbild, .seitenkopf .navigation { display: none; }
  body { padding: 0; }
}
