html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}


:root {
  --nhsuk-header-height: 74px; /* default */
}

@media (max-width: 816px) {
  :root {
    --nhsuk-header-height: 94px; /* smaller screens */
  }
}


#mapContainer {
  flex-direction: column; /* Stack map vertically */
  height: max(300px, calc(100vh - var(--nhsuk-header-height)));
  transition: all 0.5s ease;
}

#map {
  height: 100%;
  width: 100%;
  z-index: 1;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.5);
  transition: height 0.5s ease;
}


nhsuk-footer {
  height: 50px !important;      /* Reduce height */
  padding: 5px 5px !important; /* Adjust padding so content fits */
}

.custom-tooltip{
  opacity: 0.75;
}



  .leaflet-popup-content-wrapper {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 14px;
        line-height: 21px;
        font-weight: 500;
        background-color: whitesmoke;
        opacity: 0.75;
        color: black;
        text-align: center;
        border-radius: 0;
    }
    .leaflet-popup-tip {
        background-color: whitesmoke;
        opacity: 0.75;
}
.Legend {
  font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 21px;
    font-weight: 500;
    background-color: grey;
    opacity: 0.75;
    color: black;
    text-align: left;
    border-radius: 0;
    padding: 10px;
    max-width: 200px;
}
.Legend i{
width: 18px;
height: 2px;
float: left;
margin-top: 8px;
margin-right: 8px;
opacity: 1;
border-radius:0%;
}

.intersect-alert{
opacity: 0.75;
}

      /* Control.Geocoder.css overrides */
      .leaflet-control-geocoder-error {
        padding-bottom: 5px;
    }
    .leaflet-control-geocoder-alternatives {
        max-height: 300px;
        overflow: hidden;
        overflow-y: auto;
    }
    .leaflet-control-geocoder-alternatives li {
        white-space: normal;
    }

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
  width: 48px!important;
  height: 48px!important;
  line-height: 48px!important;
  text-align: center;
  font-size: 18px;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
}
.leaflet-control-zoom-in:focus,
.leaflet-control-zoom-out:focus {
  background: #ffeb3b !important;
  box-shadow: 0 4px 0 #212b32!important;
  color: #212b32!important;
}
.leaflet-control-zoom-in:hover,
.leaflet-control-zoom-out:hover {
  background-color: #f0f0f0;
}
button#home.nhsuk-button {
  width: 48px !important;
  height: 48px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
button.leaflet-control-geocoder-icon {
  width: 40px !important;
  height: 40px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
.leaflet-control-geocoder-form input {
  font-size: 16px;
  font-size: 1rem;
}
.leaflet-control-geocoder-form input:focus{
  border: 2px solid #212b32;
    box-shadow: inset 0 0 0 2px;
    outline: 4px solid #ffeb3b;
    outline-offset: 0;
    height: 32px;
    font-weight: 400;
    font-size: 16px;
    font-size: 1rem;
    line-height: 1.5;
}
.leaflet-control-layers-selector {
  width: 20px;
  height: 20px;
  cursor: pointer;
  margin: 0 5px 0 0;
  vertical-align: middle;
}
.leaflet-control-layers-selector + span {
  font-size: 1.1875rem;
  line-height: 1.47368;
}

.leaflet-control-layers-selector:checked {
  outline: 2px solid #ffeb3b;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}
.geo-close-icon{
  border-radius: 4px;
  height: 34px;
  width: 34px;
  border: none;
  background-color:rgb(255, 255, 255);
  background-image: url('data:image/svg+xml, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" focusable="false" height="34" width="34"><path d="M13.41 12l5.3-5.29a1 1 0 1 0-1.42-1.42L12 10.59l-5.29-5.3a1 1 0 0 0-1.42 1.42l5.3 5.29-5.3 5.29a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l5.29-5.3 5.29 5.3a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42z"></path></svg>');
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
}
.geo-close-icon:focus {
  background-color: #ffeb3b !important;
  box-shadow: 0 4px 0 #212b32!important;
  color: #212b32!important;
}
.geo-close-icon:hover {
  background-color: #f0f0f0;
}
.leaflet-control-geocoder-alternatives {
  position: absolute !important;
  z-index: 9999;
  background: white;
  border: 1px solid #ccc;
  width: 300px; /* Match the width of leaflet-control-geocoder */
}

#toggleSidebar {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1100;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}

#sidebar {
  position: absolute;
  top: 50px;
  left: 10px;
  background: #fff;
  padding: 10px;
  border-radius: 4px;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
}

#sidebar.closed {
  transform: translateX(-120%);
}

.leaflet-control.info {
    background: rgba(255, 255, 255, 0.75); /* white with 75% opacity */
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    z-index: 1000;
    max-width: 300px;;
}

.nhsuk-icon {
  vertical-align: middle;
  background-color: #edf4fa;
}


/* --- Make the Layers control fill the side panel width --- */
#layers-control-slot .leaflet-control-layers {
  width: 100%;
  max-width: none;
  box-shadow: none;              /* Remove floating-control chrome */
  border: 0;
  background: transparent;       /* Use panel background */
  font: inherit;                 /* Inherit NHSUK font stack */
  color: inherit;
  padding: 0;                    /* Let inner elements control spacing */
}

/* Title bar */
#layers-control-slot .leaflet-control-layers-base,
#layers-control-slot .leaflet-control-layers-overlays {
  margin: 0;
  padding: 0;
}

/* Optional headings to split base/overlays like NHSUK legends */
#layers-control-slot .leaflet-control-layers-separator {
  height: 1px;
  margin: 12px 0;
  background: #d8dde0;           /* NHSUK grey-4 */
  border: 0;
}

/* Make each item a full-width row with spacing */
#layers-control-slot .leaflet-control-layers-list {
  margin: 0;
  padding: 0;
}

/* Inputs + labels as block rows */
#layers-control-slot .leaflet-control-layers-selector {
  /* the <input> itself */
  margin-right: 8px;
}

#layers-control-slot .leaflet-control-layers label {
  display: flex;                 /* align input + text */
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 0;                /* vertical rhythm */
  margin: 0;
  cursor: pointer;
  border-bottom: 1px solid #f0f4f5;  /* subtle divider */
}

/* Last label in each group: no divider */
#layers-control-slot .leaflet-control-layers-base label:last-child,
#layers-control-slot .leaflet-control-layers-overlays label:last-child {
  border-bottom: 0;
}

/* Optional: match NHSUK label typography */
#layers-control-slot .leaflet-control-layers label span {
  font-size: 1rem;
  line-height: 1.5;
}

/* Scroll if you have many layers */
#layers-control-slot {
  max-height: 50vh;
  overflow: auto;
}

/* If you don’t want the default ‘Layers’ toggle button at all (not needed in a panel) */
.leaflet-top.leaflet-right .leaflet-control-layers-toggle {
  display: none !important;
}

/* Hide the small boxy background of the inner form */
#layers-control-slot .leaflet-control-layers-expanded {
  padding: 0;
  margin: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

/* Optional hover affordance */
#layers-control-slot .leaflet-control-layers label:hover {
  background: #f8f8f8;
}


/* We’re driving searches from #postcode, so hide the geocoder’s form UI */
#postcode-group .leaflet-control-geocoder .leaflet-control-geocoder-form {
  display: none;
}

/* If you later decide to show it, these make it look native in the panel */
#postcode-group .leaflet-control-geocoder {
  width: 100%;
  box-shadow: none;
  border: 0;
  background: transparent;
  overscroll-behavior: contain; /* stops scroll from panning the map */
}


.nhsuk-header__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap; /* Prevent wrapping on desktop */
  gap: 1rem;
}

#postcode-geocoder {
  width: 100%;
  max-width: 300px;
}


@media (max-width: 768px) {
  .nhsuk-header__container {
    flex-wrap: wrap;
  }
  #postcode-geocoder {
    flex: 1 1 100%;
    margin-top: .5rem;
  }
}



/* Tidy label layout in the layer control */
.leaflet-control-layers label {
  display: flex;
  align-items: center;        /* vertical alignment */
  gap: .4em;                  /* space between icon and text */
  line-height: 1.25;          /* avoid crowding */
}

/* Size & align the inline <svg> icon */
.legend-svg {
  width: 1.35em;              /* make it bigger relative to text */
  height: 1.35em;
  display: inline-block;
  transform: translateY(1px); /* tiny baseline nudge so it sits nicely */
  flex: 0 0 auto;
}


.nhs-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    margin-left: -30px; /* half of width */
    margin-top: -30px;  /* half of height */
    border: 6px solid #d8dde0; /* NHS Grey */
    border-top-color: #005eb8; /* NHS Blue */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
    z-index: 9999;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.leaflet-control-geocoder.nhsuk-input {
  color: #0B0C0C; /* NHS black */
  background-color: #FFFFFF; /* white */
}


/* CSS utility to hide content visually while keeping it accessible */
.visually-hidden:not(:focus):not(:active) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important; /* modern fallback */
  border: 0 !important;
  white-space: nowrap !important;
}


.pin-wrapper { position: relative; width: 40px; height: 40px; }
.pin-wrapper img { width: 40px; height: 40px; display: block; }
.pin-wrapper i {
  position: absolute;
  left: 50%; top: 42%;              /* adjust to center over your pin */
  transform: translate(-50%, -50%);
  color: #fff;                       /* white glyph */
  font-size: 16px;                   /* size of FA icon */
}
