/* =============================================================
   FCG Sonnefeld Mediathek – app.css
   ============================================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ---- Font Awesome Icons (self-hosted) ---- */
.icon { vertical-align: -0.1em; flex-shrink: 0; }

:root {
    --primary:       #4284b0;
    --primary-dark:  #3470a0;
    --primary-light: #e8f2f9;
    --accent:        #7cb94e;
    --accent-dark:   #6aa33e;
    --bg:            #f5f7fa;
    --surface:       #ffffff;
    --text:          #1a2332;
    --text-muted:    #6b7280;
    --text-faint:    #9ca3af;
    --border:        #e5e7eb;
    --border-focus:  #4284b0;
    --radius:        12px;
    --radius-sm:     8px;
    --shadow:        0 1px 4px rgba(0,0,0,.07);
    --shadow-md:     0 4px 16px rgba(0,0,0,.10);
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
}
a { color: var(--primary); }
img { display: block; max-width: 100%; }

/* ---- Header ---- */
.site-header {
    position: sticky; top: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
    z-index: 100;
}
.header-inner {
    max-width: 1100px; margin: 0 auto; padding: 0 20px;
    height: 60px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.header-logo img { height: 34px; width: auto; }
.header-nav { display: flex; gap: 24px; }
.header-nav a {
    font-size: 14px; font-weight: 500; color: var(--text-muted);
    text-decoration: none; transition: color .15s;
}
.header-nav a:hover, .header-nav a.active { color: var(--primary); }

/* ---- Layout ---- */
.main-wrap {
    max-width: 1100px; margin: 0 auto; padding: 32px 20px 60px;
}
.back-link {
    display: inline-block; font-size: 14px; color: var(--text-muted);
    text-decoration: none; margin-bottom: 24px; transition: color .15s;
}
.back-link:hover { color: var(--primary); }

/* ---- Hero / Suche ---- */
.hero-section { margin-bottom: 24px; }
.hero-title { font-size: 26px; font-weight: 700; margin-bottom: 16px; }
.search-box { position: relative; }
.search-box input {
    width: 100%; padding: 12px 18px 12px 46px;
    border: 1.5px solid var(--border); border-radius: 50px;
    font-size: 15px; font-family: inherit; color: var(--text);
    background: #fff; outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.search-box input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(66,132,176,.14);
}
.search-icon {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none;
    display: flex; align-items: center;
}

/* ---- Filter-Leiste ---- */
.filter-bar {
    display: flex; gap: 8px; flex-wrap: wrap;
    align-items: center; margin-bottom: 28px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 10px 14px;
    box-shadow: var(--shadow);
}
.filter-bar select,
.filter-bar input[type="date"] {
    padding: 7px 12px; border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px; font-family: inherit; color: var(--text);
    background: #fff; cursor: pointer; outline: none; transition: border-color .2s;
}
.filter-bar select:focus,
.filter-bar input[type="date"]:focus { border-color: var(--border-focus); }
.filter-reset {
    font-size: 13px; color: var(--text-muted); text-decoration: none;
    padding: 7px 10px; border-radius: var(--radius-sm); transition: color .15s;
}
.filter-reset:hover { color: var(--primary); }

/* ---- Toolbar ---- */
.results-toolbar {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 18px;
}
.results-count { font-size: 13px; color: var(--text-muted); }
.view-toggle { display: flex; gap: 4px; }
.view-btn {
    padding: 6px 11px; border: 1px solid var(--border); border-radius: 6px;
    background: #fff; cursor: pointer; font-size: 15px; color: var(--text-muted);
    transition: all .15s; line-height: 1;
}
.view-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- Raster-Ansicht ---- */
.sermon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 20px;
}
.sermon-grid .sermon-card {
    background: var(--surface); border-radius: var(--radius);
    border: 1px solid var(--border); box-shadow: var(--shadow);
    overflow: hidden; text-decoration: none; color: inherit; display: block;
    transition: transform .2s, box-shadow .2s;
}
.sermon-grid .sermon-card:hover {
    transform: translateY(-3px); box-shadow: var(--shadow-md);
}
.sermon-grid .card-thumb {
    width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
}
.sermon-grid .card-thumb-placeholder {
    width: 100%; aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.7);
}
.sermon-grid .card-body { padding: 14px 16px; }
.sermon-grid .card-speaker {
    font-size: 12px; font-weight: 600; color: var(--primary);
    text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px;
}
.sermon-grid .card-title {
    font-size: 15px; font-weight: 600; line-height: 1.4; margin-bottom: 8px;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.sermon-grid .card-meta {
    font-size: 12px; color: var(--text-muted);
    display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 6px;
}
.sermon-grid .card-series {
    font-size: 12px; color: var(--text-muted); margin-bottom: 6px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sermon-grid .card-rating {
    display: flex; align-items: center; gap: 4px; margin-top: 4px;
}

/* ---- Listen-Ansicht ---- */
.sermon-list { display: flex; flex-direction: column; gap: 8px; }
.sermon-list .sermon-card {
    display: flex; align-items: center; gap: 14px; padding: 12px 16px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); box-shadow: var(--shadow);
    text-decoration: none; color: inherit;
    transition: box-shadow .15s, border-color .15s;
}
.sermon-list .sermon-card:hover { box-shadow: var(--shadow-md); border-color: #b9d0e4; }
.sermon-list .list-num {
    font-size: 13px; font-weight: 600; color: var(--text-faint);
    min-width: 22px; text-align: right; flex-shrink: 0;
}
.sermon-list .list-thumb {
    width: 60px; height: 60px; border-radius: 8px; flex-shrink: 0;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: #fff;
}
.sermon-list .list-thumb img {
    width: 60px; height: 60px; object-fit: cover; border-radius: 8px;
}
.sermon-list .list-body { flex: 1; min-width: 0; }
.sermon-list .list-title {
    font-size: 15px; font-weight: 600; margin-bottom: 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sermon-list .list-meta {
    font-size: 12px; color: var(--text-muted);
    display: flex; gap: 12px; flex-wrap: wrap;
}
.sermon-list .list-rating { flex-shrink: 0; }

/* ---- Sterne ---- */
.star-filled { color: #f59e0b; }
.star-empty  { color: #d1d5db; }
.stars       { font-size: 13px; letter-spacing: 1px; }
.rating-count { font-size: 12px; color: var(--text-muted); }

/* ---- Pagination ---- */
.pagination {
    display: flex; gap: 6px; justify-content: center;
    margin-top: 36px; flex-wrap: wrap;
}
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 10px;
    border-radius: 8px; font-size: 14px; text-decoration: none;
    border: 1px solid var(--border); color: var(--text); transition: all .15s;
}
.pagination a:hover  { border-color: var(--primary); color: var(--primary); }
.pg-current { background: var(--primary); color: #fff !important; border-color: var(--primary) !important; }
.pg-dots    { border: none !important; color: var(--text-faint); }

/* ---- Empty State ---- */
.empty-state { text-align: center; padding: 64px 20px; color: var(--text-muted); }
.empty-state-icon { margin-bottom: 14px; color: var(--text-faint); }
.empty-state p { font-size: 15px; }

/* ---- Reihen-Übersicht (index.php) ---- */
.series-section { margin-top: 56px; }
.section-title { font-size: 20px; font-weight: 700; margin-bottom: 20px; }
.series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}
.series-card {
    display: block; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; text-decoration: none;
    color: inherit; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.series-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.series-thumb { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.series-thumb-placeholder {
    width: 100%; aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, #2d6a9a, #4284b0);
    display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.7);
}
.series-info { padding: 10px 12px; }
.series-name {
    font-size: 14px; font-weight: 600; margin-bottom: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.series-count { font-size: 12px; color: var(--text-muted); }

/* ---- Predigt-Detail (predigt.php) ---- */
.detail-hero {
    display: grid; grid-template-columns: 260px 1fr;
    gap: 32px; margin-bottom: 28px; align-items: start;
}
.detail-thumb-wrap { border-radius: var(--radius); overflow: hidden; }
.detail-thumb { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.detail-thumb-placeholder {
    width: 100%; aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex; align-items: center; justify-content: center;
    font-size: 72px; border-radius: var(--radius);
}
.detail-info { display: flex; flex-direction: column; gap: 10px; }
.detail-series-link {
    display: inline-block; font-size: 12px; font-weight: 600; color: var(--primary);
    text-decoration: none; background: var(--primary-light);
    padding: 4px 12px; border-radius: 20px; align-self: flex-start;
    transition: background .15s;
}
.detail-series-link:hover { background: #cce0f0; }
.detail-title { font-size: 26px; font-weight: 700; line-height: 1.3; }
.detail-meta {
    display: flex; flex-wrap: wrap; gap: 10px 20px;
    font-size: 14px; color: var(--text-muted);
}
.meta-speaker { font-weight: 600; color: var(--primary); }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: 12px; background: #f0f4f8; color: var(--text-muted);
    text-decoration: none; border: 1px solid var(--border); transition: all .15s;
}
.tag:hover { background: var(--primary-light); color: var(--primary); border-color: #b9d0e4; }
.detail-rating-display {
    display: flex; align-items: center; gap: 6px; font-size: 18px;
}
.rating-text { font-size: 13px; color: var(--text-muted); }

/* ---- Audio Player ---- */
.audio-section {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px 24px;
    margin-bottom: 20px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.audio-section audio {
    flex: 1; min-width: 200px; height: 44px; accent-color: var(--primary);
}
.btn-download {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px; background: var(--accent); color: #fff;
    border-radius: var(--radius-sm); text-decoration: none;
    font-size: 14px; font-weight: 500; white-space: nowrap;
    transition: background .15s; flex-shrink: 0;
}
.btn-download:hover { background: var(--accent-dark); color: #fff; }
.download-size { font-size: 12px; opacity: .85; }

/* ---- Beschreibung ---- */
.detail-description {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 22px 24px; margin-bottom: 20px;
}
.detail-description h2 { font-size: 16px; font-weight: 600; margin-bottom: 10px; }
.detail-description p { font-size: 15px; color: var(--text-muted); line-height: 1.7; }

/* ---- Bewertungs-Widget ---- */
.rating-section {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px; text-align: center;
}
.rating-section h2 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.rating-hint { font-size: 14px; color: var(--text-muted); margin-bottom: 14px; }
.star-input { display: flex; justify-content: center; gap: 4px; }
.star-btn {
    font-size: 38px; color: #d1d5db;
    background: none; border: none; cursor: pointer;
    transition: color .1s, transform .1s; line-height: 1; padding: 4px;
}
.star-btn.hovered { color: #f59e0b; transform: scale(1.15); }
.rating-consent-hint, .rating-done {
    font-size: 14px; color: var(--text-muted); padding: 10px 0;
}
.rating-done { color: var(--accent); font-weight: 500; }

/* ---- Reihen-Detail (reihe.php) ---- */
.series-hero {
    display: grid; grid-template-columns: 220px 1fr;
    gap: 32px; margin-bottom: 36px; align-items: start;
}
.series-hero-thumb-wrap { border-radius: var(--radius); overflow: hidden; }
.series-hero-thumb { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius); }
.series-hero-thumb-placeholder {
    width: 100%; aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.7); border-radius: var(--radius);
}
.series-hero-info { display: flex; flex-direction: column; gap: 8px; }
.series-hero-label {
    font-size: 11px; font-weight: 700; color: var(--primary);
    text-transform: uppercase; letter-spacing: .1em;
}
.series-hero-title { font-size: 28px; font-weight: 700; line-height: 1.3; }
.series-hero-speaker { font-size: 15px; color: var(--text-muted); }
.series-hero-desc { font-size: 15px; color: var(--text-muted); line-height: 1.6; }
.series-hero-count { font-size: 14px; color: var(--text-faint); }
.series-sermon-list .list-num { display: flex; }

/* ---- Cookie-Banner ---- */
.cookie-banner {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; border-top: 2px solid var(--primary);
    padding: 14px 24px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; z-index: 1000;
    box-shadow: 0 -2px 12px rgba(0,0,0,.08);
}
.cookie-banner p { font-size: 13px; color: var(--text-muted); margin: 0; flex: 1; }
.cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-cookie-accept {
    padding: 8px 18px; background: var(--primary); color: #fff;
    border: none; border-radius: 8px; font-size: 13px; font-weight: 500;
    cursor: pointer; font-family: inherit; transition: background .15s;
}
.btn-cookie-accept:hover { background: var(--primary-dark); }
.btn-cookie-decline {
    padding: 8px 14px; background: transparent; color: var(--text-muted);
    border: 1px solid var(--border); border-radius: 8px;
    font-size: 13px; cursor: pointer; font-family: inherit; transition: background .15s;
}
.btn-cookie-decline:hover { background: #f3f4f6; }

/* ---- Footer ---- */
.site-footer {
    border-top: 1px solid var(--border); padding: 20px;
    text-align: center; font-size: 13px; color: var(--text-faint);
}
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--primary); }

/* ---- Responsiv ---- */
@media (max-width: 768px) {
    .detail-hero  { grid-template-columns: 1fr; }
    .detail-thumb-wrap { max-width: 220px; }
    .series-hero  { grid-template-columns: 1fr; }
    .series-hero-thumb-wrap { max-width: 180px; }
    .detail-title { font-size: 22px; }
    .series-hero-title { font-size: 22px; }
    .audio-section { flex-direction: column; align-items: stretch; }
    .audio-section audio { width: 100%; }
}
@media (max-width: 540px) {
    .sermon-grid { grid-template-columns: 1fr 1fr; }
    .header-nav  { display: none; }
    .cookie-banner { flex-direction: column; align-items: flex-start; }
    .series-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .hero-title  { font-size: 22px; }
}
@media (max-width: 380px) {
    .sermon-grid { grid-template-columns: 1fr; }
}

/* ---- Tag-Vorschläge ---- */
.tag-suggestions-wrap { margin-bottom: 28px; }
.suggestions-label {
    display: block;
    font-size: 11px; font-weight: 700;
    color: var(--text-faint);
    text-transform: uppercase; letter-spacing: .08em;
    margin-bottom: 9px;
}
.tag-suggestions {
    display: flex; flex-wrap: wrap; gap: 7px;
}
.tag-pill {
    display: inline-block; padding: 5px 13px; border-radius: 20px;
    font-size: 13px; font-weight: 500;
    background: #fff; color: var(--text-muted);
    border: 1px solid var(--border); text-decoration: none;
    transition: all .15s; white-space: nowrap;
}
.tag-pill:hover { background: var(--primary-light); color: var(--primary); border-color: #b9d0e4; }
.tag-pill-active { background: var(--primary); color: #fff !important; border-color: var(--primary); }
.tag-pill-active:hover { background: var(--primary-dark); }
.tag-pill-clear { color: var(--text-faint); border-style: dashed; }
.tag-pill-clear:hover { color: #ef4444; border-color: #ef4444; background: #fff5f5; }

/* ---- Karten: Position + Footer ---- */
.sermon-grid .sermon-card { position: relative; }
.sermon-list .sermon-card { position: relative; }
.card-footer {
    display: flex; align-items: center; gap: 10px;
    margin-top: 8px; min-height: 20px;
    font-size: 12px; color: var(--text-muted);
}
.card-plays { display: flex; align-items: center; gap: 2px; }
.card-rating-mini { display: flex; align-items: center; gap: 3px; margin-left: auto; }
.card-rating-mini .star-filled,
.card-rating-mini .star-empty { font-size: 11px; }
.card-rating-val { font-size: 11px; color: var(--text-muted); }

/* ---- Teilen-Button (Karte) ---- */
.card-share-btn {
    position: absolute; top: 8px; right: 8px; z-index: 2;
    display: flex; align-items: center; justify-content: center;
    width: 30px; height: 30px;
    background: rgba(255,255,255,.92); border: 1px solid var(--border);
    border-radius: 50%; cursor: pointer; color: var(--text-muted);
    opacity: 0; transition: opacity .15s, background .15s, color .15s;
    user-select: none;
}
.sermon-card:hover .card-share-btn,
.card-share-btn:focus { opacity: 1; outline: none; }
.card-share-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.card-share-btn.copied { background: var(--accent) !important; color: #fff !important; border-color: var(--accent) !important; opacity: 1 !important; font-size: 13px; font-weight: 600; }
.sermon-list .card-share-btn { display: none; }

/* ---- Teilen-Button (Detail) ---- */
.detail-actions { margin-top: 6px; }
.btn-share {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 16px; background: #f0f4f8;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 13px; font-family: inherit; color: var(--text-muted);
    cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.btn-share:hover { background: var(--primary-light); color: var(--primary); border-color: #b9d0e4; }
.btn-share.copied { background: #dcfce7; color: #166534; border-color: #86efac; }

/* ---- Wiedergaben (Detail) ---- */
.detail-plays { color: var(--text-faint); }
