/* Navigation Menu */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    padding: 0 2rem;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
    text-decoration: none;
}
.navbar-brand span {
    color: #4a90e2;
}
.navbar-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
}
.navbar-menu a {
    color: #555;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.5rem 0;
    position: relative;
}
.navbar-menu a:hover {
    color: #4a90e2;
}
.navbar-menu a.active {
    color: #4a90e2;
}
.navbar-menu a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #4a90e2;
}
.navbar-cta {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.navbar-cta:hover {
    background: #3a7bc8;
}

/* Filter Bar - Now positioned absolute within canvas */
.filter-bar {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ffffff;
    color: #1a1a2e;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    align-items: center;
    z-index: 1100;
    max-width: calc(100% - 20px);
    width: auto;
}
.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem 1rem;
    flex-wrap: wrap;
}
.filter-title {
    font-weight: 700;
    color: #1a1a2e;
    margin-right: 0.25rem;
}
.filter-sep {
    width: 1px;
    height: 28px;
    background: #e5e7eb;
}
.province-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-width: 700px;
}
.province-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    font-size: 0.85rem;
    color: #374151;
    user-select: none;
}
.province-chip input {
    accent-color: #4a90e2;
    cursor: pointer;
}
.reset-btn {
    background: #4a90e2;
    color: #ffffff;
    border: none;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
.reset-btn:hover {
    background: #3a7bc8;
    transform: translateY(-1px);
}

/* Filter toggle and transitions */
.filter-bar { transition: transform 0.25s ease, opacity 0.25s ease; }
.filter-bar.hidden { opacity: 0; transform: translate(10px, -10px) scale(0.98); pointer-events: none; }

.filter-fab {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    border-radius: 9999px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1150;
    transition: transform 0.2s, box-shadow 0.2s;
}
.filter-fab:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.16);
}
.filter-fab .hamburger span {
    width: 18px;
    height: 2px;
    background: #1f2937;
    display: block;
    margin: 2px 0;
    transition: transform 0.2s, opacity 0.2s;
}
.filter-fab.active .hamburger span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.filter-fab.active .hamburger span:nth-child(2) {
    opacity: 0;
}
.filter-fab.active .hamburger span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Hero Section with Map */
.hero-section {
    position: relative;
    height: 100vh;
    /* Make hero background transparent so Elementor / #map-wrapper background shows through */
    background: transparent;
    overflow: hidden;
}
.hero-content {
    position: absolute;
    bottom: 4rem;
    left: 4rem;
    z-index: 20;
    max-width: 500px;
    color: white;
}

/* Ensure the map wrapper and canvas fill the available widget/section width */
#map-wrapper {
    width: 100%;
}

#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#canvas-container canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/*
  Fallback (cards grid)
  - No-JS: browser renders the <noscript> content.
  - JS error/missing deps: frontend.js clones the <noscript> HTML into the DOM.

  The widget height is fixed (hero-section/canvas-container fill the widget), so
  the fallback must scroll within the widget instead of expanding the page.
*/
.map-fallback {
    position: absolute;
    inset: 0;
    z-index: 1400;
    padding: 1.25rem;
    color: #0f172a;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;

    /* Ensure the fallback fully covers the canvas/map UI underneath */
    background: #f8fafc;
}

/* When fallback is visible, hide the WebGL canvas (the fallback overlays everything) */
#map-wrapper.map-fallback-visible #canvas-container canvas {
    display: none;
}

.map-fallback-header {
    max-width: 1040px;
    margin: 0 auto 1rem;
}
.map-fallback-heading {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0b1220;
    margin: 0 0 0.25rem;
}
.map-fallback-sub {
    margin: 0;
    color: rgba(15, 23, 42, 0.7);
    font-size: 0.95rem;
}

.map-fallback-grid {
    max-width: 1040px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
}

.map-fallback-card {
    grid-column: span 6;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 10px 22px rgba(0,0,0,0.08);
    padding: 1rem;
}

@media (max-width: 900px) {
    .map-fallback-card { grid-column: span 12; }
}

.map-fallback-card__header {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eef2f7;
    margin-bottom: 0.75rem;
}

.map-fallback-kicker {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #2563eb;
    font-weight: 800;
}

.map-fallback-title {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.15;
    color: #0f172a;
}

.map-fallback-link {
    font-size: 0.85rem;
    color: #2563eb;
    text-decoration: none;
    font-weight: 700;
}
.map-fallback-link:hover { text-decoration: underline; }

.map-fallback-card__body {
    color: #0f172a;
    font-size: 0.95rem;
    line-height: 1.7;
}
.map-fallback-card__body p { margin: 0 0 0.5rem; }

.map-fallback-card__meta {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eef2f7;
}

.map-fallback-meta-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(15, 23, 42, 0.6);
    font-weight: 800;
    margin-bottom: 0.4rem;
}

.map-fallback-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.map-fallback-chip {
    display: inline-flex;
    padding: 0.22rem 0.6rem;
    border-radius: 9999px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}
.map-fallback-chip--home {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e40af;
}
.map-fallback-chip--empty {
    opacity: 0.7;
}

/* Featured person block */
.map-fallback-person {
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid #eef2f7;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.map-fallback-person__top {
    display: grid;
    grid-template-columns: 84px 1fr;
    gap: 0.75rem;
    align-items: center;
}

/* Left column wrapper: photo + "Meet the team" CTA */
.map-fallback-person__media {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: flex-start;
}

.map-fallback-person__media .map-fallback-person__cta {
    margin: 0;
}

.map-fallback-person__photo {
    width: 84px;
    height: 96px;
    overflow: hidden;
    background: #0b1220;
}

.map-fallback-person__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.map-fallback-person__label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(15, 23, 42, 0.6);
    font-weight: 800;
    margin-bottom: 0.15rem;
}

.map-fallback-person__name {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
}

.map-fallback-person__title {
    font-size: 0.9rem;
    color: rgba(15, 23, 42, 0.7);
    font-weight: 600;
}

.map-fallback-person__bio {
    color: rgba(15, 23, 42, 0.8);
    font-size: 0.92rem;
    line-height: 1.6;
}

.map-fallback-person__cta a {
    display: inline-block;
    color: #2563eb;
    text-decoration: none;
    font-weight: 800;
}
.map-fallback-person__cta a:hover { text-decoration: underline; }

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}
.hero-content p {
    font-size: 1.125rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}
.hero-btn {
    display: inline-block;
    background: #4a90e2;
    color: white;
    padding: 1rem 2rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
}
.hero-btn:hover {
    background: #3a7bc8;
    transform: translateY(-2px);
}
#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
#info {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.6);
    z-index: 15;
    max-width: 320px;
}
#svg-data {
    display: none;
}
/* Info Card Styles - positioned within the canvas */
#info-card {
    position: absolute;
    left: 0;
    top: 0;
    --map-card-gap: 36px;
    width: min(820px, calc(100vw - 48px));
    max-height: calc(100% - 48px);
    z-index: 1250;
    opacity: 0;
    pointer-events: none;
    will-change: transform;
    transition: opacity 0.18s ease;
}
#info-card.visible {
    opacity: 1;
    pointer-events: auto;
}
#info-card.visible .info-card-shell {
    animation: map-card-pop 0.2s ease-out both;
}

/* Anchored popover placement around the marker */
#info-card[data-placement="top"] { transform: translate(-50%, calc(-100% - var(--map-card-gap, 36px))); }
#info-card[data-placement="bottom"] { transform: translate(-50%, var(--map-card-gap, 36px)); }
#info-card[data-placement="left"] { transform: translate(calc(-100% - var(--map-card-gap, 36px)), -50%); }
#info-card[data-placement="right"] { transform: translate(var(--map-card-gap, 36px), -50%); }

@keyframes map-card-pop {
    from {
        opacity: 0.85;
        transform: translateY(8px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#info-card .info-card-shell {
    position: relative;
    max-height: inherit;
    overflow: auto;
    background: #052234;
    border-top: 1px solid #3bcbff;
    box-shadow: 0 18px 20px rgba(0, 0, 0, 0.48);
    padding: 1.85rem 2rem 1.65rem;
    color: #fff;
}

#info-card h2::before {
    content: none;
}
#info-card p {
    margin: 0 0 10px 0;
}

#info-card .card-layout {
    display: grid;
    grid-template-columns: minmax(0, 62%) minmax(0, 38%);
    gap: 2rem;
    align-items: start;
}
#info-card .card-col {
    min-width: 0;
}
#info-card .card-kicker {
    margin-bottom: 0.8rem;
    color: #3BCBFF;
    font-family: "Aeonik", Sans-serif, sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
}
#info-card #card-title {
    margin: 0 0 0.5rem 0;
    color: #fff !important;
    font-size: 2.5rem !important;
    font-weight: 500 !important;
    line-height: 1.05 !important;
    letter-spacing: 0 !important;
    font-family: "Nib Semi Pro", Georgia, "Times New Roman", serif;
}
#info-card #card-body {
    max-height: 230px;
    overflow: auto;
    padding-right: 0.35rem;
    color: #fff !important;
    font-size: 0.86rem !important;
    line-height: 1.22 !important;
}
#info-card #card-body p {
    margin: 0 0 0.55rem !important;
    color: inherit !important;
    font-size: 1.1rem;
    line-height: 1.4;
    font-weight: 400;
    margin-bottom: 0px !important;
}
#info-card .card-meta {
    display: block;
    margin: 0.85rem 0 0.8rem 0;
    color: #3BCBFF;
    font-size: 0.78rem;
    font-style: italic;
    line-height: 1.35;
}
#info-card .meta-title {
    color: #3BCBFF;
    font-family: "Aeonik", Sans-serif, sans-serif;
    font-size: inherit;
    font-weight: 400;
    letter-spacing: 0;
}
#info-card .region-inline {
    color: #3BCBFF;
}
#info-card .region-inline-link,
#info-card .region-inline-text {
    color: #3BCBFF;
    font: inherit;
}
#info-card .region-inline-link {
    appearance: none;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-decoration: none;
}
#info-card .region-inline-link:hover,
#info-card .region-inline-link:focus {
    color: #e8f6ff;
    text-decoration: underline;
}
#info-card .card-contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    margin-top: 1.25rem;
    padding: 0.38rem 1rem;
    border-radius: 9999px;
    background: #3BCBFF;
    color: #052234;
    font-family: "Aeonik", Sans-serif, sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.1;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
#info-card .card-contact-btn:hover,
#info-card .card-contact-btn:focus {
    background: #e8f6ff;
    color: #052234;
    transform: translateY(-1px);
}
#info-card .person-panel {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    color: #e5e7eb;
}
#info-card .person-photo-wrap {
    width: 100%;
    aspect-ratio: 1 / 0.98;
    overflow: hidden;
    background: #020617;
    margin: 0 0 0.8rem;
}
#info-card .person-photo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
#info-card .person-summary {
    min-width: 0;
}
#info-card .person-heading {
    margin: 0 !important;
    color: #fff !important;
    font-family: "Nib Semi Pro", Georgia, "Times New Roman", serif;
    font-size: 1.42rem !important;
    font-weight: 500 !important;
    line-height: 1.1 !important;
    letter-spacing: 0 !important;
}
#info-card .person-titles {
    margin-top: 0.35rem;
    min-width: 0;
}
#info-card .person-title {
    margin: 0 !important;
    color: #fff !important;
    font-size: 0.74rem !important;
    line-height: 1.25 !important;
    white-space: normal;
}
#info-card .person-title__partner {
    color: #fff !important;
}
#info-card .person-title__subtitle {
    color: #fff !important;
}
#close-card {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    padding: 0;
    border: none;
    background: transparent;
    margin: -1px;
}

@media (max-width: 1024px) {
    #info-card {
        width: min(820px, calc(100vw - 32px));
    }
    #info-card .info-card-shell {
        padding: 1.7rem 1.8rem 1.55rem;
    }
    #info-card .card-layout {
        grid-template-columns: minmax(0, 62%) minmax(0, 38%);
        gap: 1.75rem;
    }
}
@media (max-width: 768px) {
    #info-card.visible {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        width: calc(100vw - 24px) !important;
        max-width: 480px !important;
        max-height: 82vh !important;
        transform: translate(-50%, -50%) !important;
        z-index: 2000 !important;
    }
    #info-card .info-card-shell {
        max-height: 82vh;
        padding: 1.45rem 1.35rem 1.35rem;
    }
    #info-card .card-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.35rem;
    }
    #card-title {
        font-size: 1.85rem;
    }
    #info-card .person-panel {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
        text-align: center;
    }
    #info-card .person-photo-wrap {
        width: min(240px, 100%);
    }
    #info-card .person-summary {
        width: 100%;
        text-align: center;
    }
}
/* UX additions */
#hover-tooltip {
    position: absolute;
    top: 0; left: 0;
    transform: translate(-50%, -120%);
    background: rgba(17, 24, 39, 0.92);
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
    pointer-events: none;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 250;
    white-space: nowrap;
}
#hover-tooltip.visible { opacity: 1; }

#filter-summary {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    color: #1f2937;
    padding: 0.4rem 0.6rem;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    font-size: 0.85rem;
    display: none;
    gap: 0.4rem;
    z-index: 1150;
    cursor: pointer;
}

#empty-toast {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: #111827;
    color: #e5e7eb;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    border: 1px solid #374151;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    display: none;
    align-items: center;
    gap: 0.6rem;
    z-index: 1200;
}
#empty-toast button {
    background: #4a90e2;
    color: #fff;
    border: none;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}
#empty-toast button:hover { background: #3a7bc8; }

/* A11Y overlay for keyboard access to markers */
#marker-a11y-layer {
    position: absolute;
    inset: 0;
    z-index: 190;
    pointer-events: none;
}
.marker-a11y-btn {
    position: absolute;
    left: 0; top: 0;
    transform: translate(-50%, -50%);
    width: 0; height: 0;
    opacity: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    outline: none;
    padding: 0;
    pointer-events: none;
}
.marker-a11y-btn:focus,
.marker-a11y-btn:focus-visible {
    width: 22px; height: 22px;
    opacity: 1;
    box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px #4a90e2;
    background: rgba(74, 144, 226, 0.3);
}

/* Hero content positioning & width presets */
.hero-section { position: relative; }
.hero-content { position: absolute; }

.pos-bottom-left { bottom: 4rem; left: 4rem; right: auto; top: auto; transform: none; }
.pos-bottom-right { bottom: 4rem; right: 4rem; left: auto; top: auto; transform: none; }
.pos-top-left { top: 4rem; left: 4rem; right: auto; bottom: auto; transform: none; }
.pos-top-right { top: 4rem; right: 4rem; left: auto; bottom: auto; transform: none; }
.pos-center-left { top: 50%; left: 4rem; right: auto; transform: translateY(-50%); }
.pos-center-right { top: 50%; right: 4rem; left: auto; transform: translateY(-50%); }
.pos-center { top: 50%; left: 50%; right: auto; bottom: auto; transform: translate(-50%, -50%); }

/* width presets (desktop) */
.w-1-3 { max-width: min(33.333%, 560px); }
.w-1-2 { max-width: min(50%, 680px); }
.w-2-3 { max-width: min(66.666%, 820px); }
.w-full { max-width: min(100%, 960px); }

/* tablet overrides */
@media (max-width: 1024px) {
    .tablet-w-1-3 { max-width: min(33.333%, 520px); }
    .tablet-w-1-2 { max-width: min(50%, 620px); }
    .tablet-w-2-3 { max-width: min(66.666%, 760px); }
    .tablet-w-full { max-width: 100%; }
}
/* mobile overrides */
@media (max-width: 768px) {
    .mobile-w-1-3 { max-width: min(90%, 420px); }
    .mobile-w-1-2 { max-width: min(95%, 500px); }
    .mobile-w-2-3 { max-width: min(100%, 560px); }
    .mobile-w-full { max-width: 100%; }
    .pos-center-left, .pos-center-right { top: auto; transform: none; bottom: 2rem; }
}
