:root {
    --farbe-hintergrund: #1f2723;
    --farbe-text: #efe8d8;
    --farbe-karte: #2a342f;
    --farbe-link: #f2b8c6;
    --farbe-linie: #44524a;
    --rand: min(8vw, 7rem);
}

body {
    background-color: var(--farbe-hintergrund);
    color: var(--farbe-text);
    margin: 0;
    padding: 2rem clamp(1rem, 8vw, 8rem);
    font-family: system-ui, Helvetica, Arial, sans-serif;
    line-height: 1.7;
    min-height: 100vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    position: relative;
}

h1,
h2,
h3 {
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-weight: 400;
    letter-spacing: 0.03em;
}

.seitenname {
    grid-area: name;
    letter-spacing: 0.08em;
}

h1 {
    font-size: 2.2rem;
    line-height: 1.2;
}

h2 {
    font-size: 1.6rem;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

article h2:first-child {
    margin-top: 1rem;
}

h3 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

p {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
    max-width: 65ch;
}

a {
    color: var(--farbe-link);
    text-decoration: none;
}

p a {
    text-decoration: underline;
}

.kartenliste {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 1rem;
    list-style: none;
    padding: 0;
}

.kartenliste li {
    background-color: var(--farbe-karte);
    border: 1px solid var(--farbe-linie);
    border-radius: 1rem;
    padding: 0.9rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.kartenliste li::before {
    content: "";
    flex: none;
    width: 1.2rem;
    height: 1.2rem;
    background: url("bilder/liane_Basic/bluete.svg") no-repeat center / contain;
}

.kartenliste li a {
    color: var(--farbe-text);
}

.karte {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: 1rem;
}
.karte figure {
    margin: 0;
}

.karte figcaption {
    font-size: 0.9rem;
}

header {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "name nav"
        "titel titel";
    align-items: center;
    gap: 1rem;
}

.seitenname {
    grid-area: name;
}

nav {
    grid-area: nav;
}

header h1 {
    grid-area: titel;
    margin-top: 2rem;
}

header h1::before {
    content: "";
    display: inline-block;
    width: 2rem;
    height: 2rem;
    margin-right: 0.7rem;
    vertical-align: middle;
    background: url("bilder/liane_Basic/bluete.svg") no-repeat center / contain;
}

nav ul {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

main {
    flex: 1;
}

main> :first-child {
    margin-top: 0;
}

footer {
    position: relative;
    margin-top: 8rem;
    text-align: center;
    border-top: 1px solid var(--farbe-linie);
    padding-top: 1rem;
}

footer::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: 100%;
    width: 9rem;
    height: 8rem;
    background: url("bilder/liane_Basic/liane.webp") no-repeat left bottom / contain;
    pointer-events: none;
}

footer p {
    font-size: 0.9rem;
    max-width: none;
}

img {
    max-width: 100%;
    height: auto;
}
body::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: var(--rand);
    background-image: url("bilder/liane_Basic/pflanze-rand-dunkel.svg");
    background-repeat: repeat-y;
    background-size: 100% auto;
    top: calc(4.7rem + var(--rand) * 2.9833);
    pointer-events: none;
}
body::before {
    content: "";
    position: absolute;
    right: 0;
    top: calc(4.7rem - var(--rand) * 190 / 120);
    width: calc(var(--rand) * 534 / 120);
    height: calc(var(--rand) * 548 / 120);
    background-image: url("bilder/liane_Basic/pflanze-kopf-dunkel.svg");
    background-size: 100% 100%;
    pointer-events: none;
}
.figur {
    display: block;
    width: min(100%, 24rem);
    margin: 2rem 0;
}

/* Figur rechts neben dem Text, der Text fliesst links herum */
.sequenz {
    float: right;
    width: min(35%, 15rem);
    margin: 0 0 1rem 2rem;
}

.sequenz img {
    display: block;
    width: 100%;
}

/* verhindert, dass die Figur in den Footer ragt */
article::after {
    content: "";
    display: block;
    clear: both;
}

@media (max-width: 40rem) {
    body::before,
    body::after {
        display: none;
    }

    /* auf dem Handy: Figur mittig über dem Text */
    .sequenz {
        float: none;
        width: min(100%, 12rem);
        margin: 0 auto 1.5rem;
    }
}
/* Titel beginnt auf Höhe des Textes, die Blüte hängt links im Seitenrand */
@media (min-width: 40rem) {
    header h1 {
        position: relative;
    }

    header h1::before {
        position: absolute;
        right: 100%;
        top: 50%;
        transform: translateY(-50%);
        margin-right: 0.5rem;
    }
}
