/* Map */
.routen-map {
    width: 100%;
    height: 100%;
    flex: 1;
}

.routen-marker {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
}

.routen-marker-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.routen-marker:hover,
.routen-marker--hover {
    transform: scale(1.6);
}

.routen-marker-dot {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid white;
    z-index: 1;
}

/* Home button */
.routen-map-home-btn {
    position: absolute;
    bottom: 24px;
    right: 16px;
    z-index: 1000;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: var(--white-main);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--black-main);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.routen-map-home-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

/* Panel */
.routen-modules {
    width: 100%;
    max-width: 420px;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--white-main);
    border-left: 1px solid var(--black-main);
}

[dir="rtl"] .routen-modules {
    border-left: 1px solid var(--black-main);
    border-right: none;
}

.routen-modules-header {
    flex-shrink: 0;
    padding: var(--padding-global);
    padding-top: calc(var(--nav-height) + var(--padding-global));
    background-color: var(--white-main);
    border-bottom: 1px solid var(--black-main);
}

.routen-modules-title {
    font-size: 1.5rem;
    font-weight: var(--black);
    margin-bottom: 12px;
}

.routen-modules-list {
    flex: 1;
    min-height: 0;
    overflow-y: scroll;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 320px;
    gap: 8px;
    padding: 8px;
    align-content: start;
}

.routen-sentinel {
    grid-column: 1 / -1;
    height: 1px;
}

/* Filter */
.filter-container {
    width: 100%;
}

.filter-select {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2px;
}

.filter-select::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    padding: 8px 16px;
    font-family: 'ToshA', sans-serif;
    font-size: 0.85rem;
    font-weight: var(--regular);
    color: var(--black-main);
    -webkit-appearance: none;
    appearance: none;
    background-color: var(--white-main);
    border: 1px solid var(--black-main);
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}

.filter-btn:hover {
    background-color: #f5f5f5;
}

.filter-btn.active {
    background-color: var(--filter-btn-color, var(--black-main));
    color: var(--filter-btn-text-color, var(--white-main));
}

.filter-btn-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--filter-btn-color, transparent);
    margin-right: 5px;
    flex-shrink: 0;
    vertical-align: middle;
}
.filter-btn.active .filter-btn-dot {
    display: none;
}

/* Popup */
.routen-popup-wrapper .leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 0;
    overflow: hidden;
    background-color: var(--white-main);
    border: 1px solid var(--black-main);
}

.routen-popup-wrapper .leaflet-popup-content {
    margin: 0;
    font-family: 'ToshA', sans-serif;
}

.routen-popup-wrapper .leaflet-popup-tip-container {
    display: none;
}

.routen-popup {
    display: flex;
    flex-direction: column;
    min-width: 220px;
    color: var(--black-main);
    overflow: hidden;
  
}

.routen-popup-content {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.routen-popup-title {
    font-size: 0.95rem;
    font-weight: var(--black);
    line-height: 1.35;
    color: var(--black-main);
}

.routen-popup-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.routen-popup-tag {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.68rem;
    font-weight: var(--regular);
    color: var(--black-main);
    border-radius: 9999px;
    white-space: nowrap;
}

.routen-popup-desc {
    font-size: 0.8rem;
    font-weight: var(--regular);
    line-height: 1.45;
    color: var(--black-main);
    opacity: 0.7;
}

.routen-popup-ausstellung {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 18px;
    background-color: var(--black-main);
}

.routen-popup-ausstellung-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.routen-popup-ausstellung-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-width: 0;
}

.routen-popup-ausstellung-live {
    flex-shrink: 0;
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.routen-popup-ausstellung-text {
    font-size: 0.8rem;
    font-weight: var(--black);
    color: var(--white-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.routen-popup-ausstellung-datum {
    font-size: 0.7rem;
    font-weight: var(--regular);
    color: var(--white-main);
    opacity: 0.6;
}

.routen-popup-ausstellung-link {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white-main) !important;
    transition: opacity 0.15s ease;
}

.routen-popup-ausstellung-link:hover {
    opacity: 0.7;
}

.routen-popup-btn {
    display: block;
    margin-top: 4px;
    padding: 9px 14px;
    background-color: var(--black-main);
    color: var(--white-main) !important;
    font-family: 'ToshA', sans-serif;
    font-size: 0.78rem;
    font-weight: var(--black);
    text-decoration: none;
    border-radius: 9999px;
    border: none;
    text-align: center;
}

/* RTL overrides */
[dir="rtl"] .routen-popup-title {
    line-height: 1.7;
    text-align: right;
}
[dir="rtl"] .routen-popup-desc {
    line-height: 1.7;
    text-align: right;
}
[dir="rtl"] .routen-popup-meta {
    justify-content: flex-end;
}
[dir="rtl"] .routen-popup-ausstellung-item {
    flex-direction: row-reverse;
}

/* Skeleton */
@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.routen-card--skeleton {
    pointer-events: none;
    cursor: default;
}

.skeleton-image {
    width: 100%;
    flex: 1;
    min-height: 0;
    background: linear-gradient(90deg, #ececec 25%, #e0e0e0 50%, #ececec 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.skeleton-line {
    height: 11px;
    border-radius: 6px;
    background: linear-gradient(90deg, #ececec 25%, #e0e0e0 50%, #ececec 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.skeleton-line--title {
    width: 75%;
}

.skeleton-line--meta {
    width: 45%;
    margin-top: 4px;
}

/* Cards */
.routen-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--border-radius-global);
    overflow: hidden;
    background-color: var(--white-main);
    border: 1px solid rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    min-height: 0;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
}

.routen-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.routen-card--active {
    transform: scale(1.06);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.routen-card-image {
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
    background-color: var(--black-main);
}

.routen-card-image img,
.routen-card-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.routen-card-image-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    mix-blend-mode: multiply;
    opacity: 1;
}

.routen-card-body {
    height: fit-content;
    max-height: 100px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.routen-card-title {
    font-size: 0.85rem;
    font-weight: var(--black);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}



.routen-card-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.7rem;
    font-weight: var(--light);
    opacity: 0.45;
    margin-top: auto;
    padding-top: 4px;
}

@media (max-width: 768px) {
    /* 맵: 상단 고정 높이 */
    .routen-map {
        flex: none;
        height: 55svh;
        width: 100%;
    }

    /* 패널: 나머지 공간, max-width 해제, 상단 테두리 */
    .routen-modules {
        max-width: 100%;
        height: auto;
        flex: 1;
        border-left: none;
        border-top: 1px solid var(--black-main);
        min-height: 0;
    }

    /* 헤더: 패딩 축소 */
    .routen-modules-header {
        padding-top: var(--padding-global);
        padding-bottom: 8px;
    }

    /* 카테고리 타이틀 축소 */
    .routen-modules-title {
        font-size: 1rem;
        margin-bottom: 6px;
    }

    /* 리스트: 남은 공간 전체 채움, 가로 스크롤 */
    .routen-modules-list {
        display: flex;
        flex-direction: row;
        overflow-x: scroll;
        overflow-y: hidden;
        grid-template-columns: unset;
        grid-auto-rows: unset;
        gap: 8px;
        padding: 8px;
        align-items: stretch;
        flex: 1;
        min-height: 0;
        scrollbar-width: none;
    }

    .routen-modules-list::-webkit-scrollbar {
        display: none;
    }

    /* 카드: 높이=리스트 높이, aspect-ratio 1:1 */
    .routen-card {
        flex: none;
        height: 100%;
        aspect-ratio: 1 / 1;
        position: relative;
    }

    .routen-card-image {
        display: block;
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        flex: none;
        min-height: 0;
    }

    .routen-card-body {
        position: absolute;
        inset: 0;
        z-index: 2;
        max-height: none;
        height: 100%;
        padding: 8px;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 60%);
    }

    .routen-card-title {
        color: var(--white-main);
        white-space: normal;
        line-height: 1.2;
        font-size: 0.75rem;
    }

    .routen-card-meta {
        display: none;
    }

    /* sentinel */
    .routen-sentinel {
        grid-column: unset;
        width: 1px;
        height: 100%;
        flex-shrink: 0;
    }
}
