/* ==========================================================================
   KOMPONENTEN: wiederverwendbare Bausteine (Beiträge, Karten, Galerie ...)
   ========================================================================== */

/* ---- Beiträge ---- */
.post { margin-bottom: 2.2rem; padding-bottom: 1.6rem; border-bottom: 4px dotted var(--pcb-line); }
.post:last-child { border-bottom: 0; }
.post h2.basteln { color: var(--led-green); }
.post h2.langfristig { color: var(--led-blue); }
.postinfo { display: block; color: var(--silk-dim); font-size: 1.15rem; margin: -0.4rem 0 0.8rem; }
.postinfo::before { content: '> '; color: var(--led-green); }
span.postinfo, .content_item span.postinfo { display: inline; margin: 0; }
.post img, .content_item img { border: 4px solid var(--ink); outline: 2px solid var(--pcb-line); background: var(--ink); margin: .4rem 0; }
.post-nav { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---- Buttons / Knöpfe ---- */
.btn, button.btn, input[type=submit] {
    display: inline-block;
    font-family: var(--font-pixel); font-size: .7rem;
    color: var(--ink); background: var(--gold);
    border: 3px solid #000; box-shadow: 4px 4px 0 #000;
    padding: 12px 16px; cursor: pointer; text-decoration: none;
}
.btn:hover, .btn:focus-visible, button.btn:hover { background: var(--led-green); color: var(--ink); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 #000; }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #000; }
.btn.alt { background: var(--led-blue); }

input[type=text], input[type=search], select, textarea {
    font-family: var(--font-text); font-size: 1.3rem;
    background: var(--ink); color: var(--silk);
    border: 3px solid var(--pcb-line); padding: 6px 10px;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); outline: none; }

/* ---- Tooltip (Termine) ---- */
.tooltip { position: relative; display: inline-block; border-bottom: 2px dotted var(--copper); cursor: help; }
.tooltip::after {
    content: attr(data-tip);
    position: absolute; left: 0; top: 100%; z-index: 20; margin-top: 8px;
    width: max-content; max-width: 260px;
    background: var(--ink); color: var(--silk); border: 3px solid var(--gold);
    padding: 6px 10px; font-size: 1.1rem; line-height: 1.2;
    visibility: hidden; opacity: 0;
}
.tooltip:hover::after, .tooltip:focus::after { visibility: visible; opacity: 1; }
.termin { margin-bottom: .4rem; }

/* ---- Startseite: Willkommens-Bereich ---- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 32px; align-items: center; }
.hero h1 { font-size: 1.5rem; margin-bottom: 1.2rem; }
.hero .lead { font-size: 1.6rem; }
.hero .age { display: inline-block; margin-top: .4rem; padding: 4px 10px; background: var(--ink); color: var(--led-green); border: 3px solid var(--led-green); font-family: var(--font-pixel); font-size: .65rem; }
.press-start { font-family: var(--font-pixel); font-size: .8rem; color: var(--gold); animation: blink 1.2s steps(1) infinite; }

/* Bildröhre mit Diashow */
.screen { background: #222; border: 6px solid #000; padding: 14px; box-shadow: 6px 6px 0 #000; }
.screen-glass { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #000; }
.screen-glass img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; border: 0; outline: 0; margin: 0; opacity: 0; transition: opacity .6s steps(4); }
.screen-glass img.show { opacity: 1; }
.screen-glass::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0,0,0,.22) 0 2px, transparent 2px 4px); }
.screen-caption { margin: 10px 0 0; font-size: 1.15rem; color: var(--led-green); min-height: 2.4em; line-height: 1.1; }
.screen-caption::before { content: '> '; }

/* ---- Level-Karten (Lernweg) ---- */
.levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 22px; margin: 0 0 1rem; padding: 0; list-style: none; }
.levels li { margin: 0; }
.level {
    display: block; height: 100%; position: relative;
    background: var(--ink); color: var(--silk); text-decoration: none;
    border: 4px solid var(--pcb-line); padding: 18px 16px 14px;
    box-shadow: 5px 5px 0 #000;
}
.level:hover, .level:focus-visible { background: var(--ink); color: var(--silk); border-color: var(--gold); transform: translate(-3px, -3px); box-shadow: 8px 8px 0 #000; }
.level-no { font-family: var(--font-pixel); font-size: .6rem; color: var(--led-green); display: block; margin-bottom: 10px; }
.level-icon { display: block; line-height: 0; margin-bottom: 12px; min-height: 64px; }
.level-name { display: block; font-family: var(--font-pixel); font-size: .75rem; color: var(--gold); margin-bottom: 8px; line-height: 1.5; }
.level-text { display: block; font-size: 1.15rem; line-height: 1.15; color: var(--silk-dim); }
.level-time { display: block; margin-top: 10px; font-size: 1.05rem; color: var(--copper); }

/* ---- Info-Kästchen ("Statuswerte" für Basteln-Seite) ---- */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.facts li { margin: 0; background: var(--ink); border: 3px solid var(--pcb-line); padding: 12px; }
.facts b { display: block; font-family: var(--font-pixel); font-size: .65rem; color: var(--led-green); font-weight: normal; margin-bottom: 8px; }
.facts span { font-size: 1.3rem; }

/* ---- Personen ---- */
.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 28px; list-style: none; padding: 0; margin: 0 0 1.5rem; }
.team li { margin: 0; background: var(--ink); border: 4px solid var(--pcb-line); padding: 12px; text-align: center; }
.team img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; margin: 0 0 10px; }
.team .call { display: block; font-family: var(--font-pixel); font-size: .6rem; color: var(--led-green); margin-top: 6px; }

/* ---- Galerie (Ausstattung, Fotos) ---- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.gallery figure { margin: 0; background: var(--ink); border: 4px solid var(--pcb-line); padding: 10px; }
.gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; margin: 0 0 8px; border: 0; outline: 0; }
.gallery figcaption { font-size: 1.1rem; line-height: 1.1; color: var(--silk-dim); }
figure.photo { margin: 1rem 0; }
figure.photo img { display: block; }
figure.photo figcaption { font-size: 1.1rem; color: var(--silk-dim); margin-top: 4px; }

/* ---- Sponsoren-Wand ---- */
.photo-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; list-style: none; padding: 0; margin: 1rem 0; max-width: 700px; }
.photo-wall li { margin: 0; background: #fff; border: 4px solid var(--ink); padding: 8px; display: flex; align-items: center; justify-content: center; min-height: 90px; }
.photo-wall img { display: block; margin: 0; border: 0; outline: 0; background: none; width: 100%; max-width: 150px; }
.photo-wall:hover li { opacity: .5; transition: opacity .3s; }
.photo-wall li:hover { opacity: 1; }
.photo-wall a:hover { background: none; }

/* ---- Archiv ---- */
.archive-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 1.2rem; }
.archive-tools input { flex: 1 1 260px; }
details.year { margin-bottom: 1.2rem; border: 4px solid var(--pcb-line); background: var(--pcb-dark); }
details.year > summary { cursor: pointer; padding: 12px 16px; font-family: var(--font-pixel); font-size: .85rem; color: var(--gold); list-style: none; }
details.year > summary::before { content: '▶ '; color: var(--led-green); }
details.year[open] > summary::before { content: '▼ '; }
details.year > summary::-webkit-details-marker { display: none; }
.year-body { padding: 8px 18px 4px; }
details.old-post { border-top: 3px dotted var(--pcb-line); padding: 6px 0; }
details.old-post > summary { cursor: pointer; font-size: 1.3rem; list-style: none; }
details.old-post > summary::before { content: '+ '; color: var(--led-green); }
details.old-post[open] > summary::before { content: '− '; }
details.old-post > summary::-webkit-details-marker { display: none; }
details.old-post .date { color: var(--silk-dim); margin-right: 8px; }
details.old-post .body { padding: 8px 0 12px 24px; }
.old-post.plain { border-top: 3px dotted var(--pcb-line); padding: 6px 0; font-size: 1.3rem; color: var(--silk-dim); }
.old-post.plain .date { margin-right: 8px; }
.old-post.plain a { color: var(--silk-dim); }
.hidden { display: none !important; }

/* ---- Hinweiskästen ---- */
.note { border: 4px solid var(--led-blue); background: var(--ink); padding: 12px 16px; margin: 0 0 1rem; }
.note.warn { border-color: var(--led-yellow); }

/* ---- Sticker für kleine Hinweise ---- */
.sticker { display: inline-block; font-family: var(--font-pixel); font-size: .6rem; background: var(--led-red); color: #fff; padding: 4px 8px; border: 3px solid #000; transform: rotate(-3deg); }

iframe.map { max-width: 100%; border: 4px solid var(--ink); outline: 2px solid var(--pcb-line); }

/* Schmale Bildschirme: Bausteine untereinander statt nebeneinander */
@media (max-width: 960px) {
    .hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
    .hero h1 { font-size: 1rem; }
    .hero .lead { font-size: 1.35rem; }
    .gallery, .team { grid-template-columns: minmax(0, 1fr); }
    .bolt-bubble { width: 200px; }
}
