/* Каталог клубов (архив CPT community).
   Вёрстка карточки перенесена из инлайн-стилей шаблона; hover был на
   onmouseover/onmouseout в атрибутах - в HTML, приезжающем по AJAX, это грязь
   и прямой конфликт с любым будущим CSP. */

.ibd-cm-head { text-align: center; margin-bottom: 26px; }
.ibd-cm-head .page-title {
    font-size: clamp(26px, 2vw, 38px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.02em;
    color: #1E2A32;
    margin: 0 0 8px;
}
.ibd-cm-sub { color: #39505E; font-size: 16px; margin: 0; }

.ibd-cm-blank { text-align: center; padding: 60px 20px; color: #5B7385; }
.ibd-cm-blank .ibd-button { display: inline-flex; margin-top: 12px; }

/* ── панель фильтров ── */
.ibd-cm-panel {
    background: #fff;
    border: 1px solid #E3ECF2;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 18px;
    box-shadow: none;
}
.ibd-cm-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ibd-cm-search {
    flex: 1;
    min-width: 220px;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    background: #fff;
    border: 1px solid #E3ECF2;
    border-radius: 12px;
    padding: 0 14px;
    transition: border-color .18s ease, box-shadow .18s ease;
}
/* Кольцо фокуса ОДНО и вокруг всего поля - тот же приём, что в ленте встреч.
   Система макетов: рамка #1F6FA6 (на белом 5.4:1, WCAG 1.4.11) + кольцо #D9EBF9. */
.ibd-cm-search:focus-within {
    border-color: #1F6FA6 !important;
    box-shadow: 0 0 0 3px #D9EBF9 !important;
}
.ibd-cm-wrap .ibd-cm-search input:focus,
.ibd-cm-wrap .ibd-cm-search input:focus-visible { outline: none; }
@media (forced-colors: active) {
    .ibd-cm-search:focus-within { outline: 2px solid Highlight; outline-offset: 2px; }
}
.ibd-cm-search svg { flex: none; }
.ibd-cm-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    height: 100%;
    background: none;
    outline: none;
    padding: 0;
    font-size: 16px;
    font-family: inherit;
    color: #1E2A32;
    appearance: none;
}
.ibd-cm-selwrap { display: inline-flex; align-items: center; }
.ibd-cm-sel {
    appearance: none;
    -webkit-appearance: none;
    background: #fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center;
    height: 48px;
    border: 1px solid #E3ECF2;
    border-radius: 12px;
    padding: 0 34px 0 14px;
    font-family: inherit;
    font-weight: 500;
    font-size: 16px;
    color: #1E2A32;
    cursor: pointer;
    max-width: 230px;
}
.ibd-cm-sel:hover { border-color: #C9D6E0; }
.ibd-cm-sel:focus { outline: none; border-color: #1F6FA6; box-shadow: 0 0 0 3px #D9EBF9; }
html[dir="rtl"] .ibd-cm-sel { background-position: left 11px center; padding: 0 14px 0 34px; }

.ibd-cm-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #E3ECF2;
}
.ibd-cm-cats-label {
    font-size: 14px;
    font-weight: 700;
    color: #39505E;
    margin-inline-end: 2px;
}
/* Чипы категорий - пилюли как в макетах (выбранный - sunday-unify.css: #FFF7EC + рамка #F5820A). */
.ibd-cm-chip {
    display: inline-flex;
    align-items: center;
    height: 36px;
    border: 1px solid #E3ECF2;
    background: #fff;
    color: #1E2A32;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    padding: 0 14px;
    border-radius: 999px;
    transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.ibd-cm-chip:hover { border-color: #F5820A; }
.ibd-cm-chip:focus-visible, .ibd-cm-seg:focus-visible, .ibd-cm-reset:focus-visible { outline: 2px solid #2E86C1; outline-offset: 2px; }
.ibd-cm-chip.is-active {
    background: rgba(245, 130, 10, .1);
    /* Подпись выбранного чипа - тёмная и не зависит от палитры категории:
       цвет категории живёт в рамке (см. club-directory.js). */
    color: #1f2937;
}
/* Категория, по которой сейчас ничего не найдётся: приглушаем, но не прячем -
   исчезающие чипы дезориентируют сильнее, чем серые. Не opacity: чип остаётся
   кликабельной кнопкой, и полупрозрачность уронила бы контраст текста ниже нормы. */
.ibd-cm-chip.is-empty {
    color: #5B7385;
    border-color: #E3ECF2;
    background: #F3F8FC;
}
.ibd-cm-chip.is-empty:hover { border-color: #C9D6E0; }

.ibd-cm-applied {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #E3ECF2;
}
.ibd-cm-applied[hidden] { display: none; }
.ibd-cm-applied-label { font-size: 14px; color: #5B7385; font-weight: 600; }
.ibd-cm-achip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    background: #FFF7EC;
    border: 1px solid #F5820A;
    color: #1E2A32;
    font-size: 14px;
    font-weight: 600;
    padding: 0 6px 0 12px;
    border-radius: 999px;
}
.ibd-cm-achip-x {
    border: 0;
    background: #FDE9CF;
    color: #1E2A32;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 10px;
    line-height: 1;
}
.ibd-cm-reset {
    border: 0;
    background: none;
    color: #1F6FA6;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    margin-inline-start: auto;
}
.ibd-cm-reset:hover { color: #1F6FA6; text-decoration: underline; }

.ibd-cm-resbar {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 14px;
    font-size: 14px;
}
.ibd-cm-resbar b { font-size: 17px; font-weight: 700; color: #1E2A32; }
.ibd-cm-resmuted { color: #39505E; font-weight: 600; }

/* ── сетка карточек ── */
.ibd-cm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 24px;
    margin-bottom: 24px;
}
.ibd-cm-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #E3ECF2;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: none;
    transition: border-color .16s ease;
}
.ibd-cm-card:hover { border-color: #F5820A; }
.ibd-cm-card-link { position: absolute; inset: 0; z-index: 1; }
.ibd-cm-card-link:focus-visible { outline: 2px solid #dc7000; outline-offset: -3px; border-radius: 16px; }
.ibd-cm-cover {
    position: relative;
    height: 130px;
    background: #FFF7EC;
    background-size: cover;
    background-position: center;
}
.ibd-cm-nophoto {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #f0a85e;
}
.ibd-cm-nophoto span { font-size: 12px; font-weight: 700; }
.ibd-cm-share {
    position: absolute;
    top: 9px;
    inset-inline-end: 9px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color:#b45309;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(30, 42, 50, .12);
    z-index: 3;
}
.ibd-cm-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    padding: 18px;
    color: inherit;
}
.ibd-cm-title { font-size: 18px; font-weight: 700; letter-spacing: -.01em; color: #1E2A32; margin: 0; }
.ibd-cm-city {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #5B7385;
}
.ibd-cm-upcoming {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    height: 26px;
    font-size: 13px;
    font-weight: 700;
    padding: 0 10px;
    border-radius: 999px;
    background: #d1fae5;
    color: #065f46;
}
.ibd-cm-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 8px;
    font-size: 14px;
    color: #5B7385;
}
.ibd-cm-members { font-weight: 700; color:#b45309; white-space: nowrap; }
/* Класс задаёт display и перебивает UA [hidden]: плашку встреч при 0 скрывает атрибут. */
.ibd-cm-upcoming[hidden] { display: none; }

.ibd-cm-empty { text-align: center; color: #5B7385; padding: 20px 0 40px; }
.ibd-cm-empty[hidden] { display: none; }
.ibd-cm-morewrap { text-align: center; margin-bottom: 48px; }
/* .ibd-button задаёт display:inline-flex и перебивает атрибут [hidden] */
.ibd-cm-morewrap [hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
    .ibd-cm-card, .ibd-cm-chip { transition: none; }
}

@media (max-width: 700px) {
    .ibd-cm-row { gap: 8px; }
    .ibd-cm-sel { max-width: 100%; flex: 1; }
}

/* ── сегменты «Размер клуба»: сегмент в рамке 12px, элементы 10px (как в Барахолке) ── */
.ibd-cm-segwrap {
    display: flex;
    align-items: center;
    background: #F3F8FC;
    border: 1px solid #E3ECF2;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}
.ibd-cm-seg {
    height: 38px;
    border: 0;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.2;
    color: #1E2A32;
    padding: 0 12px;
    border-radius: 10px;
    white-space: nowrap;
}
.ibd-cm-seg.is-active { background: #F5820A; color: #fff; font-weight: 800; text-shadow: 0 1px 1px rgba(120, 50, 0, .35); box-shadow: none; }
@media (max-width: 640px) { .ibd-cm-segwrap { width: 100%; } .ibd-cm-seg { flex: 1 1 0; padding: 0 6px; } }
