/* =====================================================================
   CIBOR — Картки референцій (.cibor-ref__card) — вигляд за дизайном
   ---------------------------------------------------------------------
   Розмітку дає плагін cibor-referenties (шорткоди [cibor_referenties]
   і [cibor_referenties_uitgelicht] на головній, архів /references/).
   Плагін малює заокруглену картку з тінню, синій #1457c4 і тонку жовту
   риску. Дизайн: прямі кути, біла плашка локації зі скосом угорі
   зліва, синій бейдж категорії кольору бренду, жовте "D" зрізане
   лівим краєм картки, білий заголовок 20px, темніший градієнт знизу.
   Селектори з .cibor-ref спереду — щоб перебити плагін незалежно від
   порядку підключення. Підключається у functions.php.
   ===================================================================== */

.cibor-ref .cibor-ref__grid { gap: 24px; }

/* ── Картка ─────────────────────────────────────────────────────────── */
.cibor-ref .cibor-ref__card {
    position: relative;
    display: block;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: none;
    background: #0b1f33;
    transition: transform .45s cubic-bezier(.16, .84, .44, 1), box-shadow .45s ease;
}
.cibor-ref .cibor-ref__card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 34px rgba(0, 0, 0, .18);
}

/* фото: 4:3. Сама картинка задана inline на .cibor-ref__media, тому
   для наближення дублюємо її у ::before (background-image: inherit)
   і масштабуємо лише його — плашка, бейдж і заголовок лишаються на місці. */
.cibor-ref .cibor-ref__media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: #2a2a2a;
    background-size: cover;
    background-position: center;
    transform: none !important;
}
.cibor-ref .cibor-ref__media::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: inherit;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(1);
    transition: transform .9s cubic-bezier(.16, .84, .44, 1);
    will-change: transform;
}
.cibor-ref .cibor-ref__card:hover .cibor-ref__media::before { transform: scale(1.06); }
/* градієнт знизу — темніший, щоб білий текст читався на будь-якому фото */
.cibor-ref .cibor-ref__media::after {
    z-index: 1;
    background: linear-gradient(to top, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, .35) 40%, rgba(0, 0, 0, 0) 68%);
}
.cibor-ref .cibor-ref__card:hover .cibor-ref__media::after {
    background: linear-gradient(to top, rgba(0, 0, 0, .85) 0%, rgba(0, 0, 0, .45) 45%, rgba(0, 0, 0, .05) 75%);
}

/* ── Локація: біла плашка зі скосом, у лівому верхньому куті ───────── */
.cibor-ref .cibor-ref__loc {
    position: absolute;
    top: -3px;
    left: -3px;
    z-index: 2;
    margin: 0;
    padding: 11px 30px 11px 16px;
    background: #ffffff;
    color: #000000;
    font-size: 13px;
    font-weight: 600;  
    line-height: 1.2;
    text-shadow: none;
    -webkit-clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 100%, 0 100%);
    clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 100%, 0 100%);
}

/* ── Низ картки: бейдж + заголовок, зліва жовте "D" ─────────────────── */
.cibor-ref .cibor-ref__overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 0 22px 26px 66px;
}
/* жовте "D" з бренду, зрізане лівим краєм картки */
.cibor-ref .cibor-ref__overlay::before {
    content: "";
    position: absolute;
    left: -16px;
    bottom: 18px;
    top: auto;
    width: 56px;
    height: 72px;
    background: url("data:image/svg+xml,%3Csvg width='108' height='139' viewBox='0 0 108 139' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M50.5329 108.215H-2.86102e-06V139H52.7654C93.7773 139 108 110.204 108 70.0897C108 29.9756 93.7773 0 52.7654 0H-2.86102e-06V31.0715L47.2923 30.7852C62.9373 30.7852 72.2811 45.6762 72.2811 69.5088C72.2811 93.3414 63.9635 108.232 50.5509 108.232L50.5329 108.215Z' fill='%23EDCC19'/%3E%3C/svg%3E") no-repeat center / contain;
}
.cibor-ref .cibor-ref__badge {
    display: inline-block;
    margin: 0 0 12px;
    padding: 6px 12px;
    border-radius: 2px;
    background: var(--blue, #065AA7);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}
.cibor-ref .cibor-ref__title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    color: #ffffff;
    text-wrap: balance;
}

/* ── Кнопка "Alle referenties" (якщо є в блоці) — синя пігулка ─────── */
.cibor-ref.cibor-ref--uitgelicht .cibor-ref__allbtn {
    padding: 15px 34px !important;
    border-radius: 40px !important;
    background: var(--blue, #065AA7) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: .04em;
    text-transform: uppercase;
    transition: background .3s ease, color .3s ease, transform .35s cubic-bezier(.16, .84, .44, 1) !important;
}
.cibor-ref.cibor-ref--uitgelicht .cibor-ref__allbtn:hover {
    background: var(--geel, #EDCC19) !important;
    color: var(--blue, #065AA7) !important;
    filter: none !important;
    transform: translateY(-2px);
}

/* ── Адаптив ────────────────────────────────────────────────────────── */
@media (max-width: 991px) {
    .cibor-ref .cibor-ref__overlay { padding: 0 18px 22px 58px; }
    .cibor-ref .cibor-ref__overlay::before { width: 48px; height: 62px; bottom: 16px; left: -14px; }
    .cibor-ref .cibor-ref__title { font-size: 18px; }
}
@media (max-width: 600px) {
    .cibor-ref .cibor-ref__grid { gap: 16px; }
    .cibor-ref .cibor-ref__title { font-size: 17px; }
    .cibor-ref .cibor-ref__badge { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    .cibor-ref .cibor-ref__card,
    .cibor-ref .cibor-ref__media { transition: none; }
}
