/* WW Stomp & Play Tools — Map Drawer
   ------------------------------------------------------------------ */

/* ── Outer wrapper — fixed to viewport edge ── */
.snp-map-drawer {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    display: flex;
    align-items: center;
}

.snp-map-drawer--left  { left:  0; flex-direction: row; }
.snp-map-drawer--right { right: 0; flex-direction: row-reverse; }

/* ── Slide panel ── */
.snp-map-panel {
    background: #fdf5e6;
    border: 2px solid #6b4a28;
    border-radius: 0 12px 12px 0;
    padding: 20px 16px;
    box-shadow: 4px 0 16px rgba(40,20,5,0.18);
    /* hidden state */
    width: 0;
    overflow: hidden;
    opacity: 0;
    transition: width 0.3s ease, opacity 0.25s ease, padding 0.3s ease;
    padding-left: 0;
    padding-right: 0;
}

.snp-map-drawer--right .snp-map-panel {
    border-radius: 12px 0 0 12px;
}

.snp-map-drawer[aria-expanded="true"] .snp-map-panel {
    /* 44px = handle; 8px = breathing room from opposite edge */
    width: min(220px, calc(100vw - 44px - 8px));
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    opacity: 1;
    padding: 20px 16px;
}

.snp-map-panel__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    /* Allow wrapping so long names never clip on narrow viewports */
    white-space: normal;
}

.snp-map-panel__link {
    font-family: 'Fredoka', sans-serif;
    font-weight: 500;
    font-size: 15px;
    color: #5e3a18;
    text-decoration: none;
    display: block;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    letter-spacing: 0.3px;
    line-height: 1.3;
}

.snp-map-panel__link:hover {
    background: rgba(110,75,20,0.12);
    color: #3a1e0a;
    text-decoration: none;
}

/* Home / top-of-page link */
.snp-map-panel__link--home {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #7a5230;
}

.snp-map-panel__divider {
    height: 1px;
    background: rgba(110,75,20,0.2);
    margin: 6px 8px;
    list-style: none;
}

/* ── Handle / tab ── */
.snp-map-handle {
    position: relative;
    width: 44px;
    height: 120px;
    border: none;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 0 12px 12px 0;
    border-top:    2px solid #704e2c;
    border-right:  4px solid #6b4a28;
    border-bottom: 3px solid #5a3d1e;
    box-shadow:
        inset 0 2px 2px rgba(254,245,226,0.3),
        3px 3px 8px rgba(40,20,5,0.2);
    background: transparent;
}

.snp-map-drawer--right .snp-map-handle {
    border-radius: 12px 0 0 12px;
    border-right:  none;
    border-left:   4px solid #6b4a28;
    box-shadow:
        inset 0 2px 2px rgba(254,245,226,0.3),
        -3px 3px 8px rgba(40,20,5,0.2);
}

/* ── Handle background image ── */
.snp-map-handle__bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.snp-map-handle__bg img {
    /* 620px = same scale as signs. !important overrides the near-universal
       WordPress theme rule:  img { max-width: 100%; height: auto; }
       Without this override the image shrinks to the 44 px button width.    */
    width: 620px !important;
    max-width: none !important;
    height: auto !important;
    min-height: 100%;
    position: absolute;
    top: 0;
    display: block;
}

.snp-map-handle__bg img[data-align="right"] { right: 0; left: auto; }
.snp-map-handle__bg img[data-align="left"]  { left:  0; right: auto; }

/* ── MAP letter stack ── */
.snp-map-handle__text {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    height: 100%;
}

.snp-map-letter {
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 28px;
    color: #3a1e0a;
    line-height: 1;
    display: block;
    text-shadow:
        0px  1.5px 0px rgba(254,245,226,0.55),
        0px  2.5px 1px rgba(254,245,226,0.2),
        0px -1px   0px rgba(30,15,3,0.35),
        1px  0px   0px rgba(30,15,3,0.1),
        -1px 0px   0px rgba(254,245,226,0.15),
        0px  0px   4px rgba(78,51,27,0.15);
}

/* ── Responsive: shrink on small screens ── */
@media (max-width: 768px) {
    .snp-map-handle {
        width: 36px;
        height: 100px;
    }
    .snp-map-letter {
        font-size: 22px;
    }
    .snp-map-drawer[aria-expanded="true"] .snp-map-panel {
        width: min(180px, calc(100vw - 36px - 8px));
        /* Full viewport height minus admin bar space — ensures all 8 stops scroll into view */
        max-height: calc(100vh - 60px);
        padding: 14px 12px;
    }
    .snp-map-panel__link {
        font-size: 13px;
        padding: 5px 6px;
    }
    .snp-map-panel__link--home {
        font-size: 12px;
    }
}
