/* WI DNR region toggle chips (map sidebar + county checkbox panel) */
.dnr-region-section {
    padding: 0.6rem 0.75rem;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-bottom: 1px solid #e5e7eb;
}

/* Collapsible header (<details>/<summary>, collapsed by default) */
.dnr-region-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
    user-select: none;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #334155;
}
.dnr-region-heading::-webkit-details-marker { display: none; }
.dnr-region-section[open] .dnr-region-heading { margin-bottom: 0.5rem; }
.dnr-region-heading:focus-visible { outline: 3px solid #0072B2; outline-offset: 2px; border-radius: 4px; }
.dnr-region-caret::before {
    content: "\25B8";
    display: inline-block;
    margin-right: 0.35rem;
    transition: transform 0.15s ease;
}
.dnr-region-section[open] .dnr-region-caret::before { transform: rotate(90deg); }

.dnr-region-hint {
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: #64748b;
    font-size: 0.7rem;
}

.dnr-region-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.4rem;
}

.dnr-region-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    min-height: 34px;
    padding: 0.3rem 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.1;
    text-align: left;
    color: #1e3a5f;
    background: #ffffff;
    border: 1px solid #d0d7e2;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.dnr-region-btn:hover { border-color: #2c5aa0; background: #f1f6fd; box-shadow: 0 2px 6px rgba(44, 90, 160, 0.15); }
.dnr-region-btn:active { transform: translateY(1px); }
.dnr-region-btn:focus-visible { outline: 3px solid #0072B2; outline-offset: 2px; }

/* Leading icon circle: "+" when off, "✓" when on (set by JS) */
.dnr-region-check {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #2c5aa0;
    background: #e8f0fb;
    border-radius: 50%;
}

.dnr-region-count {
    margin-left: auto;
    padding: 0.05rem 0.4rem;
    font-size: 0.68rem;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border-radius: 999px;
}

.dnr-region-btn.active {
    color: #ffffff;
    background: linear-gradient(135deg, #1d3f73 0%, #2c5aa0 100%);
    border-color: #1d3f73;
    box-shadow: 0 2px 8px rgba(29, 63, 115, 0.3);
}
.dnr-region-btn.active .dnr-region-check { color: #1d3f73; background: #ffffff; }
.dnr-region-btn.active .dnr-region-count { color: #ffffff; background: rgba(255, 255, 255, 0.2); }

/* Expand / pop-out map */
.county-map-frame { position: relative; }
.county-map-expand-btn {
    position: absolute;
    right: 8px;
    bottom: 22px;
    z-index: 500;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1e3a5f;
    background: #ffffff;
    border: 1px solid #d0d7e2;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
    cursor: pointer;
}
.county-map-expand-btn:hover { background: #f1f6fd; border-color: #2c5aa0; }
.county-map-expand-btn:focus-visible,
.county-map-close-btn:focus-visible { outline: 3px solid #0072B2; outline-offset: 2px; }

.county-map-expanded-header { display: none; }

.county-map-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1990;
    background: rgba(15, 23, 42, 0.55);
}

.county-map-widget.expanded-map {
    position: fixed;
    inset: 4vh 4vw;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35);
    overflow: hidden;
}
.county-map-widget.expanded-map .county-map-header { display: none; }
.county-map-widget.expanded-map .county-map-content {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none !important;
}
.county-map-widget.expanded-map .county-map-expanded-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}
.county-map-widget.expanded-map .county-map-expanded-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e3a5f;
}
.county-map-close-btn {
    padding: 0.35rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e3a5f;
    background: #f1f5f9;
    border: 1px solid #d0d7e2;
    border-radius: 8px;
    cursor: pointer;
}
.county-map-close-btn:hover { background: #e2e8f0; }
.county-map-widget.expanded-map .dnr-region-buttons { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.county-map-widget.expanded-map .county-map-frame { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.county-map-widget.expanded-map #wisconsinCountyMap { flex: 1 1 auto; height: auto !important; min-height: 0 !important; }
.county-map-widget.expanded-map .county-map-expand-btn { display: none; }
body.county-map-modal-open { overflow: hidden; }
/* .map-sidebar is position:sticky (its own stacking context), so lift it above the backdrop */
body.county-map-modal-open .map-sidebar { z-index: 2000; }

@media (max-width: 768px) {
    .county-map-widget.expanded-map { inset: 0; border-radius: 0; }
    .county-map-widget.expanded-map .dnr-region-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    .dnr-region-btn,
    .dnr-region-caret::before { transition: none; }
}
