/* ==============================================
   ЗАКЛАДЫ (place)
   Карточки, спойлеры, ACF-поля, типы, place-home
   ============================================== */

/* ===== КАРТОЧКА ЗАКЛАДА (базовая) ===== */
.place-card {
    background: var(--global-palette8, #f3f5f6);
    padding: 1.5rem;
    border-radius: 20px;
    box-shadow: -8px 12px 15px -8px rgba(0, 0, 0, 0.1),
                 8px 12px 15px -8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.place-card:hover {
    transform: translateY(-4px);
    box-shadow: -8px 15px 20px -8px rgba(0, 0, 0, 0.15),
                 8px 15px 20px -8px rgba(0, 0, 0, 0.15);
}

.place-card h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.place-card h3 a {
    color: var(--global-palette1, #9B004E);
    text-decoration: none;
}

.place-card .place-name-en {
    font-size: 0.85rem;
    color: var(--global-palette2, #700038);
    margin-bottom: 8px;
}

.place-card .place-old-name {
    font-size: 0.8rem;
    color: var(--global-palette5, #374151);
    margin: 8px 0;
}

.place-card .place-description {
    font-size: 0.9rem;
    color: var(--global-palette4, #1e2635);
    margin: 10px 0;
    line-height: 1.4;
}

.place-card .more-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--global-palette2, #700038);
    text-decoration: none;
    font-weight: 500;
}

.place-card .more-link:hover {
    text-decoration: underline;
}

/* ===== ПЛАШКА ОПИСАНИЯ ===== */
.location-description {
    margin: 20px 0 30px;
    padding: 15px;
    background: var(--global-palette8, #f3f5f6);
    font-size: 1rem;
    line-height: 1.3;
    color: var(--global-palette4, #1e2635);
}

.location-old-name {
    font-weight: 400;
}

/* ===== ТИПЫ ЗАКЛАДА (place_type) В КАРТОЧКЕ СОБЫТИЯ ===== */
.place-type-list {
    margin: 10px 0 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 6px 14px;
    border-radius: 20px;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    line-height: 1.3;
    background-color: var(--global-palette8, #f3f5f6);
    border: 1px solid var(--global-palette1, #9B004E);
}

.place-type-list a {
    color: var(--global-palette5, #374151);
    text-decoration: none;
}

.place-type-list a:hover,
.place-type-list:hover {
    background-color: var(--global-palette8, #f3f5f6);
    border-color: var(--global-palette2, #700038);
    color: var(--global-palette5, #374151);
}

/* ===== СПИСОК ЗАКЛАДОВ (в таксономии и library-location) ===== */
.places-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.places-list .place-list-item {
    display: block;
    padding: 20px 24px;
    margin-bottom: 12px;
    background: var(--global-palette8, #f3f5f6);
    border-radius: 10px;
}

.places-list .place-list-item:last-child {
    margin-bottom: 0;
}

/* ===== РАСКРЫТАЯ КАРТОЧКА ЗАКЛАДА (collapsible=false) ===== */
.place-card-inline {
    display: block;
}

.place-card-inline .place-card-heading,
.place-card-heading {
    margin: 0 0 12px 0;
    font-weight: 600;
    line-height: 1.3;
    color: var(--global-palette3, #00030c);
}

.place-card-inline .place-card-content {
    /* padding уже у .place-list-item */
}

/* ===== СПОЙЛЕР БИБЛИОТЕКИ ===== */
.place-spoiler {
    margin: 0;
    padding: 0;
}

.place-spoiler summary {
    cursor: pointer;
    font-weight: 500;
    font-size: 1em;
    color: var(--global-palette10, #1e5261);
    transition: color 0.2s ease, transform 0.2s ease;
    padding: 4px 0;
    list-style: none;
    display: inline-block;
}

.place-spoiler summary:hover {
    color: var(--global-palette2, #700038);
    text-decoration: underline;
}

/* Маркер — двойной круг / точка в круге */
.place-spoiler summary::before {
    content: '◎';
    display: inline-block;
    margin-right: 8px;
    margin-top: -3px;
    font-size: 1.3em;
    color: var(--global-palette1, #9B004E);
    transition: transform 0.2s ease, color 0.2s ease;
    vertical-align: middle;
    line-height: 1;
}

.place-spoiler[open] summary::before {
    content: '◉';
}

.place-spoiler summary:hover::before {
    transform: scale(1.4);
    color: var(--global-palette2, #700038);
}

.place-spoiler-content {
    margin-top: 12px;
    padding: 15px 30px;
    background: var(--global-palette9, #ffffff);
    border-radius: 6px;
}

.place-spoiler-content p:last-child {
    margin-bottom: 0;
}

/* ===== ПЛАШКА HEADER (events-place): English + кнопка ===== */
.place-header-box {
    margin: 0;
    padding: 0;
    background: transparent;
}

.place-header-box .subzag {
    margin: 0 0 12px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--global-palette5, #374151);
    letter-spacing: 0;
}

.place-nav-link-wrapper {
    margin-top: 15px;
    margin-bottom: 25px;
}

/* ===== СТРАНИЦА ЗАКЛАДА (events-place) ===== */
.place-location-info {
    margin: 10px 0 20px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border-left: none;
}

.place-location-uk {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.place-location-district {
    color: #333;
}

.place-location-en {
    font-size: 0.95rem;
    color: #666;
    font-style: italic;
    margin-bottom: 10px;
}

.place-location-district-en,
.place-location-community-en {
    color: #666;
}

/* ===== ГРУППЫ ЗАКЛАДОВ ПО РАЙОНАМ (в архиве типа) ===== */
.type-place-group {
    margin-bottom: 40px;
}

.type-place-group h2 {
    margin: 2em 0 1em 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--global-palette5, #374151);
    padding-left: 12px;
    border-left: 4px solid var(--global-palette1, #9B004E);
}

/* ==============================================
   place-home.php — Список типов закладов
   ============================================== */

/* ===== СПИСОК ТИПОВ ===== */
.types-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 40px;
}

.types-list .type-card {
    width: 100%;
}

/* ===== КАРТОЧКА ТИПА ===== */
.type-card {
    background: var(--global-palette8, #f3f5f6);
    padding: 1.5rem;
    border-radius: 20px;
    box-shadow: -8px 12px 15px -8px rgba(0, 0, 0, 0.1),
                 8px 12px 15px -8px rgba(0, 0, 0, 0.1);
    transition: none;
}

.type-card h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    color: var(--global-palette10, #1e5261) !important;
}

/* Список закладов в карточке типа */
.type-card .places-preview {
    list-style: none;
    padding: 0;
    margin: 12px 0;
}

.type-card .places-preview li {
    margin-bottom: 16px;
    padding-left: 18px;
    position: relative;
}

.type-card .places-preview li:last-child {
    margin-bottom: 0;
}

/* Буллет перед каждой библиотекой — как в спойлерах */
.type-card .places-preview li::before {
    content: "◎";
    position: absolute;
    left: 0;
    top: -1px;
    color: var(--global-palette1, #9B004E);
    font-size: 1.3em;
    line-height: 1;
    transition: transform 0.2s ease, color 0.2s ease;
    transform-origin: center;
    display: inline-block;
}

/* Увеличение буллета при наведении */
.type-card .places-preview li:hover::before {
    transform: scale(1.4);
    color: var(--global-palette2, #700038);
}

.type-card .places-preview li a {
    color: var(--global-palette3, #00030c);
    text-decoration: none;
    font-size: 1em;
    line-height: 1.2;
}

.type-card .places-preview li a:hover {
    color: var(--global-palette2, #700038);
    text-decoration: underline;
}

/* Кнопка "Переглянути всі N →" */
.type-card .uppercase-link {
    display: inline-block;
    margin-top: 12px;
    padding: 6px 16px;
    color: var(--global-palette9, #ffffff) !important;
    background-color: var(--global-palette6, #546279);
    border-radius: 30px;
    font-size: 0.9em;
    font-weight: 400;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.type-card .uppercase-link:hover {
    background-color: var(--global-palette1, #9B004E);
    color: var(--global-palette9, #ffffff) !important;
}

.type-card .uppercase-link strong {
    font-weight: 900;
    color: inherit;
}

/* ===== КАРТОЧКА САМОСТОЯТЕЛЬНОГО ТИПА (без h2) ===== */
.type-card-standalone {
    margin-top: 10px;
}

/* ===== РАЗДЕЛИТЕЛЬ — ЗАГОЛОВОК РОДИТЕЛЯ МЕЖДУ ЛИНИЯМИ ===== */
.type-parent-divider {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 20px 0 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--global-palette10, #1e5261);
    font-family: var(--global-heading-font-family);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    white-space: nowrap;
}

.type-parent-divider::before,
.type-parent-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--global-palette6, #546279);
}

/* Отступ под разделителем */
.type-parent-divider + .type-card {
    margin-top: 10px;
}

/* ==============================================
   taxonomy-type_place.php — Ссылки в архиве типа
   ============================================== */

/* ===== СПИСОК ССЫЛОК (без спойлеров) ===== */
.place-list-link {
    padding: 12px 20px;
}

.place-list-link .place-link {
    display: flex;
    align-items: baseline;
    gap: 10px;
    text-decoration: none;
    color: var(--global-palette10, #1e5261);
    font-size: 1em;
    line-height: 1.35;
    transition: color 0.2s ease;
}

.place-list-link .place-link:hover {
    color: var(--global-palette2, #700038);
}

.place-list-link .place-link:hover .place-text {
    text-decoration: underline;
}

.place-list-link .place-link:hover .place-marker {
    transform: scale(1.4);
    color: var(--global-palette2, #700038);
}

.place-list-link .place-marker {
    flex-shrink: 0;
    color: var(--global-palette1, #9B004E);
    font-size: 1.1em;
    line-height: 1;
    transition: transform 0.2s ease, color 0.2s ease;
    display: inline-block;
}

/* ==============================================
   ФИЛЬТР ПО НАЗВАНИЮ (taxonomy-type_place.php)
   ============================================== */
.place-filter-wrapper {
    position: relative;
    margin: 20px 0 30px;
    max-width: 500px;
}

.place-filter-input {
    width: 100%;
    padding: 12px 20px 12px 44px;
    border: 2px solid var(--global-palette7, #e9eaee);
    border-radius: 30px;
    font-size: 1rem;
    background-color: var(--global-palette9, #ffffff);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%231e5261" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="7"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>');
    background-repeat: no-repeat;
    background-position: 16px center;
    transition: border-color 0.2s ease;
    color: var(--global-palette3, #00030c);
}

.place-filter-input:focus {
    outline: none;
    border-color: var(--global-palette1, #9B004E);
}

.place-filter-input::placeholder {
    color: var(--global-palette6, #546279);
}

.place-filter-count {
    display: block;
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--global-palette5, #374151);
    font-weight: 500;
    min-height: 1.2em;
}