/* ===========================================================
   WDB Referenzen – Frontend
   Elementor-CSS-Variablen als Standard, alles überschreibbar.
   =========================================================== */
.wdb-ref-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
}

/* --- Karte --- */
.wdb-ref-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .10);
    transition: transform .28s ease, box-shadow .28s ease;
    will-change: transform;
}
a.wdb-ref-card { cursor: pointer; }
.wdb-ref-card:hover { transform: translateY(-5px); }

/* --- Thumbnail (Screenshot) --- */
.wdb-ref-thumb {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 – per Control überschrieben */
    overflow: hidden;
    background: #eef1f5 linear-gradient(110deg, #eef1f5 30%, #f6f8fb 50%, #eef1f5 70%);
    background-size: 200% 100%;
    animation: wdb-ref-shimmer 1.6s linear infinite;
}
.wdb-ref-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    transition: transform .5s ease;
}
.wdb-ref-thumb__ph {
    position: absolute; inset: 0;
    display: block;
}
@keyframes wdb-ref-shimmer {
    to { background-position: -200% 0; }
}

/* --- Hover-Overlay --- */
.wdb-ref-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--e-global-color-primary, #1e2a3a) 72%, transparent);
    opacity: 0;
    transition: opacity .28s ease;
}
.wdb-ref-card:hover .wdb-ref-overlay { opacity: 1; }
.wdb-ref-overlay__text {
    display: inline-flex;
    align-items: center;
    gap: .5em;
    padding: .6em 1.1em;
    border: 2px solid #fff;
    border-radius: 999px;
    color: #fff;
    font-weight: 600;
    font-size: .95rem;
    transform: translateY(8px);
    transition: transform .28s ease;
    background: transparent;
}
.wdb-ref-card:hover .wdb-ref-overlay__text { transform: translateY(0); }

/* --- Badges --- */
.wdb-ref-badges {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    z-index: 2;
}
.wdb-ref-badges--overlay {
    position: absolute;
    left: 12px;
    bottom: 12px;
}
.wdb-ref-badges--body { margin-top: 12px; }

.wdb-ref-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 4px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
    overflow: hidden;
}
.wdb-ref-badge svg { width: 100%; height: 100%; display: block; }

/* --- Textbereich --- */
.wdb-ref-body {
    display: flex;
    flex-direction: column;
    padding: 16px 18px 18px;
}
.wdb-ref-title {
    display: block;
    font-family: var(--e-global-typography-primary-font-family, inherit);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--e-global-color-primary, #1e2a3a);
}
.wdb-ref-domain {
    display: block;
    margin-top: 2px;
    font-size: .85rem;
    line-height: 1.4;
    color: var(--e-global-color-text, #7a869a);
    word-break: break-word;
}

/* --- Badges im Textbereich linksbündig zur Ausrichtung --- */
.wdb-ref-body { align-items: flex-start; }
.wdb-ref-body[style*="center"] { align-items: center; }

/* --- Responsive Fallback (greift, falls keine Elementor-Controls) --- */
@media (max-width: 1024px) {
    .wdb-ref-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .wdb-ref-grid { grid-template-columns: 1fr; }
    .wdb-ref-overlay__text { font-size: .85rem; }
}

/* Reduzierte Bewegung respektieren */
@media (prefers-reduced-motion: reduce) {
    .wdb-ref-thumb { animation: none; }
    .wdb-ref-card, .wdb-ref-thumb img, .wdb-ref-overlay, .wdb-ref-overlay__text { transition: none; }
}
