
/* ==========================================================================
   Download Box – modern slim card
   Override-Stylesheet für das Theme (Download Monitor Template)
   ========================================================================== */

.download-box {
    width: 100% !important;
    max-width: 560px !important;
    margin: 0 !important;
    text-align: left !important;
    border: 1px solid rgba(0, 0, 0, 0.2) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2) !important;
    background: #ffffff !important;
    border-radius: 16px !important;
}


.download-box-content {
    padding: 24px !important;
}

/* ---- Kopfbereich: Datei-Icon + Titel/Meta ---- */
.download-box-head {
    display: flex !important;
    align-items: flex-start !important;
    gap: 14px !important;
    margin-bottom: 8px !important;
}

/* Typspezifisches Datei-Icon */
.dlm-file-icon {
    flex-shrink: 0 !important;
    width: 44px !important;
    height: 44px !important;
    margin: 1px 0 0 0 !important;
    color: var( --dlm-icon-color, #7f8c8d ) !important;
}

.dlm-file-icon svg {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}

.download-box-head-body {
    min-width: 0 !important;
    flex: 1 1 auto !important;
}

.download-title {
    margin: 0 0 6px !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    color: #111111 !important;
}

.download-box-content .wp-block-freeform,
.download-box-content p {
    margin: 0 0 14px !important;
    color: #555555 !important;
}

/* ---- Meta-Info: Groesse ---- */
.download-meta {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.download-meta-item {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #666666 !important;
    margin: 0 !important;
}

.dlm-icon {
    width: 16px !important;
    height: 16px !important;
    display: block !important;
}

/* ---- Button ---- */
.download-link {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    min-width: 200px !important;
    padding: 12px 26px !important;
    border: none !important;
    border-radius: 12px !important;
    background: var( --e-global-color-el_color_1, #a31f23 ) !important;
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    box-shadow: 0 4px 14px rgba(163, 31, 35, 0.25) !important;
    transition: background 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease !important;
}

.download-link:hover {
    background: var( --e-global-color-el_color_1_3, #7d1215 ) !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(163, 31, 35, 0.32) !important;
}

.download-link:active {
    transform: translateY(0) !important;
}

/* Icon im Button: beim Klick ausgeblendet */
.download-link .download-icon {
    transition: opacity 0.2s ease !important;
}

.download-link.is-loading .download-icon {
    display: none !important;
}

/* ---- Lade-Spinner ---- */
.download-spinner {
    display: none !important;
    width: 18px !important;
    height: 18px !important;
    border: 2px solid rgba(255, 255, 255, 0.35) !important;
    border-top-color: #ffffff !important;
    border-radius: 50% !important;
    animation: download-spin 0.8s linear infinite !important;
}

.download-link.is-loading .download-spinner {
    display: inline-block !important;
}

@keyframes download-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Dezente Puls-Animation fuer den Button waehrend des Downloads */
.download-link.is-loading {
    animation: download-pulse 1.4s ease-in-out infinite !important;
}

@keyframes download-pulse {
    0%, 100% { box-shadow: 0 4px 14px rgba(163, 31, 35, 0.25); }
    50%      { box-shadow: 0 4px 22px rgba(163, 31, 35, 0.45); }
}

/* ==========================================================================
   Layout: Info links (70%), Inline-Vorschau rechts (30%)
   Feste horizontale Aufteilung – kein Umbruch.
   ========================================================================== */

.download-box-main {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 20px !important;
    align-items: stretch !important;
    width: 100% !important;
}

.download-box-left {
    flex: 0 0 calc(70% - 10px) !important;
    max-width: calc(70% - 10px) !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}

.download-box-right {
    flex: 0 0 calc(30% - 10px) !important;
    max-width: calc(30% - 10px) !important;
    min-width: 0 !important;
    display: flex !important;
}

/* --- Inline-Vorschau-Fenster (direkt sichtbar beim Laden) ---
   Bilder erhalten ihr Seitenverhältnis (contain), Video/PDF füllen das Fenster. */
.dlm-preview-frame {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 220px !important;
    overflow: hidden !important;
    background:
        linear-gradient(135deg, color-mix(in srgb, var( --dlm-preview-color, #a31f23 ) 6%, transparent), transparent 40%),
        #f5f5f7 !important;
}

.dlm-preview-media {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    display: block !important;
    object-fit: contain !important;
    background: #ffffff !important;
}

/* Bilder / Videos füllen das Fenster aus, Seitenverhältnis bleibt */
img.dlm-preview-media,
video.dlm-preview-media,
iframe.dlm-preview-media {
    object-fit: contain !important;
}

/* --- Nicht-Bild-Typen: statisches Typ-Icon in der Vorschau --- */
.dlm-preview-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 80px !important;
    color: var( --dlm-preview-color, #7f8c8d ) !important;
}

.dlm-preview-icon svg {
    width: 44px !important;
    height: 44px !important;
    max-width: 70% !important;
    max-height: 70% !important;
    display: block !important;
}

/* Platzhalter (falls für andere Zwecke genutzt) */
.dlm-preview-placeholder {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 180px !important;
    position: relative !important;
}

.dlm-preview-placeholder-icon {
    width: 28px !important;
    height: 28px !important;
    display: block !important;
    opacity: 0.75 !important;
}

.dlm-preview-zoom {
    position: absolute !important;
    right: 4px !important;
    bottom: 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    background: rgba(17, 17, 17, 0.55) !important;
    color: #ffffff !important;
}

.dlm-preview-zoom .dlm-icon {
    width: 12px !important;
    height: 12px !important;
}

/* ==========================================================================
   Tablet & Mobile (max. 1024px): Container untereinander, Preview unten,
   Download-Button als rundes Icon, rechts oben auf Höhe von Icon/Titel
   ========================================================================== */
@media (max-width: 1024px) {

    .download-box-main {
        flex-direction: column !important;
        flex-wrap: wrap !important;
        gap: 16px !important;
    }

    .download-box-left,
    .download-box-right {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .download-box-right {
        order: 2 !important;
    }

    .dlm-preview-frame {
        max-height: 100px !important;
        min-height: 60px !important;
    }

    .dlm-preview-frame .dlm-preview-media,
    .dlm-preview-frame img.dlm-preview-media {
        max-height: 100px !important;
        height: auto !important;
    }

    /* Button: nur rundes Icon, rechts oben auf Höhe von Icon/Titel */
    .download-box-left {
        position: relative !important;
    }

    .download-link {
        position: absolute !important;
        top: 0 !important;
        right: 0 !important;
        z-index: 2 !important;
        width: 48px !important;
        min-width: 0 !important;
        padding: 0 !important;
        aspect-ratio: 1 !important;
        border-radius: 50% !important;
    }

    .download-box-head {
        padding-right: 60px !important;
    }

    .download-link .download-link-text {
        display: none !important;
    }

    .download-link .download-icon {
        width: 20px !important;
        height: 20px !important;
        margin: 0 !important;
        display: block !important;
    }
}

