@font-face {
  font-family: 'DINPro';
  src: url('../assets/fonts/DINPro.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'DINPro';
  src: url('../assets/fonts/DINPro-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'DINPro';
  src: url('../assets/fonts/DINPro-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'DINPro';
  src: url('../assets/fonts/DINPro-Italic.otf') format('opentype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'MinionPro';
  src: url('../assets/fonts/MinionPro-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'MinionPro';
  src: url('../assets/fonts/MinionPro-Semibold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;
}

header {
  background-color: #1270B3;
  color: #fff;
  padding: 5px;
  padding-left: 20px;
  padding-right: 20px;
  font-size: 29px;
  font-weight: 700;
  font-family: 'DINPro', Arial, sans-serif;
  position: fixed;
  width: 100%;
  height: 50px; 
  top: 0;
  left: 0;
  z-index: 2;
  opacity: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

/* Desktop and mobile header title variants */
.header-title-mobile { display: none; line-height: 1;}
.header-title-desktop { display: inline; line-height: 1;}

/* Hide mobile-only drawer button on desktop */
.openDrawer-mobile { display: none; }

/* Prevent flash of unstyled drawer before Web Component upgrades */
wa-drawer.drawer-placement:not(:defined) {
  visibility: hidden;
}

/* Reduce drawer body padding */
.drawer-placement {
  --body-spacing: 0.85rem;
}

/* Drawer typography — headings */
wa-drawer h3 {
  font-family: 'DINPro', Arial, sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0;
}

/* Section heading wrapper — adds top border and spacing between sections */
.drawer-section-heading {
  text-align: center;
  margin-top: 14px;
  margin-bottom: 8px;
  padding-top: 12px;
  border-top: 1px solid #ddd;
}

/* First section has no top border */
.drawer-section-heading:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* Drawer typography — selects, switches, table */
wa-drawer wa-select,
wa-drawer wa-switch {
  font-family: 'DINPro', Arial, sans-serif;
  font-weight: 400;
}

/* Spacing between consecutive wa-select elements */
wa-drawer wa-select + wa-select {
  margin-top: 8px;
}

/* Compress wa-select height to match geo radio buttons */
wa-drawer wa-select::part(combobox) {
  min-height: unset;
  height: 34px;
  padding-top: 0;
  padding-bottom: 0;
}

/* Allow the type multi-select to expand vertically with multiple chips */
#typeSelect::part(combobox) {
  height: auto;
  min-height: 34px;
  align-items: center;
}

#typeSelect::part(tags) {
  flex-wrap: wrap;
  align-items: center;
}

wa-drawer wa-select::part(form-control-label) {
  margin-bottom: 2px;
  font-size: 0.85rem;
}

wa-drawer wa-select::part(display-input) {
  font-size: 0.85rem;
}

/* Geography radio buttons — DINPro Regular, smaller size (inherited into shadow DOM) */
wa-drawer wa-radio {
  font-family: 'DINPro', Arial, sans-serif;
  font-weight: 400;
  font-size: 0.8rem;
}

/* Selected geo radio button — agency blue fill, white text */
wa-drawer wa-radio[checked]::part(button) {
  background-color: #1270B3;
  border-color: #1270B3;
  color: #ffffff;
}

/* Stats table font and no borders */
#projectStatsTable,
#projectStatsTable tr,
#projectStatsTable td {
  font-family: 'DINPro', Arial, sans-serif;
  font-weight: 400;
  border: none !important;
}

/* Switch spacing */
wa-drawer wa-switch {
  margin-top: 20px;
  display: block;
}

.arc-logo-link {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.arc-logo {
  height: 30px;
  width: auto;
  display: block;
}

.mapboxgl-ctrl-logo {
  display: none !important;
}

.mapboxgl-ctrl-attrib-inner {
  display: none !important;
}

/* Base styling for the open drawer button */
wa-button.openDrawer {
  position: absolute;
  top: 70px;
  left: 15px;
  z-index: 99;
}

/* Target the shadow parts of the button to change border-radius and remove background */
wa-button.openDrawer::part(base) {
  border-radius: var(--border-radius);
  background-color: #efefef;
  opacity: var(--opacity-value);
  color: #58585A;
  font-family: 'DINPro', Arial, sans-serif;
  font-weight: 500;
  font-size: 16px;
  white-space: nowrap;
  padding: 0 14px;
  transition: var(--wa-transition-medium) background-color ease, var(--wa-transition-medium) border ease;
  border: 1px solid #58585A;
}

/* Style the button part to match the base part */
wa-button.openDrawer::part(button) {
  border-radius: var(--border-radius);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Hover effect: blue background, white text */
wa-button.openDrawer::part(base):hover {
  background-color: #1270B3; 
  color: white;
  border: 1px solid white;
}

/* Base styling for the download button */
#downloadBtn {
  position: absolute;
  top: 65px;
  right: 15px;
  /* Remove any background or border from the host element */
  background: transparent;
  border: none;
}

/* Target the shadow parts of the download button */
#downloadBtn::part(base) {
  border-radius: var(--border-radius);
  background-color: #efefef;
  opacity: var(--opacity-value);
  color: #58585A;
  font-family: 'DINPro', Arial, sans-serif;
  font-weight: 500;
  font-size: 16px;
  white-space: nowrap;
  padding: 0 14px;
  transition: var(--wa-transition-medium) background-color ease, var(--wa-transition-medium) border ease;
  border: 1px solid #58585A;
}

/* Style the button part to match the base part */
#downloadBtn::part(button) {
  border-radius: var(--border-radius);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

#downloadBtn::part(base):hover {
  background-color: #1270B3;
  color: white;
  border: 1px solid white;
}

/* #geocoder-container {
  position: absolute;
  top: 0.5px;
  right: 0px !important;
  z-index: 99 !important;
}

#geocoder-container:hover {
  opacity: 1 !important;
}

#geocoder-container .mapboxgl-ctrl-geocoder input {
  outline: none !important;
  box-shadow: none !important;
} */


#map {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
}

/* set global styling variables */
:root {
  --opacity-value: 0.90;
  --topline-margin: 25px;
  --border-radius: 8px;

  /* Override Web Awesome brand color ramp to ARC Agency Blue */
  --wa-color-brand-95: #ddeef9;
  --wa-color-brand-90: #b8d9f2;
  --wa-color-brand-80: #7ab8e4;
  --wa-color-brand-70: #4897d0;
  --wa-color-brand-60: #1a85d0;
  --wa-color-brand-50: #1270B3;
  --wa-color-brand-40: #0d5a8e;
  --wa-color-brand-30: #094070;
  --wa-color-brand-20: #062a4a;
  --wa-color-brand-10: #031525;

  /* Tooltip styling — charcoal gray background */
  --wa-tooltip-background-color: #58585A;
  --wa-tooltip-color: #ffffff;
}

/* Tooltip font — DINPro Regular */
wa-tooltip {
  font-family: 'DINPro', Arial, sans-serif;
  font-weight: 400;
  font-size: 16px;
}

/* place the geocoder at the top left of the screen */
.mapboxgl-ctrl-geocoder {
  width: 300px !important;
  margin-top: 6px !important;
  margin-right: 20px !important;
  opacity: var(--opacity-value);
  z-index: 999 !important;
}

.map-overlay {
  position: absolute;
  width: 350px;
  top: 75px;
  bottom: 150px;
  left: 15px;
  background-color: #efefef;
  opacity: var(--opacity-value);
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid black;
}

.map-overlay p#dynamic-table-info {
  padding: 10px;
}

.map-overlay .listing {
  overflow-y: auto;
  max-height: calc(100% - 40px);
}

.map-overlay .listing>* {
  display: block;
  padding: 5px 10px;
  margin: 0;
}

.map-overlay .listing a {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  color: #404;
  text-decoration: none;
}

.map-overlay .listing a:last-child {
  border: none;
}

.map-overlay .listing a:hover {
  background: #f0f0f0;
}

.project-link {
  font-size: 15px;
  color: #000 !important;
}

.project-link:hover {
  color: #23527c !important;
  text-decoration: underline !important;
}

#feature-filter+span {
  position: absolute;
  right: 20px;
  color: darkgrey;
  top: 15px;
}

#dynamic-table-info {
  font-style: italic;
  font-weight: 400;
  font-size: 16px;
  padding: 8px;
  text-align: center;
  margin: auto;
  display: block;
  background-color: #969696;
}

.legend {
  position: absolute;
  bottom: 25px;
  right: 15px;
  background-color: #f0f0f0;
  padding: 10px;
  border: 1px solid black;
  border-radius: 6px;
  display: block;
  opacity: var(--opacity-value);
  font: 14px/20px "Helvetica Neue", Arial, Helvetica, sans-serif;
}

.legend-color {
  display: inline-block;
  width: 20px;
  height: 10px;
  margin-right: 10px;
}

#last-updated {
  position: absolute;
  bottom: 9px;
  left: 100px;
  font-size: 15px;
  opacity: 0.8;
  z-index: 1;
}

.summary-stats {
  max-width: 300px;
  position: absolute;
  top: 365px;
  left: 84px;
  background-color: #f0f0f0;
  border: 0.5px solid lightgray;
  border-radius: 6px;
  display: block;
}

.summary-stats [slot='header'] {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.summary-stats h3 {
  margin: 0;
}

/* Google Material UI icons */
.material-symbols-outlined {
  font-variation-settings:
    'FILL' 0,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24;
  vertical-align: middle;
  /* Align icon with text */
  margin-left: 4px;
  /* Optional: Add space between text and icon */
  line-height: 1;
  /* Ensures consistent alignment */
}

/* Theme toggle button inside the drawer */
#themeToggleBtn wa-icon {
  font-size: 1.2rem;
}
#themeToggleBtn::part(base) {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  /* colors handled by the footer button rule below */
}

.map-legend {
  position: fixed;
  bottom: 25px;
  right: 15px;
  background-color: #fff;
  padding: 10px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  z-index: 1;
  font-size: 14px;
  line-height: 1.5;
  max-width: 250px;
  opacity: 0.9;
}

.map-legend h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-family: 'DINPro', Arial, sans-serif;
  font-weight: 500;
  border-bottom: 1px solid #eee;
  padding-bottom: 5px;
}

.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
  font-family: 'DINPro', Arial, sans-serif;
  font-weight: 400;
}

.legend-key {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  border-radius: 3px;
}

/* Slightly enlarge Mapbox popup close (X) button for better usability */
.mapboxgl-popup .mapboxgl-popup-close-button {
  width: 34px !important;
  height: 38px !important;
  line-height: 38px !important; /* vertically center the × */
  font-size: 24px !important;   /* make the × a bit larger */
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
}

.mapboxgl-popup .mapboxgl-popup-close-button:hover {
  background: rgba(216, 26, 26, 0.06);
}

.mapboxgl-popup .mapboxgl-popup-close-button:focus {
  outline: none;
}

/* Download dialog — compact width */
#downloadDialog {
  --width: 420px;
}

/* Download dialog — DINPro Medium header */
#downloadDialog::part(title) {
  font-family: 'DINPro', Arial, sans-serif;
  font-weight: 500;
}

#downloadDialog::part(body) {
  padding-top: 2px;
}

/* Download dialog — stacked layout: text above side-by-side buttons */
.download-dialog-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  padding: 8px 0;
}

.download-dialog-buttons p {
  font-family: 'DINPro', Arial, sans-serif;
  font-weight: 400;
  font-size: 14px;
  margin: 0;
  text-align: center;
}

.download-dialog-buttons .download-btn-row {
  display: flex;
  gap: 12px;
}

/* Download dialog — branded blue buttons */
#downloadDialog wa-button[variant="primary"]::part(base) {
  background-color: #1270B3;
  border-color: #1270B3;
  color: #fff;
  font-family: 'DINPro', Arial, sans-serif;
  font-weight: 400;
}

#downloadDialog wa-button[variant="primary"]::part(base):hover {
  background-color: #005495;
  border-color: #005495;
}

/* About dialog — widen via wa-dialog's built-in custom property */
#infoDialog {
  --width: 800px;
}

/* About dialog — MinionPro body font */
#infoDialogContent {
  font-family: 'MinionPro', Georgia, serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.6em;
}

/* About dialog — MinionPro Semibold title */
#infoDialog::part(title) {
  font-family: 'MinionPro', Georgia, serif;
  font-weight: 600;
}

/* About dialog — Close button blue */
#infoDialog wa-button[variant="primary"]::part(base) {
  background-color: #1270B3;
  border-color: #1270B3;
  color: #fff;
}

#infoDialog wa-button[variant="primary"]::part(base):hover {
  background-color: #005495;
  border-color: #005495;
}

@media screen and (max-width: 768px) {

  /* reposition drawer button on mobile */
  wa-button.openDrawer {
    top: 60px;
    left: 10px;
  }

  /* swap desktop/mobile drawer buttons */
  .openDrawer-desktop { display: none; }
  .openDrawer-mobile { display: block; }

  /* reposition legend to bottom-right corner */
  .map-legend {
    position: fixed;
    bottom: 15px;
    right: 10px;
  }

  /* remove the following elements on mobile */
  .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl-scale,
  .map-overlay,
  .mapboxgl-ctrl-geocoder,
  .mapboxgl-ctrl-attrib,
  #downloadBtn {
    display: none !important;
  }
  /* Swap header titles on mobile */
  .header-title-desktop { display: none; }
  .header-title-mobile { display: inline; }

  header { font-size: 25px; }
}

/* Position the Info button to the left within the drawer footer */
wa-drawer .drawer-info-left {
  margin-right: auto; /* push following footer buttons (e.g., Close) to the right */
}

wa-drawer .drawer-info-left::part(base) {
  margin-right: auto; /* push following footer buttons (e.g., Close) to the right */
}

/* Ensure footer uses space-between and provides a gap between controls */
wa-drawer::part(footer) {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

/* About and theme toggle buttons in drawer footer — no fill, gray border/text, blue on hover */
#aboutBtn::part(base),
#themeToggleBtn::part(base) {
  background-color: transparent;
  border: 1px solid #58585A;
  color: #58585A;
  transition: var(--wa-transition-medium) background-color ease, var(--wa-transition-medium) border ease;
}

#aboutBtn::part(base):hover,
#themeToggleBtn::part(base):hover {
  background-color: #1270B3;
  border-color: #1270B3;
  color: #ffffff;
}

/* Remove focus ring on wa-select combobox */
wa-select::part(combobox):focus,
wa-select::part(combobox):focus-within {
  outline: none;
  box-shadow: none;
}

/* Loading overlay styles */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.7); /* Semi-transparent white mask */
  z-index: 9999; /* Above map but below modals */
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  transition: opacity 500ms ease-out; /* Smooth fade-out transition */
}

.loading-overlay.fade-out {
  opacity: 0;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  text-align: center;
}