/* Hans Guck-in-die-Luft – original 2000s design (frames + tables) rebuilt with CSS grid/flex */

:root {
  --z: 1;
  --gelb: #ffcc00;
  --blau: #2e59a9;
  --lila: #666699;
  --grau: #999999;
  --hell: #d6dcea;      /* links + headings on blue: 4.9:1 */
  --meta: #d3dcf3;      /* file info on blue: 4.9:1 */
  --schrift: Verdana, Geneva, "DejaVu Sans", sans-serif;
  --titel: Arial, Helvetica, sans-serif;
  --hand: "Comic Sans MS", "Comic Neue", "Trebuchet MS", sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--gelb); }

body {
  margin: 0;
  background: var(--gelb);
  color: #fff;
  font: 14px/1.55 var(--schrift);
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; height: auto; }

a { color: var(--hell); text-decoration: none; }
a:hover, a:focus-visible { color: var(--gelb); }
:focus-visible { outline: 2px dashed var(--gelb); outline-offset: 2px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; z-index: 10; padding: 6px 10px; background: var(--blau); color: #fff; }

/* ---------- Header strip (was heading.htm) */
.kopf {
  display: flex;
  height: 80px;
  overflow: hidden;
  background: var(--gelb) url(/assets/topframe/centerbg.gif) repeat-x;
}
.kopf a, .kopf img { display: block; }
.kopf-mitte { position: relative; }

/* ---------- Menu column + content (was the frameset) */
.rahmen {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  min-height: calc(100vh - 80px);
}
.rahmen > .menu { grid-row: span 2; }

.menu { width: 162px; background: var(--grau) url(/assets/navimages/leftbg.gif) repeat-y; }
.menu ul { list-style: none; margin: 0; padding: 0; width: 160px; }

/* Text menu on the original striped panel (navrow.png = border, stripes, border, yellow gap) */
.menu li a {
  display: block;
  min-height: 22px;
  padding: 3px 18px 3px 28px;
  background: url(/assets/navimages/pfeil.png) no-repeat 11px 50%, url(/assets/navimages/navrow.png) repeat-y;
  color: #fff;
  font: 12px/16px Tahoma, Verdana, Geneva, sans-serif;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}
.menu li a:is(:hover, :focus-visible) {
  background-image: url(/assets/navimages/pfeil-an.png), url(/assets/navimages/navrow.png);
  text-decoration: underline;
  text-underline-offset: 2px;
}
/* current page: yellow arrow + bold (yellow text would be too low in contrast on the stripes) */
.menu li a[aria-current="page"] {
  background-image: url(/assets/navimages/pfeil-an.png), url(/assets/navimages/navrow.png);
  font-weight: bold;
}
.menu li.trenner a { padding-top: 9px; background-position: 11px calc(50% + 3px), 0 0; }
.menu li a:focus-visible { outline-offset: -3px; }
.menu-knopf { display: none; }
.menu-anker { display: block; height: 0; }

/* Desktop: menu stays in view while scrolling (only if the window is tall enough for it) */
@media (min-width: 761px) and (min-height: 640px) {
  .menu-inhalt { position: sticky; top: 12px; }
  .menu.klebt .menu-inhalt::before {
    content: "";
    display: block;
    width: 146px;
    height: 10px;
    border: 2px solid #e6e6e6;
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
    background: url(/assets/navimages/navrow.png) -2px 0;
  }
  .menu.klebt .menu-inhalt { filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25)); }
}
.credits, .credits img { display: block; }

.haupt {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 12px;
}

.box {
  flex: 0 1 660px;
  min-width: 0;
  min-height: 630px;
  padding: 30px;
  background: var(--blau);
}

.box h1 { margin: 0 0 18px; line-height: 0; }
.druck-titel { display: none; }
.box h1.text-titel { line-height: 1.2; font: 26px/1.2 var(--hand); color: #fff; }

.box h2, .box h3 {
  margin: 1.4em 0 0.6em;
  color: var(--hell);
  font: bold 16px/1.3 var(--titel);
}
.box h1 + .prosa > h2:first-child { margin-top: 0; }

.prosa p { margin: 0 0 1em; }
.prosa ul { padding-left: 1.4em; list-style-image: url(/assets/bullet.gif); }
.prosa li { margin-bottom: 0.15em; }
.prosa a { text-decoration: underline; text-decoration-color: rgba(204, 204, 204, 0.5); text-underline-offset: 2px; }
#inhalt .prosa > p { text-align: justify; hyphens: auto; }
.unten { margin-top: 2em; }

/* ---------- Sidebar with the Struwwelpeter verse */
.seite {
  flex: 0 0 150px;
  padding: 30px 18px 30px 46px;
  background: var(--lila) url(/assets/tblbg.gif) repeat-y left top;
  font: 12px/1.45 var(--hand);
}
.seite img { display: block; margin-bottom: 14px; }
.seitenbild { max-width: 80px; }
.vers { margin: 0; }

/* ---------- Home */
.untertitel { text-align: center; font-family: var(--hand) !important; font-size: 20px !important; }
.personen { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 24px; text-align: center; }
.person img { display: block; margin: 0 auto 10px; max-height: 150px; width: auto; }
.person h3 { margin: 0 0 0.4em; }
.person p { margin: 0 0 0.6em; }
.unten h2 { font-size: 20px; }

/* ---------- Home: newest documents */
.neu { margin-top: 2.2em; padding: 16px 20px 6px; border: 2px dashed rgba(255, 204, 0, 0.7); }
.neu h2 { margin-top: 0; color: var(--gelb); font-family: var(--hand); font-size: 18px; }
.neu ul { list-style: none; margin: 0; padding: 0; }
.neu li { margin-bottom: 0.9em; }
.neu-wo { display: block; color: var(--meta); font-size: 12px; }

/* ---------- Search box on the article lists */
.suche { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 1.4em; }
.suche label { color: var(--hell); font-weight: bold; }
.suche input {
  flex: 1 1 220px;
  max-width: 360px;
  padding: 6px 10px;
  border: 2px solid var(--lila);
  border-radius: 3px;
  background: #fff;
  color: #222;
  font: inherit;
}
.suche input:focus { outline: 2px solid var(--gelb); outline-offset: 1px; border-color: var(--gelb); }
.suche-info { flex-basis: 100%; margin: 0; color: var(--meta); font-size: 12px; min-height: 1em; }
.suche-info:empty { display: none; }

/* ---------- Sections (Bücher, Fragebogen) with jump links */
html { scroll-behavior: smooth; }
.abschnitt { scroll-margin-top: 16px; }
.sprungmarken { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 1.8em; }
.sprungmarken a {
  padding: 5px 12px;
  border: 2px solid var(--gelb);
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  text-decoration: none;
}
.sprungmarken a:is(:hover, :focus-visible) { background: var(--gelb); color: var(--blau); }
.sprungmarken .anzahl { opacity: 0.75; font-size: 11px; }
.box h2.abschnitt-titel {
  margin: 1.8em 0 0.9em;
  padding: 7px 12px;
  border-left: 5px solid var(--gelb);
  background: rgba(0, 0, 0, 0.18);
  color: #fff;
  font: 18px/1.3 var(--hand);
}
.abschnitt:first-of-type h2.abschnitt-titel, .box .prosa:empty + h2.abschnitt-titel { margin-top: 0; }
.nach-oben { margin: -0.6em 0 0; text-align: right; font-size: 12px; }

/* ---------- Document and literature lists */
.dokliste, .literatur { width: 100%; border-collapse: collapse; }
.dokliste td, .literatur td { padding: 2px 0; vertical-align: top; }
.dokliste tbody + tbody tr:first-child td { padding-top: 1.1em; }
.dokliste .jahr { width: 4.2em; padding-right: 12px; }
ul.dokliste { list-style: none; padding: 0; margin: 0 0 1.5em; }
ul.dokliste li { padding: 2px 0; }
.meta { color: var(--meta); font-size: 11px; white-space: nowrap; }
.literatur { margin-bottom: 1.5em; }
.literatur td { padding: 3px 0 7px; }
.literatur .autor { width: 9.5em; padding-right: 12px; }

/* ---------- Larger screens: header, menu, sidebar and headings grow with the window */
.kopf, .menu, .seite, .box h1 img { zoom: var(--z); }

@media (min-width: 1000px) {
  :root { --z: 1.15; }
  body { font-size: 15px; }
  .box { flex-basis: 720px; }
}
@media (min-width: 1300px) {
  :root { --z: 1.3; }
  .box { flex-basis: 800px; }
}
@media (min-width: 1700px) {
  :root { --z: 1.45; }
  body { font-size: 16px; }
  .box { flex-basis: 900px; }
}

/* ---------- Footer link (Impressum) */
.fuss { padding: 0 12px 24px; font-size: 12px; }
.fuss a { color: #4d4d4d; }
.fuss a:hover, .fuss a:focus-visible { color: var(--blau); }
.kontakt { line-height: 1.7; }

/* ---------- Phones and small tablets */
@media (max-width: 760px) {
  .kopf .kopf-rechts, .kopf .kopf-mitte { display: none; }
  .rahmen { display: block; }

  .menu { width: auto; background: var(--lila); }
  .menu ul { width: auto; padding: 4px 0 8px; }
  .menu li a,
  .menu li a:is(:hover, :focus-visible),
  .menu li.trenner a {
    min-height: 44px;
    padding: 11px 16px 11px 38px;
    background-color: var(--lila);
    background-image: url(/assets/navimages/pfeil.png), repeating-linear-gradient(#7373a5 0 1px, #666699 1px 2px);
    background-repeat: no-repeat, repeat;
    background-position: 16px 50%, 0 0;
    font-size: 16px;
    line-height: 22px;
  }
  .menu li a:is(:hover, :focus-visible, [aria-current="page"]) {
    background-image: url(/assets/navimages/pfeil-an.png), repeating-linear-gradient(#7373a5 0 1px, #666699 1px 2px);
  }
  .menu li.trenner { border-top: 1px solid rgba(255, 255, 255, 0.35); }
  .credits { display: none; }
  .js .menu-knopf {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: 0;
    border-bottom: 2px solid #fff;
    background: var(--lila);
    color: #fff;
    font: 16px var(--hand);
    text-align: left;
    cursor: pointer;
  }
  .js .menu-knopf::before { content: "☰  "; }
  .js .menu:not(.offen) ul { display: none; }

  .haupt { flex-direction: column; padding: 12px 0; gap: 0; }
  .box { flex: none; min-height: 0; padding: 22px 16px; }
  #inhalt .prosa > p { text-align: left; }
  .seite { flex: none; padding: 24px 16px 24px 46px; }
  .fuss { padding: 16px; text-align: center; }
  .literatur .autor { width: 7.5em; }
}

@media (max-width: 440px) {
  .literatur tr, .literatur td { display: block; width: auto !important; }
  .literatur .autor { padding-bottom: 0; font-weight: bold; }
}

/* ---------- Print: only the content, black on white */
@media print {
  .kopf, .menu, .seite, .fuss, .skip, .suche, .neu, .sprungmarken, .nach-oben { display: none !important; }
  .box h2.abschnitt-titel { background: none; border-left-color: #000; }
  .rahmen, .haupt { display: block; min-height: 0; padding: 0; }
  body, html { background: #fff; color: #000; font-size: 11pt; }
  .box { padding: 0; min-height: 0; background: none; zoom: 1; }
  .box h1 img { display: none; }
  .druck-titel { display: block; font: bold 18pt/1.2 var(--titel); }
  .box h2, .box h3, .box h1.text-titel, a, .meta { color: #000 !important; }
  .prosa a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; }
  .prosa ul { list-style: disc; }
}
