/* Kiambu Health Facilities — EGE 2531 week 2 */

/* Colours defined once, used everywhere with var(--name) */
:root {
  --teal: #0E6E78;
  --ink: #1d2327;
  --paper: #f7f7f5;
  --line: #d9dcd8;
}

/* Width and height include padding and border — the sane box model */
* {
  box-sizing: border-box;
}

/* Let the page fill the whole window, with no default gap round the edge */
html,
body {
  height: 100%;
  margin: 0;
}

/* body stacks the header above the main area: a column flexbox */
body {
  display: flex;
  flex-direction: column;
  font-family: system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

.site-header {
  background: var(--teal);
  color: white;
  padding: 12px 20px;
}

.site-header h1 {
  margin: 0;
  font-size: 1.4rem;
}

.subtitle {
  margin: 4px 0 0;
  font-size: 0.9rem;
  opacity: 0.85;
}

/* main takes all the height left over, and puts sidebar and map side by side */
.layout {
  flex: 1;
  display: flex;
  min-height: 0;
}

.sidebar {
  width: 320px;
  padding: 16px;
  overflow-y: auto;
  background: white;
  border-right: 1px solid var(--line);
}

/* the map takes all the width left over */
#map {
  flex: 1;
  position: relative;
  background: #e3ece6;
}

/* On a phone: sidebar on top, map underneath */
@media (max-width: 700px) {
  .layout {
    flex-direction: column;
  }
  .sidebar {
    width: auto;
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
}

/* ---- Step 4: form controls and the list ---- */

.sidebar label {
  display: block;
  margin: 12px 0 4px;
  font-weight: 600;
}

.sidebar label.check {
  font-weight: normal;
}

.sidebar select {
  width: 100%;
  padding: 6px;
  font: inherit;
}

.status {
  margin: 16px 0 8px;
  font-weight: 600;
  color: var(--teal);
}

.status.error {
  color: #b3261e;
}

.facility-list {
  padding-left: 18px;
  margin: 0;
}

.facility-list li {
  margin-bottom: 4px;
}

/* A class added by JavaScript: facilities that are not operational */
.facility-list li.closed {
  color: #8a8f8c;
  text-decoration: line-through;
}

.credit {
  margin-top: 24px;
  font-size: 0.8rem;
  color: #666;
}

/* ---- Step 6: the dots ---- */

.dot {
  position: absolute;             /* placed relative to #map, which is position: relative */
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;          /* centre the dot on its point, not its top-left corner */
  border-radius: 50%;
  background: var(--teal);
  border: 1px solid white;
}

.dot.level-4 { width: 14px; height: 14px; margin: -7px 0 0 -7px; }
.dot.level-5 { width: 18px; height: 18px; margin: -9px 0 0 -9px; background: #084a51; }

.dot.closed {
  background: white;
  border: 2px solid #8a8f8c;
}
