/* ══════════════════════════════════════════════
   frontend/public/css/references.css
   ══════════════════════════════════════════════ */

/* ── Referenzen-Seite ────────────────────────────────────── */
.ref-page {
    min-height: 60vh;
}

.ref-header {
    background: linear-gradient(135deg, #1a3a5c, #004080);
    color: #fff;
    padding: 2rem;
    text-align: center;
}

.ref-header h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: .4rem;
}

.ref-header p {
    font-size: 1rem;
    opacity: .85;
}

.ref-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: #9ca3af;
    max-width: 500px;
    margin: 0 auto;
}

/* Grid */
.ref-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 5rem;
}

/* Card */
.ref-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow .25s, transform .2s;
}

.ref-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    transform: translateY(-3px);
}

/* Vorschau-Bild */
.ref-thumb {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: #1a3a5c;
}

.ref-thumb img,
.ref-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}

.ref-card:hover .ref-thumb img,
.ref-card:hover .ref-thumb video {
    transform: scale(1.05);
}

.ref-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, .55);
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    pointer-events: none;
}

.ref-yt-icon {
    background: rgba(220, 0, 0, .85);
}

.ref-caption {
    padding: .7rem .85rem;
    border-top: 1px solid #f1f5f9;
}

.ref-caption-title {
    font-weight: 600;
    font-size: .9rem;
    color: #1e293b;
}

.ref-caption-desc {
    font-size: .8rem;
    color: #64748b;
    margin-top: .15rem;
}

/* ── Lightbox Modal ──────────────────────────────────────── */
.ref-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .85);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.ref-modal-overlay.is-open {
    display: flex;
}

.ref-modal {
    position: relative;
    background: #111;
    border-radius: 10px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ref-modal-close {
    position: absolute;
    top: .6rem;
    right: .6rem;
    z-index: 10;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ref-modal-close:hover {
    background: rgba(255, 255, 255, .2);
}

.ref-modal-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    max-height: 70vh;
    overflow: hidden;
}

.ref-modal-content img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

.ref-modal-content video {
    max-width: 100%;
    max-height: 70vh;
    display: block;
}

.ref-modal-content iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    display: block;
}

.ref-modal-caption {
    padding: .6rem 1rem;
    color: #e2e8f0;
    font-size: .88rem;
    background: rgba(0, 0, 0, .4);
}

.ref-modal-caption strong {
    display: block;
    font-size: .95rem;
}

.ref-modal-caption p {
    margin: .2rem 0 0;
    color: #94a3b8;
}

.ref-modal-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: .5rem;
    background: #000;
}

.ref-modal-nav button {
    background: none;
    border: 1px solid #444;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ref-modal-nav button:hover {
    background: rgba(255, 255, 255, .1);
}

.ref-modal-nav span {
    color: #9ca3af;
    font-size: .85rem;
}

@media (max-width: 768px) {
    .ref-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: .8rem;
        padding: 1.5rem .8rem 3rem;
    }

    .ref-thumb {
        height: 140px;
    }
}

@media (max-width: 480px) {
    .ref-grid {
        grid-template-columns: 1fr;
    }
}

/* Kategorie-Filter-Leiste (Pill-Buttons) */
.ref-cat-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    max-width: 1200px;
    margin: 1.5rem auto 0;
    padding: 0 1.5rem;
}

.ref-cat-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .4rem 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: .87rem;
    color: #374151;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
    white-space: nowrap;
}

.ref-cat-btn:hover {
    background: #f0f7ff;
    border-color: #004080;
    color: #004080;
    text-decoration: none;
}

.ref-cat-btn.active {
    background: #004080;
    border-color: #004080;
    color: #fff;
    font-weight: 600;
}

.ref-cat-btn.active:hover {
    background: #002d5e;
}

.ref-cat-btn-count {
    font-size: .72rem;
    background: rgba(0, 0, 0, .12);
    padding: .05rem .4rem;
    border-radius: 10px;
}

.ref-cat-btn.active .ref-cat-btn-count {
    background: rgba(255, 255, 255, .25);
}

/* Abstand zwischen Kategorie-Leiste und Grid */
.ref-grid {
    margin-top: 1.5rem;
}

@media (max-width: 600px) {
    .ref-cat-nav {
        padding: 0 .8rem;
        gap: .35rem;
        margin-top: 1rem;
    }

    .ref-cat-btn {
        font-size: .8rem;
        padding: .3rem .7rem;
    }
}