/**
 * FILE: /css/public-majestic-map.css
 * VERSION: 1.1.0
 * DATE: 2026-08-29
 * AUTHOR: BOFF Social Technologies LLC
 * PROJECT: BoffOS / AXO / Admintor
 * MODULE: Public Property MajesticMap Styles
 *
 * PURPOSE:
 * Styles the embedded MajesticMap, category controls, accessible local states,
 * source notices and the responsive Bootstrap fullscreen map workspace.
 *
 * ARCHITECTURE:
 * - Component-scoped selectors avoid changes to existing public map widgets.
 * - OpenLayers core styles remain in the vendored ol.css file.
 * - Mobile modal dimensions use dynamic viewport units with safe fallbacks.
 *
 * ACCESSIBILITY:
 * - Interactive controls retain visible keyboard focus.
 * - Status and filter selection use text/shape in addition to color.
 * - Forced-colors and reduced-motion preferences are respected.
 *
 * VERSION HISTORY:
 * - 1.1.0 / 2026-08-29: Aligns the widget typography with the public property
 *   page and reduces section/category heading sizes.
 * - 1.0.0 / 2026-08-29: Initial public MajesticMap component styles.
 */

.public-majestic-map {
    --majestic-ink: #17191d;
    --majestic-muted: #69707d;
    --majestic-border: rgba(23, 25, 29, 0.12);
    --majestic-surface: #fff;
    --majestic-soft: #f5f6f8;
    --majestic-accent: #c99a47;
    --majestic-danger: #b42318;
    overflow: visible;
    font-family: "DM Sans", sans-serif;
    font-size: 16px;
    line-height: 26px;
}

.public-majestic-map button,
.public-majestic-map input,
.public-majestic-map select,
.public-majestic-map textarea {
    font-family: inherit;
}

.public-majestic-map__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}

.public-majestic-map__header .title {
    margin-bottom: 0.45rem;
    font-family: "Josefin Sans", sans-serif;
    font-size: 20px;
    line-height: 28px;
}

.public-majestic-map__header p {
    margin: 0;
    max-width: 52rem;
}

.public-majestic-map__eyebrow {
    margin-bottom: 0.35rem;
    color: var(--majestic-accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.public-majestic-map__open {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    gap: 0.55rem;
}

.public-majestic-map__preview-shell,
.public-majestic-map__modal-map-shell {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border: 1px solid var(--majestic-border);
    background: #e8ebef;
}

.public-majestic-map__preview-shell {
    min-height: clamp(20rem, 42vw, 31rem);
    border-radius: 1.15rem;
    box-shadow: 0 18px 45px rgba(30, 34, 42, 0.11);
}

.public-majestic-map__canvas {
    width: 100%;
    height: 100%;
    min-height: inherit;
    background: #e8ebef;
}

.public-majestic-map__canvas--preview {
    pointer-events: auto;
}

.public-majestic-map__canvas:focus-visible,
.public-majestic-map__filter:focus-visible,
.public-majestic-map__expand:focus-visible,
.public-majestic-map__open:focus-visible,
.public-majestic-map__poi-button:focus-visible {
    outline: 3px solid #1d4ed8;
    outline-offset: 3px;
}

.public-majestic-map__state {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem;
    color: var(--majestic-ink);
    background: rgba(255, 255, 255, 0.9);
    text-align: center;
    transition: opacity 180ms ease, visibility 180ms ease;
}

.public-majestic-map[data-map-status="ready"] .public-majestic-map__state:not(.public-majestic-map__state--modal) {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.public-majestic-map[data-map-status="error"] .public-majestic-map__state {
    color: var(--majestic-danger);
}

.public-majestic-map[data-map-status="error"] .public-majestic-map__spinner {
    display: none;
}

.public-majestic-map__spinner {
    width: 1.4rem;
    height: 1.4rem;
    flex: 0 0 auto;
    border: 2px solid rgba(23, 25, 29, 0.16);
    border-top-color: var(--majestic-accent);
    border-radius: 50%;
    animation: public-majestic-map-spin 760ms linear infinite;
}

@keyframes public-majestic-map-spin {
    to { transform: rotate(360deg); }
}

.public-majestic-map__expand {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(23, 25, 29, 0.14);
    border-radius: 0.8rem;
    color: var(--majestic-ink);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 24px rgba(23, 25, 29, 0.14);
    cursor: pointer;
}

.public-majestic-map__legend {
    position: absolute;
    left: 0.85rem;
    bottom: 0.85rem;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 0.8rem;
    max-width: calc(100% - 1.7rem);
    padding: 0.65rem 0.8rem;
    border: 1px solid rgba(23, 25, 29, 0.1);
    border-radius: 0.75rem;
    color: var(--majestic-ink);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 24px rgba(23, 25, 29, 0.12);
    font-size: 0.78rem;
}

.public-majestic-map__legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    white-space: nowrap;
}

.public-majestic-map__legend i {
    width: 0.75rem;
    height: 0.75rem;
    border: 2px solid var(--zone-color);
    border-radius: 50%;
    background: rgba(23, 25, 29, 0.12);
    background: color-mix(in srgb, var(--zone-color) 28%, transparent);
}

.public-majestic-map__filters,
.public-majestic-map__modal-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.public-majestic-map__filters {
    margin-top: 1.25rem;
}

.public-majestic-map__filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    gap: 0.5rem;
    padding: 0.65rem 0.95rem;
    border: 1px solid var(--majestic-border);
    border-radius: 999px;
    color: var(--majestic-ink);
    background: var(--majestic-surface);
    font-weight: 650;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.public-majestic-map__filter:hover {
    border-color: rgba(23, 25, 29, 0.3);
    transform: translateY(-1px);
}

.public-majestic-map__filter.is-active,
.public-majestic-map__filter[aria-pressed="true"] {
    border-color: var(--majestic-ink);
    color: #fff;
    background: var(--majestic-ink);
}

.public-majestic-map__count {
    min-width: 1.5rem;
    padding: 0.12rem 0.38rem;
    border-radius: 999px;
    color: currentColor;
    background: rgba(255, 255, 255, 0.17);
    font-size: 0.72rem;
    text-align: center;
}

.public-majestic-map__address {
    margin-top: 1.25rem;
}

.public-majestic-map__address a,
.public-majestic-map__external,
.public-majestic-map__source-notice a,
.public-majestic-map__dynamic-attribution a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

.public-majestic-map__ssr-places {
    margin-top: 1.5rem;
}

.public-majestic-map__ssr-places > h3 {
    margin-bottom: 0.75rem;
    font-family: "Josefin Sans", sans-serif;
    font-size: 20px;
    line-height: 28px;
}

.public-majestic-map__ssr-category {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--majestic-border);
    border-radius: 0.9rem;
    background: var(--majestic-soft);
}

.public-majestic-map__ssr-category h4 {
    margin: 0 0 0.65rem;
    font-family: "DM Sans", sans-serif;
    font-size: 16px;
    line-height: 26px;
}

.public-majestic-map__ssr-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.public-majestic-map__ssr-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.6rem;
    font-size: 15px;
    line-height: 22px;
}

.public-majestic-map__ssr-list li span:not(.fw-7) {
    color: var(--majestic-muted);
}

.public-majestic-map__source-notice {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.7rem;
    margin-top: 0.85rem;
    font-size: 0.78rem;
}

.public-majestic-map__noscript,
.public-majestic-map__fallback-note {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    color: #7a2e0e;
    background: #fff4e5;
}

.public-majestic-map__modal {
    --bs-modal-bg: #f7f7f8;
}

.public-majestic-map__modal .modal-header {
    min-height: 76px;
    padding: 0.9rem clamp(1rem, 3vw, 2rem);
    border-color: var(--majestic-border);
    background: #fff;
}

.public-majestic-map__modal .modal-title {
    margin: 0;
    color: var(--majestic-ink);
    font-family: "Josefin Sans", sans-serif;
    font-size: 20px;
    line-height: 28px;
}

.public-majestic-map__modal .btn-close {
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    background-size: 0.9rem;
}

.public-majestic-map__modal-body {
    display: grid;
    grid-template-columns: minmax(0, 2.25fr) minmax(19rem, 0.75fr);
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.public-majestic-map__modal-map-shell {
    min-width: 0;
    min-height: 0;
    border: 0;
    border-radius: 0;
}

.public-majestic-map__canvas--modal {
    min-height: calc(100vh - 76px);
    min-height: calc(100dvh - 76px);
}

.public-majestic-map__state--modal:empty {
    display: none;
}

.public-majestic-map__panel {
    min-width: 0;
    padding: 1.25rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-left: 1px solid var(--majestic-border);
    background: #fff;
}

.public-majestic-map__modal-filters {
    margin-bottom: 1.25rem;
}

.public-majestic-map__panel-title {
    margin: 0 0 0.75rem;
    color: var(--majestic-ink);
    font-size: 1rem;
}

.public-majestic-map__modal-list {
    display: grid;
    gap: 0.65rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.public-majestic-map__poi-button {
    display: grid;
    width: 100%;
    min-height: 52px;
    grid-template-columns: 1fr auto;
    gap: 0.3rem 0.75rem;
    padding: 0.8rem;
    border: 1px solid var(--majestic-border);
    border-radius: 0.75rem;
    color: var(--majestic-ink);
    background: var(--majestic-soft);
    text-align: left;
    cursor: pointer;
}

.public-majestic-map__poi-button:hover {
    border-color: rgba(23, 25, 29, 0.28);
    background: #fff;
}

.public-majestic-map__poi-name {
    overflow-wrap: anywhere;
    font-weight: 700;
}

.public-majestic-map__poi-category,
.public-majestic-map__poi-facts {
    color: var(--majestic-muted);
    font-size: 0.78rem;
}

.public-majestic-map__poi-facts {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    white-space: nowrap;
}

.public-majestic-map__empty {
    margin: 0;
    padding: 1rem;
    border: 1px dashed var(--majestic-border);
    border-radius: 0.75rem;
    color: var(--majestic-muted);
    background: var(--majestic-soft);
}

.public-majestic-map__dynamic-attribution {
    display: grid;
    gap: 0.6rem;
    margin-top: 1.2rem;
    color: var(--majestic-muted);
    font-size: 0.72rem;
}

.public-majestic-map__dynamic-attribution section {
    display: grid;
    gap: 0.25rem;
}

.public-majestic-map__dynamic-attribution p {
    margin: 0;
}

.public-majestic-map__external {
    display: inline-flex;
    margin-top: 1.2rem;
    font-weight: 700;
}

.public-majestic-map .ol-control button {
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    color: #fff;
    background: rgba(23, 25, 29, 0.86);
}

.public-majestic-map .ol-attribution {
    max-width: calc(100% - 1rem);
    font-size: 0.68rem;
}

.public-majestic-map .ol-attribution.ol-uncollapsible {
    max-width: min(100%, 40rem);
    padding-left: 0.35rem;
    background: rgba(255, 255, 255, 0.9);
}

.public-majestic-map__popup {
    min-width: 13rem;
    max-width: min(19rem, calc(100vw - 3rem));
    padding: 0.8rem 2.2rem 0.8rem 0.9rem;
    border: 1px solid var(--majestic-border);
    border-radius: 0.75rem;
    color: var(--majestic-ink);
    background: #fff;
    box-shadow: 0 14px 34px rgba(23, 25, 29, 0.2);
}

.public-majestic-map__popup strong,
.public-majestic-map__popup span {
    display: block;
}

.public-majestic-map__popup span {
    margin-top: 0.2rem;
    color: var(--majestic-muted);
    font-size: 0.78rem;
}

.public-majestic-map__popup-close {
    position: absolute;
    top: 0.28rem;
    right: 0.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    color: var(--majestic-ink);
    background: transparent;
    font-size: 1.2rem;
    cursor: pointer;
}

@media (max-width: 991.98px) {
    .public-majestic-map__modal-body {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(52vh, 60dvh) minmax(0, 1fr);
        overflow-y: auto;
    }

    .public-majestic-map__canvas--modal {
        min-height: 52vh;
        min-height: 60dvh;
    }

    .public-majestic-map__panel {
        overflow: visible;
        border-top: 1px solid var(--majestic-border);
        border-left: 0;
        padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
    }
}

@media (max-width: 767.98px) {
    .public-majestic-map__header {
        display: grid;
    }

    .public-majestic-map__open {
        width: 100%;
    }

    .public-majestic-map__preview-shell {
        min-height: 20rem;
        border-radius: 0.9rem;
    }

    .public-majestic-map__ssr-list {
        grid-template-columns: 1fr;
    }

    .public-majestic-map__legend {
        right: 0.65rem;
        bottom: 0.65rem;
        left: 0.65rem;
    }

    .public-majestic-map__expand {
        top: 0.65rem;
        right: 0.65rem;
    }

    .public-majestic-map__filter {
        flex: 1 1 auto;
    }
}

@media (max-width: 389.98px) {
    .public-majestic-map__legend strong {
        width: 100%;
    }

    .public-majestic-map__poi-button {
        grid-template-columns: 1fr;
    }

    .public-majestic-map__poi-facts {
        grid-column: 1;
        grid-row: auto;
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    .public-majestic-map *,
    .public-majestic-map *::before,
    .public-majestic-map *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (forced-colors: active) {
    .public-majestic-map__filter.is-active,
    .public-majestic-map__filter[aria-pressed="true"] {
        border: 2px solid ButtonText;
        color: HighlightText;
        background: Highlight;
    }

    .public-majestic-map__legend i,
    .public-majestic-map__state,
    .public-majestic-map__poi-button {
        border: 1px solid CanvasText;
    }
}

/* END OF FILE: /css/public-majestic-map.css */
