/*!
 * Knowco US Map — https://usmap.knowco.co/
 * Copyright (c) 2026 Knowco LLC
 * @license GPL-2.0-or-later — https://www.gnu.org/licenses/gpl-2.0.html
 */
/* ==========================================================================
   Theme Reset — prevent external themes from interfering with map styles
   ========================================================================== */
.us-map-wrapper,
.us-map-wrapper *,
.us-map-wrapper *::before,
.us-map-wrapper *::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;
}

/* 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;
}

/* 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-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; }
}
