/* ========== Grundreset ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Header/Nav-Höhe für Berechnungen */
    --header-h: 60px;
}

/* ========== Seite & Grundlayout ========== */
html, body {
    height: 100%;
    font-family: sans-serif;
    background-color: #f0f2f5;
}

/* ========== Menü / Header ========== */
header {
    background-color: #1f2937;
    padding: 1em 0;
}

header, nav {
    width: 100%;
    max-width: none;
}

.menu {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2em;
}

.menu li a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

/* Aktiver Menüpunkt (body bekommt die Seitenklasse) */
body.ersatzteile .menu a[href*="seite=ersatzteile"],
body.scheckheft .menu a[href*="seite=scheckheft"],
body.impressum .menu a[href*="seite=impressum"],
body.start .menu a[href*="seite=start"] {
    font-weight: 700;
    text-decoration: underline;
}

/* ========== Hauptinhalt (Default, z. B. Startseite) ========== */
main {
    height: calc(100vh - var(--header-h));
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ========== Bildrahmen & Bilder ========== */
.bild-rahmen {
    background: white;
    padding: 1rem;
    border: 5px solid #ccc;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.projekt-bild {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    display: block;
}

/* ========== Seiteninhalt-Container-Reset ========== */
#seiteninhalt {
    all: initial;
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========== Impressum-Block ========== */
.impressumblock {
    background: white;
    padding: 1rem;
    border: 5px solid #ccc;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    width: 96%;
    margin: 0 auto;
}

.impressumblock h2, .impressumblock h3 {
    color: #1f2937;
    margin-top: 1rem;
}

.impressumblock p {
    margin: 0.5rem 0;
}

/* ========== Einbettungen (Ersatzteile / E-Scheckheft) ========== */
/* Auf diesen Seiten soll main nicht zentrieren, sondern Fläche bieten */
body.ersatzteile main,
body.scheckheft main {
    display: block;
    height: auto;
    min-height: calc(100vh - var(--header-h));
    padding: 1rem; /* etwas Luft um das Iframe */
}

/* Wrapper begrenzen & zentrieren (keine Vollbreite) */
.embed-wrap {
    max-width: min(1200px, 96vw);
    margin: 0 auto;
}

/* Iframe: volle Breite innerhalb des Wrappers + ordentliche Höhe */
.embed {
    width: 100%;
    height: calc(100vh - var(--header-h) - 2rem); /* - padding von main */
    min-height: 60vh;
    border: 0;
    border-radius: 8px;                   /* optional */
    box-shadow: 0 0 10px rgba(0,0,0,0.1); /* optional */
    background: #fff;                     /* freundlicher Lade-Hintergrund */
}

/* Falls globale iframe-Regeln existieren, notfalls übersteuern */
body.ersatzteile main .embed-wrap > iframe.embed,
body.scheckheft  main .embed-wrap > iframe.embed {
    width: 100% !important;
    height: calc(100vh - var(--header-h) - 2rem) !important;
}

/* ========== Meldungsbox (Fallback bei Fehler) ========== */
.notice {
    padding: 1rem 1.25rem;
    border-radius: .5rem;
    border: 1px solid #ddd;
    background: #f7f7f7;
    max-width: min(1200px, 96vw);
    margin: 1rem auto;
}

.notice.error {
    border-color: #f5b5b5;
    background: #fdeeee;
}

.notice a {
    text-decoration: underline;
}

/* ========== Dark Mode (optional) ========== */
@media (prefers-color-scheme: dark) {
    .notice { background: #1e1e1e; border-color: #333; color: #eee; }
    .notice.error { background: #2a0f10; border-color: #6b1b1f; }
}
