/* ==============================================
   НАВИГАТОР БИБЛИОТЕК
   library-home.php, library-location.php
   ============================================== */

/* ===== ГРОМАДЫ (районы города / громады) ===== */
.location-child {
    margin-bottom: 3em;
    padding-bottom: 1em;
}

.location-child:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Заголовок громады с иконкой */
.location-child h2 {
    margin-top: 1em;
    font-size: 1.4rem;
    padding-left: 35px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%231e5261" width="20px" height="20px"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"/></svg>') no-repeat left center;
    background-size: 24px 24px;
    text-transform: uppercase;
    color: var(--global-palette6, #546279);
    font-weight: 700;
}

.location-child .subzag {
    margin-bottom: 16px;
    padding-left: 16px;
}

/* Ссылка "Перейти до бібліотек м. Харкова" */
.location-child-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--global-palette1, #9B004E);
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

.location-child-link:hover {
    color: var(--global-palette2, #700038);
    text-decoration: underline;
    transform: translateX(4px);
}

/* ===== ГРУППА ПО ТИПАМ (внутри громады) ===== */
.type-group {
    margin-bottom: 30px;
}

.type-group:last-child {
    margin-bottom: 0;
}

.type-group-header {
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--global-palette7, #e9eaee);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px;
}

.type-group-title {
    font-family: var(--global-heading-font-family);
    margin: 0.5em 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--global-palette5, #374151);
    padding-left: 12px;
    border-left: 4px solid var(--global-palette1, #9B004E);
}

.type-group-link {
    font-size: 0.9rem;
    color: var(--global-palette1, #9B004E);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.type-group-link:hover {
    color: var(--global-palette2, #700038);
    text-decoration: underline;
}

/* ===== ТИП БИБЛИОТЕКИ (плашка в спойлере) ===== */
.place-type-row {
    margin: 0 0 12px;
    font-size: 1rem;
}

.place-type-link-inline {
    color: var(--global-palette5, #374151) !important;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.place-type-link-inline:hover {
    color: var(--global-palette4, #1e2635);
    text-decoration: underline;
}

/* ===== СЕТКА РАЙОНОВ (library-home) ===== */
.library-districts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

/* ===== КАРТОЧКА РАЙОНА (library-home) ===== */
.district-card {
    background: var(--global-palette8, #f3f5f6);
    border-radius: 16px;
    padding: 18px;
    transition: all 0.2s ease;
    border: 1px solid var(--global-palette7, #e9eaee);
}

.district-card:hover {
    border-color: var(--global-palette7, #e9eaee);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.district-header {
    margin-bottom: 10px;
    border-bottom: 1px dashed var(--global-palette6, #546279);
    padding-bottom: 8px;
}

.district-title {
    font-size: 1.4rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--global-palette10, #1e5261);
    text-decoration: none;
    font-family: var(--global-heading-font-family) !important;
}

.district-title:hover {
    color: var(--global-palette2, #700038);
    text-decoration: none;
}

.district-title-en {
    color: var(--global-palette4, #1e2635);
    font-weight: 400;
}

/* ===== СПИСОК БИБЛИОТЕК В КАРТОЧКЕ РАЙОНА ===== */
.libraries-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.libraries-list li {
    padding: 8px 0 8px 22px;
    position: relative;
}

/* Буллет ◎ — как везде */
.libraries-list li::before {
    content: "◎";
    position: absolute;
    left: 0;
    top: 7px;
    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;
}

.libraries-list li:hover::before {
    transform: scale(1.4);
    color: var(--global-palette2, #700038);
}

.libraries-list li a {
    color: var(--global-palette3, #00030c);
    text-decoration: none;
    font-size: 1em;
    line-height: 1.25;
    display: block;
}

.libraries-list li a:hover {
    color: var(--global-palette2, #700038);
    text-decoration: underline;
}

/* ===== СЕТКА БИБЛИОТЕК (устаревшая — для совместимости) ===== */
.libraries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin: 15px 0;
}

.library-item {
    display: flex;
    flex-direction: column;
    padding: 8px 10px;
    background: var(--global-palette8, #f3f5f6);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid var(--global-palette7, #e9eaee);
}

.library-item:hover {
    border-color: var(--global-palette7, #e9eaee);
    background: var(--global-palette8, #f3f5f6);
    transform: translateY(-2px);
}

.library-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--global-palette3, #00030c);
}

.library-name-en {
    font-size: 0.9rem;
    color: var(--global-palette2, #700038);
    font-weight: 500;
}

.featured-star {
    color: #d4af37;
    margin-left: 4px;
}

/* ===== ССЫЛКА "ВСІ БІБЛІОТЕКИ РАЙОНУ" ===== */
.all-link {
    display: inline-block;
    margin-top: 10px;
    font-weight: 600;
    color: var(--global-palette1, #9B004E);
    text-decoration: none;
    transition: all 0.2s ease;
}

.all-link:hover {
    color: var(--global-palette2, #700038);
    text-decoration: underline;
}

/* ===== НЕТ БИБЛИОТЕК ===== */
.no-libraries {
    color: var(--global-palette6, #546279);
    font-style: italic;
    padding: 10px 0;
    margin: 0;
}

/* ===== СТРЕЛКА "ВГОРУ" (справа внизу громады) ===== */
.scroll-to-top-wrapper {
    text-align: right;
    margin-top: 20px;
}

.scroll-to-top {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--global-palette2, #700038);
    background: transparent;
    border: 1px solid var(--global-palette2, #700038);
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    line-height: 1;
}

.scroll-to-top:hover {
    background: var(--global-palette2, #700038);
    color: var(--global-palette9, #ffffff);
    transform: translateY(-2px);
}

/* ===== АДАПТИВ ===== */
@media (max-width: 768px) {
    .library-districts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .libraries-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media (max-width: 480px) {
    .libraries-grid {
        grid-template-columns: 1fr;
    }
}