/* ==========================================================================
   grassmayr.com – Stylesheet
   Das Design folgt der ursprünglichen Website (Apple iWeb, 2016):
   weisse, zentrierte Spalte mit 700 px Breite, Schrift Arial,
   graue Navigation, dezente Farben.
   ========================================================================== */

:root {
    --text:         rgb(88, 77, 77);   /* Fliesstext          */
    --nav:          rgb(102, 102, 102);/* Navigation          */
    --nav-aktiv:    rgb(70, 60, 60);   /* aktiver Menüpunkt   */
    --titel-grau:   rgb(167, 167, 167);/* Seitentitel (grau)  */
    --titel-dunkel: rgb(10, 10, 10);   /* Seitentitel (Home)  */
    --besucht:      rgb(121, 121, 121);/* besuchte Links      */
    --linie:        rgb(200, 200, 200);/* feine Trennlinien   */
    --hervorhebung: rgb(245, 238, 223);/* Tabellen-Markierung */
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: rgb(255, 255, 255);
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
}

/* --- Grundgerüst: zentrierte 700-px-Spalte wie im Original --- */

.seite {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: left;
}

/* --- Hauptnavigation --- */

nav.hauptmenu {
    font-size: 16px;
    line-height: 30px;
    color: var(--nav);
    text-align: center;
    margin: 9px 0 6px 0;
}

nav.hauptmenu a {
    display: inline-block;
    padding: 0 10px;
    color: var(--nav);
    text-decoration: none;
}

nav.hauptmenu a:hover { color: var(--nav-aktiv); }

nav.hauptmenu a.aktiv {
    color: var(--nav-aktiv);
    font-weight: bold;
}

/* feine Linie unter der Navigation (im Original ein 1-px-Bild) */
.trennlinie {
    border: 0;
    border-top: 1px solid var(--linie);
    margin: 0;
}

/* --- Untermenü (Aufbau nach dem Vorbild von pleiterborg.nl) --- */

nav.untermenu {
    font-size: 13px;
    line-height: 24px;
    text-align: center;
    margin: 0 0 10px 0;
}

nav.untermenu a {
    display: inline-block;
    padding: 0 8px;
    color: var(--nav);
    text-decoration: none;
}

nav.untermenu a:hover { color: var(--nav-aktiv); }

nav.untermenu a.aktiv {
    color: var(--nav-aktiv);
    font-weight: bold;
}

/* --- Seitentitel --- */

h1 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 36px;
    line-height: 42px;
    font-weight: 700;
    text-align: center;
    color: var(--titel-grau);
    margin: 20px 0 18px 0;
}

h1.startseite { color: var(--titel-dunkel); }

/* --- Inhalt --- */

main {
    font-size: 13px;
    line-height: 18px;
}

main p { margin: 0 0 14px 0; }

/* Zwischentitel wie die "Arial Black"-Überschriften des Originals */
h2 {
    font-family: 'Arial Black', 'Arial-Black', Arial, sans-serif;
    font-size: 14px;
    line-height: 19px;
    font-weight: 800;
    color: var(--text);
    margin: 26px 0 8px 0;
}

h3 {
    font-size: 14px;
    line-height: 16px;
    font-weight: 700;
    color: var(--text);
    margin: 20px 0 6px 0;
}

main a { color: var(--text); text-decoration: underline; }
main a:visited { color: var(--besucht); }
main a:hover { color: rgb(0, 0, 0); }

main ul, main ol { margin: 0 0 14px 0; padding-left: 22px; }
main li { margin-bottom: 3px; }

/* --- Bilder --- */

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

/* Spiegelungseffekt wie bei iWeb (wird nicht von allen Browsern
   unterstützt; ohne Unterstützung erscheint das Bild einfach ohne
   Spiegelung) */
.spiegelung {
    -webkit-box-reflect: below 0
        linear-gradient(to bottom, rgba(0,0,0,0) 70%, rgba(0,0,0,0.2));
}

figure { margin: 0; }

figcaption {
    font-size: 11px;
    line-height: 15px;
    text-align: center;
    color: var(--besucht);
    padding-top: 4px;
}

/* --- Startseite --- */

.willkommen-bild {
    text-align: center;
    margin: 10px 0 30px 0;
}

/* Die Spiegelung des grossen Bildes nimmt keinen Platz im Layout ein,
   darum bekommt die Unterschrift genügend Abstand nach oben. */
.unterschrift {
    font-size: 24px;
    line-height: 28px;
    font-weight: 700;
    text-align: center;
    color: var(--titel-dunkel);
    margin: 120px 0 30px 0;
}

/* --- ausklappbarer Text („Die ganze Geschichte lesen“) --- */

details.mehr { margin: 0 0 14px 0; }

details.mehr summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--nav-aktiv);
    text-decoration: underline;
    margin-bottom: 10px;
}

details.mehr summary:hover { color: rgb(0, 0, 0); }

details.mehr[open] summary { margin-bottom: 14px; }

/* --- Über uns: zwei Spalten wie im Original --- */

.zwei-spalten {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.zwei-spalten .spalte-text { flex: 1 1 260px; }
.zwei-spalten .spalte-bild { flex: 1 1 300px; }

.personen-name {
    font-family: 'Arial Black', 'Arial-Black', Arial, sans-serif;
    font-size: 14px;
    line-height: 19px;
    font-weight: 800;
    margin: 0;
}

.personen-herkunft {
    font-family: 'Arial Black', 'Arial-Black', Arial, sans-serif;
    font-size: 13px;
    line-height: 22px;
    font-weight: 800;
    margin: 0 0 14px 0;
}

/* --- Tabellen (Stammliste, Standorte) --- */

table.uebersicht {
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
    line-height: 18px;
    margin: 0 0 16px 0;
}

table.uebersicht th {
    text-align: left;
    border-bottom: 1px solid var(--linie);
    padding: 5px 8px;
}

table.uebersicht td {
    border-bottom: 1px solid rgb(235, 235, 235);
    padding: 5px 8px;
    vertical-align: top;
}

table.stammliste {
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
    line-height: 18px;
    margin: 0 0 16px 0;
}

table.stammliste th,
table.stammliste td {
    border: 1px solid var(--linie);
    padding: 6px 8px;
    vertical-align: top;
    text-align: left;
}

table.stammliste th.generation,
table.stammliste td.generation {
    text-align: center;
    width: 42px;
    background: var(--hervorhebung);
    font-weight: 700;
}

table.stammliste ol { margin: 0; padding-left: 20px; }

.legende {
    font-size: 12px;
    line-height: 17px;
    color: var(--besucht);
    margin: 0 0 16px 0;
}

/* --- Fotoalben --- */

.albenliste {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 27px;
    margin: 10px 0 30px 0;
}

.albenliste a {
    text-decoration: none;
    color: var(--text);
}

.albenliste img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.albenliste .albumtitel {
    font-weight: 700;
    font-size: 14px;
    line-height: 18px;
    text-align: center;
    padding-top: 8px;
}

.albenliste .albuminfo {
    font-size: 11px;
    line-height: 15px;
    text-align: center;
    color: var(--besucht);
}

.fotoraster {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin: 10px 0 30px 0;
}

.fotoraster img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

/* --- Grossansicht (Lightbox) --- */

.grossansicht {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 100;
}

.grossansicht.offen { display: flex; }

.grossansicht img {
    max-width: 92vw;
    max-height: 82vh;
    width: auto;
    height: auto;
}

.grossansicht .bildtitel {
    color: rgb(230, 230, 230);
    font-size: 15px;
    line-height: 22px;
    text-align: center;
    padding: 12px 20px 0 20px;
}

.grossansicht button {
    position: absolute;
    background: none;
    border: none;
    color: rgb(230, 230, 230);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 46px;
    line-height: 1;
    cursor: pointer;
    padding: 15px;
}

.grossansicht button:hover { color: rgb(255, 255, 255); }

.grossansicht .schliessen { top: 5px; right: 12px; }
.grossansicht .zurueck    { left: 5px; top: 50%; transform: translateY(-50%); }
.grossansicht .weiter     { right: 5px; top: 50%; transform: translateY(-50%); }

/* --- Giesserei-Seiten (Inhalte übernommen von pleiterborg.nl) --- */

.vorwort {
    background: var(--hervorhebung);
    padding: 10px 14px;
    font-size: 12px;
    line-height: 17px;
    margin: 0 0 16px 0;
}

.vorwort h2 { margin: 0 0 6px 0; }

.giesserei .separator {
    clear: both;
    height: 14px;
}

.giesserei .small {
    font-size: 11px;
    line-height: 15px;
    color: var(--besucht);
}

.giesserei .small h2 { color: var(--text); }

.giesserei .magazine { overflow: hidden; }

.giesserei sup a { text-decoration: none; }

.giesserei audio { max-width: 100%; }

.giesserei table.style2 {
    border-collapse: collapse;
    font-size: 12px;
    line-height: 17px;
    margin: 0 0 16px 0;
    color: var(--text);
}

.giesserei table.style2 th,
.giesserei table.style2 td {
    border: 1px solid var(--linie);
    padding: 5px 8px;
    vertical-align: top;
    text-align: left;
}

.giesserei table.style2 th { background: var(--hervorhebung); }

.giesserei ol.quellen {
    font-size: 11px;
    line-height: 16px;
    color: var(--besucht);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* --- Bilder und Tonaufnahmen im Fliesstext --- */

figure.buchbild {
    margin: 18px auto;
    text-align: center;
}

/* Mehrere Bilder hintereinander stehen nebeneinander in einer Reihe
   (auf schmalen Bildschirmen brechen sie in die nächste Zeile um). */
.bildreihe {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    gap: 14px 18px;
    margin: 18px 0;
}

.bildreihe figure.buchbild {
    margin: 0;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
}

/* Bilder nicht höher als nötig – ein Klick zeigt sie in voller Grösse */
.bildreihe.bilder img {
    display: block;
    margin: 0 auto;
    max-height: 260px;
    width: auto;
}

/* Einzelnes Bild: rechts neben dem Text, der Text fliesst daneben */
.bildreihe.einzeln {
    float: right;
    clear: right;
    max-width: 45%;
    margin: 4px 0 12px 20px;
}

.bildreihe.einzeln img { max-height: 300px; }

/* Überschriften, Tabellen usw. beginnen immer unter dem Bild */
main.giesserei h2,
main.giesserei table,
main.giesserei .vorwort,
main.giesserei ol.quellen,
main.giesserei .bildreihe:not(.einzeln) { clear: both; }

main.giesserei::after { content: ""; display: block; clear: both; }

/* Wörter in der Bild-Zeile: [Bild: datei.jpg | Text | links klein]
   links  = links neben dem Text
   rechts = rechts neben dem Text
   mitte  = allein in der Mitte, ohne Text daneben
   klein / gross = Grösse (ohne Angabe: mittel) */
.bildreihe.einzeln.links {
    float: left;
    clear: left;
    margin: 4px 20px 12px 0;
}

.bildreihe.klein img,
.bildreihe.einzeln.klein img { max-height: 170px; }
.bildreihe.einzeln.klein     { max-width: 30%; }

.bildreihe.gross img,
.bildreihe.einzeln.gross img { max-height: 500px; }
.bildreihe.einzeln.gross     { max-width: 60%; }

/* Handy: Bilder neben dem Text würden die Spalte zu schmal machen,
   darum stehen sie dort über dem Text, mittig. Nur kleine Bilder
   bleiben neben dem Text. */
@media (max-width: 500px) {
    .bildreihe.einzeln,
    .bildreihe.einzeln.links,
    .bildreihe.einzeln.gross { float: none; max-width: none; margin: 18px 0; }

    .bildreihe.einzeln.klein { max-width: 40%; }
    .bildreihe.einzeln.klein:not(.links) { float: right; margin: 4px 0 10px 14px; }
    .bildreihe.einzeln.klein.links { float: left; margin: 4px 14px 10px 0; }
}

.bildreihe.toene figure.buchbild { flex: 1 1 260px; max-width: 340px; }
.bildreihe.toene audio { width: 100%; }

/* --- die anklickbare Landkarte der Standorte --- */

figure.karte { margin: 18px 0; }

/* Karte und Schildchen nach dem Vorbild von pleiterborg.nl */
.karte .karte-flaeche {
    position: relative;
    max-width: 300px;      /* Originalgrösse der Karte, bleibt scharf */
    margin: 0 auto;
}

.karte .karte-flaeche img {
    width: 100%;
    display: block;
}

/* Ortsnamen: weisse Schildchen, beim Darüberfahren orange */
.karte .karte-flaeche a,
.karte .karte-flaeche a:visited {
    position: absolute;
    font-size: 13px;
    line-height: 16px;
    font-weight: bold;
    white-space: nowrap;
    padding: 0 3px;
    color: rgb(0, 0, 0);
    background: rgb(255, 255, 255);
    text-decoration: none;
}

.karte .karte-flaeche a:hover,
.karte .karte-flaeche a:focus { background: rgb(255, 165, 0); }

/* --- Fusszeile --- */

footer {
    border-top: 1px solid var(--linie);
    margin-top: 40px;
    padding: 12px 0 30px 0;
    font-size: 11px;
    line-height: 16px;
    text-align: center;
    color: var(--titel-grau);
}

footer a { color: var(--titel-grau); }

/* --- kleine Bildschirme (Smartphone) --- */

@media (max-width: 500px) {
    h1 { font-size: 28px; line-height: 34px; }
    .fotoraster { grid-template-columns: repeat(2, 1fr); }
    .albenliste { grid-template-columns: 1fr; }

    .seite { padding: 0 14px; }

    /* Die Spiegelung des Startseiten-Bildes ist auf dem Handy kleiner,
       darum genügt weniger Abstand. */
    .unterschrift { margin-top: 70px; }

    /* Grossansicht: etwas kleinere Knöpfe, damit sie das Foto
       weniger überdecken */
    .grossansicht button { font-size: 36px; padding: 10px; }

    /* Giesserei-Seiten: die umflossenen Bilder und Randnotizen werden
       untereinander gestapelt statt in schmale Spalten gequetscht
       (!important ist nötig, weil die übernommenen Seiten die Breiten
       direkt im style-Attribut setzen). */
    .giesserei .magazine div {
        float: none !important;
        width: auto !important;
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .giesserei .small { font-size: 12px; line-height: 17px; }
}

/* Stammbaum auf schmalen Bildschirmen: statt einer gequetschten
   Tabelle wird jede Generation als eigener Block untereinander
   angezeigt. */
@media (max-width: 540px) {
    table.stammliste,
    table.stammliste tr,
    table.stammliste td {
        display: block;
        width: 100%;
    }

    table.stammliste tr:first-child { display: none; } /* Kopfzeile */

    table.stammliste tr {
        border: 1px solid var(--linie);
        margin-bottom: 14px;
    }

    table.stammliste td {
        border: none;
        padding: 8px 10px;
    }

    table.stammliste td.generation {
        width: 100%;
        text-align: left;
        padding: 6px 10px;
    }

    /* Aus "XII" wird die verständliche Zeile "Generation XII" */
    table.stammliste td.generation::before { content: "Generation "; }

    table.stammliste td + td {
        border-top: 1px solid rgb(235, 235, 235);
    }
}
