/* ==========================================================================
   Theme Reset — prevent external themes from interfering with map styles
   ========================================================================== */
.us-map-wrapper,
.us-map-wrapper *,
.us-map-wrapper *::before,
.us-map-wrapper *::after,
.us-map-mega-dropdown,
.us-map-mega-dropdown *,
.us-map-mega-dropdown *::before,
.us-map-mega-dropdown *::after {
    box-sizing: border-box;
}

@keyframes usmap-fade-in {
    to { opacity: 1; }
}

.us-map-wrapper {
    position: relative;
    max-width: var(--usmap-max-width, 960px);
    margin-left: auto !important;
    margin-right: auto !important;
    border: none !important;
    border-style: none !important;
    box-shadow: none !important;
    animation: usmap-fade-in 0.2s ease forwards;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-style: normal;
    font-variant: normal;
    text-transform: none;
    letter-spacing: normal;
    word-spacing: normal;
    text-indent: 0;
    text-decoration: none;
    line-height: 1.5;
    color: #111827;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Desktop map */
.us-map-desktop {
    position: relative;
    display: block;
}

.us-map-svg {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
    border: none;
    box-shadow: none;
    background: transparent;
}

.us-map-state {
    cursor: pointer;
    transition: fill var(--usmap-hover-duration, 0.15s) ease;
}

.us-map-label {
    pointer-events: none;
    user-select: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.us-map-sidebar-state {
    cursor: pointer;
}

.us-map-sidebar-state:hover .us-map-sidebar-rect {
    stroke: #93c5fd;
}

/* Tooltip */
.us-map-tooltip {
    position: absolute;
    pointer-events: none;
    background: #111827;
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-style: normal;
    text-transform: none;
    letter-spacing: normal;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translate(-50%, -100%);
    opacity: 0;
    transition: opacity var(--usmap-hover-duration, 0.15s) ease;
    z-index: 100;
    white-space: nowrap;
}

.us-map-tooltip.is-visible {
    opacity: 1;
}

.us-map-tooltip-name {
    margin: 0;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
}

/* Mobile dropdown */
.us-map-mobile {
    display: none;
}

.us-map-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    text-transform: none;
    letter-spacing: normal;
    background: #ffffff;
    color: #111827;
    appearance: auto;
    box-shadow: none;
    outline: none;
    height: auto;
    min-height: 0;
    margin: 0;
}

/* Desktop dropdown — above map */
.us-map-wrapper.usmap-dropdown-above {
    display: flex;
    flex-direction: column;
}

.us-map-wrapper.usmap-dropdown-above .us-map-desktop {
    order: 2;
}

.us-map-wrapper.usmap-dropdown-above .us-map-mobile {
    display: block;
    order: 1;
    margin-bottom: 12px;
}

/* Desktop dropdown — below map */
.us-map-wrapper.usmap-dropdown-below {
    display: flex;
    flex-direction: column;
}

.us-map-wrapper.usmap-dropdown-below .us-map-desktop {
    order: 1;
}

.us-map-wrapper.usmap-dropdown-below .us-map-mobile {
    display: block;
    order: 2;
    margin-top: 12px;
}

/* External dropdown shortcode */
.us-map-dropdown-external .us-map-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    text-transform: none;
    letter-spacing: normal;
    background: #ffffff;
    color: #111827;
    appearance: auto;
    box-shadow: none;
    outline: none;
    height: auto;
    min-height: 0;
    margin: 0;
}

/* Disabled states */
.us-map-state-disabled {
    cursor: default;
    opacity: 0.5;
}

.us-map-sidebar-state.us-map-state-disabled {
    cursor: default;
    opacity: 0.5;
}

/* Custom tooltip content */
.us-map-tooltip-custom {
    margin: 4px 0 0;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.3;
    opacity: 0.85;
}

/* Container card */
.us-map-contained {
    background: var(--usmap-container-bg-color, transparent);
    border: var(--usmap-container-bw, 1px) solid var(--usmap-container-bc, #e5e7eb) !important;
    border-style: solid !important;
    border-radius: var(--usmap-container-br, 16px);
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04) !important;
}

/* Search bar */
.us-map-search-container {
    position: relative;
    margin-bottom: 16px;
}

.us-map-search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    text-transform: none;
    letter-spacing: normal;
    box-sizing: border-box;
    background: #ffffff;
    color: #111827;
    box-shadow: none;
    outline: none;
    height: auto;
    min-height: 0;
    margin: 0;
    -webkit-appearance: none;
}

.us-map-search-input:focus {
    outline: none;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

.us-map-search-suggestions {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 4px;
    padding: 0;
    list-style: none;
}

.us-map-search-item {
    padding: 10px 14px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    text-decoration: none;
    color: #111827;
    border: none;
    list-style: none;
}

.us-map-search-item:hover,
.us-map-search-item.active {
    background: #f3f4f6;
}

/* Map title */
.us-map-title {
    text-align: center;
    margin: 0 0 1rem;
    padding: 0;
    font-size: 1.5em;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.3;
    text-transform: none;
    letter-spacing: normal;
    color: #111827;
    border: none;
    background: none;
}

/* Popover */
.us-map-popover {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.us-map-popover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.us-map-popover-content {
    position: relative;
    background: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1;
    font-family: inherit;
    text-transform: none;
    letter-spacing: normal;
    color: #111827;
}

.us-map-popover-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: transparent;
    border: none;
    border-radius: 0;
    font-family: inherit;
    font-size: 28px;
    font-weight: 400;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    margin: 0;
    box-shadow: none;
    outline: none;
    min-width: 0;
    min-height: 0;
    width: auto;
    height: auto;
    text-decoration: none;
}

.us-map-popover-close:hover {
    color: #111827;
    background: transparent;
    border: none;
    box-shadow: none;
}

.us-map-popover-close:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    box-shadow: none;
}

.us-map-popover-title {
    margin: 0 0 16px;
    padding: 0;
    padding-right: 32px;
    font-family: inherit;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
    text-transform: none;
    letter-spacing: normal;
    color: #111827;
    border: none;
    background: none;
}

.us-map-popover-detail {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.us-map-popover-detail:empty {
    display: none;
}

.us-map-popover-image {
    width: 100px;
    height: 100px;
    border: none;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: none;
    outline: none;
    max-width: none;
}

.us-map-popover-body {
    margin: 0;
    padding: 0;
    color: #4b5563;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    text-transform: none;
    letter-spacing: normal;
    flex: 1;
    min-width: 0;
}

.us-map-popover-body:empty {
    display: none;
}

.us-map-popover-actions {
    display: flex;
    justify-content: flex-end;
}

.us-map-popover-cta {
    display: inline-block;
    padding: 10px 24px;
    background: #3b82f6;
    color: #ffffff !important;
    text-decoration: none !important;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    text-transform: none;
    letter-spacing: normal;
    transition: background 0.15s ease;
    box-shadow: none;
    outline: none;
    cursor: pointer;
}

.us-map-popover-cta:hover,
.us-map-popover-cta:focus {
    background: #2563eb;
    color: #ffffff !important;
    text-decoration: none !important;
    box-shadow: none;
}

.us-map-popover-cta:visited {
    color: #ffffff !important;
}

/* Choropleth legend */
.us-map-choropleth-legend {
    margin-top: 16px;
    text-align: center;
}

.us-map-choropleth-legend-title {
    margin: 0 0 8px;
    padding: 0;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-transform: none;
    letter-spacing: normal;
    color: #1d2327;
    border: none;
    background: none;
}

.us-map-choropleth-gradient {
    height: 12px;
    border-radius: 6px;
    max-width: 300px;
    margin: 0 auto;
}

.us-map-choropleth-labels {
    display: flex;
    justify-content: space-between;
    max-width: 300px;
    margin: 4px auto 0;
    font-family: inherit;
    font-size: 12px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: #6b7280;
}

/* Region legend */
.us-map-region-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

.us-map-region-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    transition: background 0.15s ease;
    font-family: inherit;
    font-size: 13px;
    text-decoration: none;
    text-transform: none;
    letter-spacing: normal;
}

.us-map-region-item:hover {
    background: #f3f4f6;
}

.us-map-region-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
    border: none;
}

.us-map-region-label {
    color: #374151;
    font-weight: 500;
    font-family: inherit;
    text-transform: none;
    letter-spacing: normal;
    text-decoration: none;
}

/* Tour controls */
.us-map-tour-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.us-map-tour-controls button {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    color: #374151;
    padding: 0;
    margin: 0;
    box-shadow: none;
    outline: none;
    min-width: 0;
    min-height: 0;
    text-decoration: none;
    line-height: 1;
}

.us-map-tour-controls button:hover {
    background: #e5e7eb;
    border: 1px solid #d1d5db;
    box-shadow: none;
}

.us-map-tour-controls button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    box-shadow: none;
}

.us-map-tour-indicator {
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: #6b7280;
    min-width: 50px;
    text-align: center;
}

.us-map-tour-caption {
    text-align: center;
    margin-top: 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: #374151;
    line-height: 1.5;
    padding: 0 16px;
}

.us-map-tour-dimmed {
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.us-map-tour-active {
    opacity: 1;
    transition: opacity 0.3s ease;
}

@keyframes usmap-pulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

.us-map-tour-active path,
path.us-map-tour-active {
    animation: usmap-pulse 1.5s ease-in-out infinite;
}

/* SEO: Screen-reader-only links for crawlers */
.us-map-seo-links {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* SEO: Noscript fallback links */
.us-map-noscript-links {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
}

.us-map-noscript-links p {
    margin: 0 0 8px;
    padding: 0;
    font-family: inherit;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    color: #374151;
}

.us-map-noscript-links ul {
    margin: 0;
    padding: 0;
    list-style: none;
    columns: 3;
    column-gap: 16px;
}

.us-map-noscript-links li {
    padding: 2px 0;
    list-style: none;
}

.us-map-noscript-links a {
    color: #2563eb !important;
    text-decoration: none !important;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
}

.us-map-noscript-links a:hover {
    text-decoration: underline !important;
}

.us-map-noscript-links a:visited {
    color: #2563eb !important;
}

/* Print */
@media print {
    .us-map-tooltip,
    .us-map-mobile,
    .us-map-search-container,
    .us-map-popover,
    .us-map-tour-controls,
    .us-map-tour-caption,
    .us-map-noscript-links    { display: none !important; }

    .us-map-wrapper            { max-width: 100% !important; border: 1pt solid #000;
                                 padding: 12pt; page-break-inside: avoid; }
    .us-map-desktop            { display: block !important; }
    .us-map-svg                { width: 100% !important; }
    .us-map-title              { font-size: 18pt; color: #000; page-break-after: avoid; }
    .us-map-state,
    .us-map-sidebar-state      { transition: none !important; }
    .us-map-label              { fill: #000 !important;
                                 text-shadow: 0 0 2px #fff, 0 0 2px #fff; }
    .us-map-state              { stroke-width: 1pt !important; }
    .us-map-mega-dropdown      { display: none !important; }
}

/* ==========================================================================
   Mega Dropdown
   ========================================================================== */

.us-map-mega-dropdown {
    position: relative;
    display: inline-block;
    z-index: 999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-style: normal;
    font-variant: normal;
    text-transform: none;
    letter-spacing: normal;
    word-spacing: normal;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.us-map-mega-align-right  { text-align: right; }
.us-map-mega-align-left   { text-align: left; }
.us-map-mega-align-center { text-align: center; }

.us-map-mega-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
    text-decoration: none;
    cursor: pointer;
    transition: filter 0.15s ease, border-radius 0.15s ease;
    line-height: 1.4;
    box-shadow: none;
    outline: none;
    margin: 0;
    min-width: 0;
    min-height: 0;
    -webkit-appearance: none;
}

.us-map-mega-button:hover {
    filter: brightness(1.1);
    border: none;
    box-shadow: none;
}

.us-map-mega-button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    box-shadow: none;
}

.us-map-mega-arrow {
    font-size: 10px;
    transition: transform 0.25s ease;
    display: inline-block;
}

.us-map-mega-dropdown.is-open .us-map-mega-button {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    position: relative;
    z-index: 100002;
    padding-bottom: 12px;
    margin-bottom: -2px;
}

/* Curved slope "feet" at bottom corners of open button */
.us-map-mega-dropdown.is-open .us-map-mega-button::before,
.us-map-mega-dropdown.is-open .us-map-mega-button::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 10px;
    height: 10px;
    pointer-events: none;
}

.us-map-mega-dropdown.is-open .us-map-mega-button::before {
    left: -10px;
    background: radial-gradient(circle at top left, transparent 10px, var(--usmap-mega-btn-bg) 10.5px);
}

.us-map-mega-dropdown.is-open .us-map-mega-button::after {
    right: -10px;
    background: radial-gradient(circle at top right, transparent 10px, var(--usmap-mega-btn-bg) 10.5px);
}

.us-map-mega-dropdown.is-open .us-map-mega-arrow {
    transform: rotate(180deg);
}

.us-map-mega-panel {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 100001;
    padding: 32px 40px;
    border: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    animation: usmap-mega-slide-down 0.2s ease-out;
    font-family: inherit;
    text-transform: none;
    letter-spacing: normal;
}

@keyframes usmap-mega-slide-down {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.us-map-mega-close {
    position: absolute;
    top: 12px;
    right: 20px;
    background: transparent;
    border: none;
    border-radius: 0;
    font-family: inherit;
    font-size: 32px;
    font-weight: 400;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
    text-decoration: none;
    cursor: pointer;
    padding: 4px;
    margin: 0;
    opacity: 0.8;
    transition: opacity 0.15s ease;
    box-shadow: none;
    outline: none;
    min-width: 0;
    min-height: 0;
    width: auto;
    height: auto;
    color: inherit;
    -webkit-appearance: none;
}

.us-map-mega-close:hover {
    opacity: 1;
    background: transparent;
    border: none;
    box-shadow: none;
}

.us-map-mega-close:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    box-shadow: none;
}

.us-map-mega-grid {
    display: grid;
    gap: 0 16px;
}

.us-map-mega-grid br,
.us-map-mega-grid p {
    display: none;
}

.us-map-mega-state {
    display: block;
    padding: 6px 4px;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    text-decoration: none !important;
    text-transform: none;
    letter-spacing: normal;
    color: inherit !important;
    border: none;
    background: none;
    box-shadow: none;
}

a.us-map-mega-state {
    font-weight: 700;
    opacity: 1;
    cursor: pointer;
    color: inherit !important;
    text-decoration: none !important;
}

a.us-map-mega-state:visited {
    color: inherit !important;
}

a.us-map-mega-state:hover {
    text-decoration: underline !important;
    color: inherit !important;
}

span.us-map-mega-state-nourl {
    font-weight: 400;
    opacity: 0.5;
}

span.us-map-mega-state-disabled {
    font-weight: 400;
    opacity: 0.35;
}

@media (max-width: 768px) {
    .us-map-mega-panel {
        padding: 24px 20px;
    }
}
