/* ==========================================================
   handdrucksachen.de — Stylesheet
   Neuaufbau August 2026
   ========================================================== */

/* ---------- 1. SCHRIFTEN ---------- */

@font-face {
    font-family: 'Fern';
    src: url('/fonts/FernV2Variable.woff2') format('woff2-variations');
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: 'Alegreya Sans';
    src: url('/fonts/AlegreyaSans-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Alegreya Sans';
    src: url('/fonts/AlegreyaSans-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Alegreya Sans';
    src: url('/fonts/AlegreyaSans-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Alegreya Sans';
    src: url('/fonts/AlegreyaSans-MediumItalic.ttf') format('truetype');
    font-weight: 500;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Alegreya Sans';
    src: url('/fonts/AlegreyaSans-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Alegreya Sans';
    src: url('/fonts/AlegreyaSans-BoldItalic.ttf') format('truetype');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

/* ---------- 2. VARIABLEN ---------- */

:root {
    --bg:            #FFFAEB;
    --text:          #111111;
    --text-muted:    #5A5248;
    --accent:        #722121;
    --border:        #E2D8C2;
    --sprenkel-a:    #C5886E;
    --sprenkel-b:    #D4956D;

    --font-head:     'Fern', Georgia, serif;
    --font-body:     'Alegreya Sans', 'Helvetica Neue', Arial, sans-serif;

    --radius:        3px;
    --transition:    0.25s ease;
    --navbar-h:      70px;
    --content-max:   980px;
}

/* ---------- 3. RESET & GRUNDLAGEN ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-head);
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 0.6em;
}

h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.08rem; }

/* Zwischenüberschriften brauchen Luft nach oben */
.container h2 { margin-top: 2.2rem; }
.container h3 { margin-top: 1.6rem; }
.container h4 { margin-top: 1.3rem; }

.container .hero + h2,
.container > h2:first-child { margin-top: 0; }

p { margin: 0 0 1.1em; }

a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity var(--transition);
}

a:hover { opacity: 0.7; }

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

code {
    background: rgba(0,0,0,0.05);
    padding: 0.1em 0.4em;
    border-radius: 2px;
    font-size: 0.9em;
}

/* ---------- 4. HINTERGRUND-SPRENKEL ---------- */

.bg-sprenkel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ---------- 5. NAVIGATION ---------- */

.navbar {
    position: relative;
    z-index: 50;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.navbar-container {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 12px 1.5rem;
    display: flex;
    flex-wrap: wrap;              /* WICHTIG: erlaubt Menü als eigene Zeile */
    align-items: center;
    justify-content: space-between;
    min-height: var(--navbar-h);
}

/* Auf schmalen Geräten bleiben mindestens 12 px zum Rand */
@media (max-width: 420px) {
    .navbar-container {
        padding: 12px;
    }
}

.navbar-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.navbar-logo-img {
    height: 44px;
    width: auto;
    display: block;
}

/* Hamburger — nur mobil sichtbar */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 26px;
    height: 2px;
    background: var(--text);
    transition: transform var(--transition), opacity var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Menü — Desktop */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    display: block;
    padding: 0.4rem 0;
    color: var(--text);
    font-size: 0.98rem;
    border-bottom: 2px solid transparent;
}

.nav-link:hover,
.nav-link.current {
    border-bottom-color: var(--accent);
    color: var(--accent);
    opacity: 1;
}

/* ---------- 6. MOBILES MENÜ ----------
   Das <ul> ist ein Flex-Item in .navbar-container.
   Mit flex-wrap + width:100% bricht es in eine eigene Zeile um
   und liegt damit IM DOKUMENTFLUSS. Die Höhenanimation von
   max-height:0 auf einen Wert schiebt dadurch die komplette
   Seite nach unten — kein position:fixed, keine Überlagerung.
-------------------------------------- */

@media (max-width: 820px) {

    .hamburger {
        display: flex;
    }

    .nav-menu {
        order: 3;                 /* eigene Zeile unter Logo + Hamburger */
        width: 100%;
        flex-basis: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;

        max-height: 0;
        overflow: hidden;
        transition: max-height 0.32s ease;
    }

    .nav-menu.open {
        max-height: 640px;        /* > Höhe von 8 Einträgen */
    }

    .nav-menu li {
        border-top: 1px solid var(--border);
    }

    .nav-menu li:last-child {
        border-bottom: 1px solid var(--border);
    }

    .nav-link {
        padding: 1rem 0.25rem;
        border-bottom: none;
        border-left: 3px solid transparent;
        padding-left: 0.75rem;
    }

    .nav-link:hover,
    .nav-link.current {
        border-bottom: none;
        border-left-color: var(--accent);
        background: rgba(114, 33, 33, 0.05);
    }
}

/* ---------- 7. LAYOUT ---------- */

.container {
    position: relative;
    z-index: 1;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

.hero {
    padding: 3.5rem 0 2rem;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin: 0;
}

.content-section {
    margin: 0 0 2.5rem;
}

/* Bilder in Seitentexten (aus /inhalte/*.md) */
.seitenbild {
    margin: 1.8rem 0;
}

.seitenbild img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.seitenbild figcaption {
    margin-top: 0.5rem;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.container pre {
    padding: 0.9rem 1rem;
    overflow-x: auto;
    font-size: 0.85rem;
    background: rgba(0,0,0,0.04);
    border-radius: var(--radius);
}

/* ---------- 8. BUTTONS ---------- */

.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius);
    font-size: 0.98rem;
    transition: var(--transition);
}

.btn-primary {
    background: var(--accent);
    color: #FFFAEB;
}

.btn-primary:hover {
    opacity: 0.85;
}

.btn-secondary {
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn-secondary:hover {
    background: var(--accent);
    color: #FFFAEB;
    opacity: 1;
}

/* ---------- 9. SCHRIFTENKARTEI ---------- */

.suchleiste {
    width: 100%;
    padding: 0.85rem 1rem;
    margin: 0 0 2rem;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text);
    background: rgba(255,255,255,0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.suchleiste:focus {
    outline: none;
    border-color: var(--accent);
}

/* Filterleiste (Drucksachen) */
.filterleiste {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1.8rem;
}

.filter-btn {
    padding: 0.4rem 0.9rem;
    font: inherit;
    font-size: 0.9rem;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-btn.aktiv {
    background: var(--accent);
    border-color: var(--accent);
    color: #FFFAEB;
}

.grid-sammlung {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.8rem;
    margin: 0 0 2rem;
}

@media (min-width: 640px) {
    .grid-sammlung {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.8rem 6%;
    }
}

@media (min-width: 1000px) {
    .grid-sammlung {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.8rem 5%;
    }
}

.karte {
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,0.55);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-align: left;
    padding: 0;
    font: inherit;
    color: inherit;
    transition: var(--transition);
}

/* Nur echte Schaltflächen (Schriftenkartei) reagieren auf Klick */
button.karte {
    cursor: pointer;
}

button.karte:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 14px rgba(114, 33, 33, 0.13);
}

/* Angaben auf der Motivkarte */
.karte-angaben {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.15rem 0.6rem;
    margin: 0.7rem 0 0;
    font-size: 0.84rem;
    line-height: 1.45;
}

.karte-angaben dt {
    color: var(--text-muted);
    white-space: nowrap;
}

.karte-angaben dd {
    margin: 0;
}

.karte-text {
    margin: 0.8rem 0 0;
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--text-muted);
}

a.karte-bild:hover img {
    opacity: 0.85;
}

.karte-mehr {
    margin: 0.9rem 0 0;
    font-size: 0.88rem;
}

.karte-mehr a {
    font-weight: 500;
}

/* Motiv-Detailseite */
.motiv-hauptbild {
    margin: 0 0 1.5rem;
}

.motiv-hauptbild img {
    display: block;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.motiv-text {
    margin: 1.5rem 0;
}

.motiv-galerie {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.8rem;
    margin: 2rem 0 0;
}

.motiv-galerie img {
    display: block;
    width: 100%;
    height: 150px;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
}

.motiv-galerie a:hover img {
    border-color: var(--accent);
    opacity: 0.9;
}

/* Blätterleiste */
.blaetterleiste {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin: 2.5rem 0 1rem;
}

.blatt-btn {
    min-width: 42px;
    padding: 0.45rem 0.8rem;
    font: inherit;
    font-size: 0.92rem;
    color: var(--text);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.blatt-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.blatt-btn.aktiv {
    background: var(--accent);
    border-color: var(--accent);
    color: #FFFAEB;
}

.blatt-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.karte-bild {
    height: 300px;
    padding: 6px;
    background: linear-gradient(135deg, #F3ECDC 0%, #FBF8ED 100%);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Schriftenkartei: Bildfläche 72 % der Kartenbreite hoch */
#grid-sammlung .karte-bild {
    height: auto;
    aspect-ratio: 100 / 72;
}

.karte-bild img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.karte-info {
    padding: 0.9rem 1rem 1.1rem;
}

.karte-info {
    display: block;
}

.karte-titel {
    display: block;
    font-family: var(--font-head);
    font-size: 1.15rem;
    line-height: 1.3;
    margin: 0 0 0.2rem;
}

.karte-meta {
    display: block;
    font-size: 0.88rem;
    line-height: 1.4;
    color: var(--text-muted);
    margin: 0;
}

/* Herausgeber: eigene Zeile */
.karte-herausgeber {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.88rem;
    line-height: 1.4;
    color: var(--text-muted);
}

/* Schriftgröße: eigene Zeile am Schluss der Karte */
.karte-groesse {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.88rem;
    line-height: 1.4;
    color: var(--text);
}

.karte-bild {
    display: flex;
}

.hinweis {
    text-align: center;
    padding: 3rem 0;
    color: var(--text-muted);
}

/* ---------- 10. DETAILSEITE ---------- */

.detail-bild-wrap {
    position: relative;
    background: #F3ECDC;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 0 0 1.5rem;
}

.detail-bild-viewport {
    height: 65vh;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-bild-viewport img {
    transition: transform 0.15s ease;
    transform-origin: center center;
}

.zoom-controls {
    display: flex;
    gap: 0.5rem;
    padding: 0.6rem;
    border-top: 1px solid var(--border);
    background: rgba(255,255,255,0.6);
}

.zoom-btn {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text);
}

.zoom-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.detail-tabelle {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 2rem;
}

.detail-tabelle th,
.detail-tabelle td {
    text-align: left;
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.detail-tabelle th {
    width: 34%;
    font-weight: 500;
    color: var(--text-muted);
}

/* ---------- 11. JOURNAL / BLOG ----------
   Anmutung einer Tageszeitung: Spalten statt Kästen, Bilder in
   Graustufen direkt auf dem Papierton, keine Rahmen.
-------------------------------------------- */

.blog-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.6rem 3%;
    margin: 1rem 0 0;
}

@media (min-width: 640px) {
    .blog-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1000px) {
    .blog-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

.blog-post {
    display: flex;
    flex-direction: column;
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    cursor: pointer;
}

.blog-bild {
    margin: 0 0 0.9rem;
}

.blog-bild img {
    display: block;
    width: 100%;
    height: 190px;
    object-fit: cover;
    /* Zeitungsanmutung: entsättigt, leicht angehobener Kontrast */
    filter: grayscale(1) contrast(1.08);
    transition: filter var(--transition), opacity var(--transition);
}

.blog-post:hover .blog-bild img {
    opacity: 0.85;
}

.blog-post h3 {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
    line-height: 1.25;
}

.blog-post:hover h3 {
    color: var(--accent);
}

.blog-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin: 0 0 0.6rem;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.blog-excerpt {
    margin: 0 0 0.7rem;
    font-size: 0.98rem;
    line-height: 1.6;
}

.blog-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 0.7rem;
}

.blog-tag {
    font-size: 0.78rem;
    padding: 0.15rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-muted);
}

/* Weiterleitung ans Ende der Spalte */
.blog-weiter {
    margin: auto 0 0;
    padding-top: 0.4rem;
    font-size: 0.95rem;
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Artikelseite */
.blog-content img {
    border-radius: var(--radius);
    margin: 1.2rem 0;
}

.blog-content h2 {
    margin-top: 2rem;
}

/* ---------- 12. FOOTER ---------- */

.footer {
    position: relative;
    z-index: 1;
    background: rgba(255,255,255,0.35);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    font-size: 0.9rem;
}

.footer-container {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.4rem;
}

.footer-container p {
    margin: 0;
}

.footer-heart {
    color: var(--accent);
}

.footer-built {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.footer-newsletter {
    margin: 1.1rem 0 0.3rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border);
    width: 100%;
    max-width: 460px;
}

.footer-newsletter-text {
    margin: 0 0 0.35rem;
    color: var(--text-muted);
}

.footer-newsletter-link {
    margin: 0;
}

.footer-newsletter-link a {
    font-weight: 500;
}

.footer-partners {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    margin-top: 0.6rem;
}

.partner-logo {
    height: 22px;
    width: auto;
    display: block;
}

.partner-link:hover {
    opacity: 0.65;
}

/* Ab Tablet: Partnerlogos nebeneinander */
@media (min-width: 640px) {
    .footer-partners {
        flex-direction: row;
        gap: 1.6rem;
    }
}

/* ---------- 13. KARTE (Kontakt) ---------- */

#map {
    height: 380px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 1.5rem 0;
}
