/**
 * Frontend CSS für Flimmerkiste Poster Import
 * 
 * TMDB Attribution Styles
 * DSGVO-konforme Anzeige
 * Newspaper Theme Kompatibilität
 * 
 * @package Flimmerkiste_Poster_Import
 * @since 1.0.0
 */

/* ==========================================================================
   TMDB Attribution - Grundstyles
   ========================================================================== */

/* Attribution Text unter Bildern */
.tmdb-attribution {
    font-size: 11px;
    color: #666;
    font-style: italic;
    text-align: center;
    margin-top: 5px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.tmdb-attribution:hover {
    opacity: 1;
}

/* Attribution als Overlay */
.entry-thumb[data-attribution="TMDB"]::after,
.td_module_wrap img[data-attribution="TMDB"]::after,
.featured-image[data-attribution="TMDB"]::after {
    content: "Quelle: TMDB";
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 3px 8px;
    font-size: 10px;
    border-radius: 3px;
    font-style: normal;
    z-index: 10;
    pointer-events: none;
    opacity: 0.9;
}

/* Container muss relative sein für absolute Positionierung */
.entry-thumb,
.td_module_wrap .td-module-thumb,
.featured-image-wrapper {
    position: relative;
}

/* ==========================================================================
   Newspaper Theme Spezifische Anpassungen
   ========================================================================== */

/* TD Module Anpassungen */
.td_module_wrap .td-module-thumb[data-attribution="TMDB"]::after {
    content: "TMDB";
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 2px 6px;
    font-size: 9px;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Flex Module (Newspaper 12+) */
.td_module_flex_1 .td-image-wrap[data-attribution="TMDB"]::after,
.td_module_flex_2 .td-image-wrap[data-attribution="TMDB"]::after,
.td_module_flex_3 .td-image-wrap[data-attribution="TMDB"]::after,
.td_module_flex_4 .td-image-wrap[data-attribution="TMDB"]::after {
    content: "TMDB";
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: linear-gradient(135deg, rgba(34, 113, 177, 0.9), rgba(19, 94, 150, 0.9));
    color: #fff;
    padding: 4px 8px;
    font-size: 10px;
    border-radius: 3px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* MX Modules */
.td_module_mx1 .td-module-thumb[data-attribution="TMDB"]::after,
.td_module_mx2 .td-module-thumb[data-attribution="TMDB"]::after {
    bottom: 10px;
    right: 10px;
}

/* Single Post Featured Image */
.td-post-featured-image[data-attribution="TMDB"]::after,
.single .td-image-wrap[data-attribution="TMDB"]::after {
    content: "Bildquelle: The Movie Database (TMDB)";
    bottom: 10px;
    right: 10px;
    padding: 5px 10px;
    font-size: 11px;
}

/* ==========================================================================
   Attribution Position Varianten
   ========================================================================== */

/* Variante: Attribution unter dem Bild */
body.tmdb-attribution-below .entry-thumb[data-attribution="TMDB"]::after,
body.tmdb-attribution-below .td_module_wrap img[data-attribution="TMDB"]::after {
    display: none;
}

body.tmdb-attribution-below .entry-thumb[data-attribution="TMDB"] + .tmdb-attribution-text,
body.tmdb-attribution-below .td-module-thumb[data-attribution="TMDB"] + .tmdb-attribution-text {
    display: block;
    font-size: 10px;
    color: #999;
    text-align: right;
    margin-top: 3px;
    font-style: italic;
}

/* Variante: Attribution in Caption */
body.tmdb-attribution-caption .wp-caption-text {
    position: relative;
}

body.tmdb-attribution-caption .wp-caption-text::after {
    content: " (Quelle: TMDB)";
    font-size: 0.9em;
    color: #999;
}

/* Variante: Versteckte Attribution (nur HTML) */
body.tmdb-attribution-hidden .entry-thumb[data-attribution="TMDB"]::after,
body.tmdb-attribution-hidden .td_module_wrap img[data-attribution="TMDB"]::after {
    display: none;
}

/* ==========================================================================
   Dark Mode Support (Newspaper)
   ========================================================================== */

.td-theme-wrap.td-dark-mode .tmdb-attribution {
    color: #aaa;
}

.td-theme-wrap.td-dark-mode .entry-thumb[data-attribution="TMDB"]::after,
.td-theme-wrap.td-dark-mode .td_module_wrap img[data-attribution="TMDB"]::after {
    background: rgba(255, 255, 255, 0.1);
    color: #ddd;
}

/* ==========================================================================
   Mobile Anpassungen
   ========================================================================== */

@media (max-width: 767px) {
    /* Kleinere Attribution auf Mobile */
    .entry-thumb[data-attribution="TMDB"]::after,
    .td_module_wrap img[data-attribution="TMDB"]::after {
        font-size: 8px;
        padding: 2px 5px;
        bottom: 3px;
        right: 3px;
    }
    
    /* Vereinfachte Attribution */
    .td_module_flex_1 .td-image-wrap[data-attribution="TMDB"]::after,
    .td_module_flex_2 .td-image-wrap[data-attribution="TMDB"]::after {
        content: "TMDB";
        padding: 2px 4px;
        font-size: 8px;
        bottom: 5px;
        right: 5px;
    }
    
    /* Single Post */
    .single .td-image-wrap[data-attribution="TMDB"]::after {
        content: "TMDB";
        font-size: 9px;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1018px) {
    .entry-thumb[data-attribution="TMDB"]::after,
    .td_module_wrap img[data-attribution="TMDB"]::after {
        font-size: 9px;
    }
}

/* ==========================================================================
   Hover Effects
   ========================================================================== */

/* Sanftes Einblenden bei Hover */
.td_module_wrap:hover img[data-attribution="TMDB"]::after,
.entry-thumb:hover[data-attribution="TMDB"]::after {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Normale Opacity wenn nicht gehovert */
.td_module_wrap img[data-attribution="TMDB"]::after,
.entry-thumb[data-attribution="TMDB"]::after {
    opacity: 0.7;
}

/* ==========================================================================
   Special Cases
   ========================================================================== */

/* Grid Layouts */
.td-grid-style .entry-thumb[data-attribution="TMDB"]::after {
    font-size: 8px;
    padding: 2px 4px;
}

/* Big Grid */
.td_module_mx5 .td-module-thumb[data-attribution="TMDB"]::after,
.td_module_mx6 .td-module-thumb[data-attribution="TMDB"]::after {
    bottom: 15px;
    right: 15px;
    padding: 5px 10px;
    font-size: 11px;
}

/* Mega Menu */
.td-mega-menu .entry-thumb[data-attribution="TMDB"]::after {
    display: none; /* Zu klein für Attribution */
}

/* Related Posts */
.td_block_related_posts .entry-thumb[data-attribution="TMDB"]::after {
    font-size: 8px;
    padding: 1px 3px;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .tmdb-attribution,
    .entry-thumb[data-attribution="TMDB"]::after,
    .td_module_wrap img[data-attribution="TMDB"]::after {
        display: block !important;
        opacity: 1 !important;
        color: #000 !important;
        background: #fff !important;
        border: 1px solid #000 !important;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

/* Screen Reader Only Attribution */
.screen-reader-text.tmdb-attribution {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .entry-thumb[data-attribution="TMDB"]::after,
    .td_module_wrap img[data-attribution="TMDB"]::after {
        background: #000;
        color: #fff;
        border: 1px solid #fff;
    }
}

/* ==========================================================================
   CSS Custom Properties für einfache Anpassung
   ========================================================================== */

:root {
    --tmdb-attribution-bg: rgba(0, 0, 0, 0.7);
    --tmdb-attribution-color: #fff;
    --tmdb-attribution-font-size: 10px;
    --tmdb-attribution-padding: 3px 8px;
    --tmdb-attribution-radius: 3px;
    --tmdb-attribution-opacity: 0.9;
}

/* Verwendung der Custom Properties */
.custom-attribution[data-attribution="TMDB"]::after {
    background: var(--tmdb-attribution-bg);
    color: var(--tmdb-attribution-color);
    font-size: var(--tmdb-attribution-font-size);
    padding: var(--tmdb-attribution-padding);
    border-radius: var(--tmdb-attribution-radius);
    opacity: var(--tmdb-attribution-opacity);
}

/* ==========================================================================
   Wichtig: Newspaper Theme CSS Override Fix
   ========================================================================== */

/* Maximale Spezifität für Newspaper Theme */
body .td-main-content-wrap .td-container .td_module_wrap img[data-attribution="TMDB"]::after,
body .td-ss-main-content .td_module_wrap img[data-attribution="TMDB"]::after {
    content: "TMDB" !important;
    position: absolute !important;
    bottom: 5px !important;
    right: 5px !important;
    background: rgba(0, 0, 0, 0.7) !important;
    color: white !important;
    padding: 3px 8px !important;
    font-size: 10px !important;
    border-radius: 3px !important;
    z-index: 10 !important;
}

/* Datei: /wp-content/plugins/flimmerkiste-poster-import/assets/css/frontend-poster.css */