/* ================================================================
   Pflanzen in der Bibel — Botanisches Design
   ================================================================ */

:root {
    --green-deep:    #2D5016;
    --green-mid:     #4A7C2F;
    --green-light:   #6BA547;
    --green-pale:    #C5D5A8;
    --green-bg:      #EAF0DC;
    --earth:         #8B7355;
    --earth-light:   #C4A882;
    --bg:            #F7F5EE;
    --bg-card:       #FFFDF7;
    --text:          #2C2C2C;
    --text-muted:    #6B6B5E;
    --border:        #D4DEC0;
    --shadow:        rgba(45, 80, 22, 0.13);
}

/* ================================================================
   Reset & Basis
   ================================================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.75;
    min-height: 100vh;
    /* Dezentes botanisches Hintergrundlicht */
    background-image:
        radial-gradient(ellipse at 15% 8%,  rgba(107, 165, 71, 0.07) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 92%, rgba(45,  80,  22, 0.06) 0%, transparent 55%);
}

/* ================================================================
   Seitensystem (Single-Page-Navigation)
   ================================================================ */

.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

.page.slide-from-right {
    animation: slideFromRight 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.page.slide-from-left {
    animation: slideFromLeft 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideFromRight {
    from { transform: translateX(40px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

@keyframes slideFromLeft {
    from { transform: translateX(-40px); opacity: 0; }
    to   { transform: translateX(0);     opacity: 1; }
}

.page-content {
    max-width: 920px;
    margin: 0 auto;
    padding: 2.5rem 1.75rem 5rem;
}

/* ================================================================
   Übersichtsseite — Header
   ================================================================ */

.site-header {
    text-align: center;
    padding: 3.5rem 1rem 3rem;
    border-bottom: 2px solid var(--green-pale);
    margin-bottom: 2.5rem;
    position: relative;
}

.site-header::before {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--green-mid), transparent);
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    border-radius: 2px;
}

.header-deco {
    font-size: 1.6rem;
    color: var(--green-light);
    line-height: 1.2;
    margin: 0.4rem 0;
    letter-spacing: 0.1em;
}

.site-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(2rem, 5.5vw, 3.4rem);
    color: var(--green-deep);
    font-weight: normal;
    letter-spacing: 0.02em;
    line-height: 1.15;
    margin: 0.6rem 0 0.4rem;
}

.site-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 0.5rem;
}

.site-footer {
    text-align: center;
    padding: 2rem 1rem 1.5rem;
    border-top: 1px solid var(--green-pale);
    margin-top: 2.5rem;
}

.impressum-link {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
}

.impressum-link:hover {
    color: var(--green-mid);
    text-decoration: underline;
}

/* ================================================================
   Übersichtsseite — Pflanzenliste
   ================================================================ */

.plant-list {
    list-style: none;
    display: grid;
    gap: 0.6rem;
}

.plant-link {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 5px solid var(--green-mid);
    border-radius: 0 8px 8px 0;
    text-decoration: none;
    color: var(--text);
    transition: background 0.18s ease, border-left-color 0.18s ease, transform 0.15s ease,
                box-shadow 0.18s ease;
    box-shadow: 0 1px 4px var(--shadow);
}

.plant-link:hover,
.plant-link:focus-visible {
    background: var(--green-bg);
    border-left-color: var(--green-deep);
    transform: translateX(4px);
    box-shadow: 0 3px 10px var(--shadow);
    outline: none;
}

.plant-number {
    font-family: Georgia, serif;
    font-size: 1rem;
    font-weight: bold;
    color: var(--green-mid);
    min-width: 2.2rem;
    flex-shrink: 0;
}

.plant-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.15rem;
    color: var(--green-deep);
}

/* ================================================================
   Pflanzen-Unterseiten — Header
   ================================================================ */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--green-mid);
    text-decoration: none;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--green-pale);
    border-radius: 5px;
    margin-bottom: 2rem;
    background: var(--bg-card);
    transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.back-link:hover,
.back-link:focus-visible {
    background: var(--green-bg);
    color: var(--green-deep);
    border-color: var(--green-mid);
    outline: none;
}

.plant-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--green-pale);
    margin-bottom: 2rem;
}

.plant-number-badge {
    font-family: Georgia, serif;
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--bg-card);
    background: var(--green-deep);
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px var(--shadow);
}

.plant-name {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.7rem, 4.5vw, 2.6rem);
    color: var(--green-deep);
    font-weight: normal;
    line-height: 1.2;
}

/* ================================================================
   Pflanzen-Unterseiten — Inhalt (Text + Bild)
   ================================================================ */

.plant-body {
    display: block;
}

/* Desktop: Bild rechts, Text links */
.plant-body.has-image {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 2.5rem;
    align-items: start;
}

/* Bild ist 1. Kind im HTML (gut für Mobile-first);
   auf Desktop per order nach rechts verschieben */
.plant-body.has-image .plant-gallery {
    order: 2;
    min-width: 0;  /* verhindert, dass Grid-Kind über Spaltengrenzen hinauswächst */
}

.plant-body.has-image .plant-text {
    order: 1;
    min-width: 0;
}

/* Galerie-Container */
.plant-gallery {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.plant-gallery.multi {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.plant-figure {
    margin: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow);
    border: 1px solid var(--border);
    background: var(--bg-card);
    position: relative;
    cursor: zoom-in;
}

.zoom-icon {
    position: absolute;
    bottom: 0.5rem;
    right: 0.6rem;
    font-size: 1.35rem;
    line-height: 1;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    pointer-events: none;
}

.plant-figure:focus {
    outline: 2px solid var(--green-mid);
    outline-offset: 2px;
}

/* ================================================================
   Lightbox
   ================================================================ */

#lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

#lightbox.open {
    display: flex;
}

#lightbox-img {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    object-fit: contain;
}

#lightbox-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s;
}

#lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.plant-image {
    display: block;
    width: 100%;
    height: auto;
}

.plant-text {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text);
    overflow-wrap: break-word;  /* lange Wörter ohne Leerzeichen umbrechen */
}

.plant-text p {
    margin-bottom: 1.1rem;
}

.plant-text p:last-child {
    margin-bottom: 0;
}

/* ================================================================
   Navigation (Vor / Zurück / Übersicht)
   ================================================================ */

.plant-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 7px;
    text-decoration: none;
    color: var(--green-deep);
    font-size: 0.9rem;
    white-space: nowrap;
    transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
    box-shadow: 0 1px 3px var(--shadow);
}

.nav-btn:hover,
.nav-btn:focus-visible {
    background: var(--green-bg);
    border-color: var(--green-mid);
    outline: none;
}

.nav-btn.disabled {
    visibility: hidden;
    pointer-events: none;
}

.overview-btn {
    background: var(--green-deep);
    color: var(--bg-card);
    border-color: var(--green-deep);
}

.overview-btn:hover,
.overview-btn:focus-visible {
    background: var(--green-mid);
    border-color: var(--green-mid);
    color: var(--bg-card);
}

.nav-arrow {
    font-size: 1.05rem;
    line-height: 1;
}

/* ================================================================
   Responsive — Mobile (≤ 680px)
   ================================================================ */

@media (max-width: 680px) {
    .page-content {
        padding: 1.5rem 1rem 3rem;
    }

    .site-header {
        padding: 2.5rem 0 2rem;
    }

    /* Bild über Text auf Mobile */
    .plant-body.has-image {
        grid-template-columns: 1fr;
    }

    .plant-body.has-image .plant-gallery {
        order: -1;  /* Bilder oben */
    }

    .plant-body.has-image .plant-text {
        order: 1;
    }

    .plant-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .plant-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-btn {
        justify-content: center;
        text-align: center;
    }

    .nav-btn.disabled {
        display: none;
    }
}

/* ================================================================
   Feinheiten
   ================================================================ */

/* Scrollbar (WebKit) */
::-webkit-scrollbar        { width: 8px; }
::-webkit-scrollbar-track  { background: var(--bg); }
::-webkit-scrollbar-thumb  { background: var(--green-pale); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--green-mid); }

/* Textmarkierung */
::selection {
    background: var(--green-pale);
    color: var(--green-deep);
}
