/* ============================================
   Basis & Reset – inspiriert von Thalia/Gorki
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color, #ffffff);
    color: var(--primary-color, #111111);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Container – großzügiger Weißraum */
.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: var(--container-spacing, 2rem) 2rem;
}

@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }
}

/* ============================================
   Typografie – dynamisch, mit Fallbacks
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading, 'Inter', system-ui);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin-top: 1.5rem; }
h3 { font-size: 1.5rem; margin-top: 1rem; }

p {
    margin-bottom: 1rem;
    color: #2c2c2c;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #666;
    text-decoration: underline;
}

/* ============================================
   Header & Navigation – clean, dezent
   ============================================ */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #eaeaea;
}

.main-nav ul.menu {
    display: flex;
    gap: 2rem;
    list-style: none;
    font-weight: 500;
}

.main-nav a {
    font-size: 1rem;
    letter-spacing: 0.01em;
}

.header-extras {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.search-inline {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.search-inline input {
    padding: 0.4rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 2rem;
    font-size: 0.9rem;
    background: white;
}

.user-links {
    display: flex;
    gap: 1rem;
}

.user-links a {
    font-size: 0.9rem;
    font-weight: 500;
}

.admin-link {
    background: #f0f0f0;
    padding: 0.2rem 0.7rem;
    border-radius: 2rem;
}

/* Responsive Navigation */
@media (max-width: 700px) {
    .main-header {
        flex-direction: column;
        align-items: stretch;
    }
    .main-nav ul.menu {
        justify-content: center;
        gap: 1rem;
        flex-wrap: wrap;
    }
    .header-extras {
        justify-content: space-between;
    }
}

/* ============================================
   Hero / Intro – zurückhaltend, viel Luft
   ============================================ */
.hero-block {
    text-align: center;
    padding: 4rem 1rem;
    margin-bottom: 3rem;
    background: #fafafa;
    border-radius: 2rem;
}

.hero-block h1 {
    margin-bottom: 0.5rem;
}

/* ============================================
   Grids – Podcasts, Episoden, ähnliche Inhalte
   ============================================ */
.podcast-grid, .episode-grid, .similar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

/* Karten – leichte Erhebung */
.podcast-card, .episode-card, .similar-card, .article-card {
    background: white;
    border-radius: 1.5rem;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02), 0 1px 2px rgba(0,0,0,0.03);
}

.podcast-card:hover, .episode-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 30px -12px rgba(0,0,0,0.08);
}

.podcast-cover, .episode-cover {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f2f2f2;
}

.episode-info, .podcast-content {
    padding: 1.2rem;
}

.podcast-title, .episode-card h4 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.podcast-description, .episode-card p {
    font-size: 0.9rem;
    color: #4a4a4a;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Buttons in Karten */
.btn-small, .play-btn {
    display: inline-block;
    background: none;
    border: 1px solid #ccc;
    padding: 0.3rem 1rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.75rem;
}

.play-btn:hover {
    background: #111;
    color: white;
    border-color: #111;
}

/* ============================================
   Detailseiten: Episode & Podcast
   ============================================ */
.podcast-header {
    text-align: center;
    margin-bottom: 3rem;
}
.podcast-cover-large {
    max-width: 220px;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
}

.episode-detail {
    max-width: 800px;
    margin: 0 auto;
}

.episode-detail h1 {
    margin-bottom: 0.5rem;
}

.audio-player audio {
    width: 100%;
    margin: 1.5rem 0;
}

.like-section {
    margin: 1rem 0;
}

.like-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 2rem;
    padding: 0.3rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
}
.like-btn.liked {
    background: #111;
    color: white;
    border-color: #111;
}

/* ============================================
   Redaktionsartikel – klare Lesbarkeit
   ============================================ */
.article-single {
    max-width: 780px;
    margin: 0 auto;
}
.article-single h1 {
    font-size: 2.4rem;
}
.article-single .meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}
.article-single .content {
    font-size: 1.05rem;
    line-height: 1.6;
}

/* ============================================
   Suchformular und Ergebnisse
   ============================================ */
.search-form {
    max-width: 600px;
    margin: 2rem auto;
    display: flex;
    gap: 0.5rem;
}
.search-form input {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 2rem;
    font-size: 1rem;
}
.result-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

/* ============================================
   Authentifizierungs-Boxen (Login/Register)
   ============================================ */
.auth-box {
    max-width: 480px;
    margin: 4rem auto;
    padding: 2rem;
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.02), 0 2px 4px rgba(0,0,0,0.02);
}
.auth-box input {
    width: 100%;
    padding: 0.7rem;
    margin: 0.5rem 0 1rem;
    border: 1px solid #ddd;
    border-radius: 2rem;
}
.auth-box button {
    width: 100%;
}

/* ============================================
   Playlists – Drag & Drop freundlich
   ============================================ */
.playlist-sortable {
    list-style: none;
    background: #f9f9f9;
    border-radius: 1rem;
    padding: 1rem;
}
.playlist-sortable li {
    background: white;
    margin-bottom: 0.5rem;
    padding: 0.8rem;
    border-radius: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    cursor: grab;
}
.playlist-sortable li:active { cursor: grabbing; }

/* ============================================
   Footer – dezent, viel Abstand nach oben
   ============================================ */
footer {
    margin-top: 5rem;
    padding: 2rem 0 1rem;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 0.85rem;
    color: #777;
}
.footer-menu {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    list-style: none;
    margin-top: 0.5rem;
}

/* ============================================
   Paginierung
   ============================================ */
.pagination {
    margin: 3rem 0 2rem;
    text-align: center;
}
.pagination a {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    margin: 0 0.2rem;
    border-radius: 2rem;
    border: 1px solid #ddd;
    color: #111;
}
.pagination a.active {
    background: #111;
    color: white;
    border-color: #111;
}

/* ============================================
   Admin-Tabellen – responsiv
   ============================================ */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 1rem;
    overflow: auto;
}
.admin-table th, .admin-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}
@media (max-width: 640px) {
    .admin-table, .admin-table tbody, .admin-table tr, .admin-table td {
        display: block;
    }
    .admin-table tr {
        margin-bottom: 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 0.75rem;
        padding: 0.5rem;
    }
    .admin-table td {
        border: none;
        padding: 0.4rem 0;
    }
    .admin-table th {
        display: none;
    }
}

/* ============================================
   Formulare und Buttons (dynamisch via style.php)
   ============================================ */
.btn, button, input[type="submit"], .podcast-link {
    background: var(--button-bg, #111);
    color: var(--button-text, white);
    padding: var(--button-padding, 0.6rem 1.2rem);
    border-radius: var(--button-radius, 2rem);
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: inline-block;
    text-align: center;
}
.btn:hover, button:hover, input[type="submit"]:hover {
    background: var(--button-hover-bg, #333);
}
.btn-small {
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
}
.btn-outline {
    background: transparent;
    border: 1px solid currentColor;
    color: var(--primary-color);
}
.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* ============================================
   Globaler Player (fixed bottom) – bereits in player.php gestyled
   Ergänzungen für bessere Integration
   ============================================ */
.global-player {
    font-family: inherit;
}
.player-controls button, .player-controls select {
    background: white;
}

/* ============================================
   Hilfsklassen
   ============================================ */
.error {
    color: #d32f2f;
    background: #fef2f2;
    padding: 0.5rem;
    border-radius: 0.5rem;
}
.success {
    color: #2e7d32;
    background: #e8f5e9;
    padding: 0.5rem;
    border-radius: 0.5rem;
}