:root {
  --ink: #17251f;
  --muted: #000;
  --accent: #c64b2f;
  --paper: #f5f4ef;
  --line: #d8ddd7;
  --district-stroke: #000000; /* district outline colour: same while drawing and after */
}




.layout {
  position: relative;         /* keeps map and text above the background */
  z-index: 1;
}
.layout {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
  -ms-flex-direction: row;
  flex-direction: row;
  -webkit-box-align: start;
  -ms-flex-align: start;
  align-items: flex-start; /* lets the map column stay sticky */
  max-width: 1000px;
  margin: 0 auto;

}
.bg{
    
    position: fixed;
    left: 0; 
    top: 0;
    right: 0;
    bottom: 0;
}

.map-sticky {
  position: -webkit-sticky;
  position: sticky;
  top: 15px;
  height:100vh;
  height: 100dvh;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  min-height: 0;
/*  -webkit-box-flex: 1.05;
  -ms-flex: 1.05 1 0%;
  flex: 1.05 1 0%;
  min-width: 300px;*/
  -ms-flex-item-align: start;
  align-self: flex-start;
  padding: 50px 0 50px 0;
  width: 50%;
}

.map-card {
  max-height: calc(100vh - 30px);
  max-height: calc(100dvh - 30px);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  position: relative; /* anchor for the district tooltips */
}

.map-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.map-head strong { font-size: 14px; }
.year-pill { background: #f7e9e3; color: var(--accent); padding: 7px 11px; border-radius: 99px; font-size: 12px; font-weight: 700; }

.map-card svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 50px);
  max-height: calc(100dvh - 50px);
  -ms-flex-negative: 1;
  flex-shrink: 1;
  min-height: 0;
  overflow: visible;
  -ms-touch-action: pan-y;
  touch-action: pan-y; /* vertical scroll still works when swiping over the map */
}
.land { fill: #c4f9f1; stroke: #c4f9f1; stroke-width: 2; stroke-linejoin: round; }

.district {
  fill: #dfe5df;
  stroke: #000;
  stroke-width: 7;
  stroke-linejoin: round;
  cursor: pointer;
/*  -webkit-transition: fill 0.95s, opacity 0.95s, stroke 0.95s;
  transition: fill 0.95s, opacity 0.95s, stroke 0.95s;*/
}
.district.active { fill: #4aa928; }
.district.current { fill: #4aa928; }
.district.picked { opacity: 0.7; }

.map-note { font-size: 12px; line-height: 1.5; color: var(--muted); margin: 10px 2px 0; }
.map-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin-top: 12px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; background: #dfe5df; }
.dot.on { background: #d9694d; }
.dot.now { background: #a93320; }

.map-tip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  padding: 3px 3px;
  line-height: 1;
  border-radius: 99px;
  background: #2f6a5f;
  color: #fff;
 font-family: arial;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  -webkit-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);

  font-size: 11px
}
.map-tip.show { opacity: 1; }
.logo-area {
    padding-top: 22vh
}
.dl-btn {
  -webkit-appearance: none;
  appearance: none;
  align-self: flex-start;
  margin-top: 12px;
  min-height: 40px; /* comfortable touch target */
  padding: 9px 14px;
  border: 1px solid var(--accent);
  border-radius: 99px;
  background: #fff;
  color: var(--accent);
  font: 700 12px Arial, Helvetica, sans-serif;
  cursor: pointer;
  -ms-touch-action: manipulation;
  touch-action: manipulation;
}
.dl-btn:hover, .dl-btn:focus { background: var(--accent); color: #fff; outline: none; }

/* ---------- Timeline ---------- */
.map-timeline {
/*  padding-bottom: 18vh;
  -webkit-box-flex: 0.95;
  -ms-flex: 0.95 1 0%;
  flex: 0.95 1 0%;
  min-width: 280px;*/
width: 400px;

}

.step {
  min-height: 78vh;
  display: flex;
  align-items: center;
/*  padding: 45px 0;*/
  -webkit-transition: opacity 0.3s;
  transition: opacity 0.3s;
  cursor: pointer;
  -ms-touch-action: manipulation;
  touch-action: manipulation;
  padding: 20px 0;
}
.layout .year{
    font-family: "PT Serif", serif;
    font-weight: 700;
    font-size:35px;
   color: #fff;
 
}
.date{ font-family: "Oswald", sans-serif; font-weight: 700;  line-height: 1; color: #fbec0e; font-size: 75px; margin-bottom: 8px;display: block}
.layout p{
    font-family: "PT Serif", serif;
      font-size: 22px;
      font-weight: normal;
      color: #fff;
  
}
.step-inner{
    display: block;
    width: 100%;
}
/* ---------- Mobile: map and timeline stay side by side ---------- */
/* ---------- Mobile: full-width map, content overlaps the map ---------- */
@media (max-width: 768px) {
    .sub-title, .sub-title-small{
        font-size:25px;
        text-align: left;
    }
    .keep-scroll{
        margin: inherit
    }
    .district{
        stroke-width: 10;
    }
    .date{
        font-size: 45px;
    }
    .map-sticky {

  padding: 60px 0 20px 0;

}
    .layout .year{
        font-size:21px;
    }
  .layout p{font-size: 18px;
    line-height: 25px;}
  /* stack instead of side by side */
  .layout {
    display: block;
    padding: 0;
    max-width: none;
    position: relative;
  }

  /* map: full width, stays pinned behind the content */
  .map-sticky {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    width: 100%;
    min-width: 0;

    z-index: 1;
    -webkit-box-flex: 0;
    -ms-flex: none;
    flex: none;
  }
  .map-card {
    width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    padding: 8px 4vw;
    border-radius: 0;
  }
  .map-head { gap: 4px; flex-wrap: wrap; }
  .map-head strong { font-size: 12px; }
  .year-pill { font-size: 11px; padding: 5px 8px; }
  .map-card svg {
    width: 100%;
  }
  .map-note { font-size: 10px; }
  .map-legend { gap: 8px; font-size: 10px; }
  .dl-btn { font-size: 10px; padding: 8px 10px; }


  /* timeline: pulled up over the map */
  .map-timeline {
    position: relative;
    z-index: 0;
    width: 100%;
    min-width: 0;
    margin: -100vh 0 0 0;
    margin-top: -100dvh;
    padding: 0 5vw 10vh;
    box-sizing: border-box;
    pointer-events: none; /* touches in the gaps reach the map */
  }
  .step {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 25px 0;
    align-items: flex-end;   /* text sits low so the map stays visible above */

  }

  .step-inner {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    padding: 5px;
    border-radius: 16px;
/*    background: rgba(245, 244, 239, 0.88);*/
/*    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);*/
    pointer-events: auto;
    max-width:175px;
    width: 100%;
  }

}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .district, .step { -webkit-transition: none; transition: none; }
}