/* ==========================================================================
   Planty of Gold Shelter - Styles
   Tokens aus den Mockups:
     Hintergrund  #9AB5FF (Periwinkle)
     Text         #FFFFFF
     Schrift      DIN Condensed (alles), Snug Low Compact Bold (nur Logo)
   ========================================================================== */

/* ---------- Fonts ---------- */
@font-face {
    font-family: 'DIN Condensed';
    src: url('../fonts/din-condensed_vf.woff2') format('woff2-variations'),
         url('../fonts/din-condensed_vf.woff') format('woff');
    font-weight: 400 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Snug Low Compact';
    src: url('../fonts/SnugLowCompact-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ---------- Basis ---------- */
:root {
    --bg: #9AB5FF;
    --fg: #FFFFFF;
    --card-img-bg: #FFFFFF;
    --font-body: 'DIN Condensed', 'Arial Narrow', sans-serif;
    --font-logo: 'Snug Low Compact', 'Arial Black', sans-serif;
    --content-max: 68rem; /* absolut (rem), damit 1.3rem-Font-Größen in .grid die Breite nicht strecken */
    --gutter: 3rem;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-body);
    font-weight: 400;
    min-height: 100vh;
    overflow-x: clip;
}

a {
    color: var(--fg);
}

/* ---------- Header ---------- */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    padding: 2.2rem 3rem 1.4rem;
    flex-wrap: wrap;
    max-width: var(--content-max);
    margin: 0 auto;
}

.header-brand {
    display: flex;
    align-items: flex-end;
    gap: 1.4rem;
    min-width: 0;
}

.brand-logo {
    font-family: var(--font-logo);
    font-weight: 700;
    font-size: clamp(2.4rem, 5.5vw, 4rem);
    line-height: 0.92;
    letter-spacing: 0.01em;
    text-transform: lowercase;
    text-align: left;
}

.brand-subtitle {
    font-size: 1.3em; /* wie Haupt-Fließtext; nur die Überschrift (Logo) ist größer */
    line-height: 1.35;
    max-width: 22rem;
}

.header-opening {
    text-align: left;
    font-size: 1.3em; /* wie Haupt-Fließtext; nur die Überschrift (Logo) ist größer */
    line-height: 1.45;
    align-self: flex-end; /* unten bündig mit Logo/Subtitle */
}

/* ---------- Ticker ---------- */
.ticker {
    overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, 0.55);
    border-bottom: 1px solid rgba(255, 255, 255, 0.55);
    padding: 0.55rem 1.5em;
    background: rgba(255, 255, 255, 0.06);
    white-space: nowrap;
    width: min(calc(100% - 2 * var(--gutter)), calc(var(--content-max) - 2 * var(--gutter)));
    margin: 0 auto;
}

.ticker-track {
    display: inline-block;
    white-space: nowrap;
    animation: ticker-scroll 60s linear infinite;
    will-change: transform;
}

@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.ticker:hover .ticker-track {
    animation-play-state: paused;
}

.ticker-chunk {
    display: inline-block;
    font-size: 1.3em; /* wie Haupt-Fließtext; nur die Überschrift (Logo) ist größer */
    letter-spacing: 0.02em;
}

/* Abstand zwischen den Wiederholungen des Ticker-Textes (keine automatischen Trennzeichen) */
.ticker-chunk {
    margin-right: 3rem;
}


/* ---------- Grid ---------- */
.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.6rem 2rem;
    padding: 2.4rem 3rem 3rem;
    max-width: var(--content-max);
    margin: 0 auto;
    font-size: 1.3rem; /* Fließtext-Grundeinstellung im Content-Bereich */
}

/* ---------- Karte ---------- */
.card {
    display: flex;
    align-items: stretch;
    gap: 1.1rem;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0.5em;
    text-align: left;
    color: inherit;
    font-family: inherit;
    width: 100%;
    border-radius: 6px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover,
.card:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 10px 26px rgba(30, 45, 120, 0.22);
    outline: 2px solid rgba(255, 255, 255, 0.7);
    outline-offset: 4px;
}

.card-img {
    flex: 0 0 50%;
    max-width: 50%;
    background: var(--card-img-bg);
    border-radius: 4px;
    overflow: hidden;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-text {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
    min-width: 0;
}

.card-name {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
}

.card-sub {
    font-size: 1.3rem;
    line-height: 1.2;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.92);
}

.card-more {
    margin-top: 1.4rem;
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.card:hover .card-more,
.card:focus-visible .card-more {
    text-decoration: none;
}

/* ---------- Seitenkopf im Content-Bereich (Happy End) ---------- */
.main-head {
    grid-column: 1 / -1; /* überspannt alle Grid-Spalten */
}
.main-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}
.back-link {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.15em;
    white-space: nowrap;
}
.back-link:hover {
    text-decoration: none;
}
/* Spalte mit Back-Link über der Überschrift bzw. nur Verweislink (Startseite) */
.main-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
}
.main-link {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}
.main-link:hover {
    text-decoration: none;
}
/* Happy-End-Link auf der Startseite: als Button erkennbar (grün wie das Badge) */
.happy-end-btn {
    display: inline-block;
    font-size: 1.3rem;
    font-weight: 700;
    background: #89ba10;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    padding: 0.5rem 1.3rem;
}
.happy-end-btn:hover {
    background: #75a10c;
}
.main-empty {
    grid-column: 1 / -1;
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
}

/* ---------- Happy-End-Badge im Pflanzendetail (unter der Beschreibung) ---------- */
.modal-badge {
    display: inline-block;
    font-family: var(--font-logo);
    font-size: 1rem;
    background: #89ba10;
    color: #fff;
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    align-self: flex-start;
    margin-top: 0.2rem;
}

/* ---------- Modal / Overlay ---------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 28, 80, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
    z-index: 50;
    animation: fade-in 0.18s ease;
}

.modal-backdrop[hidden] {
    display: none;
}

.modal {
    position: relative;
    background: var(--bg);
    color: var(--fg);
    width: min(880px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 8px;
    padding: 2.2rem 2.4rem 2.6rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    animation: pop-in 0.18s ease;
}

@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes pop-in {
    from { transform: scale(0.96); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 0.6rem;
    right: 0.9rem;
    background: none;
    border: none;
    color: var(--fg);
    font-size: 2.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.modal-close:hover,
.modal-close:focus-visible {
    background: rgba(255, 255, 255, 0.18);
    outline: none;
}

.modal-body {
    display: flex;
    gap: 2rem;
}

.modal-img {
    flex: 0 0 38%;
    max-width: 38%;
    background: var(--card-img-bg);
    border-radius: 4px;
    align-self: flex-start;
    overflow: hidden;
}

.modal-img img {
    width: 100%;
    height: auto;
    display: block;
}

.modal-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.modal-name {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.05;
}

.modal-character {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.92);
    margin-top: -0.4rem;
}

.modal-rows {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.35rem 1.2rem;
    font-size: 1.05rem;
}

.modal-rows dt {
    font-weight: 700;
    white-space: nowrap;
}

.modal-rows dd {
    font-weight: 400;
    word-break: break-word;
}

.modal-desc {
    font-size: 1.05rem;
    line-height: 1.45;
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    padding-top: 0.9rem;
}

/* ---------- Footer ---------- */
.site-footer {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    width: min(calc(100% - 2 * var(--gutter)), calc(var(--content-max) - 2 * var(--gutter)));
    margin: 0 auto;
    padding: 1.1rem 0 1.6rem;
    border-top: 4px solid rgba(255, 255, 255, 0.85);
}

.footer-brand {
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
}

.footer-brand:hover {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.footer-nav {
    display: flex;
    gap: 1.6rem;
    font-size: 1rem;
    margin-left: auto;
}

.footer-nav a {
    text-decoration: none;
}

.footer-nav a:hover {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.admin-link {
    position: absolute;
    bottom: 0.25rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    opacity: 0.5;
    text-decoration: none;
}

.admin-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.no-js {
    grid-column: 1 / -1;
    font-size: 1.3rem;
}

/* ---------- Responsive ---------- */
/* Desktop >= 900px: 3 Spalten */
@media (min-width: 900px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.6rem 2.4rem;
    }
}

/* Mobile < 600px: kompaktere Paddings */
@media (max-width: 600px) {
    :root {
        --gutter: 1.2rem;
    }
    .site-header {
        padding: 1.6rem 1.2rem 1rem;
    }
    .brand-subtitle {
        max-width: 100%;
        margin-bottom: -0.1em;
    }
    .grid {
        padding: 1.8rem 1.2rem 2.4rem;
        gap: 2.2rem;
    }
    .card {
        gap: 0.9rem;
    }
    .card-img {
        flex-basis: 50%;
        max-width: 50%;
        min-height: 180px;
    }
    .card-name {
        font-size: 1.5rem;
    }
    .card-sub {
        font-size: 1.3rem;
    }
    .modal {
        padding: 1.8rem 1.4rem 2rem;
    }
    .modal-body {
        flex-direction: column;
        gap: 1.4rem;
    }
    .modal-img {
        flex-basis: auto;
        max-width: 100%;
        max-height: 34vh;
    }
    .modal-img img {
        object-fit: cover;
        height: 34vh;
    }
    .ticker {
        padding: 0.55rem 1em;
    }
    .site-footer {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 0 1.2rem;
    }
    .admin-link {
        position: static;
        transform: none;
        width: 100%;
        text-align: center;
    }
    .footer-nav {
        width: 100%;
    }
}

