/* ==========================================================
   JP Card System — passend zur junge-presse.de (Nunito Sans,
   freundliche Palette). Signature: abgeschnittene Ecke oben
   rechts wie im JP-Logo, mit JP-Blau-Rahmen. Meta unter Bild.

   Hohe Selektor-Spezifität + !important weil Elementor/Themes
   sonst padding/background/filter überschreiben.
   ========================================================== */

/* Der Wrapper — trägt Border-Farbe, clip-path, drop-shadow */
article.jpeb-card-v3,
.jpeb-card-v3.events-post,
.jpeb-card-v3.type-event,
.jpeb-card-v3.em-event,
.jpeb-card-v3.elementor-post {
    all: initial;
    display: block !important;
    position: relative !important;
    width: 100% !important;
    box-sizing: border-box !important;
    line-height: 1.4 !important;
    background: #1a4c7e !important;
    padding: 1.5px !important;
    color: #1a4c7e;
    font-family: 'Nunito Sans', ui-sans-serif, system-ui, sans-serif !important;
    border: 0 !important;
    border-radius: 0 !important;
    -webkit-clip-path: polygon(0 0, 100% 0, 100% calc(100% - 32px), calc(100% - 32px) 100%, 0 100%) !important;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 32px), calc(100% - 32px) 100%, 0 100%) !important;
    filter: drop-shadow(0 2px 6px rgba(25, 75, 125, 0.12))
            drop-shadow(0 12px 24px rgba(25, 75, 125, 0.16)) !important;
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1),
                filter 0.3s cubic-bezier(0.2, 0.9, 0.3, 1) !important;
    overflow: visible !important;
}
.jpeb-card-v3 * { box-sizing: border-box; font-family: inherit !important; }
.jpeb-card-v3:hover {
    transform: translateY(-4px) !important;
    filter: drop-shadow(0 4px 10px rgba(25, 75, 125, 0.15))
            drop-shadow(0 22px 40px rgba(232, 57, 110, 0.28)) !important;
}

/* Elementor-Wrapper transparent durchreichen */
article.elementor-post.jpeb-card-v3 .elementor-post__card {
    all: unset !important;
    display: block !important;
    height: 100% !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: none !important;
}

/* Weiße Innenfläche — 1.5px kleiner geclippt, damit Border sichtbar bleibt */
.jpeb-card-v3 > .jpeb-v3-link,
.jpeb-card-v3 .elementor-post__card > .jpeb-v3-link {
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    text-decoration: none !important;
    color: #1a4c7e !important;
    height: 100% !important;
    min-height: 440px !important;
    background: #ffffff !important;
    -webkit-clip-path: polygon(0 0, 100% 0, 100% calc(100% - 30.5px), calc(100% - 30.5px) 100%, 0 100%) !important;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 30.5px), calc(100% - 30.5px) 100%, 0 100%) !important;
}

/* ============ Bild-Bereich — frei von Overlays! ============ */
.jpeb-card-v3 .jpeb-v3-bg {
    position: relative;
    height: 210px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    background-color: #eef2f7;
    overflow: hidden;
    transition: transform 0.6s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.jpeb-card-v3:hover .jpeb-v3-bg { transform: scale(1.04); }

.jpeb-card-v3:not(.jpeb-has-image) .jpeb-v3-bg {
    background:
        radial-gradient(circle at 25% 30%, rgba(232, 57, 110, 0.55), transparent 55%),
        radial-gradient(circle at 80% 75%, rgba(59, 130, 246, 0.5), transparent 55%),
        linear-gradient(135deg, #1a4c7e 0%, #264a7b 100%);
}
.jpeb-v3-ph {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    z-index: 2;
    pointer-events: none;
}
.jpeb-v3-ph span {
    color: rgba(255, 255, 255, 0.22);
    font-weight: 900;
    font-size: 4.5rem;
    letter-spacing: -0.04em;
    line-height: 1;
}

.jpeb-card-v3 .jpeb-v3-shade { display: none; }

/* ============ Meta-Zone unter dem Bild ============ */
.jpeb-card-v3 .jpeb-v3-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 20px 0;
    background: #ffffff;
    flex-wrap: wrap;
}

/* Datum — flach, horizontal, immer mit Jahreszahl */
.jpeb-v3-date {
    display: inline-flex !important;
    align-items: baseline !important;
    gap: 6px;
    background: transparent !important;
    color: #1a4c7e !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    line-height: 1.2 !important;
    font-variant-numeric: tabular-nums;
}
.jpeb-v3-day {
    font-size: 15px !important;
    font-weight: 900 !important;
    letter-spacing: -0.01em;
    line-height: 1.2 !important;
    color: #1a4c7e !important;
}
.jpeb-v3-month {
    font-size: 13px !important;
    font-weight: 700 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    color: #4b5570 !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}
.jpeb-v3-year {
    font-size: 12.5px !important;
    font-weight: 500 !important;
    color: #6b7185 !important;
    font-variant-numeric: tabular-nums;
    margin-left: 2px;
}

/* Mehrtägige Datums-Pille im gleichen Flow */
.jpeb-v3-date-range {
    display: inline-flex !important;
    align-items: baseline !important;
    gap: 4px;
    background: transparent !important;
    color: #1a4c7e !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    line-height: 1.2 !important;
    font-weight: 800 !important;
    font-size: 15px !important;
    font-variant-numeric: tabular-nums;
}
.jpeb-v3-date-range .jpeb-v3-range-dash {
    color: #e8396e;
    font-weight: 900 !important;
    padding: 0 1px;
}
.jpeb-v3-date-range .jpeb-v3-range-month {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #4b5570 !important;
    margin-left: 4px;
    text-transform: none !important;
    letter-spacing: 0 !important;
}
.jpeb-v3-date-range .jpeb-v3-range-year {
    font-size: 12.5px !important;
    font-weight: 500 !important;
    color: #6b7185 !important;
    margin-left: 2px;
}

/* Chips */
.jpeb-v3-chips {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
.jpeb-v3-chip {
    padding: 5px 11px !important;
    font-size: 10.5px !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 999px !important;
    line-height: 1 !important;
    color: #fff !important;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
    display: inline-block !important;
}
.jpeb-v3-chip-online   { background: #0693e3 !important; }
.jpeb-v3-chip-presence { background: #00b070 !important; }
.jpeb-v3-chip-last {
    background: linear-gradient(135deg, #f97316, #ea580c) !important;
    animation: jpebV3Pulse 2s ease-in-out infinite;
}
.jpeb-v3-chip-full {
    background: linear-gradient(135deg, #dc2626, #991b1b) !important;
}

/* ============ Content-Zone: Titel + Excerpt + CTA ============ */
.jpeb-card-v3 .jpeb-v3-content {
    padding: 14px 20px 20px !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    position: relative;
}

.jpeb-v3-title {
    margin: 0 !important;
    color: #1a4c7e !important;
    font-size: 1.2rem !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    letter-spacing: -0.015em;
    text-wrap: balance;
    text-shadow: none !important;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.jpeb-v3-excerpt {
    margin: 10px 0 0 !important;
    padding: 0 !important;
    color: #4b5570 !important;
    font-size: 13.5px !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.jpeb-v3-cta {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    margin-top: 16px !important;
    padding: 0 !important;
    background: transparent !important;
    color: #e8396e !important;
    font-size: 12.5px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    align-self: flex-start;
    box-shadow: none !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em;
}
.jpeb-v3-arrow {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.jpeb-card-v3:hover .jpeb-v3-arrow { transform: translateX(6px); }

/* Ausgebucht: leichter grayscale */
.jpeb-card-full .jpeb-v3-bg { filter: grayscale(0.6) brightness(0.85); }

/* Grid-Kompatibilität */
.wgl_col-4.item .jpeb-card-v3,
.wgl-events__wrapper .jpeb-card-v3 {
    height: 100%;
}

/* Animationen */
@keyframes jpebV3Pulse {
    0%, 100% { box-shadow: 0 2px 6px rgba(249, 115, 22, 0.4); }
    50%      { box-shadow: 0 4px 12px rgba(249, 115, 22, 0.65); }
}
@media (prefers-reduced-motion: reduce) {
    .jpeb-card-v3,
    .jpeb-card-v3:hover,
    .jpeb-card-v3 .jpeb-v3-bg {
        transition: none !important;
        transform: none !important;
    }
    .jpeb-v3-chip-last { animation: none; }
}

/* Responsive */
@media (max-width: 640px) {
    .jpeb-card-v3 > .jpeb-v3-link,
    .jpeb-card-v3 .elementor-post__card > .jpeb-v3-link { min-height: 400px !important; }
    .jpeb-card-v3 .jpeb-v3-bg { height: 170px; }
    .jpeb-v3-title { font-size: 1.05rem !important; }
    .jpeb-card-v3 .jpeb-v3-content { padding: 12px 16px 16px !important; }
    .jpeb-card-v3 .jpeb-v3-top { padding: 10px 16px 0; }
    article.jpeb-card-v3,
    .jpeb-card-v3.events-post,
    .jpeb-card-v3.type-event,
    .jpeb-card-v3.em-event,
    .jpeb-card-v3.elementor-post {
        -webkit-clip-path: polygon(0 0, 100% 0, 100% calc(100% - 24px), calc(100% - 24px) 100%, 0 100%) !important;
        clip-path: polygon(0 0, 100% 0, 100% calc(100% - 24px), calc(100% - 24px) 100%, 0 100%) !important;
    }
    .jpeb-card-v3 > .jpeb-v3-link,
    .jpeb-card-v3 .elementor-post__card > .jpeb-v3-link {
        -webkit-clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22.5px), calc(100% - 22.5px) 100%, 0 100%) !important;
        clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22.5px), calc(100% - 22.5px) 100%, 0 100%) !important;
    }
}
