/* Mapbox Control Fixes */
.mapboxgl-ctrl-top-left,
.mapboxgl-ctrl-top-right,
.mapboxgl-ctrl-bottom-left,
.mapboxgl-ctrl-bottom-right {
    margin: 10px !important;
}

/* Ensure map container clips content */
#map {
    overflow: hidden;
    border-radius: inherit;
    position: relative;
}

/* Filter Info Toggle Arrow */
.map-arrow {
    width: 12px;
    height: 12px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: transform 0.3s ease;
    display: inline-block;
    position: relative;
}

    .map-arrow.minus {
        background-image: url('/images/digital-library/icons/minus_icon.svg');
    }

    .map-arrow.add {
        background-image: url('/images/digital-library/icons/add_icon.svg');
    }

    /* CSS-only fallback / overlay */
    .map-arrow::before, .map-arrow::after {
        content: '';
        position: absolute;
        background-color: white;
    }

    /* Horizontal line (common) */
    .map-arrow::before {
        top: 5px;
        left: 0;
        width: 12px;
        height: 2px;
    }

    /* Vertical line (add only) */
    .map-arrow.add::after {
        top: 0;
        left: 5px;
        width: 2px;
        height: 12px;
    }

    /* Hide vertical line for minus */
    .map-arrow.minus::after {
        display: none;
    }

/* 地圖容器 */
.map-plugin-content {
    position: relative;
    width: 100%;
    height: 660px;
    border-radius: 12px;
    overflow: hidden;
}

/* map 本體 */
#map {
    width: 100%;
    height: 100%;
}

/* 精確檢索按鈕 外層 */
.map-plugin-btns-wrapper {
    position: absolute;
    bottom: 0;
    width: 100%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
}

/* 精確檢索按鈕 */
#map-refine-search-btn {
    background: #004080;
    color: white;
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: bold;
    cursor: pointer;
    border: none;
}

/* 右上方篩選條件 */
.search-filter-info {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    width: 420px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    padding-bottom: 8px;
    max-height: 300px;
}

#filter-info-content, .bar-reset {
    padding-left: 15px;
    padding-right: 15px;
}

.reset_btn {
    background-image: url(/images/digital-library/icons/refresh_icon.svg);
}

/* 藏品卡片 */
#collectionCards {
    display: grid;
    grid-template-columns: repeat((2), 1fr);
    gap: 16px;
}

@media(min-width: 640px) {
    #collectionCards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media(min-width: 1024px) {
    #collectionCards {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* 彈窗黑色背景 */
.map-overlay,
.tick-list-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.8);
}

/* 彈窗內容 */
.map-card-popup,
.tick-list-card-popup {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
}

/* 彈窗本體 */
.map-pop-up-container {
    max-height: 90vh;
}
.tick-list-popup-container {
    background: white;
    border-radius: 12px;
    max-width: 28rem;
    width: 90%;
    margin-top: 3.5rem;
    padding-bottom: 24px;
}
.search_icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url('/images/digital-library/icons/search_icon.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}

.recommended-browser-card-wrapper {
    min-width: 0;
}

/* 左側精確檢索面板吸附標題 */
.sticky-header-1 {
    position: sticky;
    top: 0px;
    z-index: 30;
}

.sticky-header-2 {
    position: sticky;
    top: 41px;
    z-index: 20;
}

.sticky-header-3 {
    position: sticky;
    top: 82px;
    z-index: 10;
}

#moreinformation-btn {
    background-color: #facc15;
    color: #000;
    font-weight: 600; 
    padding: 0.5rem 1rem; 
    border-radius: 0.5rem; 
    border: none; 
    cursor: pointer; 
    transition: background-color 0.2s; 
}

#moreinformation-btn:hover {
    background-color: #f6e087;
}
.map-image-wrapper {
    height: 260px;
    max-height: 30vh;
    overflow: hidden;
    background-color: #f3f4f6;
}
.line-clamp-5 {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}