* {
  box-sizing: border-box;
  font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

html {
  background-color: rgb(246, 246, 246);
}

body {
  background-color: white;
}

:root {
  font-size: 16px;
}

h3 {
  font-size: 24px;
}

body {
  color: #333;
  padding: 0;
  margin: 0 auto;
  max-width: 1280px;
  height: 100%;
  display: grid;
  grid-template-areas: "countries header"
                       "countries map"
                       "countries map";
  grid-template-columns: 250px auto;
  grid-template-rows: 50px auto 50px;
  grid-gap: 10px;
}

@media only screen and (max-width: 600px) {
  body {
    grid-template-areas: "header"
                         "map"
                         "countries";
    grid-template-columns: auto;
    grid-template-rows: 50px 1fr 2fr;
  }

  .countrylist {
    border-top: 1px solid #DDD;
  }
}

header {
  grid-area: header;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 1em;
}

header h3 {
  margin: 0em;
}

.countrylist {
  grid-area: countries;
  border-left: 1px solid #DDD;
  border-right: 1px solid #DDD;
  max-height: 100%;
  min-height: 0;
  overflow: auto;
  --gap: 10px;
  cursor: pointer;
  /* support smooth scrolling on safari */
  -webkit-overflow-scrolling: touch;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

.countrylist .region {
  position: relative;
}

.countrylist .region .region-title {
  position: sticky;
  position: -webkit-sticky;
  top: 0;
  background-color: white;
  padding: 4px var(--gap);
  background-color: #EEE;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.countrylist .region .region-title h3 {
  margin: 0;
  padding: 0;
}

.countrylist .region .entry {
  margin: 0px var(--gap);
  padding: 6px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.countrylist .region .entry.revealing {
  color: blue !important;
}

.countrylist .region .entry.hovered {
  color: rgba(0, 0, 255, 0.5);
}

.countrylist .region .entry.visited::after {
  content: '✔';
  font-size: 12px;
  --green: #4CAF50;
  color: white;
  padding: 1px 3px;
  border-radius: 3px;
  background-color: var(--green);
}

.countrylist .region .entry + .entry {
  padding-top: var(--gap);
  border-top: 1px solid #DDD;
}

.map {
  grid-area: map;
  margin: 1em;
  overflow: hidden;
}

.map svg {
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

.map svg .revealing {
  fill: blue !important;
  fill-opacity: 1 !important;
}

.map svg .visited {
  fill: #8bc34a;
}

.map svg path {
  cursor: pointer;
  fill: #ccc;
  fill-opacity: 1;
  stroke: white;
  stroke-opacity: 1;
  stroke-width: 0.5;
}

.map svg path.hovered {
  fill: blue;
  fill-opacity: 0.5;
}

footer {
  grid-area: footer;
}

