/* Каталог клубов (архив 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(1.7rem, 3.6vw, 2.3rem);
    font-weight: 800;
    letter-spacing: -.02em;
    margin: 0 0 8px;
}
.ibd-cm-sub { color: #4b5563; font-size: 15.5px; margin: 0; }

.ibd-cm-blank { text-align: center; padding: 60px 20px; color: #6b7280; }
.ibd-cm-blank .ibd-button { display: inline-flex; margin-top: 12px; }

/* ── панель фильтров ── */
.ibd-cm-panel {
    background: #fff;
    border: 1px solid #eef0f6;
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 18px;
    box-shadow: 0 12px 30px -26px rgba(17, 24, 39, .5);
}
.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: 9px;
    background: #fff;
    border: 1.5px solid #E3ECF2;
    border-radius: 14px;
    padding: 0 12px;
    transition: border-color .18s ease, box-shadow .18s ease;
}
/* Кольцо фокуса ОДНО и вокруг всего поля - тот же приём, что в ленте встреч.
   #dc7000 вместо #f5820a: второй даёт на белом 2.61:1 при требуемых 3:1
   (WCAG 2.2, SC 1.4.11). */
.ibd-cm-search:focus-within {
    border-color: #dc7000 !important;
    box-shadow: 0 0 0 3px rgba(220, 112, 0, .22) !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;
    background: none;
    outline: none;
    padding: 12px 0;
    font-size: 14.5px;
    font-family: inherit;
    color: #1f2937;
    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;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 11px 34px 11px 14px;
    font-family: inherit;
    font-weight: 700;
    font-size: 13.5px;
    color: #374151;
    cursor: pointer;
    max-width: 230px;
}
.ibd-cm-sel:hover { border-color: #f8dcc1; }
html[dir="rtl"] .ibd-cm-sel { background-position: left 11px center; padding: 11px 14px 11px 34px; }

.ibd-cm-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f1f6;
}
.ibd-cm-cats-label {
    font-size: 12.5px;
    font-weight: 800;
    color: #6b7280;
    margin-inline-end: 2px;
}
.ibd-cm-chip {
    border: 1.5px solid #e5e7eb;
    background: #fff;
    color: #374151;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 13px;
    padding: 8px 13px;
    border-radius: 999px;
    transition: transform .15s ease, border-color .2s ease, color .2s ease, opacity .2s ease;
}
.ibd-cm-chip:hover { transform: translateY(-1px); }
.ibd-cm-chip.is-active {
    background: rgba(245, 130, 10, .1);
    /* Подпись выбранного чипа - тёмная и не зависит от палитры категории:
       цвет категории живёт в рамке (см. club-directory.js). */
    color: #1f2937;
}
/* Категория, по которой сейчас ничего не найдётся: приглушаем, но не прячем -
   исчезающие чипы дезориентируют сильнее, чем серые. Не opacity: чип остаётся
   кликабельной кнопкой, и полупрозрачность уронила бы контраст текста ниже нормы. */
.ibd-cm-chip.is-empty {
    color: #6b7280;
    border-color: #eceff3;
    background: #fafbfc;
}
.ibd-cm-chip.is-empty:hover { transform: none; border-color: #dfe3e9; }

.ibd-cm-applied {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f1f6;
}
.ibd-cm-applied[hidden] { display: none; }
.ibd-cm-applied-label { font-size: 12.5px; color: #6b7280; font-weight: 700; }
.ibd-cm-achip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #eaf1f6;
    color:#b45309;
    font-size: 12.5px;
    font-weight: 700;
    padding: 5px 6px 5px 11px;
    border-radius: 999px;
}
.ibd-cm-achip-x {
    border: 0;
    background: rgba(220, 112, 0, .14);
    color:#b45309;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 10px;
    line-height: 1;
}
.ibd-cm-reset {
    border: 0;
    background: none;
    color: #6b7280;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
    margin-inline-start: auto;
}
.ibd-cm-reset:hover { color:#b45309; }

.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: 800; }
.ibd-cm-resmuted { color: #4b5563; 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 #eef0f6;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 30px -22px rgba(17, 24, 39, .4);
    transition: transform .2s ease, box-shadow .2s ease;
}
.ibd-cm-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -20px rgba(17, 24, 39, .35);
}
.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: linear-gradient(135deg, #eaf1f6, #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 6px 16px -8px rgba(17, 24, 39, .5);
    z-index: 3;
}
.ibd-cm-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    padding: 18px;
    color: inherit;
}
.ibd-cm-title { font-size: 17px; font-weight: 800; letter-spacing: -.01em; margin: 0; }
.ibd-cm-city {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6b7280;
}
.ibd-cm-upcoming {
    align-self: flex-start;
    font-size: 11.5px;
    font-weight: 800;
    padding: 3px 9px;
    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: 13px;
    color: #6b7280;
}
.ibd-cm-members { font-weight: 700; color:#b45309; white-space: nowrap; }

.ibd-cm-empty { text-align: center; color: #6b7280; 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; }
    .ibd-cm-card:hover, .ibd-cm-chip:hover { transform: none; }
}

@media (max-width: 700px) {
    .ibd-cm-row { gap: 8px; }
    .ibd-cm-sel { max-width: 100%; flex: 1; }
}

/* ── сегменты «Размер клуба» ── */
.ibd-cm-segwrap {
    display: flex;
    align-items: center;
    background: #eef2f7;
    border-radius: 11px;
    padding: 4px;
    gap: 2px;
}
.ibd-cm-seg {
    border: 0;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 13px;
    color: #374151;
    padding: 8px 12px;
    border-radius: 8px;
    white-space: nowrap;
}
.ibd-cm-seg.is-active { background: #fff; color: #b45309; box-shadow: 0 2px 8px -4px rgba(17, 24, 39, .35); }
@media (max-width: 640px) { .ibd-cm-segwrap { width: 100%; } .ibd-cm-seg { flex: 1 1 0; padding: 8px 6px; } }
