/*
Theme Name: Eggers Wiki
Theme URI: https://example.com/
Author: Cowork Build
Description: Wiki-Theme im Enzyklopädie-Stil für die Gedenk- und Dokumentationsseite über Prof. Gerhard Eggers (1912–1998), Pionier der deutschen Luft- und Raumfahrt.
Version: 1.0
Requires at least: 5.0
Requires PHP: 7.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: eggers-wiki
*/

/* ---------- Grundlayout ---------- */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.65;
    color: #202122;
    background: #f8f9fa;
}

a { color: #0645ad; text-decoration: none; }
a:hover { text-decoration: underline; }
a:visited { color: #0b0080; }

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

/* ---------- Kopfbereich ---------- */
.site-header {
    background: #fff;
    border-bottom: 1px solid #a2a9b1;
    padding: 0.8em 1.2em;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5em;
}

.site-title {
    font-family: "Linux Libertine", Georgia, "Times New Roman", serif;
    font-size: 1.6em;
    margin: 0;
    font-weight: normal;
}
.site-title a { color: #202122; }
.site-title a:hover { text-decoration: none; }

.site-description {
    margin: 0;
    color: #54595d;
    font-size: 0.85em;
}

.header-search form {
    display: flex;
    gap: 0.3em;
}
.header-search input[type="search"] {
    border: 1px solid #a2a9b1;
    border-radius: 2px;
    padding: 0.35em 0.6em;
    font-size: 0.9em;
    min-width: 200px;
}
.header-search button {
    border: 1px solid #a2a9b1;
    background: #f8f9fa;
    border-radius: 2px;
    padding: 0.35em 0.8em;
    cursor: pointer;
    font-size: 0.9em;
}
.header-search button:hover { background: #eaecf0; }

/* ---------- Seitengerüst ---------- */
.site-layout {
    display: flex;
    max-width: 1300px;
    margin: 0 auto;
    align-items: flex-start;
}

/* Seitenleiste */
.site-sidebar {
    flex: 0 0 220px;
    padding: 1.2em 1em;
    font-size: 0.85em;
}
.site-sidebar h2 {
    font-size: 0.95em;
    color: #54595d;
    border-bottom: 1px solid #c8ccd1;
    padding-bottom: 0.3em;
    margin: 1.2em 0 0.5em;
    font-weight: 600;
}
.site-sidebar h2:first-child { margin-top: 0; }
.site-sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-sidebar li { margin: 0.35em 0; }
.site-sidebar .current_page_item > a { font-weight: 700; color: #202122; }
.site-sidebar .children { padding-left: 1em; }

/* Inhalt */
.site-content {
    flex: 1;
    background: #fff;
    border: 1px solid #a2a9b1;
    border-right: none;
    border-bottom: none;
    padding: 1.5em 2em 3em;
    min-height: 80vh;
    min-width: 0;
}

/* ---------- Artikel (Wiki-Stil) ---------- */
.entry-title {
    font-family: "Linux Libertine", Georgia, "Times New Roman", serif;
    font-size: 2em;
    font-weight: normal;
    margin: 0 0 0.2em;
    padding-bottom: 0.17em;
    border-bottom: 1px solid #a2a9b1;
}

.entry-content h2 {
    font-family: "Linux Libertine", Georgia, "Times New Roman", serif;
    font-size: 1.5em;
    font-weight: normal;
    margin: 1.4em 0 0.4em;
    padding-bottom: 0.17em;
    border-bottom: 1px solid #a2a9b1;
    clear: left;
}
.entry-content h3 {
    font-size: 1.15em;
    margin: 1.2em 0 0.3em;
}
.entry-content p { margin: 0.5em 0 0.9em; }

.entry-content ul, .entry-content ol { margin: 0.3em 0 0.9em 1.6em; padding: 0; }
.entry-content li { margin-bottom: 0.25em; }

.entry-content blockquote {
    margin: 1em 2em;
    padding: 0.4em 1em;
    border-left: 3px solid #c8ccd1;
    color: #54595d;
    font-style: italic;
}

.entry-content table {
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 0.92em;
    width: 100%;
}
.entry-content table th,
.entry-content table td {
    border: 1px solid #a2a9b1;
    padding: 0.4em 0.7em;
    text-align: left;
    vertical-align: top;
}
.entry-content table th { background: #eaecf0; }
.entry-content table tr:nth-child(even) td { background: #f8f9fa; }

/* ---------- Infobox ---------- */
.infobox {
    float: right;
    clear: right;
    width: 300px;
    margin: 0 0 1em 1.5em;
    border: 1px solid #a2a9b1;
    background: #f8f9fa;
    font-size: 0.85em;
    line-height: 1.5;
    padding: 0.4em;
}
.infobox-title {
    text-align: center;
    font-weight: 700;
    font-size: 1.15em;
    padding: 0.4em 0.2em;
}
.infobox img { display: block; margin: 0 auto; }
.infobox-caption {
    text-align: center;
    color: #54595d;
    font-size: 0.9em;
    padding: 0.3em 0.4em 0.5em;
}
.infobox table { width: 100%; border-collapse: collapse; }
.infobox table th,
.infobox table td {
    border: none;
    padding: 0.25em 0.4em;
    text-align: left;
    vertical-align: top;
    background: transparent !important;
}
.infobox table th {
    width: 38%;
    font-weight: 600;
    background: transparent;
}

/* ---------- Hinweiskästen / Lead ---------- */
.wiki-lead { font-size: 1.02em; }

.hatnote {
    font-size: 0.85em;
    color: #54595d;
    font-style: italic;
    margin: 0 0 1em;
    padding-left: 1.6em;
}

.reflist {
    font-size: 0.85em;
    color: #333;
}

/* Galerie */
.wiki-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    margin: 1em 0;
}
.wiki-gallery figure {
    margin: 0;
    border: 1px solid #c8ccd1;
    background: #f8f9fa;
    padding: 0.5em;
    width: 220px;
    font-size: 0.82em;
    text-align: center;
}

/* ---------- Artikel-Fußzeile ---------- */
.entry-footer {
    margin-top: 3em;
    padding-top: 0.6em;
    border-top: 1px solid #c8ccd1;
    font-size: 0.8em;
    color: #54595d;
    clear: both;
}

.site-footer {
    max-width: 1300px;
    margin: 0 auto;
    padding: 1em 1.5em 2em;
    font-size: 0.8em;
    color: #54595d;
}

/* ---------- Suchergebnisse ---------- */
.search-result { margin-bottom: 1.5em; }
.search-result h2 {
    font-size: 1.1em;
    margin: 0 0 0.2em;
    border: none;
}
.search-result p { margin: 0; font-size: 0.9em; color: #54595d; }

/* ---------- Responsiv ---------- */
@media (max-width: 900px) {
    .site-layout { flex-direction: column; }
    .site-sidebar {
        flex: none;
        width: 100%;
        background: #fff;
        border-bottom: 1px solid #a2a9b1;
        padding: 0.8em 1.2em;
    }
    .site-content { border: none; padding: 1.2em 1.2em 2.5em; }
    .infobox {
        float: none;
        width: 100%;
        margin: 0 0 1.2em;
    }
}

/* ==========================================================================
   v1.1 – Inhaltsverzeichnis (Wikipedia-Stil), Sprachumschalter, Galerie
   ========================================================================== */

/* ---------- Inhaltsverzeichnis ---------- */
.wiki-toc {
    display: inline-block;
    background: #f8f9fa;
    border: 1px solid #a2a9b1;
    padding: 0.5em 1.2em 0.6em 1em;
    font-size: 0.9em;
    margin: 0.8em 0 1.2em;
    max-width: 100%;
}
.wiki-toc summary {
    cursor: pointer;
    font-weight: 700;
    text-align: center;
    padding: 0.2em 0;
    list-style: none;
}
.wiki-toc summary::-webkit-details-marker { display: none; }
.wiki-toc summary::after {
    content: " ▾";
    color: #54595d;
    font-size: 0.85em;
}
.wiki-toc details:not([open]) summary::after { content: " ▸"; }
.wiki-toc ol {
    list-style: none;
    margin: 0.4em 0 0;
    padding: 0;
}
.wiki-toc ol.toc-sub {
    margin: 0.15em 0 0.15em 1.4em;
}
.wiki-toc li { margin: 0.25em 0; }
.wiki-toc a { color: #0645ad; }
.wiki-toc .toc-num {
    color: #202122;
    font-weight: 600;
    margin-right: 0.35em;
}

/* Sanftes Scrollen zu Ankern + Platz unter fixen Leisten */
html { scroll-behavior: smooth; }
.entry-content h2[id], .entry-content h3[id] { scroll-margin-top: 0.8em; }

/* ---------- Kopfbereich / Sprachumschalter ---------- */
.header-tools {
    display: flex;
    align-items: center;
    gap: 1em;
    flex-wrap: wrap;
}
.lang-switcher {
    display: flex;
    gap: 0.15em;
    border: 1px solid #a2a9b1;
    border-radius: 2px;
    overflow: hidden;
    font-size: 0.85em;
}
.lang-switcher a,
.lang-switcher .lang-current {
    padding: 0.35em 0.7em;
    display: inline-block;
}
.lang-switcher a { color: #0645ad; background: #f8f9fa; }
.lang-switcher a:hover { background: #eaecf0; text-decoration: none; }
.lang-switcher .lang-current {
    background: #eaecf0;
    color: #202122;
    font-weight: 700;
}

/* ---------- Galerie ---------- */
.wiki-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1em;
}
.wiki-gallery figure {
    width: auto;
    margin: 0;
    border: 1px solid #c8ccd1;
    background: #f8f9fa;
    padding: 0.5em;
    font-size: 0.82em;
    text-align: center;
}
.wiki-gallery figure img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}
.wiki-gallery figcaption { margin-top: 0.35em; color: #54595d; }

/* Einzelbilder im Fließtext (Wikipedia-"thumb" rechts) */
.wiki-thumb {
    float: right;
    clear: right;
    width: 240px;
    margin: 0.3em 0 1em 1.5em;
    border: 1px solid #c8ccd1;
    background: #f8f9fa;
    padding: 0.4em;
    font-size: 0.82em;
    text-align: center;
}
.wiki-thumb img { width: 100%; height: auto; display: block; }
.wiki-thumb figcaption { margin-top: 0.3em; color: #54595d; text-align: left; }

/* ---------- Mobil ---------- */
@media (max-width: 900px) {
    .site-header { padding: 0.7em 1em; }
    .header-tools { width: 100%; justify-content: space-between; }
    .header-search input[type="search"] { min-width: 130px; }
    .wiki-toc { display: block; }
    .wiki-thumb {
        float: none;
        width: 100%;
        margin: 0.8em 0;
    }
    .wiki-gallery { grid-template-columns: repeat(2, 1fr); }
    .wiki-gallery figure img { height: 130px; }
}

/* ==========================================================================
   v1.2 – Inhaltsverzeichnis, Sprachumschalter, Wikipedia-Thumbs,
   Galerie, mobil einklappbare Abschnitte
   ========================================================================== */

/* ---------- Inhaltsverzeichnis ---------- */
.wiki-toc {
    display: table;
    background: #f8f9fa;
    border: 1px solid #a2a9b1;
    padding: 0.5em 1.2em 0.6em 1em;
    font-size: 0.9em;
    margin: 0.8em 0 1.2em;
    max-width: 100%;
}
.wiki-toc summary {
    cursor: pointer;
    font-weight: 700;
    text-align: center;
    padding: 0.2em 0;
    list-style: none;
}
.wiki-toc summary::-webkit-details-marker { display: none; }
.wiki-toc summary::after { content: " ▾"; color: #54595d; font-size: 0.85em; }
.wiki-toc details:not([open]) summary::after { content: " ▸"; }
.wiki-toc ol { list-style: none; margin: 0.4em 0 0; padding: 0; }
.wiki-toc ol.toc-sub { margin: 0.15em 0 0.15em 1.4em; }
.wiki-toc li { margin: 0.25em 0; }
.wiki-toc a { color: #0645ad; }
.wiki-toc .toc-num { color: #202122; font-weight: 600; margin-right: 0.35em; }

html { scroll-behavior: smooth; }
.entry-content h2[id], .entry-content h3[id] { scroll-margin-top: 0.8em; }

/* ---------- Kopfbereich / Sprachumschalter ---------- */
.header-tools { display: flex; align-items: center; gap: 1em; flex-wrap: wrap; }
.lang-switcher {
    display: flex; gap: 0.15em;
    border: 1px solid #a2a9b1; border-radius: 2px; overflow: hidden; font-size: 0.85em;
}
.lang-switcher a, .lang-switcher .lang-current { padding: 0.35em 0.7em; display: inline-block; }
.lang-switcher a { color: #0645ad; background: #f8f9fa; }
.lang-switcher a:hover { background: #eaecf0; text-decoration: none; }
.lang-switcher .lang-current { background: #eaecf0; color: #202122; font-weight: 700; }

/* ---------- Wikipedia-Thumbnail (Bild rechts mit Rahmen + Bildunterschrift) ----------
   Klassischer MediaWiki-"thumb": dünner Rahmen, hellgrauer Untergrund,
   Bildunterschrift IM Rahmen unter dem Bild, klein und grau-links. */
.wiki-thumb {
    float: right;
    clear: right;
    width: 220px;
    max-width: 45%;
    margin: 0.3em 0 0.8em 1.4em;
    border: 1px solid #c8ccd1;
    background: #f8f9fa;
    padding: 3px;
    font-size: 0.83em;
    line-height: 1.4;
}
.wiki-thumb img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid #c8ccd1;
    background: #fff;
}
.wiki-thumb figcaption {
    padding: 0.35em 0.2em 0.15em;
    color: #54595d;
    text-align: left;
}
/* Linksbündige Variante */
.wiki-thumb.tleft { float: left; clear: left; margin: 0.3em 1.4em 0.8em 0; }

/* ---------- Galerie (Wikipedia "gallery"-Raster) ---------- */
.wiki-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 6px;
    margin: 1em 0;
    clear: both;
}
.wiki-gallery figure {
    margin: 0;
    border: 1px solid #c8ccd1;
    background: #f8f9fa;
    padding: 3px;
    font-size: 0.78em;
    line-height: 1.35;
    display: flex;
    flex-direction: column;
}
.wiki-gallery figure img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    background: #fff;
    border: 1px solid #c8ccd1;
}
.wiki-gallery figcaption { padding: 0.3em 0.2em 0.1em; color: #54595d; text-align: left; }

/* ---------- Artikel-Fußzeile ---------- */
.entry-content h2 { clear: none; }

/* ---------- Mobil: einklappbare Abschnitte wie Wikipedia-Mobile ---------- */
.section-toggle { display: none; }

@media (max-width: 900px) {
    .site-header { padding: 0.7em 1em; }
    .header-tools { width: 100%; justify-content: space-between; }
    .header-search input[type="search"] { min-width: 120px; }

    .wiki-toc { display: block; }

    /* Bilder over volle breedte, niet zwevend, kleiner */
    .wiki-thumb, .wiki-thumb.tleft {
        float: none;
        width: 100%;
        max-width: 100%;
        margin: 0.8em 0;
    }
    .wiki-gallery { grid-template-columns: repeat(2, 1fr); }

    /* Sectiekoppen worden tikbare accordeon-headers */
    .entry-content h2.collapsible-head {
        cursor: pointer;
        position: relative;
        padding-right: 1.4em;
        -webkit-tap-highlight-color: transparent;
    }
    .entry-content h2.collapsible-head::after {
        content: "▾";
        position: absolute;
        right: 0.1em;
        color: #54595d;
        font-size: 0.7em;
        top: 50%;
        transform: translateY(-40%);
    }
    .entry-content h2.collapsible-head.collapsed::after { content: "▸"; }
    .section-body.collapsed { display: none; }
}
   v1.3 – mobiel: zijbalk-navigatie naar ONDER het artikel (zoals mobile
   Wikipedia); de inklapbare sectiekoppen dienen als navigatie.
   ========================================================================== */
@media (max-width: 900px) {
    .site-layout { display: flex; flex-direction: column; }
    .site-content { order: 1; }
    .site-sidebar {
        order: 2;
        margin-top: 1.5em;
        border-top: 2px solid #a2a9b1;
        padding-top: 1em;
        background: #f8f9fa;
    }
}
