/* Linksblatt Styles — BILD-Boulevard-Stil */

/* ========== CSS Custom Properties ========== */
:root {
    --bg-primary: #f5f5f5;
    --bg-card: #ffffff;
    --bg-card-hover: #fafafa;
    --text-primary: #1a1a1a;
    --text-secondary: #555;
    --text-muted: #888;
    --accent: #c62828;
    --accent-light: #ef5350;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --border-radius: 8px;
    --grid-gap: 12px;
}

/* ========== Dark Mode ========== */
[data-theme="dark"] {
    --bg-primary: #121212;
    --bg-card: #1e1e1e;
    --bg-card-hover: #2a2a2a;
    --text-primary: #e0e0e0;
    --text-secondary: #aaa;
    --text-muted: #777;
    --accent: #ef5350;
    --accent-light: #ff7043;
    --border-color: #333;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] body,
[data-theme="dark"] .w3-light-grey {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary);
}

[data-theme="dark"] header {
    background-color: #b71c1c !important;
}

[data-theme="dark"] footer {
    border-top-color: var(--border-color);
    color: var(--text-muted);
    background: none;
}

[data-theme="dark"] .filter-btn,
[data-theme="dark"] .source-btn {
    color: var(--text-primary);
}

/* ========== Dark Mode Toggle ========== */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-fast), background var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

/* ========== Globale Einstellungen ========== */
body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
}

/* Header-Styling */
header {
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 10;
}

header h1 {
    font-weight: bold;
    margin-bottom: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header p.w3-large {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

header img {
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
}

/* ========================================
   NEWS-GRID — Zeitungslayout
   ======================================== */

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(230px, auto);
    gap: var(--grid-gap);
    margin-top: 20px;
}

/* ========================================
   CARD-STYLING — Text auf Bild (BILD-Stil)
   ======================================== */

.news-card {
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    background: #000;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    animation: fadeIn 0.5s ease forwards;
}

.news-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
}

.card-image {
    position: relative;
    overflow: hidden;
    background: #111;
    height: 100%;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.size-big { min-height: 480px; }
.size-med { min-height: 300px; }
.size-small { min-height: 230px; }

.news-card:hover .card-image img {
    transform: scale(1.05);
}

.card-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom,
        rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.1) 35%,
        rgba(0,0,0,0.1) 60%, rgba(0,0,0,0.7) 100%);
    pointer-events: none;
    z-index: 1;
}

.card-headline {
    position: absolute;
    top: 0; left: 0; right: 0;
    padding: 16px 16px 0;
    z-index: 2;
    text-align: left;
}

.card-headline h2 {
    font-family: Impact, "Arial Black", "Helvetica Neue", sans-serif;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: #fff;
    margin: 0;
    text-shadow: 3px 3px 0 rgba(0,0,0,0.9), -1px -1px 0 rgba(0,0,0,0.5), 0 0 30px rgba(0,0,0,0.7);
}

.size-big .card-headline h2 { font-size: 4.5rem; }
.size-med .card-headline h2 { font-size: 3rem; }
.size-small .card-headline h2 { font-size: 2.4rem; }

.card-text {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 0 16px 14px;
    z-index: 2;
    text-align: left;
}

.card-text p {
    font-size: 1.2rem;
    line-height: 1.4;
    color: rgba(255,255,255,0.95);
    margin: 0;
    font-weight: 600;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.9);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.size-big .card-text p { font-size: 1.5rem; -webkit-line-clamp: 3; }
.size-small .card-text p { font-size: 1.1rem; -webkit-line-clamp: 2; }

/* Drama-Keywords */
.drama-word {
    font-size: 1.4em;
    font-weight: 900;
    font-family: Impact, "Arial Black", sans-serif;
    color: #ffeb3b;
    text-transform: uppercase;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.9), 0 0 10px rgba(255,235,59,0.4);
    letter-spacing: 0.02em;
}

/* Quell-Link auf Cards */
.card-source {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 8px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    color: #ffeb3b;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: background 0.2s;
}

.card-source:hover {
    background: rgba(255,235,59,0.3);
    color: #fff;
}

/* Kategorie-Filter */
#category-filter { margin-bottom: 16px; }

.filter-btn {
    margin: 4px;
    opacity: 0.6;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.filter-btn:hover,
.filter-btn.active {
    opacity: 1;
    transform: scale(1.05);
}

/* ========== News-Feed Bereich ========== */
.news-feed-title {
    font-family: Impact, 'Arial Black', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--accent);
    border-bottom: 4px solid var(--accent);
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.news-feed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

/* Einheitliches Card-Design für Feed UND Promo */
.news-feed-item,
.promo-feed-item {
    display: block;
    background: var(--bg-card);
    border-radius: 8px;
    padding: 16px;
    text-decoration: none;
    color: var(--text-primary);
    border-left: 4px solid var(--accent);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    box-shadow: var(--shadow-sm);
}

.news-feed-item:hover,
.promo-feed-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    background: var(--bg-card-hover);
}

.feed-item-source,
.promo-feed-source {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: 4px;
}

.feed-item-title,
.promo-feed-title {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.feed-item-desc,
.promo-feed-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0 0 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.feed-item-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Promo-Cards: subtiler Akzent */
.promo-feed-item {
    border-left-color: #ff9800;
}

.promo-feed-source {
    color: #ff9800;
}

.promo-feed-item .kofi-img {
    height: 36px;
    margin-top: 4px;
}

/* Quellen-Filter */
.source-btn {
    margin: 2px 4px;
    font-size: 0.8rem;
    padding: 4px 12px !important;
}

.source-btn.active {
    background: var(--accent) !important;
    color: white !important;
}

/* ========== Footer ========== */
footer {
    margin-top: 50px;
    padding: 30px 0;
    border-top: 3px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-muted);
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(0,0,0,0.02));
}

[data-theme="dark"] footer a {
    color: var(--accent-light);
}

/* Datetime Display */
#current-datetime {
    opacity: 0.9;
    font-weight: 500;
    margin-bottom: 8px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 992px) {
    header .w3-row > div { text-align: center !important; }
    header img { max-width: 100% !important; margin: 10px auto; }
    header h1 { font-size: 3rem; }

    .news-grid {
        display: flex;
        flex-wrap: wrap;
        gap: var(--grid-gap);
    }

    .news-card {
        grid-column: unset !important;
        grid-row: unset !important;
    }

    .news-card.size-big { flex: 1 1 100%; min-height: 380px; }
    .news-card.size-med { flex: 1 1 calc(50% - var(--grid-gap)); min-height: 280px; }
    .news-card.size-small { flex: 1 1 calc(50% - var(--grid-gap)); min-height: 230px; }
}

@media (max-width: 600px) {
    .news-card.size-big,
    .news-card.size-med,
    .news-card.size-small {
        flex: 1 1 100%;
        min-height: 280px;
    }

    .size-big .card-headline h2 { font-size: 2.4rem; }
    .size-med .card-headline h2,
    .size-small .card-headline h2 { font-size: 1.8rem; }
    header h1 { font-size: 2rem; }

    .news-feed { grid-template-columns: 1fr; }
}

/* Smooth Scroll */
html { scroll-behavior: smooth; }

/* Loading Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.news-card:nth-child(1) { animation-delay: 0.05s; }
.news-card:nth-child(2) { animation-delay: 0.1s; }
.news-card:nth-child(3) { animation-delay: 0.15s; }
.news-card:nth-child(4) { animation-delay: 0.2s; }
.news-card:nth-child(5) { animation-delay: 0.25s; }
.news-card:nth-child(6) { animation-delay: 0.3s; }
.news-card:nth-child(7) { animation-delay: 0.35s; }
.news-card:nth-child(8) { animation-delay: 0.4s; }
.news-card:nth-child(9) { animation-delay: 0.45s; }
