/* PS Kochbuch v2.3.0 — Grid-Layout */

/* ═══════════════════════════════════════════════════════
   LAYOUT-SKELETT
   #ps-kb-wrapper → flex-Kind von #main (Flex-Kaskade)
   ═══════════════════════════════════════════════════════ */
#ps-kb-wrapper {
    flex: 1 1 0;
    min-height: 0;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Untere Leiste: Suchbutton fix + scrollbare Nav */
#ps-kb-nav-bar {
    flex-shrink: 0;
    display: flex;
    align-items: stretch;
    background: var(--ps-nav-bg, rgba(0,0,0,0.85));
}
/* Nav nimmt den restlichen Platz, Ticker läuft darin */
#ps-kb-nav-bar #ps-kb-nav {
    flex: 1 1 0;
    min-width: 0;
    background: transparent;
}

/* Suchbutton: fix links, nie Teil des Tickers */
#ps-kb-search-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    background: none;
    border: none;
    border-right: 1px solid rgba(255,255,255,.1);
    color: rgba(255,255,255,.65);
    font-size: 15px;
    cursor: pointer;
    transition: color .2s, background .2s;
    padding: 0;
}
#ps-kb-search-btn:hover { color: var(--ps-accent, #c9a96e); background: rgba(255,255,255,.05); }

/* Hauptbereich: nur Grid, kein Topbar */
#ps-kb-main {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ═══════════════════════════════════════════════════════
   REZEPT-RASTER — kein Scrollen, kein Overflow
   Spalten + Zeilen + Kartengrösse werden per JS gesetzt
   ═══════════════════════════════════════════════════════ */
#ps-kb-grid-wrap {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#ps-kb-grid {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    padding: 6px;
    display: grid;
    gap: 6px;
    /* Spalten/Zeilen/Kartenhöhe kommen per JS */
}
/* Seitennavigation */
#ps-kb-pages {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 5px 0 3px;
    min-height: 20px;
}
.ps-kb-page-dot {
    width: 6px; height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,.2);
    transition: background .2s, width .2s;
    cursor: pointer;
    flex-shrink: 0;
}
.ps-kb-page-dot.active {
    background: var(--ps-accent, #c9a96e);
    width: 20px;
}

/* ── Rezept-Karte: Bild oben, Text darunter ──────────
   Feste Größe kommt vom Grid (grid-auto-rows + minmax)  */
.ps-kb-card {
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: #232323;
    box-shadow: 0 3px 12px rgba(0,0,0,.5);
    border: 1px solid rgba(255,255,255,.07);
    transition: transform .2s ease, box-shadow .2s ease;
    display: flex;
    flex-direction: column;
}
.ps-kb-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,.7);
    border-color: rgba(201,169,110,.3);
}

/* Bild: 65% der Kartenhöhe */
.ps-kb-card-img {
    flex: 0 0 65%;
    background-size: cover;
    background-position: center;
    background-color: #1a1a1a;
    position: relative;
}
/* Overlay nur als subtiler Schutz — kein Gradient über Text */
.ps-kb-card-overlay { display: none; }

/* Text-Bereich: 35% der Kartenhöhe, volle Farbe */
.ps-kb-card-body {
    flex: 1 1 0;
    padding: 6px 8px 5px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #232323;
}
.ps-kb-card-title {
    color: #fff !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    margin: 0 0 3px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ps-kb-card-meta {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
}
.ps-kb-card-meta span {
    font-size: 8px;
    color: var(--ps-accent, #c9a96e);
    line-height: 1.4;
}
.ps-kb-card-flag { font-size: 11px !important; line-height: 1 !important; }

/* Video-Badge auf dem Bild */
.ps-kb-play-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(201,169,110,.88);
    color: #0a0806;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
}

/* ═══════════════════════════════════════════════════════
   SUCH-SCREEN
   ═══════════════════════════════════════════════════════ */
#ps-kb-search-overlay {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #0a0806;
    overflow: hidden;
}
#ps-kb-search-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(201,169,110,.15);
}
#ps-kb-search-back {
    background: none;
    border: none;
    color: var(--ps-accent, #c9a96e);
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px 4px 0;
    flex-shrink: 0;
    line-height: 1;
}
#ps-kb-search-input-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}
#ps-kb-search-input {
    width: 100%;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(201,169,110,.25);
    border-radius: 20px;
    padding: 9px 36px 9px 16px;
    font-size: 14px;
    color: #fff;
    outline: none;
    transition: border-color .2s;
    font-family: inherit;
}
#ps-kb-search-input:focus { border-color: var(--ps-accent, #c9a96e); }
#ps-kb-search-input::placeholder { color: rgba(255,255,255,.35); font-style: italic; }
#ps-kb-search-clear {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: rgba(255,255,255,.45);
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
#ps-kb-search-body {
    flex: 1 1 0;
    overflow-y: auto;
}
.ps-kb-search-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px 8px;
}
.ps-kb-search-section-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,255,255,.35);
}
#ps-kb-search-last-clear {
    background: none;
    border: none;
    color: var(--ps-accent, #c9a96e);
    font-size: 11px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}
#ps-kb-search-last-query { padding: 0 18px 10px; }
.ps-kb-search-last-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(201,169,110,.12);
    border: 1px solid rgba(201,169,110,.25);
    border-radius: 20px;
    padding: 6px 14px;
    color: var(--ps-accent, #c9a96e);
    font-size: 13px;
    cursor: pointer;
}
.ps-kb-search-kat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    color: rgba(255,255,255,.75);
    font-size: 13px;
    cursor: pointer;
    transition: background .15s;
    text-decoration: none;
}
.ps-kb-search-kat-row:hover { background: rgba(201,169,110,.08); color: #fff; text-decoration: none; }
.ps-kb-search-arrow { color: rgba(255,255,255,.3); font-size: 18px; }
#ps-kb-search-results { padding: 0 0 10px; }
.ps-kb-search-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 18px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    cursor: pointer;
    transition: background .15s;
}
.ps-kb-search-item:hover { background: rgba(201,169,110,.1); }
.ps-kb-search-thumb {
    width: 48px; height: 48px;
    border-radius: 8px; object-fit: cover; flex-shrink: 0;
}
.ps-kb-search-thumb-ph {
    width: 48px; height: 48px;
    border-radius: 8px; background: #222;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3em; flex-shrink: 0;
}
.ps-kb-search-info { flex: 1; min-width: 0; }
.ps-kb-search-titel { font-weight: 600; font-size: 14px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-kb-search-kat   { font-size: 11px; color: var(--ps-accent, #c9a96e); margin-top: 2px; }

/* ═══════════════════════════════════════════════════════
   DETAIL-ANSICHT
   ═══════════════════════════════════════════════════════ */
#ps-kb-detail {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #1a1a1a;
}

/* ── Badges-Zeile: Pfeil + Text, vertikal zentriert ─── */
.ps-kb-badges-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

/* ── Zurück-Button: kleines Quadrat ─────────────────── */
#ps-kb-detail-back {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    color: var(--ps-accent, #c9a96e);
    font-size: 11px;
    cursor: pointer;
    width: 18px; height: 18px;
    border-radius: 3px;
    display: flex; align-items: center; justify-content: center;
    font-family: inherit;
    flex-shrink: 0;
    transition: background .2s;
    padding: 0; line-height: 1;
}
#ps-kb-detail-back:hover { background: rgba(201,169,110,.2); }

/* Kategorie / Herkunft als einfacher Text */
.ps-kb-kat-label {
    font-size: 11px;
    color: rgba(255,255,255,.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: .3px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Flaggen-Bild */
.ps-kb-flag {
    display: inline-block;
    width: 20px; height: 15px;
    vertical-align: middle;
    border-radius: 2px;
    object-fit: cover;
    flex-shrink: 0;
}
.ps-kb-card-meta .ps-kb-flag {
    width: 14px; height: 10px;
}

/* ── Hero: Bild links 50% | Info rechts 50% ────────── */
#ps-kb-detail-hero {
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    height: 48%;          /* mehr Platz ohne Topbar */
    background: #111;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

/* Slideshow links */
#ps-kb-slides-col {
    flex: 0 0 50%;
    display: flex;
    flex-direction: column;
}
#ps-kb-slides-wrap {
    flex: 1 1 auto;
    position: relative;
    overflow: hidden;
    background: #000;
}
#ps-kb-slides {
    display: flex;
    width: 100%; height: 100%;
    will-change: transform;
    transition: transform .38s cubic-bezier(.4,0,.2,1);
}
.ps-kb-slide {
    flex-shrink: 0;
    width: 100%; height: 100%;
}
.ps-kb-slide-img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
}
.ps-kb-slide-video { width: 100%; height: 100%; border: none; display: block; }
#ps-kb-video-stop {
    padding: 1px 10px;
    background: rgba(160,0,0,0.85);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    line-height: 16px;
    height: 16px;
    transition: background 0.2s;
}
#ps-kb-video-stop:hover { background: #c0392b; }
.ps-kb-slide-thumb {
    width: 100%; height: 100%;
    position: relative; cursor: pointer; background: #000;
}
.ps-kb-slide-thumb img {
    width: 100%; height: 100%;
    object-fit: cover; opacity: .75;
}
.ps-kb-slide-play {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
}
.ps-kb-slide-play-btn {
    width: 54px; height: 54px; border-radius: 50%;
    background: rgba(201,169,110,.9); color: #0a0806;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; box-shadow: 0 4px 20px rgba(0,0,0,.5);
}

/* Pfeile: ausgeblendet — Navigation per Wischen + Dots */
#ps-kb-slides-prev, #ps-kb-slides-next { display: none !important; }

/* Nav-Leiste: Dots + Stop-Button */
#ps-kb-slides-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 4px 0 2px;
    min-height: 18px;
}
.ps-kb-slide-dot {
    width: 6px; height: 6px; border-radius: 3px;
    background: rgba(255,255,255,.4); transition: background .2s, width .2s; cursor: pointer;
}
.ps-kb-slide-dot.active { background: var(--ps-accent, #c9a96e); width: 18px; }

/* Info rechts: oben bündig mit Bild, dann Titel, Beschreibung, Meta */
#ps-kb-detail-hero-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 6px 14px 10px;
    overflow: hidden;
    min-width: 0;
}
.ps-kb-hero-top { flex-shrink: 0; }
.ps-kb-badges {
    display: flex; gap: 5px; flex-wrap: nowrap; margin-bottom: 8px;
    overflow: hidden;
}
.ps-kb-badge {
    font-size: 10px; padding: 3px 10px;
    border-radius: 12px; font-weight: 600;
    white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.ps-kb-badge-kat      { background: rgba(201,169,110,.15); color: var(--ps-accent,#c9a96e); }
.ps-kb-badge-herkunft { background: rgba(41,128,185,.15);  color: #5dade2; flex-shrink: 0; }

.ps-kb-hero-mid {
    flex-shrink: 0;
    margin-bottom: 8px;
}
.ps-kb-hero-mid h2 {
    font-size: clamp(14px, 2.8vw, 20px) !important;
    font-weight: 700 !important;
    color: #fff !important;
    margin: 0 !important;
    line-height: 1.25 !important;
}

/* Beschreibung: scrollbar in der rechten Spalte */
.ps-kb-hero-desc {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    font-size: 12px;
    color: rgba(255,255,255,.55);
    line-height: 1.6;
    margin-bottom: 8px;
    padding-right: 4px;
}
.ps-kb-hero-desc::-webkit-scrollbar { width: 2px; }
.ps-kb-hero-desc::-webkit-scrollbar-thumb { background: rgba(201,169,110,.2); }

.ps-kb-hero-bottom {
    flex-shrink: 0;
    border-top: 1px solid rgba(255,255,255,.08);
    padding-top: 8px;
}
.ps-kb-detail-meta {
    display: flex; flex-wrap: wrap; gap: 10px;
    font-size: 11px; color: rgba(255,255,255,.5);
}
.ps-kb-detail-meta span { display: flex; align-items: center; gap: 3px; }

/* ── Scrollbarer Bereich: volle Breite ──────────────── */
#ps-kb-detail-scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 18px 28px;
    background: #1a1a1a;
}
#ps-kb-detail-scroll::-webkit-scrollbar { width: 3px; }
#ps-kb-detail-scroll::-webkit-scrollbar-thumb { background: rgba(201,169,110,.2); }

.ps-kb-detail-beschreibung {
    font-size: 13px !important; color: rgba(255,255,255,.6) !important;
    line-height: 1.7 !important;
    margin-bottom: 20px !important;
    padding-bottom: 16px !important;
    border-bottom: 1px solid rgba(255,255,255,.07) !important;
}

/* Zutaten + Zubereitung nebeneinander */
.ps-kb-detail-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}
@media (max-width: 400px) { .ps-kb-detail-cols { grid-template-columns: 1fr; } }

.ps-kb-detail-section h4 {
    font-size: 10px; font-weight: 700;
    color: var(--ps-accent, #c9a96e);
    text-transform: uppercase; letter-spacing: 2px;
    margin: 0 0 10px; padding-bottom: 6px;
    border-bottom: 1px solid rgba(201,169,110,.2);
}
.ps-kb-zutat-gruppe {
    font-weight: 700; color: rgba(255,255,255,.35);
    margin: 10px 0 4px; font-size: 10px;
    text-transform: uppercase; letter-spacing: 1px;
}
.ps-kb-zutat-item {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    font-size: 12px; color: rgba(255,255,255,.75);
    padding: 2px 0;
    line-height: 1.5;
}
.ps-kb-zutat-bullet {
    color: var(--ps-accent, #c9a96e);
    flex-shrink: 0;
    line-height: 1.5;
    font-size: 12px;
}
.ps-kb-zutat-item > span:last-child {
    flex: 1;
}
.ps-kb-schritt-gruppe {
    font-weight: 700; color: rgba(255,255,255,.35);
    margin: 14px 0 6px; font-size: 10px;
    text-transform: uppercase; letter-spacing: 1px;
}
.ps-kb-schritt { display: flex; gap: 12px; margin-bottom: 10px; align-items: flex-start; }
.ps-kb-schritt-nr {
    background: var(--ps-accent, #c9a96e); color: #0a0806;
    width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; flex-shrink: 0; margin-top: 2px;
}
.ps-kb-schritt-text { font-size: 12px; color: rgba(255,255,255,.7); line-height: 1.6; }

.ps-kb-cta-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.ps-kb-cta {
    padding: 10px 20px; border-radius: 4px; font-size: 12px; font-weight: 600;
    letter-spacing: 1px; text-transform: uppercase;
    text-decoration: none; border: none; cursor: pointer; transition: opacity .2s;
    display: inline-block;
}
.ps-kb-cta-reservierung { background: var(--ps-accent, #c9a96e); color: #0a0806; }
.ps-kb-cta-reservierung:hover { opacity: .85; color: #0a0806; }
.ps-kb-cta-feinkost { background: #27ae60; color: #fff; }
.ps-kb-cta-feinkost:hover { opacity: .85; color: #fff; }
