/* /map/: the living masjid map. Brand tokens come from theme.css. */

.map-body { overflow: hidden; overscroll-behavior: none; }
.map-body #footer-container { display: none; }

.map-stage {
    --map-top: 64px;
    --map-bottom: 0px;
    --map-sky: #faf6ee;
    --glass: rgba(255, 252, 245, 0.86);
    --glass-line: rgba(18, 54, 47, 0.1);
    --map-shadow: 0 18px 50px -22px rgba(18, 54, 47, 0.45), 0 2px 8px -2px rgba(18, 54, 47, 0.12);
    position: fixed;
    left: 0;
    right: 0;
    top: var(--map-top);
    bottom: var(--map-bottom);
    overflow: hidden;
    background: var(--map-sky);
    isolation: isolate;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

/* Poster first, canvas fades in over it. */
.map-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    transition: opacity 900ms ease;
}
.map-canvas-wrap {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0;
    transition: opacity 900ms ease;
}
.map-stage.is-ready .map-canvas-wrap { opacity: 1; }
.map-stage.is-ready .map-poster { opacity: 0; }
.map-canvas-wrap canvas { display: block; cursor: grab; outline: none; }
.map-stage.is-over canvas { cursor: pointer; }
.map-stage.is-grabbing canvas { cursor: grabbing; }

/* ------------------------------------------------------------ labels */

.map-labels { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.map-label {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 220ms ease, visibility 0s linear 220ms, background-color 150ms ease, color 150ms ease;
    white-space: nowrap;
    will-change: transform;
}
.map-label.is-on { opacity: 1; visibility: visible; transition: opacity 220ms ease, visibility 0s, background-color 150ms ease, color 150ms ease; }

.map-label.is-masjid, .map-label.is-metro {
    pointer-events: auto;
    border: 0;
    font-family: var(--font-display);
    font-weight: 650;
    border-radius: 999px;
    box-shadow: 0 6px 16px -8px rgba(18, 54, 47, 0.55), 0 0 0 1px rgba(18, 54, 47, 0.08);
    cursor: pointer;
}
.map-label.is-masjid {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.28rem 0.7rem 0.28rem 0.5rem;
    background: rgba(255, 253, 248, 0.96);
    color: var(--forest);
    font-size: 0.78rem;
    letter-spacing: 0.01em;
}
.map-label.is-masjid .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px rgba(227, 163, 64, 0.22); }
.map-label.is-masjid::after, .map-label.is-metro::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -5px;
    width: 10px;
    height: 10px;
    background: inherit;
    transform: translateX(-50%) rotate(45deg);
    border-radius: 0 0 3px 0;
    z-index: -1;
}
.map-label.is-masjid.is-hot, .map-label.is-masjid:hover, .map-label.is-masjid:focus-visible {
    background: var(--forest);
    color: #fff;
}
.map-label.is-masjid.is-hot .dot { background: var(--amber); box-shadow: 0 0 0 3px rgba(227, 163, 64, 0.35); }
.map-label.is-metro {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.42rem 0.5rem 0.42rem 0.95rem;
    background: var(--forest);
    color: #fff;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.map-label.is-metro b {
    display: inline-grid;
    place-items: center;
    min-width: 1.6rem;
    height: 1.6rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--amber);
    color: var(--forest);
    font-size: 0.8rem;
    letter-spacing: 0;
}
.map-label.is-metro:hover, .map-label.is-metro:focus-visible { background: var(--forest-600); }
.map-label.is-town {
    font-family: var(--font-display);
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(18, 54, 47, 0.62);
    text-shadow: 0 0 3px rgba(250, 246, 238, 0.95), 0 0 8px rgba(250, 246, 238, 0.8);
}
.map-label:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* ------------------------------------------------------------ glass cards */

.map-sheet, .map-panel, .map-controls, .map-time-pill, .map-time-drawer, .map-hint {
    background: var(--glass);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    backdrop-filter: blur(14px) saturate(1.2);
    border: 1px solid var(--glass-line);
    box-shadow: var(--map-shadow);
}

.map-sheet {
    position: absolute;
    z-index: 5;
    left: 1.25rem;
    top: 1.25rem;
    bottom: 1.25rem;
    width: min(360px, 34vw);
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    user-select: text;
    -webkit-user-select: text;
}
.map-sheet-handle { display: none; }
.map-sheet-head { padding: 1.3rem 1.3rem 0.6rem; }
.map-eyebrow {
    margin: 0 0 0.25rem;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #b47a1f;
}
.map-sheet-head h1 { font-size: 1.45rem; margin: 0 0 0.3rem; color: var(--forest); line-height: 1.15; }
.map-sub { margin: 0; font-size: 0.86rem; color: var(--muted); }
.map-search { position: relative; margin: 0.5rem 1.1rem 0.4rem; }
.map-search i { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.map-search input {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 14px;
    padding: 0.62rem 0.9rem 0.62rem 2.35rem;
    font-size: 0.95rem;
    color: var(--ink);
}
.map-search input:focus { outline: none; border-color: var(--forest-600); box-shadow: 0 0 0 3px rgba(36, 92, 79, 0.15); }
.map-now {
    margin: 0.3rem 1.1rem 0.4rem;
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    background: rgba(227, 163, 64, 0.14);
    color: #7a5313;
    font-size: 0.84rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.map-list { flex: 1; overflow-y: auto; padding: 0.2rem 0.6rem 1rem; overscroll-behavior: contain; touch-action: pan-y; }
.map-group-title {
    position: sticky;
    top: 0;
    margin: 0;
    padding: 0.7rem 0.6rem 0.35rem;
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--forest-600);
    background: linear-gradient(var(--glass) 70%, transparent);
    z-index: 1;
}
.map-group-title span { color: var(--muted); font-weight: 600; margin-left: 0.25rem; }
.map-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.05rem 0.6rem;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    border-radius: 12px;
    padding: 0.55rem 0.65rem;
    color: var(--ink);
    transition: background-color 120ms ease;
}
.map-item:hover, .map-item:focus-visible { background: rgba(36, 92, 79, 0.07); outline: none; }
.map-item.is-on { background: rgba(36, 92, 79, 0.12); }
.map-item-name { font-weight: 600; font-size: 0.9rem; color: var(--forest); line-height: 1.3; }
.map-item-meta { grid-column: 1; font-size: 0.78rem; color: var(--muted); }
.map-item-time { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 0.74rem; font-weight: 600; color: var(--forest-600); white-space: nowrap; }
.map-item-time.is-live { color: #9a5d06; }
.map-item.is-offmap .map-item-name { color: var(--ink-soft); }
.map-empty { padding: 1rem; color: var(--muted); font-size: 0.9rem; }

/* ------------------------------------------------------------ panel */

.map-panel {
    position: absolute;
    z-index: 6;
    right: 1.25rem;
    top: 1.25rem;
    width: min(400px, 38vw);
    max-height: calc(100% - 2.5rem);
    overflow-y: auto;
    border-radius: 22px;
    padding: 0 0 1rem;
    user-select: text;
    -webkit-user-select: text;
    animation: map-panel-in 380ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes map-panel-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.map-panel-band { height: 5px; background: linear-gradient(90deg, var(--forest), var(--forest-600) 60%, var(--amber)); }
.map-panel-close {
    position: absolute;
    right: 0.8rem;
    top: 0.9rem;
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 253, 248, 0.92);
    color: var(--forest);
    box-shadow: 0 2px 8px rgba(18, 54, 47, 0.18);
}
.map-panel-photo { display: block; width: 100%; height: 170px; object-fit: cover; }
.map-panel-body { padding: 1.1rem 1.3rem 0.4rem; }
.map-panel-body h2 { font-size: 1.35rem; color: var(--forest); margin: 0 2rem 0.4rem 0; line-height: 1.2; }
.map-panel-addr { font-size: 0.88rem; color: var(--ink-soft); margin-bottom: 0.7rem; display: flex; gap: 0.4rem; }
.map-panel-addr i { color: var(--amber); }
.map-panel-live { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.84rem; font-weight: 700; color: #9a5d06; margin-bottom: 0.6rem; }
.map-panel-jummah { background: var(--sand); border-radius: 14px; padding: 0.75rem 0.9rem; }
.map-panel-k { display: block; font-family: var(--font-display); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--forest-600); margin-bottom: 0.35rem; }
.map-times { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.map-times span { background: #fff; border-radius: 999px; padding: 0.25rem 0.7rem; font-weight: 700; font-size: 0.9rem; color: var(--forest); box-shadow: 0 1px 0 rgba(18, 54, 47, 0.08); }
.map-panel-actions { display: flex; gap: 0.5rem; padding: 0.9rem 1.3rem 0.2rem; flex-wrap: wrap; }
.map-panel-actions .btn { border-radius: 12px; }
.map-panel-nav { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.8rem 1rem 0; margin-top: 0.6rem; border-top: 1px solid var(--line); }
.map-panel-nav button {
    border: 0;
    background: none;
    color: var(--forest-600);
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    max-width: 48%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0.3rem 0.4rem;
    border-radius: 8px;
}
.map-panel-nav button:hover { background: rgba(36, 92, 79, 0.08); }

/* ------------------------------------------------------------ controls, time, hint */

.map-controls {
    position: absolute;
    z-index: 5;
    right: 1.25rem;
    bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
}
.map-stage.has-panel .map-controls { right: calc(min(400px, 38vw) + 2.25rem); }
.map-controls button {
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    color: var(--forest);
    font-size: 1.05rem;
    display: grid;
    place-items: center;
}
.map-controls button + button { border-top: 1px solid var(--glass-line); }
.map-controls button:hover { background: rgba(36, 92, 79, 0.08); }
.map-controls button[aria-pressed="true"] { background: var(--forest); color: #fff; }
.map-controls button.is-busy i { animation: map-spin 1s linear infinite; }
@keyframes map-spin { to { transform: rotate(360deg); } }

.map-time {
    position: absolute;
    z-index: 5;
    left: 50%;
    bottom: 1.25rem;
    transform: translateX(calc(-50% + min(360px, 34vw) / 2));
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 0.6rem;
}
.map-time-pill {
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-family: var(--font-display);
    font-weight: 650;
    font-size: 0.85rem;
    color: var(--forest);
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}
.map-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa5a0; flex: 0 0 auto; }
.map-time.is-live .map-live-dot, .map-now .map-live-dot, .map-panel-live .map-live-dot {
    background: #e3a340;
    box-shadow: 0 0 0 0 rgba(227, 163, 64, 0.6);
    animation: map-live 2s ease-out infinite;
}
@keyframes map-live { 0% { box-shadow: 0 0 0 0 rgba(227, 163, 64, 0.55); } 100% { box-shadow: 0 0 0 10px rgba(227, 163, 64, 0); } }
.map-time-drawer { width: min(520px, calc(100vw - 2rem)); border-radius: 20px; padding: 0.9rem 1.1rem 0.8rem; }
.map-time-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.map-time-title { font-family: var(--font-display); font-weight: 650; color: var(--forest); margin-right: auto; font-size: 0.92rem; }
.map-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 0.25rem 0.75rem; font-size: 0.8rem; font-weight: 600; color: var(--forest); }
.map-chip:hover { border-color: var(--forest-600); }
#map-scrub { width: 100%; accent-color: var(--forest-600); }
.map-prayer-ticks { position: relative; height: 1.3rem; margin: 0 0.5rem; }
.map-prayer-ticks span {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--forest-600);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.map-prayer-ticks i { width: 1px; height: 5px; background: var(--forest-600); margin-bottom: 1px; }
.map-time-note { font-size: 0.78rem; color: var(--muted); margin: 0.3rem 0 0; }

.map-hint {
    position: absolute;
    z-index: 4;
    left: 50%;
    top: 1.25rem;
    transform: translateX(calc(-50% + min(360px, 34vw) / 2));
    border-radius: 999px;
    padding: 0.45rem 1rem;
    font-family: var(--font-display);
    font-size: 0.74rem;
    font-weight: 650;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--forest);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 400ms ease, transform 400ms ease;
}
.map-hint.is-gone { opacity: 0; pointer-events: none; }
.map-credit {
    position: absolute;
    z-index: 4;
    right: 5rem;
    bottom: 0.4rem;
    margin: 0;
    font-size: 0.62rem;
    color: rgba(18, 54, 47, 0.5);
    pointer-events: none;
}
.map-fallback {
    position: absolute;
    z-index: 7;
    left: 50%;
    top: 50%;
    transform: translate(calc(-50% + min(360px, 34vw) / 2), -50%);
    max-width: 360px;
    padding: 1rem 1.2rem;
    border-radius: 16px;
    background: var(--glass);
    box-shadow: var(--map-shadow);
    font-size: 0.92rem;
}

/* No WebGL: the poster and the list are the whole experience. */
.map-stage.is-static .map-controls,
.map-stage.is-static .map-time,
.map-stage.is-static .map-hint,
.map-stage.is-static .map-labels { display: none; }

/* ------------------------------------------------------------ phones */

@media (max-width: 719.98px) {
    .map-sheet {
        left: 0.6rem;
        right: 0.6rem;
        top: auto;
        bottom: 0.6rem;
        width: auto;
        max-height: 172px;
        border-radius: 20px;
        transition: max-height 320ms cubic-bezier(0.22, 1, 0.36, 1);
    }
    .map-sheet.is-open { max-height: min(72%, 560px); }
    .map-sheet-handle {
        display: block;
        border: 0;
        background: none;
        padding: 0.45rem 0 0.1rem;
        width: 100%;
    }
    .map-sheet-handle span { display: block; width: 40px; height: 4px; border-radius: 4px; background: rgba(18, 54, 47, 0.22); margin: 0 auto; }
    .map-sheet-head { padding: 0.2rem 1rem 0.2rem; }
    .map-sheet-head h1 { font-size: 1.12rem; }
    .map-eyebrow { display: none; }
    .map-sub { font-size: 0.78rem; }
    .map-search { margin: 0.45rem 0.8rem 0.35rem; }
    .map-now { margin: 0.2rem 0.8rem 0.3rem; font-size: 0.78rem; }
    .map-panel {
        left: 0.6rem;
        right: 0.6rem;
        top: auto;
        bottom: 0.6rem;
        width: auto;
        max-height: 58%;
        border-radius: 20px;
        animation: map-sheet-in 360ms cubic-bezier(0.22, 1, 0.36, 1);
    }
    @keyframes map-sheet-in { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
    .map-stage.has-panel .map-sheet { visibility: hidden; }
    .map-panel-photo { height: 120px; }
    .map-controls { right: 0.6rem; top: 0.6rem; bottom: auto; }
    .map-stage.has-panel .map-controls { right: 0.6rem; }
    .map-controls button { width: 40px; height: 40px; }
    .map-time { left: 0.6rem; top: 0.6rem; bottom: auto; transform: none; align-items: flex-start; flex-direction: column; }
    .map-time-drawer { width: calc(100vw - 4.6rem); }
    .map-hint { top: auto; bottom: 190px; transform: translateX(-50%); font-size: 0.68rem; }
    .map-fallback { transform: translate(-50%, -50%); }
    .map-credit { right: auto; left: 0.8rem; bottom: auto; top: 3.3rem; }
}

@media (prefers-reduced-motion: reduce) {
    .map-panel, .map-sheet, .map-label, .map-canvas-wrap, .map-poster { transition: none; animation: none; }
    .map-live-dot { animation: none !important; }
}

/* ------------------------------------------------------------ mini map (Masjids page) */

.mini-map {
    position: relative;
    height: min(40vh, 340px);
    min-height: 210px;
    border-radius: 22px;
    overflow: hidden;
    background: #eef3ee url('/assets/map/poster-mini.jpg') center / cover no-repeat;
    cursor: pointer;
    box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.14);
    isolation: isolate;
    touch-action: pan-y;          /* a swipe over it scrolls the page, as it should */
}
.mini-map-canvas { position: absolute; inset: 0; opacity: 0; transition: opacity 900ms ease; }
.mini-map.is-ready .mini-map-canvas { opacity: 1; }
.mini-map-canvas canvas { display: block; cursor: pointer; }
.mini-map .map-labels { z-index: 2; }
.mini-map .map-label.is-metro { font-size: 0.66rem; padding: 0.3rem 0.35rem 0.3rem 0.7rem; }
.mini-map .map-label.is-metro b { min-width: 1.3rem; height: 1.3rem; font-size: 0.7rem; }
.mini-map-open {
    position: absolute;
    z-index: 3;
    right: 0.75rem;
    bottom: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 252, 245, 0.92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: var(--forest);
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 650;
    text-decoration: none;
    box-shadow: 0 6px 18px -8px rgba(18, 54, 47, 0.5);
}
.mini-map-open:hover { background: #fff; color: var(--forest); }
.mini-map-open::after { content: none !important; }
@media (prefers-reduced-motion: reduce) { .mini-map-canvas { transition: none; } }

/* ------------------------------------------------------------ masjid pins */

.map-pins { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.mpin {
    position: absolute;
    left: 0;
    top: 0;
    border: 0;
    padding: 0;
    background: none;
    pointer-events: auto;
    cursor: pointer;
    will-change: transform;
}
.mpin[hidden] { display: none; }
/* The disc sits above its point, on a short tail, like a map pin. */
.mpin-disc {
    position: absolute;
    left: -15px;
    top: -38px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #e3a340;
    color: #fff;
    border: 2.5px solid #fff;
    box-shadow: 0 6px 14px -4px rgba(10, 30, 26, 0.55), 0 0 0 1px rgba(18, 54, 47, 0.25);
    transition: transform 160ms ease, background-color 160ms ease;
}
.mpin-disc::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -8px;
    width: 3px;
    height: 7px;
    margin-left: -1.5px;
    border-radius: 2px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(10, 30, 26, 0.4);
}
.mpin-disc svg { width: 17px; height: 17px; fill: #fff; stroke: #fff; }
.mpin-disc b { display: none; }
/* A slow pulse so the eye finds the masjids first. */
.mpin-disc::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid rgba(227, 163, 64, 0.8);
    animation: mpin-pulse 2.8s ease-out infinite;
    pointer-events: none;
}
@keyframes mpin-pulse { from { transform: scale(1); opacity: 0.9; } to { transform: scale(1.9); opacity: 0; } }
.mpin:hover .mpin-disc, .mpin.is-hot .mpin-disc { transform: scale(1.12); }
.mpin.is-selected .mpin-disc { background: var(--forest); transform: scale(1.18); }

.mpin:focus-visible { outline: none; }
.mpin:focus-visible .mpin-disc { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--amber); }

/* Several masjids close together: a bigger pin with the count. */
.mpin.is-cluster .mpin-disc { left: -20px; top: -48px; width: 40px; height: 40px; background: var(--forest); }
.mpin.is-cluster .mpin-disc svg { position: absolute; top: 4px; width: 13px; height: 13px; fill: #e3a340; stroke: #e3a340; }
.mpin.is-cluster .mpin-disc b {
    display: block;
    margin-top: 11px;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 750;
    color: #fff;
    line-height: 1;
}
/* A counted pin has no pulse: a steady white rim reads cleaner than a ring. */
.mpin.is-cluster .mpin-disc::before { display: none; }
.mpin.is-cluster .mpin-disc { box-shadow: 0 0 0 3px rgba(255, 253, 248, 0.92), 0 8px 18px -6px rgba(10, 30, 26, 0.55); }

.mpin-name {
    position: absolute;
    left: 18px;
    top: -34px;
    white-space: nowrap;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.95);
    color: var(--forest);
    font-family: var(--font-display);
    font-size: 0.74rem;
    font-weight: 650;
    box-shadow: 0 4px 12px -6px rgba(10, 30, 26, 0.5);
}
.mpin-name[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .mpin-disc::before { animation: none; opacity: 0; } }

/* ------------------------------------------------------------ homepage: the map, live and decorative */

.home-live-map {
    position: relative;
    overflow: hidden;
    padding: 3rem 0;
    background: linear-gradient(180deg, #faf6ee 0%, #e6f2f5 30%, #d6ebf3 65%, #faf6ee 100%);
}
.home-live-map::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.6s ease;
    pointer-events: none;
}
.home-live-map[data-phase="dawn"]::before { opacity: 1; background: linear-gradient(180deg, #faf6ee 0%, #e7dcef 30%, #f6d8c9 70%, #faf6ee 100%); }
.home-live-map[data-phase="golden"]::before { opacity: 1; background: linear-gradient(180deg, #faf6ee 0%, #fbe3c4 30%, #f6cfa6 65%, #faf6ee 100%); }
.home-live-map[data-phase="dusk"]::before { opacity: 1; background: linear-gradient(180deg, #faf6ee 0%, #6c5a8e 22%, #3b3f6e 60%, #faf6ee 100%); }
.home-live-map[data-phase="night"]::before { opacity: 1; background: linear-gradient(180deg, #faf6ee 0%, #183a4a 20%, #0f2a33 55%, #12362f 82%, #faf6ee 100%); }
.home-live-map > .container { position: relative; }
.home-live-map[data-phase="dusk"] .hlm-copy h2, .home-live-map[data-phase="night"] .hlm-copy h2 { color: #fbf3e2; }
.home-live-map[data-phase="dusk"] .hlm-copy p, .home-live-map[data-phase="night"] .hlm-copy p,
.home-live-map[data-phase="dusk"] .hlm-stats, .home-live-map[data-phase="night"] .hlm-stats { color: rgba(251, 243, 226, 0.82); }
.home-live-map[data-phase="dusk"] .hlm-go, .home-live-map[data-phase="night"] .hlm-go { background: #e3a340; border-color: #e3a340; color: #12362f; }
.hlm-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr); gap: 2rem; align-items: center; }
.hlm-copy h2 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.03em; color: var(--forest); font-size: clamp(1.9rem, 3.4vw, 2.7rem); line-height: 1.05; margin: 0.4rem 0 0.7rem; }
.hlm-copy p { color: rgba(18, 54, 47, 0.74); font-size: 1.05rem; margin: 0 0 1.1rem; }
.hlm-stats { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; margin-bottom: 1.3rem; color: var(--forest); font-size: 0.92rem; }
.hlm-stats b { font-family: var(--font-display); font-size: 1.35rem; margin-right: 0.35rem; }
.hlm-go { border-radius: 999px; padding: 0.6rem 1.2rem; }
.hlm-stage { position: relative; }
.home-live-map .mini-map {
    position: relative;
    height: min(46vh, 420px);
    min-height: 240px;
    border-radius: 0;
    box-shadow: none;
    background: none;
    overflow: visible;
    cursor: default;
    pointer-events: none;           /* decorative: never takes a tap or a scroll */
}
.home-live-map .mini-map::before {
    content: '';
    position: absolute;
    inset: 0;
    /* While the 3D model loads: the same model as a transparent picture, with
       no baked pins or backdrop, so nothing doubles up as the live map fades
       in. It hazes and feathers into the page the way the model does. */
    background: linear-gradient(180deg, var(--map-haze) 0%, transparent 58%) 0 0 / 100% 100% no-repeat, url('/assets/map/lite.webp') center / cover no-repeat;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 16%, #000 82%, transparent 100%), linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(180deg, transparent 0, #000 16%, #000 82%, transparent 100%), linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
    mask-composite: intersect;
    transition: opacity 900ms ease;
}
.home-live-map[data-phase="dusk"] .mini-map::before,
.home-live-map[data-phase="night"] .mini-map::before { background-image: linear-gradient(180deg, var(--map-haze) 0%, transparent 58%), url('/assets/map/lite-night.webp'); }
.home-live-map .mini-map.is-ready::before { opacity: 0; }
/* With the 3D model: the picture sits exactly where the model will draw Ohio
   (js/map/poster.js), so it fades into the model without a jump. */
.home-live-map .mini-map.has-poster::before { background-position: 0 0, var(--poster-x) var(--poster-y); background-size: 100% 100%, var(--poster-w) auto; }
.home-live-map .lite-map { overflow: hidden; }
/* The map has no plate any more (it fades into the sky), so no plate shadow. */
.hlm-shadow { display: none; }
@media (max-width: 991.98px) {
    .home-live-map { padding: 2.4rem 0 1.6rem; }
    .hlm-grid { grid-template-columns: 1fr; gap: 0.8rem; }
    .hlm-copy { text-align: center; }
    .hlm-stats { justify-content: center; }
    .home-live-map .mini-map { height: min(32vh, 270px); min-height: 200px; }
    .hlm-copy p { display: none; }
    .hlm-copy h2 { margin-bottom: 0.6rem; }
    .hlm-stats { margin-bottom: 0.9rem; font-size: 0.85rem; }
}

/* ------------------------------------------------------------ lite map (no WebGL) */

.lite-map { position: relative; overflow: hidden; }
.lite-view { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
/* The frame stays put while the picture moves under it: the far land (the top)
   hazes over and fades into the sky, as the 3D map's horizon does. */
.lite-frame {
    position: absolute;
    inset: 0;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 16%);
    mask-image: linear-gradient(180deg, transparent 0, #000 16%);
}
.lite-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, var(--map-haze) 0%, transparent 58%);
    transition: background 2s ease;
}
/* The air's colour by the time of day (the 3D map takes it from sky.js). */
.lite-map, .mm-stage, .home-live-map { --map-haze: rgba(236, 241, 234, 0.78); }
[data-phase="dawn"].lite-map, .mm-stage[data-phase="dawn"], .home-live-map[data-phase="dawn"] { --map-haze: rgba(236, 219, 214, 0.72); }
[data-phase="golden"].lite-map, .mm-stage[data-phase="golden"], .home-live-map[data-phase="golden"] { --map-haze: rgba(236, 214, 172, 0.74); }
[data-phase="dusk"].lite-map, .mm-stage[data-phase="dusk"], .home-live-map[data-phase="dusk"] { --map-haze: rgba(96, 86, 112, 0.62); }
[data-phase="night"].lite-map, .mm-stage[data-phase="night"], .home-live-map[data-phase="night"] { --map-haze: rgba(34, 70, 70, 0.72); }
/* The homepage's decorative box: every edge feathers into the page. */
.home-live-map .lite-frame {
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 16%, #000 82%, transparent 100%), linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(180deg, transparent 0, #000 16%, #000 82%, transparent 100%), linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
    mask-composite: intersect;
}
.lite-img { display: block; width: auto; max-width: none; user-select: none; -webkit-user-drag: none; }
/* Cloud shadows drifting over the fields, in picture space so they ride with it. */
.lite-clouds i {
    position: absolute;
    width: 360px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(20, 40, 36, 0.13), transparent);
    animation: lite-cloud 46s linear infinite;
}
.lite-clouds i:nth-child(1) { left: 180px; top: 330px; }
.lite-clouds i:nth-child(2) { left: 620px; top: 560px; animation-duration: 58s; animation-delay: -20s; width: 460px; }
.lite-clouds i:nth-child(3) { left: 380px; top: 760px; animation-duration: 64s; animation-delay: -38s; }
@keyframes lite-cloud { from { transform: translateX(-420px); } to { transform: translateX(820px); } }
.lite-pins { position: absolute; inset: 0; pointer-events: none; }
.lite-map.is-free { cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
.lite-map.is-grabbing { cursor: grabbing; }

/* Time of day on the picture: warm at dawn and dusk; at night the land dims
   to moonlight and the towns light up. */
.lite-img { transition: filter 2s ease; }
.lite-map[data-phase="dawn"] .lite-img { filter: sepia(0.14) saturate(1.06) brightness(0.98); }
.lite-map[data-phase="golden"] .lite-img { filter: sepia(0.24) saturate(1.12) brightness(0.97); }
.lite-map[data-phase="dusk"] .lite-img { filter: brightness(0.86) saturate(0.85) sepia(0.18); }
/* After dark, the night render (the same model: glowing roads, headlights,
   lit towns) fades in over the day picture. */
.lite-night { position: absolute; left: 0; top: 0; width: auto; max-width: none; opacity: 0; transition: opacity 2s ease; pointer-events: none; }
.lite-night[hidden] { display: none; }
.lite-map[data-phase="dusk"] .lite-night { opacity: 0.55; }
.lite-map[data-phase="night"] .lite-night { opacity: 1; }
.lite-map.is-playing .lite-img, .lite-map.is-playing .lite-night, .lite-map.is-playing .lite-lights { transition-duration: 0.9s; }
.lite-map[data-phase="dusk"] .lite-clouds, .lite-map[data-phase="night"] .lite-clouds { opacity: 0; }
.lite-clouds { transition: opacity 2s ease; }
.lite-lights { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 2s ease; }
.lite-map[data-phase="dusk"] .lite-lights { opacity: 0.6; }
.lite-map[data-phase="night"] .lite-lights { opacity: 1; }
.lite-lights i {
    position: absolute;
    width: calc(var(--r) * 2);
    height: calc(var(--r) * 1.4);
    margin: calc(var(--r) * -0.7) 0 0 calc(var(--r) * -1);
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(255, 214, 140, 0.95), rgba(255, 176, 84, 0.45) 45%, rgba(255, 160, 70, 0) 100%);
    animation: lite-town 7s ease-in-out infinite alternate;
}
.lite-lights i:nth-child(3n) { animation-duration: 9s; animation-delay: -3s; }
.lite-lights i:nth-child(3n + 1) { animation-duration: 11s; animation-delay: -6s; }
@keyframes lite-town { from { opacity: 0.8; } to { opacity: 1; } }

/* + and - for the free maps (Masjids page), glass like the full map's controls. */
.map-zoom {
    position: absolute;
    z-index: 4;
    right: 1rem;
    bottom: 4.5rem;
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 253, 248, 0.88);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 26px -12px rgba(10, 30, 26, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}
.map-zoom button {
    width: 42px;
    height: 42px;
    border: 0;
    background: transparent;
    color: var(--forest);
    font: 600 1.35rem/1 var(--font-display);
    display: grid;
    place-items: center;
    touch-action: manipulation;
}
.map-zoom button + button { border-top: 1px solid rgba(18, 54, 47, 0.1); }
.map-zoom button:hover { background: rgba(36, 92, 79, 0.08); }
.map-zoom button:focus-visible { outline: 3px solid var(--amber); outline-offset: -3px; }
/* Play the day: the clock pill shows the time as it runs. */
.map-zoom .map-play { color: #b9771a; font-size: 1.15rem; }
.is-playing .map-zoom .map-play { background: var(--forest); color: #fff; }
.map-clock {
    position: absolute;
    z-index: 4;
    right: calc(1rem + 54px);
    bottom: calc(4.5rem + 8px);
    transform: translateX(8px);
    padding: 0.4rem 0.95rem;
    border-radius: 999px;
    background: rgba(18, 54, 47, 0.86);
    color: #fbf3e2;
    font: 700 0.95rem/1 var(--font-display);
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 10px 24px -12px rgba(10, 30, 26, 0.6);
    opacity: 0;
    transition: opacity 300ms ease, transform 300ms ease;
    pointer-events: none;
}
.is-playing > .map-clock { opacity: 1; transform: none; }
@media (max-width: 991.98px) { .map-zoom { right: 0.6rem; bottom: auto; top: 4.4rem; } .map-clock { right: calc(0.6rem + 52px); bottom: auto; top: calc(4.4rem + 92px); } }
/* The adhan sweep: each pin flares as the light reaches it. */
.mpin.is-call .mpin-disc { animation: mpin-call 1.3s ease-out both; }
@keyframes mpin-call {
    0% { box-shadow: 0 6px 14px -4px rgba(10, 30, 26, 0.55), 0 0 0 0 rgba(255, 214, 120, 0.9); transform: scale(1); }
    35% { box-shadow: 0 6px 14px -4px rgba(10, 30, 26, 0.55), 0 0 0 10px rgba(255, 214, 120, 0.45); transform: scale(1.16); }
    100% { box-shadow: 0 6px 14px -4px rgba(10, 30, 26, 0.55), 0 0 0 18px rgba(255, 214, 120, 0); transform: scale(1); }
}
.mpin.is-jummah .mpin-disc { box-shadow: 0 0 0 4px rgba(255, 214, 120, 0.55), 0 0 22px 6px rgba(255, 196, 90, 0.55); }
@media (prefers-reduced-motion: reduce) { .lite-clouds i, .lite-lights i { animation: none; } .mpin.is-call .mpin-disc { animation: none; } }
