/* ==========================================================================
   1. CLEAN SCROLLABLE WINDOW LAYOUT
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #bce3f7; /* Matching sky-blue canvas backdrop */
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: auto; /* Allows vertical and horizontal scrolling naturally when map expands */
    width: 100%;
    min-height: 100vh;
}

/* Container locked to the map image's exact aspect ratio (1536x1034).
   This ensures hotspot % positions track correctly at every screen size. */
.map-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1536 / 1034;
    display: block;
    overflow: hidden;
}

/* Image fills the container exactly — no gaps, no drift */
.map-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}


/* ==========================================================================
   2. ACCESSIBLE CLICKABLE SIGNPOST NAVIGATION
   ========================================================================== */
.hotspot {
    position: absolute;
    display: block;
    cursor: pointer;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0);
    transition: background-color 0.2s ease, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

/* Playful yellow glow response when hovered or tabbed with keys */
.hotspot:hover, .hotspot:focus {
    background-color: rgba(255, 235, 59, 0.25);
    outline: 3px dashed #ff9800;
    outline-offset: 4px;
    transform: scale(1.05);
}

/* Accessibility Utility Screen Reader Text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* High-Precision Signpost Coordinate Map Layout */
.sign-castle       { top: 9%;  left: 1%;  width: 14%; height: 13%; }
.sign-secret-cove  { top: 13%; left: 38%; width: 14%; height: 11%; }
.sign-lighthouse   { top: 14%; left: 84%; width: 13%; height: 12%; }
.sign-kitchen      { top: 38%; left: 6%;  width: 14%; height: 12%; }
.sign-harbour      { top: 38%; left: 60%; width: 11%; height: 10%; }
.sign-storybook    { top: 36%; left: 71%; width: 13%; height: 11%; }
.sign-sparkles     { top: 70%; left: 5%;  width: 11%; height: 9%; }
.sign-welcome      { top: 53%; left: 21%; width: 35%; height: 41%; border-radius: 20px; }
.sign-cottage      { top: 69%; left: 85%; width: 12%; height: 10%; }
.sign-tide-pools   { top: 83%; left: 88%; width: 11%; height: 11%; }
.sign-games        { top: 85%; left: 51%; width: 13%; height: 12%; }
.sign-characters   { top: 74%; left: 53%; width: 13%; height: 10%; }

/* ==========================================================================
   3. HIGH-CONTRAST SITE FOOTER TYPOGRAPHY
   ========================================================================== */
.storybook-footer {
    position: absolute; /* Forces the footer layer to pin relative to the map box */
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 25px 10px;
    text-align: center;
    z-index: 50; /* 🚀 CRITICAL: Sits higher than .hotspot (10) so the link is clickable */
    pointer-events: none; /* lets the overall transparent background ignore mouse clicks */
}

.storybook-footer p {
    font-size: 1.1rem !important;
    color: #ffffff !important;
    text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.9) !important;
    font-weight: 500;
    margin: 0;
    pointer-events: auto; /* 🚀 CRITICAL: Restores clicking specifically for the text and link */
}

.storybook-footer p a {
    color: #ffffff !important;
    text-decoration: underline !important;
    font-weight: bold;
    cursor: pointer; /* Explicitly forces the hand pointer icon to show on hover */
}

/* ==========================================================================
   4. MOBILE PAN/SWIPE MAP CONTAINER
   ========================================================================== */

/* Desktop: scroller wrapper is invisible — pure passthrough */
.mobile-map-scroller {
    display: contents;
}

/* Pan hint hidden on desktop */
.mobile-pan-hint {
    display: none;
}

@media (max-width: 768px) {

    /* Full-screen scrollable porthole — user swipes inside this */
    .mobile-map-scroller {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        overflow: auto;
        touch-action: pan-x pan-y;
        -webkit-overflow-scrolling: touch;
        background-color: #bce3f7;
        z-index: 1;
    }

    /* Map renders large — wider than phone forces horizontal pan */
    .map-container {
        width: 1536px !important;
        max-width: none !important;
        aspect-ratio: 1536 / 1034;
        position: relative;
    }

    /* Pan hint badge */
    .mobile-pan-hint {
        display: flex;
        position: fixed;
        bottom: 24px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(62, 39, 35, 0.88);
        color: #fff;
        font-family: Georgia, serif;
        font-size: 0.9rem;
        padding: 10px 20px;
        border-radius: 30px;
        z-index: 999;
        pointer-events: none;
        align-items: center;
        gap: 8px;
        white-space: nowrap;
        box-shadow: 0 4px 16px rgba(0,0,0,0.35);
        animation: hintFadeOut 4s ease forwards;
        animation-delay: 1s;
    }

    @keyframes hintFadeOut {
        0%   { opacity: 1; }
        75%  { opacity: 1; }
        100% { opacity: 0; }
    }

    /* Shrink branding banner slightly */
    .site-branding-banner {
        top: 10px !important;
        padding: 7px 16px !important;
    }

    .banner-line-two { font-size: 1.4rem !important; }
    .banner-line-one { font-size: 0.72rem !important; }

    .storybook-footer p { font-size: 0.72rem !important; }

    /* Privacy banner sits above the scroller */
    #privacy-banner { z-index: 1000 !important; }
}