/* index 미니맵 — 이벤트 자세히 보기 (플러그인 전용) */

/* place_mini_map.php — 제목 행 + [자세히 보기] (기존 CSS 미수정) */
.mm-ad-event-layout .mm-ad-event-heading-row {
    grid-area: heading;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    align-self: center;
}

.mm-ad-event-layout .mm-ad-event-heading-row .mm-ad-event-heading {
    margin: 0;
    flex: 1;
    min-width: 0;
}

.mm-ad-event-heading-more {
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: #6b5ce6;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.mm-ad-event-heading-more::after {
    content: "";
    width: 6px;
    height: 6px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
    margin-top: 1px;
}

.mm-ad-event-heading-more:hover {
    color: #5648c9;
}

.mm-ad-event-heading-more:focus-visible {
    outline: 2px solid rgba(107, 92, 230, 0.45);
    outline-offset: 3px;
    border-radius: 4px;
}

/* —— 모달 —— */
.mmel-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    box-sizing: border-box;
}

.mmel-modal[hidden] {
    display: none !important;
}

.mmel-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 14, 24, 0.58);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.mmel-modal__panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1000px;
    max-height: min(90vh, 90dvh, 900px);
    display: flex;
    flex-direction: column;
    background: linear-gradient(165deg, #ffffff 0%, #faf8f5 48%, #f5f2ee 100%);
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow:
        0 24px 64px rgba(15, 18, 32, 0.22),
        0 0 0 1px rgba(107, 92, 230, 0.06);
    overflow: hidden;
}

.mmel-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #3d4258;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(15, 18, 32, 0.08);
    transition: background 0.2s ease, color 0.2s ease;
}

.mmel-modal__close:hover {
    background: #fff;
    color: #171b2e;
}

.mmel-modal__head {
    position: relative;
    flex-shrink: 0;
    padding: 20px 52px 16px 24px;
    border-bottom: 1px solid rgba(23, 27, 46, 0.06);
}

.mmel-modal__head-accent {
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, #6b5ce6 0%, #a78bfa 42%, #d4a574 100%);
    opacity: 0.9;
}

.mmel-modal__title {
    margin: 4px 0 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.02em;
    color: #171b2e;
}

.mmel-modal__subtitle {
    margin: 8px 0 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    color: #6b7280;
    letter-spacing: -0.01em;
}

.mmel-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 20px 24px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.mmel-grid {
    width: 100%;
    box-sizing: border-box;
}

.mmel-grid.mmel-grid--card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.mmel-grid.mmel-grid--list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mmel-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(23, 27, 46, 0.07);
    box-shadow: 0 4px 20px rgba(15, 18, 32, 0.06);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.mmel-card:hover {
    transform: translateY(-2px);
    border-color: rgba(107, 92, 230, 0.18);
    box-shadow: 0 10px 28px rgba(107, 92, 230, 0.12);
}

.mmel-card__thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: linear-gradient(145deg, #f0edf8 0%, #e8e4f4 100%);
    overflow: hidden;
}

.mmel-card__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mmel-card__thumb--empty {
    background: linear-gradient(145deg, #f3f0fa 0%, #ebe6f8 55%, #f8f4ef 100%);
}

.mmel-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, #e85d6a 0%, #d4475a 100%);
    box-shadow: 0 2px 8px rgba(212, 71, 90, 0.35);
}

.mmel-card__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 14px 16px;
    flex: 1;
}

.mmel-card__title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: -0.02em;
    color: #171b2e;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mmel-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-top: auto;
}

.mmel-card__shop {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: #4b5563;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mmel-card__distance {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: #6b5ce6;
}

.mmel-card__period {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    color: #9ca3af;
    width: 100%;
}

.mmel-sentinel {
    height: 1px;
    margin-top: 8px;
}

.mmel-status {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    color: #6b7280;
}

.mmel-status[hidden] {
    display: none !important;
}

.mmel-status__spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(107, 92, 230, 0.18);
    border-top-color: #6b5ce6;
    border-radius: 50%;
    animation: mmel-spin 0.75s linear infinite;
}

@keyframes mmel-spin {
    to {
        transform: rotate(360deg);
    }
}

.mmel-card--enter {
    animation: mmel-card-in 0.38s ease both;
}

.mmel-item--enter {
    animation: mmel-card-in 0.38s ease both;
}

/* —— 리스트형 (미니맵 캐러셀 유사) —— */
.mmel-list-row {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-height: 130px;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    background: #fff;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 10px rgba(15, 18, 32, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mmel-list-row--link:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 14px rgba(17, 24, 39, 0.06);
}

.mmel-list-row__thumb {
    position: relative;
    flex: 0 0 auto;
    width: 130px;
    min-width: 130px;
    align-self: stretch;
    background: linear-gradient(135deg, #f9fafb 0%, #eef2ff 100%);
    overflow: hidden;
}

.mmel-list-row__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mmel-list-row__thumb--empty {
    background: linear-gradient(135deg, #f9fafb 0%, #eef2ff 100%);
}

.mmel-list-row__badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
    color: #fff;
    background: #ef4444;
    z-index: 1;
}

.mmel-list-row__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
    padding: 12px 14px 12px 12px;
}

.mmel-list-row__title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -0.02em;
    color: #111827;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mmel-list-row__shop {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: #6b7280;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@keyframes mmel-card-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.mmel-modal-open {
    overflow: hidden;
    touch-action: none;
}

html.mmel-modal-open {
    overflow: hidden;
}

@media (min-width: 601px) {
    .mmel-modal {
        padding: 32px 24px;
    }

    .mmel-modal__head {
        padding: 28px 60px 22px 32px;
    }

    .mmel-modal__head-accent {
        left: 32px;
        right: 32px;
    }

    .mmel-modal__title {
        font-size: 24px;
        margin-top: 6px;
        line-height: 1.35;
    }

    .mmel-modal__subtitle {
        margin-top: 10px;
        font-size: 15px;
        line-height: 1.5;
    }

    .mmel-modal__body {
        padding: 20px 28px 32px;
    }

    .mmel-grid.mmel-grid--list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .mmel-grid.mmel-grid--card {
        gap: 18px;
    }

    .mmel-card__body {
        padding: 16px 16px 18px;
    }

    .mmel-card__title {
        font-size: 15px;
        line-height: 1.5;
    }
}

@media (max-width: 600px) {
    .mmel-modal {
        display: block;
        padding: 0;
        position: fixed;
        inset: 0;
        z-index: 10050;
    }

    .mmel-modal__backdrop {
        position: fixed;
        inset: 0;
    }

    .mmel-modal__panel {
        position: fixed;
        left: 12px;
        right: 12px;
        top: calc(2.5dvh + env(safe-area-inset-top, 0px));
        bottom: calc(2.5dvh + env(safe-area-inset-bottom, 0px));
        z-index: 10051;
        width: auto;
        max-width: none;
        height: auto;
        min-height: 0;
        max-height: none;
        margin: 0;
        border-radius: 20px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        box-sizing: border-box;
        box-shadow:
            0 16px 48px rgba(15, 18, 32, 0.2),
            0 0 0 1px rgba(107, 92, 230, 0.06);
    }

    .mmel-grid.mmel-grid--card {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .mmel-grid.mmel-grid--list {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .mmel-list-row__thumb {
        width: 151px;
        min-width: 151px;
    }

    .mmel-list-row {
        min-height: 151px;
    }

    .mmel-modal__head {
        flex: 0 0 auto;
        padding: 22px 20px 20px 20px;
    }

    .mmel-modal__head-accent {
        left: 20px;
        right: 20px;
    }

    .mmel-modal__title {
        font-size: 22px;
        margin-top: 6px;
        line-height: 1.4;
    }

    .mmel-modal__subtitle {
        margin-top: 10px;
        line-height: 1.55;
    }

    .mmel-modal__body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding: 16px 16px 28px;
    }

    .mmel-modal__close {
        display: none;
    }
}
