/* ─── Tohkomeupog Interactive Map ─────────────────────────────────────────── */

.tohko-map-wrap {
    width: 100%;
    font-family: inherit;
}

.tohko-map-inner {
    position: relative;
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.28);
    cursor: crosshair;
}

.tohko-map-bg {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
}

/* ─── Hotspots ─────────────────────────────────────────────────────────────── */

.tohko-hotspot {
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 10;
}

.tohko-hotspot-pin {
    width: 28px;
    height: 28px;
    background: #c0392b;
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    transition: transform 0.18s ease, background 0.18s ease;
}

.tohko-hotspot:hover .tohko-hotspot-pin,
.tohko-hotspot.active .tohko-hotspot-pin {
    background: #d4a017;
    transform: rotate(-45deg) scale(1.2);
}

.tohko-hotspot-label {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.72);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    padding: 3px 8px;
    border-radius: 3px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
}

.tohko-hotspot:hover .tohko-hotspot-label {
    opacity: 1;
}

/* ─── Info Panel ───────────────────────────────────────────────────────────── */

.tohko-info-panel {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 560px;
    background: rgba(245, 240, 232, 0.98);
    border-left: 4px solid #c0392b;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.28);
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    overflow: hidden;
}

.tohko-info-panel.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* ─── Carousel ─────────────────────────────────────────────────────────────── */

.tohko-carousel {
    position: relative;
    width: 100%;
    background: #111;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.tohko-carousel.empty {
    display: none;
}

.tohko-carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
}

.tohko-carousel-track > div {
    flex: 0 0 100%;
    height: 100%;
    overflow: hidden;
}

.tohko-carousel-track img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tohko-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.45);
    color: #fff;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    z-index: 2;
    line-height: 1;
}

.tohko-carousel-btn:hover { background: rgba(0,0,0,0.72); }
.tohko-carousel-btn.prev  { left: 6px; }
.tohko-carousel-btn.next  { right: 6px; }
.tohko-carousel-btn:disabled { opacity: 0.25; cursor: default; }

.tohko-carousel-dots {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 2;
}

.tohko-carousel-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.45);
    cursor: pointer;
    border: none;
    transition: background 0.15s, transform 0.15s;
    padding: 0;
}

.tohko-carousel-dots .dot.active {
    background: #fff;
    transform: scale(1.3);
}

/* ─── Panel body ───────────────────────────────────────────────────────────── */

.tohko-panel-body {
    padding: 14px 16px 16px;
}

.tohko-panel-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.tohko-panel-icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.tohko-info-panel h2 {
    font-size: 1.05rem;
    color: #2d4a1e;
    line-height: 1.2;
    margin: 0;
}

.tohko-info-panel p {
    font-size: 0.81rem;
    line-height: 1.55;
    color: #3a2f1e;
    margin: 0;
}

.tohko-panel-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.35);
    border: none;
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
    transition: background 0.15s;
}

.tohko-panel-close:hover {
    background: rgba(0,0,0,0.65);
}

/* ─── Legend ───────────────────────────────────────────────────────────────── */

.tohko-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.tohko-legend-btn {
    background: #2d4a1e;
    color: #f5f0e8;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s;
}

.tohko-legend-btn:hover {
    background: #3a6186;
}

/* ─── Mobile ───────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {

    .tohko-map-inner {
        cursor: default; /* crosshair cursor is a desktop-only affordance */
    }

    /* Hotspot pins — 50% smaller for a less cluttered map on small screens */
    .tohko-hotspot-pin {
        width: 14px;
        height: 14px;
        border-width: 1.5px;
    }

    /* Labels permanently hidden on touch (no hover) — tapping opens the panel instead */
    .tohko-hotspot-label {
        display: none;
    }

    /* Info panel becomes a bottom sheet rather than a floating box.
       Flex column layout guarantees the body (title + description) is
       always visible — only the carousel area shrinks, and the sheet
       itself scrolls as a last resort on very short screens. */
    .tohko-info-panel {
        position: fixed;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        max-height: 70vh;
        overflow-y: auto;
        border-left: none;
        border-top: 4px solid #c0392b;
        border-radius: 12px 12px 0 0;
        transform: translateY(100%);
        box-shadow: 0 -8px 32px rgba(0,0,0,0.28);
        display: flex;
        flex-direction: column;
    }

    .tohko-info-panel.visible {
        transform: translateY(0);
    }

    /* Smaller, capped-height carousel so it can never crowd out the text below */
    .tohko-carousel {
        aspect-ratio: auto;
        height: 38vh;
        max-height: 220px;
        flex: 0 0 auto;
    }

    .tohko-carousel.empty {
        height: 0;
        max-height: 0;
    }

    .tohko-panel-body {
        flex: 1 1 auto;
        overflow-y: auto;
    }

    .tohko-panel-close {
        top: 10px;
        right: 10px;
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }

    .tohko-info-panel h2 {
        font-size: 1.1rem;
    }

    .tohko-info-panel p {
        font-size: 0.88rem;
    }

    /* Legend buttons get larger tap targets and wrap to full width nicely */
    .tohko-legend {
        gap: 10px;
    }

    .tohko-legend-btn {
        flex: 1 1 calc(50% - 5px);
        text-align: center;
        padding: 10px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 400px) {
    .tohko-legend-btn {
        flex: 1 1 100%;
    }
}
